pt_buffer_reset_offsets(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

pt_buffer_reset_offsets(9) πŸŽ€

okay so welcome to this Kernel API Manual page, bestie β€” we’re talking about pt_buffer_reset_offsets(9), and yes it’s giving β€œtiny function, very specific job” energy. πŸ’…


🌸 NAME 🌸

pt_buffer_reset_offsets β€” adjust buffer’s write pointers from aux_head ✨

πŸ¦‹ SYNOPSIS πŸ¦‹

void pt_buffer_reset_offsets (struct pt_buffer *buf , unsigned long head
);

πŸŽ€ ARGUMENTS πŸŽ€

  • buf β€” PT buffer. πŸ’–
  • head β€” Write pointer (aux_head) from AUX buffer.

πŸ’« DESCRIPTION πŸ’«

Find the ToPA table and entry corresponding to the given head, and set the buffer’s β€œcurrent” pointers accordingly. This is done after we have obtained the current aux_head position from a successful call to perf_aux_output_begin, to make sure the hardware is writing to the right place. 🫢

This function modifies buf::{cur,cur_idx,output_off} that will be programmed into PT msrs when the tracing is enabled, and buf::head and buf::data_size, which are used to determine INT and STOP markers’ locations by a subsequent call to pt_buffer_reset_markers. like, that’s the whole little pointer-maintenance moment, and it ate. πŸ”₯

πŸ‘€ SEE ALSO πŸ‘€

Kernel file ./arch/x86/events/intel/pt.c:


later bestie 🫢 β€” this one’s from source/version ./arch/x86/events/intel, dated October 2026, and it will always be pt_buffer_reset_offsets(9) to me. πŸ’œ

πŸ“¦ where this page comes from