intel_pt_tsc_cmp(9)
π intel_pt_tsc_cmp β the Kernel API Manual, bestie edition β¨
okay so real talk, this little function is from the Kernel API Manual and it's honestly such a tiny icon. It compares 7-byte TSCs. That's it. That's the whole vibe check. π
β¨ NAME β¨
intel_pt_tsc_cmp β compare 7-byte TSCs. literally its whole job, no cap. π¦
πΈ SYNOPSIS πΈ
int intel_pt_tsc_cmp (uint64_t tsc1 , uint64_t tsc2 );
look at her go π two uint64_t girlies walk in and one int walks out.
π ARGUMENTS π
tsc1β first TSC to compare. the one who goes first, main character energy πtsc2β second TSC to compare. the challenger, the rival, the plot twist π
π§ DESCRIPTION π§
So here's the tea β: this function compares 7-byte TSC values, and it does it while allowing for the possibility that the TSC wrapped around. Yeah. It wrapped. It happens to the best of us. π
But here's the part you need to know, bestie β generally it is not possible to know if TSC has wrapped around, so for that purpose this function just assumes the absolute difference is less than half the maximum difference. That's the assumption. That's the deal. She's doing her best with the info she has and honestly? slay. π«Ά
fr fr, remember that's an assumption, not a magic trick β the manpage says so, and I'm just the messenger π
π₯ RETURN π₯
-1β iftsc1is beforetsc2π₯² (she came in early)0β iftsc1==tsc2π«Ά (they're literally the same, twin flames)1β iftsc1is aftertsc2π₯ (fashionably late, iconic)
π SEE ALSO π
- Kernel file
./tools/perf/util/intel-pt-decoder/intel-pt-decoder.cβ go read the source, iykyk π intel_pt_next_psb(9)intel_pt_step_psb(9)intel_pt_last_psb(9)intel_pt_next_tsc(9)adj_for_padding(9)intel_pt_find_overlap_tsc(9)intel_pt_find_overlap(9)struct fast_forward_data(9)intel_pt_ff_cb(9)intel_pt_fast_forward(9)
the whole friend group π« go say hi to all of them.
okay that's the page!! π this section was sourced from ./tools/perf/util/intel-pt-dec... and dated October 2026, so likeβ¦ mark your calendars, bestie ποΈβ¨ mwah, study hard, and remember: 7-byte TSCs deserve love too. ππ
π¦ 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