1TURBOSTAT(8) System Manager's Manual TURBOSTAT(8)
2
3
4
6 turbostat - Report processor frequency and idle statistics
7
9 turbostat [Options] command
10 turbostat [Options] [--interval seconds]
11
13 turbostat reports processor topology, frequency, idle power-state sta‐
14 tistics, temperature and power on X86 processors. There are two ways
15 to invoke turbostat. The first method is to supply a command, which is
16 forked and statistics are printed in one-shot upon its completion. The
17 second method is to omit the command, and turbostat displays statistics
18 every 5 seconds interval. The 5-second interval can be changed using
19 the --interval option.
20
21 Some information is not available on older processors.
22
23 Options
24 Options can be specified with a single or double '-', and only as much
25 of the option name as necessary to disambiguate it from others is nec‐
26 essary. Note that options are case-sensitive.
27
28 --add attributes add column with counter having specified 'attributes'.
29 The 'location' attribute is required, all others are optional.
30 location: {msrDDD | msr0xXXX | /sys/path...}
31 msrDDD is a decimal offset, eg. msr16
32 msr0xXXX is a hex offset, eg. msr0x10
33 /sys/path... is an absolute path to a sysfs attribute
34
35 scope: {cpu | core | package}
36 sample and print the counter for every cpu, core, or package.
37 default: cpu
38
39 size: {u32 | u64 }
40 MSRs are read as 64-bits, u32 truncates the displayed value to 32-bits.
41 default: u64
42
43 format: {raw | delta | percent}
44 'raw' shows the MSR contents in hex.
45 'delta' shows the difference in values during the measurement interval.
46 'percent' shows the delta as a percentage of the cycles elapsed.
47 default: delta
48
49 name: "name_string"
50 Any string that does not match a key-word above is used
51 as the column header.
52
53 --cpu cpu-set limit output to system summary plus the specified cpu-
54 set. If cpu-set is the string "core", then the system summary plus the
55 first CPU in each core are printed -- eg. subsequent HT siblings are
56 not printed. Or if cpu-set is the string "package", then the system
57 summary plus the first CPU in each package is printed. Otherwise, the
58 system summary plus the specified set of CPUs are printed. The cpu-set
59 is ordered from low to high, comma delimited with ".." and "-" permit‐
60 ted to denote a range. eg. 1,2,8,14..17,21-44
61
62 --hide column do not show the specified built-in columns. May be in‐
63 voked multiple times, or with a comma-separated list of column names.
64
65 --enable column show the specified built-in columns, which are other‐
66 wise disabled, by default. Currently the only built-in counters dis‐
67 abled by default are "usec", "Time_Of_Day_Seconds", "APIC" and
68 "X2APIC". The column name "all" can be used to enable all disabled-by-
69 default built-in counters.
70
71 --show column show only the specified built-in columns. May be invoked
72 multiple times, or with a comma-separated list of column names.
73
74 --show CATEGORY --hide CATEGORY Show and hide also accept a single
75 CATEGORY of columns: "all", "topology", "idle", "frequency", "power",
76 "sysfs", "other".
77
78 --Dump displays the raw counter values.
79
80 --quiet Do not decode and print the system configuration header infor‐
81 mation.
82
83 --interval seconds overrides the default 5.0 second measurement inter‐
84 val.
85
86 --num_iterations num number of the measurement iterations.
87
88 --out output_file turbostat output is written to the specified out‐
89 put_file. The file is truncated if it already exists, and it is cre‐
90 ated if it does not exist.
91
92 --help displays usage for the most common parameters.
93
94 --Joules displays energy in Joules, rather than dividing Joules by time
95 to print power in Watts.
96
97 --list display column header names available for use by --show and
98 --hide, then exit.
99
100 --Summary limits output to a 1-line System Summary for each interval.
101
102 --TCC temperature sets the Thermal Control Circuit temperature for sys‐
103 tems which do not export that value. This is used for making sense of
104 the Digital Thermal Sensor outputs, as they return degrees Celsius be‐
105 low the TCC activation temperature.
106
107 --version displays the version.
108
109 The command parameter forks command, and upon its exit, displays the
110 statistics gathered since it was forked.
111
113 The system configuration dump (if --quiet is not used) is followed by
114 statistics. The first row of the statistics labels the content of each
115 column (below). The second row of statistics is the system summary
116 line. The system summary line has a '-' in the columns for the Pack‐
117 age, Core, and CPU. The contents of the system summary line depends on
118 the type of column. Columns that count items (eg. IRQ) show the sum
119 across all CPUs in the system. Columns that show a percentage show the
120 average across all CPUs in the system. Columns that dump raw MSR val‐
121 ues simply show 0 in the summary. After the system summary row, each
122 row describes a specific Package/Core/CPU. Note that if the --cpu pa‐
123 rameter is used to limit which specific CPUs are displayed, turbostat
124 will still collect statistics for all CPUs in the system and will still
125 show the system summary for all CPUs in the system.
126
128 usec For each CPU, the number of microseconds elapsed during counter
129 collection, including thread migration -- if any. This counter is dis‐
130 abled by default, and is enabled with "--enable usec", or --debug. On
131 the summary row, usec refers to the total elapsed time to collect the
132 counters on all cpus.
133
134 Time_Of_Day_Seconds For each CPU, the gettimeofday(2) value (sec‐
135 onds.subsec since Epoch) when the counters ending the measurement in‐
136 terval were collected. This column is disabled by default, and can be
137 enabled with "--enable Time_Of_Day_Seconds" or "--debug". On the sum‐
138 mary row, Time_Of_Day_Seconds refers to the timestamp following collec‐
139 tion of counters on the last CPU.
140
141 Core processor core number. Note that multiple CPUs per core indicate
142 support for Intel(R) Hyper-Threading Technology (HT).
143
144 CPU Linux CPU (logical processor) number. Yes, it is okay that on many
145 systems the CPUs are not listed in numerical order -- for efficiency
146 reasons, turbostat runs in topology order, so HT siblings appear to‐
147 gether.
148
149 Package processor package number -- not present on systems with a sin‐
150 gle processor package.
151
152 Avg_MHz number of cycles executed divided by time elapsed. Note that
153 this includes idle-time when 0 instructions are executed.
154
155 Busy% percent of the measurement interval that the CPU executes in‐
156 structions, aka. % of time in "C0" state.
157
158 Bzy_MHz average clock rate while the CPU was not idle (ie. in "c0"
159 state).
160
161 TSC_MHz average MHz that the TSC ran during the entire interval.
162
163 IRQ The number of interrupts serviced by that CPU during the measure‐
164 ment interval. The system total line is the sum of interrupts serviced
165 across all CPUs. turbostat parses /proc/interrupts to generate this
166 summary.
167
168 SMI The number of System Management Interrupts serviced CPU during the
169 measurement interval. While this counter is actually per-CPU, SMI are
170 triggered on all processors, so the number should be the same for all
171 CPUs.
172
173 C1, C2, C3... The number times Linux requested the C1, C2, C3 idle
174 state during the measurement interval. The system summary line shows
175 the sum for all CPUs. These are C-state names as exported in /sys/de‐
176 vices/system/cpu/cpu*/cpuidle/state*/name. While their names are
177 generic, their attributes are processor specific. They the system de‐
178 scription section of output shows what MWAIT sub-states they are mapped
179 to on each system.
180
181 C1%, C2%, C3% The residency percentage that Linux requested C1, C2,
182 C3.... The system summary is the average of all CPUs in the system.
183 Note that these are software, reflecting what was requested. The hard‐
184 ware counters reflect what was actually achieved.
185
186 CPU%c1, CPU%c3, CPU%c6, CPU%c7 show the percentage residency in hard‐
187 ware core idle states. These numbers are from hardware residency coun‐
188 ters.
189
190 CoreTmp Degrees Celsius reported by the per-core Digital Thermal Sen‐
191 sor.
192
193 PkgTmp Degrees Celsius reported by the per-package Package Thermal Mon‐
194 itor.
195
196 GFX%rc6 The percentage of time the GPU is in the "render C6" state,
197 rc6, during the measurement interval. From
198 /sys/class/drm/card0/power/rc6_residency_ms.
199
200 GFXMHz Instantaneous snapshot of what sysfs presents at the end of the
201 measurement interval. From /sys/class/graphics/fb0/de‐
202 vice/drm/card0/gt_cur_freq_mhz.
203
204 Pkg%pc2, Pkg%pc3, Pkg%pc6, Pkg%pc7 percentage residency in hardware
205 package idle states. These numbers are from hardware residency coun‐
206 ters.
207
208 PkgWatt Watts consumed by the whole package.
209
210 CorWatt Watts consumed by the core part of the package.
211
212 GFXWatt Watts consumed by the Graphics part of the package -- available
213 only on client processors.
214
215 RAMWatt Watts consumed by the DRAM DIMMS -- available only on server
216 processors.
217
218 PKG_% percent of the interval that RAPL throttling was active on the
219 Package. Note that the system summary is the sum of the package throt‐
220 tling time, and thus may be higher than 100% on a multi-package system.
221 Note that the meaning of this field is model specific. For example,
222 some hardware increments this counter when RAPL responds to thermal
223 limits, but does not increment this counter when RAPL responds to power
224 limits. Comparing PkgWatt and PkgTmp to system limits is necessary.
225
226 RAM_% percent of the interval that RAPL throttling was active on DRAM.
227
228 UncMHz uncore MHz, instantaneous sample.
229
231 By default, turbostat dumps all possible information -- a system con‐
232 figuration header, followed by columns for all counters. This is ideal
233 for remote debugging, use the "--out" option to save everything to a
234 text file, and get that file to the expert helping you debug.
235
236 When you are not interested in all that information, and there are sev‐
237 eral ways to see only what you want. First the "--quiet" option will
238 skip the configuration information, and turbostat will show only the
239 counter columns. Second, you can reduce the columns with the "--hide"
240 and "--show" options. If you use the "--show" option, then turbostat
241 will show only the columns you list. If you use the "--hide" option,
242 turbostat will show all columns, except the ones you list.
243
244 To find out what columns are available for --show and --hide, the
245 "--list" option is available. Usually, the CATEGORY names above are
246 used to refer to groups of counters. Also, for convenience, the spe‐
247 cial string "sysfs" can be used to refer to all of the sysfs C-state
248 counters at once:
249
250 sudo ./turbostat --show sysfs --quiet sleep 10
251 10.003837 sec
252 C1 C1E C3 C6 C7s C1% C1E% C3% C6% C7s%
253 4 21 2 2 459 0.14 0.82 0.00 0.00 98.93
254 1 17 2 2 130 0.00 0.02 0.00 0.00 99.80
255 0 0 0 0 31 0.00 0.00 0.00 0.00 99.95
256 2 1 0 0 52 1.14 6.49 0.00 0.00 92.21
257 1 2 0 0 52 0.00 0.08 0.00 0.00 99.86
258 0 0 0 0 71 0.00 0.00 0.00 0.00 99.89
259 0 0 0 0 25 0.00 0.00 0.00 0.00 99.96
260 0 0 0 0 74 0.00 0.00 0.00 0.00 99.94
261 0 1 0 0 24 0.00 0.00 0.00 0.00 99.84
262
264 If turbostat is invoked with a command, it will fork that command and
265 output the statistics gathered after the command exits. In this case,
266 turbostat output goes to stderr, by default. Output can instead be
267 saved to a file using the --out option. In this example, the "sleep
268 10" command is forked, and turbostat waits for it to complete before
269 saving all statistics into "ts.out". Note that "sleep 10" is not part
270 of turbostat, but is simply an example of a command that turbostat can
271 fork. The "ts.out" file is what you want to edit in a very wide win‐
272 dow, paste into a spreadsheet, or attach to a bugzilla entry.
273
274 [root@hsw]# ./turbostat -o ts.out sleep 10
275 [root@hsw]#
276
277
279 Without a command to fork, turbostat displays statistics ever 5 sec‐
280 onds. Periodic output goes to stdout, by default, unless --out is used
281 to specify an output file. The 5-second interval can be changed with
282 the "-i sec" option.
283 sudo turbostat --quiet --show CPU,frequency
284 Core CPU Avg_MHz Busy% Bzy_MHz TSC_MHz CPU%c7 UncMhz
285 - - 524 12.48 4198 3096 74.53 3800
286 0 0 4 0.09 4081 3096 98.88 3800
287 0 4 1 0.02 4063 3096
288 1 1 2 0.06 4063 3096 99.60
289 1 5 2 0.05 4070 3096
290 2 2 4178 99.52 4199 3096 0.00
291 2 6 3 0.08 4159 3096
292 3 3 1 0.04 4046 3096 99.66
293 3 7 0 0.01 3989 3096
294 Core CPU Avg_MHz Busy% Bzy_MHz TSC_MHz CPU%c7 UncMhz
295 - - 525 12.52 4198 3096 74.54 3800
296 0 0 4 0.10 4051 3096 99.49 3800
297 0 4 2 0.04 3993 3096
298 1 1 3 0.07 4054 3096 99.56
299 1 5 4 0.10 4018 3096
300 2 2 4178 99.51 4199 3096 0.00
301 2 6 4 0.09 4143 3096
302 3 3 2 0.06 4026 3096 99.10
303 3 7 7 0.17 4074 3096
304 This example also shows the use of the --show option to show only the
305 desired columns.
306
307
309 By default, turbostat always dumps system configuration information be‐
310 fore taking measurements. In the example above, "--quiet" is used to
311 suppress that output. Here is an example of the configuration informa‐
312 tion:
313 turbostat version 2022.04.16 - Len Brown <lenb@kernel.org>
314 Kernel command line: BOOT_IMAGE=/boot/vmlinuz-5.18.0-rc6-00001-ge6891250e3b5 ...
315 CPUID(0): GenuineIntel 0x16 CPUID levels
316 CPUID(1): family:model:stepping 0x6:9e:9 (6:158:9) microcode 0xea
317 CPUID(0x80000000): max_extended_levels: 0x80000008
318 CPUID(1): SSE3 MONITOR - EIST TM2 TSC MSR ACPI-TM HT TM
319 CPUID(6): APERF, TURBO, DTS, PTM, HWP, HWPnotify, HWPwindow, HWPepp, No-HWPpkg, EPB
320 cpu7: MSR_IA32_MISC_ENABLE: 0x00850089 (TCC EIST MWAIT PREFETCH TURBO)
321 CPUID(7): SGX
322 cpu7: MSR_IA32_FEATURE_CONTROL: 0x00000005 (Locked )
323 CPUID(0x15): eax_crystal: 2 ebx_tsc: 258 ecx_crystal_hz: 0
324 TSC: 3096 MHz (24000000 Hz * 258 / 2 / 1000000)
325 CPUID(0x16): base_mhz: 3100 max_mhz: 4200 bus_mhz: 100
326 cpu7: MSR_MISC_PWR_MGMT: 0x00401cc0 (ENable-EIST_Coordination DISable-EPB DISable-OOB)
327 RAPL: 5825 sec. Joule Counter Range, at 45 Watts
328 cpu7: MSR_PLATFORM_INFO: 0x80839f1011f00
329 8 * 100.0 = 800.0 MHz max efficiency frequency
330 31 * 100.0 = 3100.0 MHz base frequency
331 cpu7: MSR_IA32_POWER_CTL: 0x002c005d (C1E auto-promotion: DISabled)
332 cpu7: MSR_TURBO_RATIO_LIMIT: 0x2728292a
333 39 * 100.0 = 3900.0 MHz max turbo 4 active cores
334 40 * 100.0 = 4000.0 MHz max turbo 3 active cores
335 41 * 100.0 = 4100.0 MHz max turbo 2 active cores
336 42 * 100.0 = 4200.0 MHz max turbo 1 active cores
337 cpu7: MSR_CONFIG_TDP_NOMINAL: 0x0000001f (base_ratio=31)
338 cpu7: MSR_CONFIG_TDP_LEVEL_1: 0x00000000 ()
339 cpu7: MSR_CONFIG_TDP_LEVEL_2: 0x00000000 ()
340 cpu7: MSR_CONFIG_TDP_CONTROL: 0x80000000 ( lock=1)
341 cpu7: MSR_TURBO_ACTIVATION_RATIO: 0x00000000 (MAX_NON_TURBO_RATIO=0 lock=0)
342 cpu7: MSR_PKG_CST_CONFIG_CONTROL: 0x1e008008 (UNdemote-C3, UNdemote-C1, demote-C3, demote-C1, locked, pkg-cstate-limit=8 (unlimited))
343 Uncore Frequency pkg0 die0: 800 - 3900 MHz (800 - 3900 MHz)
344 /dev/cpu_dma_latency: 2000000000 usec (default)
345 current_driver: intel_idle
346 current_governor: menu
347 current_governor_ro: menu
348 cpu7: POLL: CPUIDLE CORE POLL IDLE
349 cpu7: C1: MWAIT 0x00
350 cpu7: C1E: MWAIT 0x01
351 cpu7: C3: MWAIT 0x10
352 cpu7: C6: MWAIT 0x20
353 cpu7: C7s: MWAIT 0x33
354 cpu7: C8: MWAIT 0x40
355 cpu7: C9: MWAIT 0x50
356 cpu7: C10: MWAIT 0x60
357 cpu7: cpufreq driver: intel_pstate
358 cpu7: cpufreq governor: performance
359 cpufreq intel_pstate no_turbo: 0
360 cpu7: MSR_MISC_FEATURE_CONTROL: 0x00000000 (L2-Prefetch L2-Prefetch-pair L1-Prefetch L1-IP-Prefetch)
361 cpu0: MSR_PM_ENABLE: 0x00000001 (HWP)
362 cpu0: MSR_HWP_CAPABILITIES: 0x01101f53 (high 83 guar 31 eff 16 low 1)
363 cpu0: MSR_HWP_REQUEST: 0x00005353 (min 83 max 83 des 0 epp 0x0 window 0x0 pkg 0x0)
364 cpu0: MSR_HWP_INTERRUPT: 0x00000001 (EN_Guaranteed_Perf_Change, Dis_Excursion_Min)
365 cpu0: MSR_HWP_STATUS: 0x00000004 (No-Guaranteed_Perf_Change, No-Excursion_Min)
366 cpu0: EPB: 6 (balanced)
367 cpu0: MSR_RAPL_POWER_UNIT: 0x000a0e03 (0.125000 Watts, 0.000061 Joules, 0.000977 sec.)
368 cpu0: MSR_PKG_POWER_INFO: 0x00000168 (45 W TDP, RAPL 0 - 0 W, 0.000000 sec.)
369 cpu0: MSR_PKG_POWER_LIMIT: 0x42820800218208 (UNlocked)
370 cpu0: PKG Limit #1: ENabled (65.000 Watts, 64.000000 sec, clamp ENabled)
371 cpu0: PKG Limit #2: ENabled (65.000 Watts, 0.002441* sec, clamp DISabled)
372 cpu0: MSR_VR_CURRENT_CONFIG: 0x00000000
373 cpu0: PKG Limit #4: 0.000000 Watts (UNlocked)
374 cpu0: MSR_DRAM_POWER_LIMIT: 0x5400de00000000 (UNlocked)
375 cpu0: DRAM Limit: DISabled (0.000 Watts, 0.000977 sec, clamp DISabled)
376 cpu0: MSR_PP0_POLICY: 0
377 cpu0: MSR_PP0_POWER_LIMIT: 0x00000000 (UNlocked)
378 cpu0: Cores Limit: DISabled (0.000 Watts, 0.000977 sec, clamp DISabled)
379 cpu0: MSR_PP1_POLICY: 0
380 cpu0: MSR_PP1_POWER_LIMIT: 0x00000000 (UNlocked)
381 cpu0: GFX Limit: DISabled (0.000 Watts, 0.000977 sec, clamp DISabled)
382 cpu0: MSR_IA32_TEMPERATURE_TARGET: 0x00640000 (100 C) (100 default - 0 offset)
383 cpu0: MSR_IA32_PACKAGE_THERM_STATUS: 0x88200800 (68 C)
384 cpu0: MSR_IA32_PACKAGE_THERM_INTERRUPT: 0x00000003 (100 C, 100 C)
385 cpu7: MSR_PKGC3_IRTL: 0x0000884e (valid, 79872 ns)
386 cpu7: MSR_PKGC6_IRTL: 0x00008876 (valid, 120832 ns)
387 cpu7: MSR_PKGC7_IRTL: 0x00008894 (valid, 151552 ns)
388 cpu7: MSR_PKGC8_IRTL: 0x000088fa (valid, 256000 ns)
389 cpu7: MSR_PKGC9_IRTL: 0x0000894c (valid, 339968 ns)
390 cpu7: MSR_PKGC10_IRTL: 0x00008bf2 (valid, 1034240 ns)
391
392 The max efficiency frequency, a.k.a. Low Frequency Mode, is the fre‐
393 quency available at the minimum package voltage. The TSC frequency is
394 the base frequency of the processor -- this should match the brand
395 string in /proc/cpuinfo. This base frequency should be sustainable on
396 all CPUs indefinitely, given nominal power and cooling. The remaining
397 rows show what maximum turbo frequency is possible depending on the
398 number of idle cores. Note that not all information is available on
399 all processors.
400
402 Here we limit turbostat to showing just the CPU number for cpu0 - cpu3.
403 We add a counter showing the 32-bit raw value of MSR 0x199
404 (MSR_IA32_PERF_CTL), labeling it with the column header, "PRF_CTRL",
405 and display it only once, afte the conclusion of a 0.1 second sleep.
406 sudo ./turbostat --quiet --cpu 0-3 --show CPU --add msr0x199,u32,raw,PRF_CTRL sleep .1
407 0.101604 sec
408 CPU PRF_CTRL
409 - 0x00000000
410 0 0x00000c00
411 1 0x00000800
412 2 0x00000a00
413 3 0x00000800
414
415
416
418 For interval-mode, turbostat will immediately end the current interval
419 when it sees a newline on standard input. turbostat will then start
420 the next interval. Control-C will be send a SIGINT to turbostat, which
421 will immediately abort the program with no further processing.
422
424 SIGINT will interrupt interval-mode. The end-of-interval data will be
425 collected and displayed before turbostat exits.
426
427 SIGUSR1 will end current interval, end-of-interval data will be col‐
428 lected and displayed before turbostat starts a new interval.
429
431 turbostat must be run as root. Alternatively, non-root users can be
432 enabled to run turbostat this way:
433
434 # setcap cap_sys_admin,cap_sys_rawio,cap_sys_nice=+ep path/to/turbostat
435
436 # chmod +r /dev/cpu/*/msr
437
438 # chmod +r /dev/cpu_dma_latency
439
440 turbostat reads hardware counters, but doesn't write them. So it will
441 not interfere with the OS or other programs, including multiple invoca‐
442 tions of itself.
443
444 turbostat may work poorly on Linux-2.6.20 through 2.6.29, as acpi-
445 cpufreq periodically cleared the APERF and MPERF MSRs in those kernels.
446
447 AVG_MHz = APERF_delta/measurement_interval. This is the actual number
448 of elapsed cycles divided by the entire sample interval -- including
449 idle time. Note that this calculation is resilient to systems lacking
450 a non-stop TSC.
451
452 TSC_MHz = TSC_delta/measurement_interval. On a system with an invari‐
453 ant TSC, this value will be constant and will closely match the base
454 frequency value shown in the brand string in /proc/cpuinfo. On a sys‐
455 tem where the TSC stops in idle, TSC_MHz will drop below the proces‐
456 sor's base frequency.
457
458 Busy% = MPERF_delta/TSC_delta
459
460 Bzy_MHz = TSC_delta/APERF_delta/MPERF_delta/measurement_interval
461
462 Note that these calculations depend on TSC_delta, so they are not reli‐
463 able during intervals when TSC_MHz is not running at the base fre‐
464 quency.
465
466 Turbostat data collection is not atomic. Extremely short measurement
467 intervals (much less than 1 second), or system activity that prevents
468 turbostat from being able to run on all CPUS to quickly collect data,
469 will result in inconsistent results.
470
471 The APERF, MPERF MSRs are defined to count non-halted cycles. Although
472 it is not guaranteed by the architecture, turbostat assumes that they
473 count at TSC rate, which is true on all processors tested to date.
474
475
477 Volume 3B: System Programming Guide" https://www.intel.com/prod‐
478 ucts/processor/manuals/
479
480
482 /dev/cpu/*/msr
483
484
486 msr(4), vmstat(8)
487
489 Written by Len Brown <len.brown@intel.com>
490
491
492
493 TURBOSTAT(8)