1TURBOSTAT(8)                System Manager's Manual               TURBOSTAT(8)
2
3
4

NAME

6       turbostat - Report processor frequency and idle statistics
7

SYNOPSIS

9       turbostat [Options] command
10       turbostat [Options] [--interval seconds]
11

DESCRIPTION

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

ROW DESCRIPTIONS

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

COLUMN DESCRIPTIONS

128       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.
129       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.
130       Core processor core number.  Note that multiple CPUs per core indicate support for Intel(R) Hyper-Threading Technology (HT).
131       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.
132       Package processor package number -- not present on systems with a single processor package.
133       Avg_MHz number of cycles executed divided by time elapsed.  Note that this includes idle-time when 0 instructions are executed.
134       Busy% percent of the measurement interval that the CPU executes instructions, aka. % of time in "C0" state.
135       Bzy_MHz average clock rate while the CPU was not idle (ie. in "c0" state).
136       TSC_MHz average MHz that the TSC ran during the entire interval.
137       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.
138       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.
139       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.
140       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.
141       CPU%c1, CPU%c3, CPU%c6, CPU%c7 show the percentage residency in hardware core idle states.  These numbers are from hardware residency counters.
142       CoreTmp Degrees Celsius reported by the per-core Digital Thermal Sensor.
143       PkgTmp Degrees Celsius reported by the per-package Package Thermal Monitor.
144       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.
145       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.
146       Pkg%pc2, Pkg%pc3, Pkg%pc6, Pkg%pc7 percentage residency in hardware package idle states.  These numbers are from hardware residency counters.
147       PkgWatt Watts consumed by the whole package.
148       CorWatt Watts consumed by the core part of the package.
149       GFXWatt Watts consumed by the Graphics part of the package -- available only on client processors.
150       RAMWatt Watts consumed by the DRAM DIMMS -- available only on server processors.
151       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.
152       RAM_% percent of the interval that RAPL throttling was active on DRAM.
153

TOO MUCH INFORMATION EXAMPLE

155       By  default,  turbostat dumps all possible information -- a system con‐
156       figuration header, followed by columns for all counters.  This is ideal
157       for  remote  debugging,  use the "--out" option to save everything to a
158       text file, and get that file to the expert helping you debug.
159
160       When you are not interested in all that information, and there are sev‐
161       eral  ways  to see only what you want.  First the "--quiet" option will
162       skip the configuration information, and turbostat will  show  only  the
163       counter  columns.  Second, you can reduce the columns with the "--hide"
164       and "--show" options.  If you use the "--show" option,  then  turbostat
165       will  show  only the columns you list.  If you use the "--hide" option,
166       turbostat will show all columns, except the ones you list.
167
168       To find out what columns are  available  for  --show  and  --hide,  the
169       "--list"  option  is  available.   For convenience, the special strings
170       "sysfs" can be used to refer to all of the sysfs  C-state  counters  at
171       once:
172       sudo ./turbostat --show sysfs --quiet sleep 10
173       10.003837 sec
174            C1   C1E  C3   C6   C7s  C1%  C1E% C3%  C6%  C7s%
175            4    21   2    2    459  0.14 0.82 0.00 0.00 98.93
176            1    17   2    2    130  0.00 0.02 0.00 0.00 99.80
177            0    0    0    0    31   0.00 0.00 0.00 0.00 99.95
178            2    1    0    0    52   1.14 6.49 0.00 0.00 92.21
179            1    2    0    0    52   0.00 0.08 0.00 0.00 99.86
180            0    0    0    0    71   0.00 0.00 0.00 0.00 99.89
181            0    0    0    0    25   0.00 0.00 0.00 0.00 99.96
182            0    0    0    0    74   0.00 0.00 0.00 0.00 99.94
183            0    1    0    0    24   0.00 0.00 0.00 0.00 99.84
184

ONE SHOT COMMAND EXAMPLE

186       If  turbostat  is invoked with a command, it will fork that command and
187       output the statistics gathered after the command exits.  In this  case,
188       turbostat  output  goes  to  stderr, by default.  Output can instead be
189       saved to a file using the --out option.  In this  example,  the  "sleep
190       10"  command  is  forked, and turbostat waits for it to complete before
191       saving all statistics into "ts.out".  Note that "sleep 10" is not  part
192       of  turbostat, but is simply an example of a command that turbostat can
193       fork.  The "ts.out" file is what you want to edit in a very  wide  win‐
194       dow, paste into a spreadsheet, or attach to a bugzilla entry.
195
196       [root@hsw]# ./turbostat -o ts.out sleep 10
197       [root@hsw]#
198
199

