intel_pt_find_overlap_tsc(9)
π intel_pt_find_overlap_tsc(9) β like, the Kernel API Manual page you didn't know you needed π
okay so bestie. this is a page straight out of the Kernel API Manual, and it's about one very specific little function: intel_pt_find_overlap_tsc. it figures out where the non-overlapped trace data starts, using TSC. that's it. that's the whole vibe. let's get into it β¨
πΈ NAME πΈ
intel_pt_find_overlap_tsc β determine start of non-overlapped trace data using TSC.
like, literally in the name. it finds the overlap. with TSC. slay π
π¦ SYNOPSIS π¦
unsigned char * intel_pt_find_overlap_tsc (unsigned char *buf_a , size_t
len_a , unsigned char *buf_b , size_t len_b , bool *consecutive , bool
ooo_tsc );
no cap, that's the signature, character for character. don't come for me about the spacing, that's how it's written π
π ARGUMENTS π
the cast of characters, in order:
buf_aβ first buffer. the one that comes first. main character energy πlen_aβ size of first buffer. you gotta tell it how bigbuf_ais, obviously.buf_bβ second buffer. the other one. the sequel π¦len_bβ size of second buffer. yes, it needs this too.consecutiveβ returnstrueif there is data inbuf_bthat is consecutive tobuf_a. it's a pointer, so it writes back to you. that's the whole point π«Άooo_tscβ out-of-order TSC due to VM TSC offset / scaling. it's abool, and honestly if you're in a VM this one's for you π
π₯ DESCRIPTION π₯
okay so here's the tea β
If the trace contains TSC, we can look at the last TSC of buf_a and the first TSC of buf_b in order to determine if the buffers overlap. then we walk forward in buf_b until a later TSC is found. iconic behaviour, honestly.
β οΈ precondition alert!!buf_aandbuf_bmust be positioned at a PSB. like, that's not optional, bestie. if they're not at a PSB, that's a you problem π
β RETURN β
what you get back:
- a pointer into
buf_bfrom where non-overlapped data starts, or buf_b + len_bif there is no non-overlapped data.
that's it. that's the return value. no surprises, no plot twists π
π SEE ALSO π
go read these next, they're all in the same friend group:
- Kernel file
./tools/perf/util/intel-pt-decoder/intel-pt-decoder.cβ the source file, the mothership intel_pt_next_psb(9)intel_pt_step_psb(9)intel_pt_last_psb(9)intel_pt_next_tsc(9)intel_pt_tsc_cmp(9)adj_for_padding(9)intel_pt_find_overlap(9)struct fast_forward_data(9)intel_pt_ff_cb(9)intel_pt_fast_forward(9)
iykyk π§
and that's the whole page!! this lil icon came from ./tools/perf/util/intel-pt-dec... and it's dated October 2026 β yes, the future, we're built different πβ¨ bye bestie, go decode some trace data π
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms