turbostat [ Options ] [ "--interval seconds" ]
Some information is not available on older processors.
--add attributes add column with counter having specified 'attributes'. The 'location' attribute is required, all others are optional.
location: {msrDDD | msr0xXXX | /sys/path...} msrDDD is a decimal offset, eg. msr16 msr0xXXX is a hex offset, eg. msr0x10 /sys/path... is an absolute path to a sysfs attribute scope: {cpu | core | package} sample and print the counter for every cpu, core, or package. default: cpu size: {u32 | u64 } MSRs are read as 64-bits, u32 truncates the displayed value to 32-bits. default: u64 format: {raw | delta | percent} 'raw' shows the MSR contents in hex. 'delta' shows the difference in values during the measurement interval. 'percent' shows the delta as a percentage of the cycles elapsed. default: delta name: "name_string" Any string that does not match a key-word above is used as the column header.
--cpu cpu-set limit output to system summary plus the specified cpu-set. If cpu-set is the string "core", then the system summary plus the first CPU in each core are printed -- eg. subsequent HT siblings are not printed. Or if cpu-set is the string "package", then the system summary plus the first CPU in each package is printed. Otherwise, the system summary plus the specified set of CPUs are printed. The cpu-set is ordered from low to high, comma delimited with ".." and "-" permitted to denote a range. eg. 1,2,8,14..17,21-44
--hide column do not show the specified built-in columns. May be invoked multiple times, or with a comma-separated list of column names.
--enable column show the specified built-in columns, which are otherwise disabled, by default. Currently the only built-in counters disabled by default are "usec", "Time_Of_Day_Seconds", "APIC" and "X2APIC". The column name "all" can be used to enable all disabled-by-default built-in counters.
--show column show only the specified built-in columns. May be invoked multiple times, or with a comma-separated list of column names.
--show CATEGORY --hide CATEGORY Show and hide also accept a single CATEGORY of columns: "all", "topology", "idle", "frequency", "power", "sysfs", "other".
--Dump displays the raw counter values.
--quiet Do not decode and print the system configuration header information.
+--no-msr Disable all the uses of the MSR driver. +.PP +--no-perf Disable all the uses of the perf API. +.PP --interval seconds overrides the default 5.0 second measurement interval.
--num_iterations num number of the measurement iterations.
--out output_file turbostat output is written to the specified output_file. The file is truncated if it already exists, and it is created if it does not exist.
--help displays usage for the most common parameters.
--Joules displays energy in Joules, rather than dividing Joules by time to print power in Watts.
--list display column header names available for use by --show and --hide, then exit.
--Summary limits output to a 1-line System Summary for each interval.
--TCC temperature sets the Thermal Control Circuit temperature for systems which do not export that value. This is used for making sense of the Digital Thermal Sensor outputs, as they return degrees Celsius below the TCC activation temperature.
--version displays the version.
The command parameter forks command, and upon its exit, displays the statistics gathered since it was forked.
usec For each CPU, the number of microseconds elapsed during counter collection, including thread migration -- if any. This counter is disabled by default, and is enabled with "--enable usec", or --debug. On the summary row, usec refers to the total elapsed time to collect the counters on all cpus.
Time_Of_Day_Seconds For each CPU, the gettimeofday(2) value (seconds.subsec since Epoch) when the counters ending the measurement interval were collected. This column is disabled by default, and can be enabled with "--enable Time_Of_Day_Seconds" or "--debug". On the summary row, Time_Of_Day_Seconds refers to the timestamp following collection of counters on the last CPU.
Core processor core number. Note that multiple CPUs per core indicate support for Intel(R) Hyper-Threading Technology (HT).
CPU Linux CPU (logical processor) number. Yes, it is okay that on many systems the CPUs are not listed in numerical order -- for efficiency reasons, turbostat runs in topology order, so HT siblings appear together.
Package processor package number -- not present on systems with a single processor package.
Avg_MHz number of cycles executed divided by time elapsed. Note that this includes idle-time when 0 instructions are executed.
Busy% percent of the measurement interval that the CPU executes instructions, aka. % of time in "C0" state.
Bzy_MHz average clock rate while the CPU was not idle (ie. in "c0" state).
TSC_MHz average MHz that the TSC ran during the entire interval.
IRQ The number of interrupts serviced by that CPU during the measurement interval. The system total line is the sum of interrupts serviced across all CPUs. turbostat parses /proc/interrupts to generate this summary.
SMI The number of System Management Interrupts serviced CPU during the measurement interval. While this counter is actually per-CPU, SMI are triggered on all processors, so the number should be the same for all CPUs.
C1, C2, C3... The number times Linux requested the C1, C2, C3 idle state during the measurement interval. The system summary line shows the sum for all CPUs. These are C-state names as exported in /sys/devices/system/cpu/cpu*/cpuidle/state*/name. While their names are generic, their attributes are processor specific. They the system description section of output shows what MWAIT sub-states they are mapped to on each system.
C1%, C2%, C3% The residency percentage that Linux requested C1, C2, C3.... The system summary is the average of all CPUs in the system. Note that these are software, reflecting what was requested. The hardware counters reflect what was actually achieved.
CPU%c1, CPU%c3, CPU%c6, CPU%c7 show the percentage residency in hardware core idle states. These numbers are from hardware residency counters.
CoreTmp Degrees Celsius reported by the per-core Digital Thermal Sensor.
PkgTmp Degrees Celsius reported by the per-package Package Thermal Monitor.
GFX%rc6 The percentage of time the GPU is in the "render C6" state, rc6, during the measurement interval. From /sys/class/drm/card0/power/rc6_residency_ms or /sys/class/drm/card0/gt/gt0/rc6_residency_ms or /sys/class/drm/card0/device/tile0/gtN/gtidle/idle_residency_ms depending on the graphics driver being used.
GFXMHz Instantaneous snapshot of what sysfs presents at the end of the measurement interval. From /sys/class/graphics/fb0/device/drm/card0/gt_cur_freq_mhz or /sys/class/drm/card0/gt_cur_freq_mhz or /sys/class/drm/card0/gt/gt0/rps_cur_freq_mhz or /sys/class/drm/card0/device/tile0/gtN/freq0/cur_freq depending on the graphics driver being used.
GFXAMHz Instantaneous snapshot of what sysfs presents at the end of the measurement interval. From /sys/class/graphics/fb0/device/drm/card0/gt_act_freq_mhz or /sys/class/drm/card0/gt_act_freq_mhz or /sys/class/drm/card0/gt/gt0/rps_act_freq_mhz or /sys/class/drm/card0/device/tile0/gtN/freq0/act_freq depending on the graphics driver being used.
SAM%mc6 The percentage of time the SA Media is in the "module C6" state, mc6, during the measurement interval. From /sys/class/drm/card0/gt/gt1/rc6_residency_ms or /sys/class/drm/card0/device/tile0/gtN/gtidle/idle_residency_ms depending on the graphics driver being used.
SAMMHz Instantaneous snapshot of what sysfs presents at the end of the measurement interval. From /sys/class/drm/card0/gt/gt1/rps_cur_freq_mhz or /sys/class/drm/card0/device/tile0/gtN/freq0/cur_freq depending on the graphics driver being used.
SAMAMHz Instantaneous snapshot of what sysfs presents at the end of the measurement interval. From /sys/class/drm/card0/gt/gt1/rps_act_freq_mhz or /sys/class/drm/card0/device/tile0/gtN/freq0/act_freq depending on the graphics driver being used.
Pkg%pc2, Pkg%pc3, Pkg%pc6, Pkg%pc7 percentage residency in hardware package idle states. These numbers are from hardware residency counters.
PkgWatt Watts consumed by the whole package.
CorWatt Watts consumed by the core part of the package.
GFXWatt Watts consumed by the Graphics part of the package -- available only on client processors.
RAMWatt Watts consumed by the DRAM DIMMS -- available only on server processors.
PKG_% percent of the interval that RAPL throttling was active on the Package. Note that the system summary is the sum of the package throttling time, and thus may be higher than 100% on a multi-package system. Note that the meaning of this field is model specific. For example, some hardware increments this counter when RAPL responds to thermal limits, but does not increment this counter when RAPL responds to power limits. Comparing PkgWatt and PkgTmp to system limits is necessary.
RAM_% percent of the interval that RAPL throttling was active on DRAM.
UncMHz uncore MHz, instantaneous sample.
When you are not interested in all that information, and there are several ways to see only what you want. First the "--quiet" option will skip the configuration information, and turbostat will show only the counter columns. Second, you can reduce the columns with the "--hide" and "--show" options. If you use the "--show" option, then turbostat will show only the columns you list. If you use the "--hide" option, turbostat will show all columns, except the ones you list.
To find out what columns are available for --show and --hide, the "--list" option is available. Usually, the CATEGORY names above are used to refer to groups of counters. Also, for convenience, the special string "sysfs" can be used to refer to all of the sysfs C-state counters at once:
sudo ./turbostat --show sysfs --quiet sleep 10 10.003837 sec C1 C1E C3 C6 C7s C1% C1E% C3% C6% C7s% 4 21 2 2 459 0.14 0.82 0.00 0.00 98.93 1 17 2 2 130 0.00 0.02 0.00 0.00 99.80 0 0 0 0 31 0.00 0.00 0.00 0.00 99.95 2 1 0 0 52 1.14 6.49 0.00 0.00 92.21 1 2 0 0 52 0.00 0.08 0.00 0.00 99.86 0 0 0 0 71 0.00 0.00 0.00 0.00 99.89 0 0 0 0 25 0.00 0.00 0.00 0.00 99.96 0 0 0 0 74 0.00 0.00 0.00 0.00 99.94 0 1 0 0 24 0.00 0.00 0.00 0.00 99.84
[root@hsw]# ./turbostat -o ts.out sleep 10 [root@hsw]#
sudo turbostat --quiet --show CPU,frequency Core CPU Avg_MHz Busy% Bzy_MHz TSC_MHz CPU%c7 UncMhz - - 524 12.48 4198 3096 74.53 3800 0 0 4 0.09 4081 3096 98.88 3800 0 4 1 0.02 4063 3096 1 1 2 0.06 4063 3096 99.60 1 5 2 0.05 4070 3096 2 2 4178 99.52 4199 3096 0.00 2 6 3 0.08 4159 3096 3 3 1 0.04 4046 3096 99.66 3 7 0 0.01 3989 3096 Core CPU Avg_MHz Busy% Bzy_MHz TSC_MHz CPU%c7 UncMhz - - 525 12.52 4198 3096 74.54 3800 0 0 4 0.10 4051 3096 99.49 3800 0 4 2 0.04 3993 3096 1 1 3 0.07 4054 3096 99.56 1 5 4 0.10 4018 3096 2 2 4178 99.51 4199 3096 0.00 2 6 4 0.09 4143 3096 3 3 2 0.06 4026 3096 99.10 3 7 7 0.17 4074 3096This example also shows the use of the --show option to show only the desired columns.
turbostat version 2022.04.16 - Len Brown <lenb@kernel.org> Kernel command line: BOOT_IMAGE=/boot/vmlinuz-5.18.0-rc6-00001-ge6891250e3b5 ... CPUID(0): GenuineIntel 0x16 CPUID levels CPUID(1): family:model:stepping 0x6:9e:9 (6:158:9) microcode 0xea CPUID(0x80000000): max_extended_levels: 0x80000008 CPUID(1): SSE3 MONITOR - EIST TM2 TSC MSR ACPI-TM HT TM CPUID(6): APERF, TURBO, DTS, PTM, HWP, HWPnotify, HWPwindow, HWPepp, No-HWPpkg, EPB cpu7: MSR_IA32_MISC_ENABLE: 0x00850089 (TCC EIST MWAIT PREFETCH TURBO) CPUID(7): SGX cpu7: MSR_IA32_FEATURE_CONTROL: 0x00000005 (Locked ) CPUID(0x15): eax_crystal: 2 ebx_tsc: 258 ecx_crystal_hz: 0 TSC: 3096 MHz (24000000 Hz * 258 / 2 / 1000000) CPUID(0x16): base_mhz: 3100 max_mhz: 4200 bus_mhz: 100 cpu7: MSR_MISC_PWR_MGMT: 0x00401cc0 (ENable-EIST_Coordination DISable-EPB DISable-OOB) RAPL: 5825 sec. Joule Counter Range, at 45 Watts cpu7: MSR_PLATFORM_INFO: 0x80839f1011f00 8 * 100.0 = 800.0 MHz max efficiency frequency 31 * 100.0 = 3100.0 MHz base frequency cpu7: MSR_IA32_POWER_CTL: 0x002c005d (C1E auto-promotion: DISabled) cpu7: MSR_TURBO_RATIO_LIMIT: 0x2728292a 39 * 100.0 = 3900.0 MHz max turbo 4 active cores 40 * 100.0 = 4000.0 MHz max turbo 3 active cores 41 * 100.0 = 4100.0 MHz max turbo 2 active cores 42 * 100.0 = 4200.0 MHz max turbo 1 active cores cpu7: MSR_CONFIG_TDP_NOMINAL: 0x0000001f (base_ratio=31) cpu7: MSR_CONFIG_TDP_LEVEL_1: 0x00000000 () cpu7: MSR_CONFIG_TDP_LEVEL_2: 0x00000000 () cpu7: MSR_CONFIG_TDP_CONTROL: 0x80000000 ( lock=1) cpu7: MSR_TURBO_ACTIVATION_RATIO: 0x00000000 (MAX_NON_TURBO_RATIO=0 lock=0) cpu7: MSR_PKG_CST_CONFIG_CONTROL: 0x1e008008 (UNdemote-C3, UNdemote-C1, demote-C3, demote-C1, locked, pkg-cstate-limit=8 (unlimited)) Uncore Frequency pkg0 die0: 800 - 3900 MHz (800 - 3900 MHz) /dev/cpu_dma_latency: 2000000000 usec (default) current_driver: intel_idle current_governor: menu current_governor_ro: menu cpu7: POLL: CPUIDLE CORE POLL IDLE cpu7: C1: MWAIT 0x00 cpu7: C1E: MWAIT 0x01 cpu7: C3: MWAIT 0x10 cpu7: C6: MWAIT 0x20 cpu7: C7s: MWAIT 0x33 cpu7: C8: MWAIT 0x40 cpu7: C9: MWAIT 0x50 cpu7: C10: MWAIT 0x60 cpu7: cpufreq driver: intel_pstate cpu7: cpufreq governor: performance cpufreq intel_pstate no_turbo: 0 cpu7: 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: 0x01101f53 (high 83 guar 31 eff 16 low 1) cpu0: MSR_HWP_REQUEST: 0x00005353 (min 83 max 83 des 0 epp 0x0 window 0x0 pkg 0x0) cpu0: MSR_HWP_INTERRUPT: 0x00000001 (EN_Guaranteed_Perf_Change, Dis_Excursion_Min) cpu0: MSR_HWP_STATUS: 0x00000004 (No-Guaranteed_Perf_Change, No-Excursion_Min) cpu0: EPB: 6 (balanced) cpu0: MSR_RAPL_POWER_UNIT: 0x000a0e03 (0.125000 Watts, 0.000061 Joules, 0.000977 sec.) cpu0: MSR_PKG_POWER_INFO: 0x00000168 (45 W TDP, RAPL 0 - 0 W, 0.000000 sec.) cpu0: MSR_PKG_POWER_LIMIT: 0x42820800218208 (UNlocked) cpu0: PKG Limit #1: ENabled (65.000 Watts, 64.000000 sec, clamp ENabled) cpu0: PKG Limit #2: ENabled (65.000 Watts, 0.002441* sec, clamp DISabled) cpu0: MSR_VR_CURRENT_CONFIG: 0x00000000 cpu0: PKG Limit #4: 0.000000 Watts (UNlocked) cpu0: MSR_DRAM_POWER_LIMIT: 0x5400de00000000 (UNlocked) cpu0: DRAM Limit: DISabled (0.000 Watts, 0.000977 sec, clamp DISabled) cpu0: MSR_PP0_POLICY: 0 cpu0: MSR_PP0_POWER_LIMIT: 0x00000000 (UNlocked) cpu0: Cores Limit: DISabled (0.000 Watts, 0.000977 sec, clamp DISabled) cpu0: MSR_PP1_POLICY: 0 cpu0: MSR_PP1_POWER_LIMIT: 0x00000000 (UNlocked) cpu0: GFX Limit: DISabled (0.000 Watts, 0.000977 sec, clamp DISabled) cpu0: MSR_IA32_TEMPERATURE_TARGET: 0x00640000 (100 C) (100 default - 0 offset) cpu0: MSR_IA32_PACKAGE_THERM_STATUS: 0x88200800 (68 C) cpu0: MSR_IA32_PACKAGE_THERM_INTERRUPT: 0x00000003 (100 C, 100 C) cpu7: MSR_PKGC3_IRTL: 0x0000884e (valid, 79872 ns) cpu7: MSR_PKGC6_IRTL: 0x00008876 (valid, 120832 ns) cpu7: MSR_PKGC7_IRTL: 0x00008894 (valid, 151552 ns) cpu7: MSR_PKGC8_IRTL: 0x000088fa (valid, 256000 ns) cpu7: MSR_PKGC9_IRTL: 0x0000894c (valid, 339968 ns) cpu7: MSR_PKGC10_IRTL: 0x00008bf2 (valid, 1034240 ns)
The max efficiency frequency, a.k.a. Low Frequency Mode, is the frequency available at the minimum package voltage. The TSC frequency is the base frequency of the processor -- this should match the brand string in /proc/cpuinfo. This base frequency should be sustainable on all CPUs indefinitely, given nominal power and cooling. The remaining rows show what maximum turbo frequency is possible depending on the number of idle cores. Note that not all information is available on all processors.
sudo ./turbostat --quiet --cpu 0-3 --show CPU --add msr0x199,u32,raw,PRF_CTRL sleep .1 0.101604 sec CPU PRF_CTRL - 0x00000000 0 0x00000c00 1 0x00000800 2 0x00000a00 3 0x00000800
/dev/cpu/*/msr
Written by Len Brown <len.brown@intel.com>