prb_for_each_record(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ NAME ✨

okay so this is prb_for_each_record(9) from the Kernel API Manual, and it is literally a macro for iterating over the records of a ringbuffer. bestie, it's giving β€œloop through ringbuffer records, but make it convenient.” πŸ’…


πŸŽ€ SYNOPSIS πŸŽ€

prb_for_each_record (from , rb , s , r );

πŸ’… ARGUMENTS πŸ’…

  • from β€” the sequence number to begin with, bestie.
  • rb β€” the ringbuffer you're iterating over. iconic.
  • s β€” a u64 to store the sequence number on each iteration.
  • r β€” a printk_record to store the record on each iteration.

🧚 DESCRIPTION 🧚

This is a macro for conveniently iterating over a ringbuffer. no cap, that's the whole vibe. πŸ¦‹

heads up though: s may not be the sequence number of the record on each iteration. not me assuming it is 😭 if you actually need the sequence number, you should check r->info->seq.

🌈 CONTEXT 🌈

Any context. literally any. ✨


πŸ”₯ SEE ALSO πŸ”₯


source/version ./kernel/printk, dated October 2026 β€” mwah, drink water, and check r->info->seq πŸ’‹πŸŽ€

πŸ“¦ where this page comes from