PERIODIC INTERVAL EXAMPLE

201       Without  a  command  to fork, turbostat displays statistics ever 5 sec‐
202       onds.  Periodic output goes to stdout, by default, unless --out is used
203       to  specify  an output file.  The 5-second interval can be changed with
204       the "-i sec" option.
205       sudo ./turbostat --quiet --hide sysfs,IRQ,SMI,CoreTmp,PkgTmp,GFX%rc6,GFXMHz,PkgWatt,CorWatt,GFXWatt
206            Core CPU  Avg_MHz   Busy%     Bzy_MHz   TSC_MHz   CPU%c1    CPU%c3    CPU%c6    CPU%c7
207            -    -    488  12.52     3900 3498 12.50     0.00 0.00 74.98
208            0    0    5    0.13 3900 3498 99.87     0.00 0.00 0.00
209            0    4    3897 99.99     3900 3498 0.01
210            1    1    0    0.00 3856 3498 0.01 0.00 0.00 99.98
211            1    5    0    0.00 3861 3498 0.01
212            2    2    1    0.02 3889 3498 0.03 0.00 0.00 99.95
213            2    6    0    0.00 3863 3498 0.05
214            3    3    0    0.01 3869 3498 0.02 0.00 0.00 99.97
215            3    7    0    0.00 3878 3498 0.03
216            Core CPU  Avg_MHz   Busy%     Bzy_MHz   TSC_MHz   CPU%c1    CPU%c3    CPU%c6    CPU%c7
217            -    -    491  12.59     3900 3498 12.42     0.00 0.00 74.99
218            0    0    27   0.69 3900 3498 99.31     0.00 0.00 0.00
219            0    4    3898 99.99     3900 3498 0.01
220            1    1    0    0.00 3883 3498 0.01 0.00 0.00 99.99
221            1    5    0    0.00 3898 3498 0.01
222            2    2    0    0.01 3889 3498 0.02 0.00 0.00 99.98
223            2    6    0    0.00 3889 3498 0.02
224            3    3    0    0.00 3856 3498 0.01 0.00 0.00 99.99
225            3    7    0    0.00 3897 3498 0.01
226       This example also shows the use of the --hide option  to  skip  columns
227       that  are  not  wanted.  Note that cpu4 in this example is 99.99% busy,
228       while the other CPUs are all under 1% busy.  Notice that cpu4's HT sib‐
229       ling is cpu0, which is under 1% busy, but can get into CPU%c1 only, be‐
230       cause its cpu4's activity on shared hardware keeps it from  entering  a
231       deeper C-state.
232
233

SYSTEM CONFIGURATION INFORMATION EXAMPLE

