pt_buffer_reset_markers(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… pt_buffer_reset_markers(9) β€” like, the whole page, bestie

okay so this is pt_buffer_reset_markers, and it lives in the Kernel API Manual, section 9. yes it's a real manual page, yes it's about Intel PT buffers, and yes we're gonna get through it together 🫢


✨ NAME ✨

pt_buffer_reset_markers β€” place interrupt and stop bits in the buffer 🎯


🌸 SYNOPSIS 🌸

int pt_buffer_reset_markers (struct pt_buffer *buf , struct
perf_output_handle *handle );

πŸŽ€ ARGUMENTS πŸŽ€

  • buf β€” the PT buffer, that's the one bb πŸ’–
  • handle β€” the current output handle, iykyk

πŸ¦‹ DESCRIPTION πŸ¦‹

So what this bad boy does: it places INT and STOP marks in the buffer. why? two reasons, and both are iconic:

  1. to prevent overwriting old data that the consumer hasn't yet collected πŸ™ˆ β€” like, rude, don't touch her stuff
  2. to wake up the consumer after a certain fraction of the buffer has filled up ⏰ β€” a little tap on the shoulder, "hey bestie, there's stuff for you"
heads up: this is only needed and sensible for non-snapshot counters. snapshot counters? not the vibe, don't bother πŸ’€

And ngl, this whole thing obviously relies on buf::head to figure out the buffer markers β€” so it has to be called after pt_buffer_reset_offsets and before the hardware tracing is enabled. get the order wrong and it's giving chaos 😭


πŸ”₯ SEE ALSO πŸ”₯

Kernel file ./arch/x86/events/intel/pt.c β€” and the whole friend group:


okay that's the page!! ✨ this lil gem comes to you from ./arch/x86/events/intel, dated October 2026, and it's filed under pt_buffer_reset_markers(9) β€” periodt πŸ’…πŸŽ€

πŸ“¦ where this page comes from