ring_buffer_swap_cpu(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

okay bestie, welcome to the ring_buffer_swap_cpu(9) page from the Kernel API Manual ✨ this one is niche but highkey useful for tracer girlies who need to swap a CPU buffer between two ring buffers. let’s get into it πŸ’…

🌸 NAME 🌸

ring_buffer_swap_cpu β€” swap a CPU buffer between two ring buffers

✨ SYNOPSIS ✨

int ring_buffer_swap_cpu (struct trace_buffer *buffer_a , struct
       trace_buffer *buffer_b , int cpu );

πŸŽ€ ARGUMENTS πŸŽ€

  • buffer_a β€” one buffer to swap with πŸ’–
  • buffer_b β€” the other buffer to swap with 🫢
  • cpu β€” the CPU of the buffers to swap ⭐

πŸ¦‹ DESCRIPTION πŸ¦‹

So picture this: you’re a tracer and you want to take a β€œsnapshot” of a CPU buffer, and bestie, you have another back up buffer just lying around. That’s the exact vibe this function is for. It is useful for tracers that want to take a β€œsnapshot” of a CPU buffer and has another back up buffer lying around. The expectation is that the tracer handles the cpu buffer not being used at the moment β€” no cap, that part is on the tracer.

⚠️ important vibe check: it is expected that the tracer handles the cpu buffer not being used at the moment.

🌈 SEE ALSO 🌈

Also peep the Kernel file ./kernel/trace/ring_buffer.c β€” and here’s the whole function friend group, all together:


mwah πŸ’‹ this page ships from the source/version tag ./kernel/trace, dated October 2026 β€” ring_buffer_swap_cpu(9) forever, periodt πŸ’–

πŸ“¦ where this page comes from