235       By default, turbostat always dumps system configuration information be‐
236       fore taking measurements.  In the example above, "--quiet" is  used  to
237       suppress that output.  Here is an example of the configuration informa‐
238       tion:
239       turbostat version 2017.02.15 - Len Brown <lenb@kernel.org>
240       CPUID(0): GenuineIntel 13 CPUID levels; family:model:stepping 0x6:3c:3 (6:60:3)
241       CPUID(1): SSE3 MONITOR - EIST TM2 TSC MSR ACPI-TM TM
242       CPUID(6): APERF, TURBO, DTS, PTM, No-HWP, No-HWPnotify, No-HWPwindow, No-HWPepp, No-HWPpkg, EPB
243       cpu4: MSR_IA32_MISC_ENABLE: 0x00850089 (TCC EIST No-MWAIT PREFETCH TURBO)
244       CPUID(7): No-SGX
245       cpu4: MSR_MISC_PWR_MGMT: 0x00400000 (ENable-EIST_Coordination DISable-EPB DISable-OOB)
246       RAPL: 3121 sec. Joule Counter Range, at 84 Watts
247       cpu4: MSR_PLATFORM_INFO: 0x80838f3012300
248       8 * 100.0 = 800.0 MHz max efficiency frequency
249       35 * 100.0 = 3500.0 MHz base frequency
250       cpu4: MSR_IA32_POWER_CTL: 0x0004005d (C1E auto-promotion: DISabled)
251       cpu4: MSR_TURBO_RATIO_LIMIT: 0x25262727
252       37 * 100.0 = 3700.0 MHz max turbo 4 active cores
253       38 * 100.0 = 3800.0 MHz max turbo 3 active cores
254       39 * 100.0 = 3900.0 MHz max turbo 2 active cores
255       39 * 100.0 = 3900.0 MHz max turbo 1 active cores
256       cpu4: MSR_CONFIG_TDP_NOMINAL: 0x00000023 (base_ratio=35)
257       cpu4: MSR_CONFIG_TDP_LEVEL_1: 0x00000000 ()
258       cpu4: MSR_CONFIG_TDP_LEVEL_2: 0x00000000 ()
259       cpu4: MSR_CONFIG_TDP_CONTROL: 0x80000000 ( lock=1)
260       cpu4: MSR_TURBO_ACTIVATION_RATIO: 0x00000000 (MAX_NON_TURBO_RATIO=0 lock=0)
261       cpu4: MSR_PKG_CST_CONFIG_CONTROL: 0x1e000400 (UNdemote-C3, UNdemote-C1, demote-C3, demote-C1, UNlocked: pkg-cstate-limit=0: pc0)
262       cpu4: POLL: CPUIDLE CORE POLL IDLE
263       cpu4: C1: MWAIT 0x00
264       cpu4: C1E: MWAIT 0x01
265       cpu4: C3: MWAIT 0x10
266       cpu4: C6: MWAIT 0x20
267       cpu4: C7s: MWAIT 0x32
268       cpu4: MSR_MISC_FEATURE_CONTROL: 0x00000000 (L2-Prefetch L2-Prefetch-pair L1-Prefetch L1-IP-Prefetch)
269       cpu0: MSR_IA32_ENERGY_PERF_BIAS: 0x00000006 (balanced)
270       cpu0: MSR_CORE_PERF_LIMIT_REASONS, 0x31200000 (Active: ) (Logged: Transitions, MultiCoreTurbo, Amps, Auto-HWP, )
271       cpu0: MSR_GFX_PERF_LIMIT_REASONS, 0x00000000 (Active: ) (Logged: )
272       cpu0: MSR_RING_PERF_LIMIT_REASONS, 0x0d000000 (Active: ) (Logged: Amps, PkgPwrL1, PkgPwrL2, )
273       cpu0: MSR_RAPL_POWER_UNIT: 0x000a0e03 (0.125000 Watts, 0.000061 Joules, 0.000977 sec.)
274       cpu0: MSR_PKG_POWER_INFO: 0x000002a0 (84 W TDP, RAPL 0 - 0 W, 0.000000 sec.)
275       cpu0: MSR_PKG_POWER_LIMIT: 0x428348001a82a0 (UNlocked)
276       cpu0: PKG Limit #1: ENabled (84.000000 Watts, 8.000000 sec, clamp DISabled)
277       cpu0: PKG Limit #2: ENabled (105.000000 Watts, 0.002441* sec, clamp DISabled)
278       cpu0: MSR_PP0_POLICY: 0
279       cpu0: MSR_PP0_POWER_LIMIT: 0x00000000 (UNlocked)
280       cpu0: Cores Limit: DISabled (0.000000 Watts, 0.000977 sec, clamp DISabled)
281       cpu0: MSR_PP1_POLICY: 0
282       cpu0: MSR_PP1_POWER_LIMIT: 0x00000000 (UNlocked)
283       cpu0: GFX Limit: DISabled (0.000000 Watts, 0.000977 sec, clamp DISabled)
284       cpu0: MSR_IA32_TEMPERATURE_TARGET: 0x00641400 (100 C)
285       cpu0: MSR_IA32_PACKAGE_THERM_STATUS: 0x884c0800 (24 C)
286       cpu0: MSR_IA32_THERM_STATUS: 0x884c0000 (24 C +/- 1)
287       cpu1: MSR_IA32_THERM_STATUS: 0x88510000 (19 C +/- 1)
288       cpu2: MSR_IA32_THERM_STATUS: 0x884e0000 (22 C +/- 1)
289       cpu3: MSR_IA32_THERM_STATUS: 0x88510000 (19 C +/- 1)
290       cpu4: MSR_PKGC3_IRTL: 0x00008842 (valid, 67584 ns)
291       cpu4: MSR_PKGC6_IRTL: 0x00008873 (valid, 117760 ns)
292       cpu4: MSR_PKGC7_IRTL: 0x00008891 (valid, 148480 ns)
293       The max efficiency frequency, a.k.a. Low Frequency Mode,  is  the  fre‐
294       quency  available at the minimum package voltage.  The TSC frequency is
295       the base frequency of the processor --  this  should  match  the  brand
296       string  in /proc/cpuinfo.  This base frequency should be sustainable on
297       all CPUs indefinitely, given nominal power and cooling.  The  remaining
298       rows  show  what  maximum  turbo frequency is possible depending on the
299       number of idle cores.  Note that not all information  is  available  on
300       all processors.
301

