4 ms·
I recently discovered 'turbostat' for reading actual CPU frequency on Linux: http://lxr.free-electrons.com/source/tools/power/x86/turbostat/turbostat.c http://l
by nkurz 13y ago
I recently discovered 'turbostat' for reading actual CPU frequency on Linux: http://lxr.free-electrons.com/source/tools/power/x86/turbostat/turbostat.c http://lxr.free-electrons.com/source/tools/power/x86/turbost...
Bruce's direct testing approach has a certain elegance, but instead of timing a loop 'turbostat' queries the CPU's performance registers. So in addition to being handy if you are running Linux, it could serve as a guide for developers of other systems trying to figure out which MSR's are needed and how to interpret them.
- Florin_Andrei 13y agocat /proc/cpuinfo
- nkurz 13y agoThis would be simpler, but doesn't work if you are running a non-standard clock. /proc/cpuinfo gives you the nominal frequency, but turbostat gives you the actual. In the example below, the 3.79 GHz reported by turbostat is the actual speed and the 2.527 reported by /proc/cpuinfo is not. I think thermal throttling is another case where turbostat is correct but the kernel info is not. nate@centos:~$ cat /proc/cpuinfo | grep -i mhz cpu MHz : 1596.000 cpu MHz : 1596.000 cpu MHz : 1596.000 cpu MHz : 1596.000 cpu MHz : 2527.000 cpu MHz : 1596.000 cpu MHz : 1596.000 cpu MHz : 1596.000 cor CPU %c0 GHz TSC %c1 %c3 %c6 %pc3 %pc6 2.82 3.75 3.79 2.92 0.57 93.69 0.00 0.00 0 0 0.29 2.76 3.79 0.26 1.24 98.21 0.00 0.00 0 7 0.11 3.02 3.79 0.45 1 3 0.14 2.45 3.79 0.14 0.56 99.16 1 6 0.03 2.79 3.79 0.25 2 1 0.06 3.07 3.79 0.12 0.26 99.56 2 5 0.05 2.85 3.79 0.13 3 2 0.05 2.81 3.79 21.88 0.23 77.84 3 4 21.83 3.78 3.79 0.11