intel_pt_find_overlap(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… intel_pt_find_overlap β€” a Kernel API Manual moment, bestie

okay so this one is from the Kernel API Manual (yes, the Kernel API Manual, we're fancy now πŸ’…) and it's about figuring out where the actually-new part of your trace data starts. let's get into it πŸŽ€


✨ NAME ✨

intel_pt_find_overlap β€” determine start of non-overlapped trace data.

like, literally its whole job is spotting where the overlap ends and the fresh data begins. icon behaviour honestly πŸ‘‘


πŸ¦‹ SYNOPSIS πŸ¦‹

unsigned char * intel_pt_find_overlap (unsigned char *buf_a , size_t
len_a , unsigned char *buf_b , size_t len_b , bool have_tsc , bool
*consecutive , bool ooo_tsc );

πŸ’– ARGUMENTS πŸ’–

  • buf_a β€” first buffer. that's the one you already had.
  • len_a β€” size of first buffer. how much buf_a we're working with.
  • buf_b β€” second buffer. the new one coming in.
  • len_b β€” size of second buffer. the size of buf_b, no cap.
  • have_tsc β€” can use TSC packets to detect overlap. so like, are we allowed to read the TSC packets to sniff out the overlap or not πŸ•΅οΈ
  • consecutive β€” returns true if there is data in buf_b that is consecutive to buf_a. it's an out-param, so it tells you the answer πŸ’Œ
  • ooo_tsc β€” out-of-order TSC due to VM TSC offset / scaling. yes that's a real thing that happens in VMs, and yes it matters here 🌸

🌈 DESCRIPTION 🌈

okay so when trace samples or snapshots are recorded there is the possibility that the data overlaps. that's the whole situation. two buffers, potential double-dipping, we gotta sort it out.

note that, for the purposes of decoding, data is only useful if it begins with a PSB packet. like, fr fr, that's the rule. no PSB at the start = not useful to the decoder. periodt.

πŸ”₯ RETURN πŸ”₯

it hands you back a pointer into buf_b from where non-overlapped data starts. ✨

or, if there's literally no non-overlapped data at all, you get buf_b + len_b. literally the end of the buffer, the "nothing for you here" pointer 😭


🫢 SEE ALSO 🫢

go read those next bestie, they're all part of the same squad πŸ’œ


k that's the whole page!! source is ./tools/perf/util/intel-pt-dec... and it's dated October 2026, so mark your calendar πŸŽ€ thanks for reading my lil manual era, mwah πŸ’‹βœ¨

πŸ“¦ where this page comes from