rdtsc(9)
π rdtsc β kernel API manual, bestie edition β¨
Okay so welcome to the Kernel API Manual entry for rdtsc, and honestly? She's a little chaotic but she's iconic. Buckle up π
πΈ NAME πΈ
rdtsc β returns the current TSC without ordering constraints
β SYNOPSIS β
u64 rdtsc (void );
π¦ ARGUMENTS π¦
voidβ no arguments. none. zero. nada. she takes nothing and she gives you au64, main character energy fr π
π₯ DESCRIPTION π₯
So rdtsc returns the result of RDTSC as a 64-bit integer. That's it, that's the vibe β¨
The only ordering constraint it supplies is the ordering implied by "asm volatile" β which means it will put the RDTSC in the place you expect. Lowkey the bare minimum, but she delivers π«Ά
β οΈ but here's the tea: the CPU can and will speculatively execute that RDTSC, though. so the results can be non-monotonic if you compare them on different CPUs. not me getting different numbers on different cores ππ plan accordingly bestie, this is NOT a globally-consistent-clock situation, no cap.
π SEE ALSO π
- Kernel file
./arch/x86/include/asm/tsc.h rdtsc_ordered(9)β the ordered one, iykyk π
that's the whole page, mwah π sourced straight from ./arch/x86/include/asm, dated October 2026, and filed under rdtsc(9). go forth and timestamp responsibly, bestie π§ββοΈπ
π¦ 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