rb_subbuf_capacity(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… rb_subbuf_capacity β€” from the Kernel API Manual, bestie ✨

Okay so picture this: we're deep in ./kernel/trace/ring_buffer.c land, and this little function is here to tell you how much room a subbuffer has. That's it. That's the whole vibe. But like, read the fine print, because the fine print is loud. 🫢


🌸 NAME 🌸

rb_subbuf_capacity β€” literally just get the capacity of a subbuffer, no cap.


πŸŽ€ SYNOPSIS πŸŽ€

unsigned int rb_subbuf_capacity (struct trace_buffer *buffer );

πŸ¦‹ ARGUMENTS πŸ¦‹

  • buffer β€” a trace buffer. that's the whole arg. she's low maintenance. πŸ’…

✨ DESCRIPTION ✨

So here's the tea, and it's kind of a big deal: this is unsafe to use without holding trace_buffer::mutex or with resizing enabled. Like, do not just walk up and call it, bestie. 😭

If you were thinking "hmm, maybe I'll just use this casually," the man page itself is like consider rb_page_capacity instead. So like, consider rb_page_capacity instead. it's giving "the safe friend who texts you back." 🌈

⚠️ unsafe without the mutex, and unsafe with resizing enabled. not a vibe you want to mess with.

πŸ”₯ RETURN πŸ”₯

The maximum size available for events in a trace buffer subbuffer. that's the number. slay. πŸ‘‘


πŸ’– SEE ALSO πŸ’–

The whole ring buffer friend group showed up, and honestly? iconic. πŸŽ€

also the kernel file ./kernel/trace/ring_buffer.c is where all this lives, iykyk. πŸ’œ


k bye bestie, muah πŸ’‹ this page came straight out of the ./kernel/trace corner of the world, dated October 2026, and she's filed under rb_subbuf_capacity(9). literally iconic of her. 🧚⭐

πŸ“¦ where this page comes from