rdtsc(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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 a u64, 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