ADD COUNTER EXAMPLE

303       Here we limit turbostat to showing just the CPU number for cpu0 - cpu3.
304       We  add  a  counter  showing  the  32-bit  raw  value  of   MSR   0x199
305       (MSR_IA32_PERF_CTL),  labeling  it  with the column header, "PRF_CTRL",
306       and display it only once, afte the conclusion of a 0.1 second sleep.
307       sudo ./turbostat --quiet --cpu 0-3 --show CPU --add msr0x199,u32,raw,PRF_CTRL sleep .1
308       0.101604 sec
309       CPU    PRF_CTRL
310       -    0x00000000
311       0    0x00000c00
312       1    0x00000800
313       2    0x00000a00
314       3    0x00000800
315
316
317

INPUT

319       For interval-mode, turbostat will immediately end the current  interval
320       when  it  sees  a newline on standard input.  turbostat will then start
321       the next interval.  Control-C will be send a SIGINT to turbostat, which
322       will immediately abort the program with no further processing.
323

SIGNALS

325       SIGINT  will interrupt interval-mode.  The end-of-interval data will be
326       collected and displayed before turbostat exits.
327
328       SIGUSR1 will end current interval, end-of-interval data  will  be  col‐
329       lected and displayed before turbostat starts a new interval.
330

NOTES

332       turbostat  must  be  run as root.  Alternatively, non-root users can be
333       enabled to run turbostat this way:
334
335       # setcap cap_sys_rawio=ep ./turbostat
336
337       # chmod +r /dev/cpu/*/msr
338
339       turbostat reads hardware counters, but doesn't write them.  So it  will
340       not interfere with the OS or other programs, including multiple invoca‐
341       tions of itself.
342
343       turbostat may work poorly on  Linux-2.6.20  through  2.6.29,  as  acpi-
344       cpufreq periodically cleared the APERF and MPERF MSRs in those kernels.
345
346       AVG_MHz  = APERF_delta/measurement_interval.  This is the actual number
347       of elapsed cycles divided by the entire sample  interval  --  including
348       idle  time.  Note that this calculation is resilient to systems lacking
349       a non-stop TSC.
350
351       TSC_MHz = TSC_delta/measurement_interval.  On a system with an  invari‐
352       ant  TSC,  this  value will be constant and will closely match the base
353       frequency value shown in the brand string in /proc/cpuinfo.  On a  sys‐
354       tem  where  the  TSC stops in idle, TSC_MHz will drop below the proces‐
355       sor's base frequency.
356
357       Busy% = MPERF_delta/TSC_delta
358
359       Bzy_MHz = TSC_delta/APERF_delta/MPERF_delta/measurement_interval
360
361       Note that these calculations depend on TSC_delta, so they are not reli‐
362       able  during  intervals  when  TSC_MHz  is not running at the base fre‐
363       quency.
364
365       Turbostat data collection is not atomic.  Extremely  short  measurement
366       intervals  (much  less than 1 second), or system activity that prevents
367       turbostat from being able to run on all CPUS to quickly  collect  data,
368       will result in inconsistent results.
369
370       The APERF, MPERF MSRs are defined to count non-halted cycles.  Although
371       it is not guaranteed by the architecture, turbostat assumes  that  they
372       count at TSC rate, which is true on all processors tested to date.
373
374

REFERENCES

376       Volume   3B:   System  Programming  Guide"  https://www.intel.com/prod
377       ucts/processor/manuals/
378
379

FILES

381       /dev/cpu/*/msr
382
383

SEE ALSO

385       msr(4), vmstat(8)
386

AUTHOR

388       Written by Len Brown <len.brown@intel.com>
389
390
391
392                                                                  TURBOSTAT(8)
Impressum