For processors on which it works, turbostat, linux-tools-common package with an additional kernel version dependency, can monitor your processor core and package temperatures, and CPU loads. It can not monitor your fan speeds.
It works on all modern Intel processors and some AMD processors. It is the only tool that upstream escalations will accept as authoritative. It has a great many options as to what to monitor.
Myself, I run this command almost always (no load, then some load, then no load):
$ sudo turbostat --Summary --quiet --show Busy%,Bzy_MHz,PkgTmp,PkgWatt,GFXWatt,IRQ --interval 6
Busy% Bzy_MHz IRQ PkgTmp PkgWatt GFXWatt
0.03 800 214 30 1.24 0.00
0.03 800 142 30 1.24 0.00
0.02 800 96 30 1.24 0.00
0.34 800 292 30 1.24 0.00
16.78 4474 8467 46 22.15 0.00
16.76 4600 7880 45 23.03 0.00
16.76 4600 7742 46 23.11 0.00
15.95 4599 7336 31 21.96 0.00
0.03 800 150 30 1.24 0.00
0.02 800 123 30 1.24 0.00
The Busy% column would be 100% if all CPUs are 100% busy. In the above example the processor has 6 CPUs, and during the loaded phase one was busy at 100%, or 16.67% of 6 CPUs.
I rarely use a short interval. Often users do not seem to realize that idle CPUs can go into deep idle states for multiple seconds at a time, and they wake them just to sample stuff.
There is a log to file option, --out file-name.
There is also a very informative spew of information about your processor during startup, if the --quiet command line option is omitted. Example:
~$ sudo ~/turbostat --Summary --show Busy%,Bzy_MHz,PkgTmp,PkgWatt,GFXWatt,IRQ --interval 6
turbostat version 20.03.20 - Len Brown <lenb@kernel.org>
CPUID(0): GenuineIntel 0x16 CPUID levels; 0x80000008 xlevels; family:model:stepping 0x6:9e:d (6:158:13)
CPUID(1): SSE3 MONITOR SMX EIST TM2 TSC MSR ACPI-TM HT TM
CPUID(6): APERF, TURBO, DTS, PTM, HWP, HWPnotify, HWPwindow, HWPepp, No-HWPpkg, EPB
cpu4: MSR_IA32_MISC_ENABLE: 0x00850089 (TCC EIST MWAIT PREFETCH TURBO)
CPUID(7): SGX
cpu4: MSR_IA32_FEATURE_CONTROL: 0x00020005 (Locked )
CPUID(0x15): eax_crystal: 2 ebx_tsc: 308 ecx_crystal_hz: 0
TSC: 3696 MHz (24000000 Hz * 308 / 2 / 1000000)
CPUID(0x16): base_mhz: 3700 max_mhz: 4600 bus_mhz: 100
cpu4: MSR_MISC_PWR_MGMT: 0x00401cc0 (ENable-EIST_Coordination DISable-EPB DISable-OOB)
RAPL: 2759 sec. Joule Counter Range, at 95 Watts
cpu4: MSR_PLATFORM_INFO: 0x8080838f1012500
8 * 100.0 = 800.0 MHz max efficiency frequency
37 * 100.0 = 3700.0 MHz base frequency
cpu4: MSR_IA32_POWER_CTL: 0x003c005d (C1E auto-promotion: DISabled)
cpu4: MSR_TURBO_RATIO_LIMIT: 0x2b2b2e2e2e2e2e2e
43 * 100.0 = 4300.0 MHz max turbo 8 active cores
43 * 100.0 = 4300.0 MHz max turbo 7 active cores
46 * 100.0 = 4600.0 MHz max turbo 6 active cores
46 * 100.0 = 4600.0 MHz max turbo 5 active cores
46 * 100.0 = 4600.0 MHz max turbo 4 active cores
46 * 100.0 = 4600.0 MHz max turbo 3 active cores
46 * 100.0 = 4600.0 MHz max turbo 2 active cores
46 * 100.0 = 4600.0 MHz max turbo 1 active cores
cpu4: MSR_CONFIG_TDP_NOMINAL: 0x00000025 (base_ratio=37)
cpu4: MSR_CONFIG_TDP_LEVEL_1: 0x00000000 ()
cpu4: MSR_CONFIG_TDP_LEVEL_2: 0x00000000 ()
cpu4: MSR_CONFIG_TDP_CONTROL: 0x80000000 ( lock=1)
cpu4: MSR_TURBO_ACTIVATION_RATIO: 0x00000000 (MAX_NON_TURBO_RATIO=0 lock=0)
cpu4: MSR_PKG_CST_CONFIG_CONTROL: 0x00000000 (UNlocked, pkg-cstate-limit=0 (pc0))
cpu4: cpufreq driver: intel_pstate
cpu4: cpufreq governor: powersave
cpufreq intel_pstate no_turbo: 0
cpu4: MSR_MISC_FEATURE_CONTROL: 0x00000000 (L2-Prefetch L2-Prefetch-pair L1-Prefetch L1-IP-Prefetch)
cpu0: MSR_PM_ENABLE: 0x00000001 (HWP)
cpu0: MSR_HWP_CAPABILITIES: 0x0108252e (high 46 guar 37 eff 8 low 1)
cpu0: MSR_HWP_REQUEST: 0xff002e08 (min 8 max 46 des 0 epp 0xff window 0x0 pkg 0x0)
cpu0: MSR_HWP_INTERRUPT: 0x00000000 (Dis_Guaranteed_Perf_Change, Dis_Excursion_Min)
cpu0: MSR_HWP_STATUS: 0x00000004 (No-Guaranteed_Perf_Change, No-Excursion_Min)
cpu0: MSR_IA32_ENERGY_PERF_BIAS: 0x00000006 (balanced)
cpu0: MSR_RAPL_POWER_UNIT: 0x000a0e03 (0.125000 Watts, 0.000061 Joules, 0.000977 sec.)
cpu0: MSR_PKG_POWER_INFO: 0x000002f8 (95 W TDP, RAPL 0 - 0 W, 0.000000 sec.)
cpu0: MSR_PKG_POWER_LIMIT: 0x4283e800dd8320 (UNlocked)
cpu0: PKG Limit #1: ENabled (100.000000 Watts, 28.000000 sec, clamp ENabled)
cpu0: PKG Limit #2: ENabled (125.000000 Watts, 0.002441* sec, clamp DISabled)
cpu0: MSR_DRAM_POWER_LIMIT: 0x5400de00000000 (UNlocked)
cpu0: DRAM Limit: DISabled (0.000000 Watts, 0.000977 sec, clamp DISabled)
cpu0: MSR_PP0_POLICY: 0
cpu0: MSR_PP0_POWER_LIMIT: 0x00000000 (UNlocked)
cpu0: Cores Limit: DISabled (0.000000 Watts, 0.000977 sec, clamp DISabled)
cpu0: MSR_PP1_POLICY: 0
cpu0: MSR_PP1_POWER_LIMIT: 0x00000000 (UNlocked)
cpu0: GFX Limit: DISabled (0.000000 Watts, 0.000977 sec, clamp DISabled)
cpu0: MSR_IA32_TEMPERATURE_TARGET: 0x0064100d (100 C)
cpu0: MSR_IA32_PACKAGE_THERM_STATUS: 0x88460000 (30 C)
cpu0: MSR_IA32_PACKAGE_THERM_INTERRUPT: 0x00000003 (100 C, 100 C)
cpu4: MSR_PKGC3_IRTL: 0x00000000 (NOTvalid, 0 ns)
cpu4: MSR_PKGC6_IRTL: 0x00000000 (NOTvalid, 0 ns)
cpu4: MSR_PKGC7_IRTL: 0x00000000 (NOTvalid, 0 ns)
cpu4: MSR_PKGC8_IRTL: 0x00000000 (NOTvalid, 0 ns)
cpu4: MSR_PKGC9_IRTL: 0x00000000 (NOTvalid, 0 ns)
cpu4: MSR_PKGC10_IRTL: 0x00000000 (NOTvalid, 0 ns)
Busy% Bzy_MHz IRQ PkgTmp PkgWatt GFXWatt
0.03 800 184 30 1.32 0.00
Turbostat does has no kernel version dependencies, but the Ubuntu version is wrapped in a rather restrictive script.
grep "model name" /proc/cpuinfo
– Doug Smythies Aug 03 '20 at 13:03sudo ~/turbostat --Summary --quiet --show Busy%,Bzy_MHz,PkgTmp,PkgWatt,GFXWatt,IRQ --interval 6
. I rarely sample at less than 6 seconds, and often more. why? because then I would be waking deep idle CPUs just to ask them stuff for turbostat. – Doug Smythies Aug 04 '20 at 17:09