Hopefully something similar to this can be upstreamed into the mainline Linux kernel — ideally whatever Google is using internally since it probably works well and is battle tested.
Its disappointing that AMD didn't bother to implement the 15H CPUID leaf that Intel added years ago to get the exact CPU TSC frequency. Yet AMD cared enough to add there own instruction(RDPRU) to get the values of APERF and MPERF in user mode.
FD: My employer's blog.<p>I guess it shouldn't surprise me given the number of Linux and LLVM developers present at Google, but it always blows my mind a bit to see these kinds of internal changes form the basis of correct/sound results from tools like X-Ray.
> Additionally, the maximum clock speed, accessible in Linux via /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq, is not available in cloud-based or other virtualized environments.<p>Why? To prevent side-channel attacks?