Read in:
Deutsch
Deutsch
It always bothered me that /proc/cpuinfo and sysfs won’t show you the real CPU speed in case you have overclocked (or underclocked) your Intel CPU. On a recent hunt for a solution I found “turbostat“:
turbostat -- utility to print cpu speed and C-state residency on recent turbo-capable processors
You will need kernel 3.2 or newer for this as far as I remember.
My Binary: https://cryptocurrency-investment.eu/blog-files/turbostat
Source: https://cryptocurrency-investment.eu/blog-files/turbostat.c (found here)
- Compile it:
gcc -o turbostat turbostat.c
- Load the kernel module “msr”:
sudo modprobe msr
- Run the program:
sudo ./turbostat
- Simulate load with the program “stress”, in my case on 4 cores:
stress -c 4
My CPU is an Intel Core2Quad Q9450 with a default clock speed of 2,6 GHz, overclocked to 3,2 Ghz (FSB set to 400) with SpeedStep enabled. Tested on Ubuntu 12.04 with kernel 3.2.0-24-generic-pae.
Output without any load:
/dev/cpu/4/msr: No such file or directory (I think this can be ignored) CPU GHz TSC 0 2.40 3.20 1 2.40 3.20 2 2.44 3.20 3 2.81 3.20
Output with the “stress” command:
CPU GHz TSC 0 3.20 3.20 1 3.20 3.20 2 3.20 3.20 3 3.20 3.20
Let me know if this tip was helpful in the comments 🙂