blob: efe6a7147ff23b121e29aa95013bc23f17e89310 [file] [log] [blame]
Len Brown103a8fe2010-10-22 23:53:03 -04001.TH TURBOSTAT 8
2.SH NAME
3turbostat \- Report processor frequency and idle statistics
4.SH SYNOPSIS
5.ft B
6.B turbostat
Len Brown8e180f32012-09-22 01:25:08 -04007.RB [ Options ]
Len Brown103a8fe2010-10-22 23:53:03 -04008.RB command
9.br
10.B turbostat
Len Brown8e180f32012-09-22 01:25:08 -040011.RB [ Options ]
Len Brownd8af6f52015-02-10 01:56:38 -050012.RB [ "\--interval seconds" ]
Len Brown103a8fe2010-10-22 23:53:03 -040013.SH DESCRIPTION
Len Brown889facb2012-11-08 00:48:57 -050014\fBturbostat \fP reports processor topology, frequency,
Len Browna7296172015-01-23 01:33:58 -050015idle power-state statistics, temperature and power on X86 processors.
16There are two ways to invoke turbostat.
17The first method is to supply a
18\fBcommand\fP, which is forked and statistics are printed
19upon its completion.
20The second method is to omit the command,
Len Brownd8af6f52015-02-10 01:56:38 -050021and turbostat displays statistics every 5 seconds.
22The 5-second interval can be changed using the --interval option.
Len Brown1cc21f72015-02-23 00:34:57 -050023.PP
Len Brownd8af6f52015-02-10 01:56:38 -050024Some information is not available on older processors.
Len Brown103a8fe2010-10-22 23:53:03 -040025.SS Options
Len Brown1cc21f72015-02-23 00:34:57 -050026Options can be specified with a single or double '-', and only as much of the option
27name as necessary to disambiguate it from others is necessary. Note that options are case-sensitive.
Len Brown388e9c82016-12-22 23:57:55 -050028.PP
29\fB--add attributes\fP add column with counter having specified 'attributes'. The 'location' attribute is required, all others are optional.
30.nf
31 location: {\fBmsrDDD\fP | \fBmsr0xXXX\fP}
32 msrDDD is a decimal offset, eg. msr16
33 msr0xXXX is a hex offset, eg. msr0x10
34
35 scope: {\fBcpu\fP | \fBcore\fP | \fBpackage\fP}
36 sample and print the counter for every cpu, core, or package.
37 default: cpu
38
39 size: {\fBu32\fP | \fBu64\fP }
40 MSRs are read as 64-bits, u32 truncates the displayed value to 32-bits.
41 default: u64
42
43 format: {\fBraw\fP | \fBdelta\fP | \fBpercent\fP}
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.fi
49.PP
Len Brown1ef7d212017-02-10 23:54:15 -050050\fB--cpu cpu-set\fP limit output to system summary plus the specified cpu-set. cpu-set is a comma delimited list of cpu ranges. cpu ranges can be individual cpu numbers or start and end numbers, separated by ".." or '-'. eg. 1,2,8,14..17,21-44
51.PP
Len Brown41618e62017-02-09 18:25:22 -050052\fB--hide column\fP do not show the specified columns. May be invoked multiple times, or with a comma-separated list of column names. Use "--hide sysfs" to hide the sysfs statistics columns as a group.
Len Brown812db3f2017-02-10 00:25:41 -050053.PP
Len Brown41618e62017-02-09 18:25:22 -050054\fB--show column\fP show only the specified columns. May be invoked multiple times, or with a comma-separated list of column names. Use "--show sysfs" to show the sysfs statistics columns as a group.
Len Brown812db3f2017-02-10 00:25:41 -050055.PP
Len Brownd8af6f52015-02-10 01:56:38 -050056\fB--Dump\fP displays the raw counter values.
Len Browne23da032012-02-06 18:37:16 -050057.PP
Len Brown96e47152017-01-21 02:26:00 -050058\fB--quiet\fP Do not decode and print the system configuration header information.
Len Brown103a8fe2010-10-22 23:53:03 -040059.PP
Len Brown2a0609c2016-02-12 22:44:48 -050060\fB--interval seconds\fP overrides the default 5.0 second measurement interval.
Len Brownf9240812012-10-06 15:26:31 -040061.PP
Len Brownb7d8c142016-02-13 23:36:17 -050062\fB--out output_file\fP turbostat output is written to the specified output_file.
63The file is truncated if it already exists, and it is created if it does not exist.
64.PP
Len Brownd8af6f52015-02-10 01:56:38 -050065\fB--help\fP displays usage for the most common parameters.
Len Brown8e180f32012-09-22 01:25:08 -040066.PP
Len Brownd8af6f52015-02-10 01:56:38 -050067\fB--Joules\fP displays energy in Joules, rather than dividing Joules by time to print power in Watts.
Len Brown8e180f32012-09-22 01:25:08 -040068.PP
Len Brownd8af6f52015-02-10 01:56:38 -050069\fB--Package\fP limits output to the system summary plus the 1st thread in each Package.
70.PP
71\fB--processor\fP limits output to the system summary plus the 1st thread in each processor of each package. Ie. it skips hyper-threaded siblings.
72.PP
73\fB--Summary\fP limits output to a 1-line System Summary for each interval.
74.PP
75\fB--TCC temperature\fP 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.
76.PP
77\fB--version\fP displays the version.
78.PP
79The \fBcommand\fP parameter forks \fBcommand\fP, and upon its exit,
Len Brown103a8fe2010-10-22 23:53:03 -040080displays the statistics gathered since it was forked.
81.PP
Len Brown1cc21f72015-02-23 00:34:57 -050082.SH DEFAULT FIELD DESCRIPTIONS
Len Brown103a8fe2010-10-22 23:53:03 -040083.nf
Len Brown1cc21f72015-02-23 00:34:57 -050084\fBCPU\fP 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.
Len Brownfc04cc62014-02-06 00:55:19 -050085\fBAVG_MHz\fP number of cycles executed divided by time elapsed.
Len Brown75d2e442016-02-13 23:41:53 -050086\fBBusy%\fP percent of the interval that the CPU retired instructions, aka. % of time in "C0" state.
Len Brownfc04cc62014-02-06 00:55:19 -050087\fBBzy_MHz\fP average clock rate while the CPU was busy (in "c0" state).
88\fBTSC_MHz\fP average MHz that the TSC ran during the entire interval.
Len Brown1cc21f72015-02-23 00:34:57 -050089.fi
90.PP
91.SH DEBUG FIELD DESCRIPTIONS
92.nf
93\fBPackage\fP processor package number.
94\fBCore\fP processor core number.
95Note that multiple CPUs per core indicate support for Intel(R) Hyper-Threading Technology (HT).
Len Brownfc04cc62014-02-06 00:55:19 -050096\fBCPU%c1, CPU%c3, CPU%c6, CPU%c7\fP show the percentage residency in hardware core idle states.
97\fBCoreTmp\fP Degrees Celsius reported by the per-core Digital Thermal Sensor.
98\fBPkgTtmp\fP Degrees Celsius reported by the per-package Package Thermal Monitor.
99\fBPkg%pc2, Pkg%pc3, Pkg%pc6, Pkg%pc7\fP percentage residency in hardware package idle states.
100\fBPkgWatt\fP Watts consumed by the whole package.
101\fBCorWatt\fP Watts consumed by the core part of the package.
102\fBGFXWatt\fP Watts consumed by the Graphics part of the package -- available only on client processors.
103\fBRAMWatt\fP Watts consumed by the DRAM DIMMS -- available only on server processors.
Len Brown889facb2012-11-08 00:48:57 -0500104\fBPKG_%\fP percent of the interval that RAPL throttling was active on the Package.
105\fBRAM_%\fP percent of the interval that RAPL throttling was active on DRAM.
Len Brown103a8fe2010-10-22 23:53:03 -0400106.fi
107.PP
Len Brownb7d8c142016-02-13 23:36:17 -0500108.SH PERIODIC EXAMPLE
Len Brownd8af6f52015-02-10 01:56:38 -0500109Without any parameters, turbostat displays statistics ever 5 seconds.
Len Brownb7d8c142016-02-13 23:36:17 -0500110Periodic output goes to stdout, by default, unless --out is used to specify an output file.
111The 5-second interval can be changed with th "-i sec" option.
112Or a command may be specified as in "FORK EXAMPLE" below.
Len Brown1cc21f72015-02-23 00:34:57 -0500113.nf
114[root@hsw]# ./turbostat
Len Brown75d2e442016-02-13 23:41:53 -0500115 CPU Avg_MHz Busy% Bzy_MHz TSC_MHz
Len Brown1cc21f72015-02-23 00:34:57 -0500116 - 488 12.51 3898 3498
117 0 0 0.01 3885 3498
118 4 3897 99.99 3898 3498
119 1 0 0.00 3861 3498
120 5 0 0.00 3882 3498
121 2 1 0.02 3894 3498
122 6 2 0.06 3898 3498
123 3 0 0.00 3849 3498
124 7 0 0.00 3877 3498
125
126.fi
127.SH DEBUG EXAMPLE
Len Brown103a8fe2010-10-22 23:53:03 -0400128
Len Browne23da032012-02-06 18:37:16 -0500129The first row of statistics is a summary for the entire system.
Len Brown889facb2012-11-08 00:48:57 -0500130For residency % columns, the summary is a weighted average.
131For Temperature columns, the summary is the column maximum.
132For Watts columns, the summary is a system total.
Len Brown103a8fe2010-10-22 23:53:03 -0400133Subsequent rows show per-CPU statistics.
Len Brown103a8fe2010-10-22 23:53:03 -0400134.nf
Len Brown1cc21f72015-02-23 00:34:57 -0500135turbostat version 4.1 10-Feb, 2015 - Len Brown <lenb@kernel.org>
136CPUID(0): GenuineIntel 13 CPUID levels; family:model:stepping 0x6:3c:3 (6:60:3)
Len Brown889facb2012-11-08 00:48:57 -0500137CPUID(6): APERF, DTS, PTM, EPB
Len Brown1cc21f72015-02-23 00:34:57 -0500138RAPL: 3121 sec. Joule Counter Range, at 84 Watts
139cpu0: MSR_NHM_PLATFORM_INFO: 0x80838f3012300
1408 * 100 = 800 MHz max efficiency
Len Brown889facb2012-11-08 00:48:57 -050014135 * 100 = 3500 MHz TSC frequency
Len Brown1cc21f72015-02-23 00:34:57 -0500142cpu0: MSR_IA32_POWER_CTL: 0x0004005d (C1E auto-promotion: DISabled)
143cpu0: MSR_NHM_SNB_PKG_CST_CFG_CTL: 0x1e000400 (UNdemote-C3, UNdemote-C1, demote-C3, demote-C1, UNlocked: pkg-cstate-limit=0: pc0)
Srinivas Pandruvadaebf59262016-07-06 16:07:56 -0700144cpu0: MSR_TURBO_RATIO_LIMIT: 0x25262727
Len Brown889facb2012-11-08 00:48:57 -050014537 * 100 = 3700 MHz max turbo 4 active cores
14638 * 100 = 3800 MHz max turbo 3 active cores
14739 * 100 = 3900 MHz max turbo 2 active cores
14839 * 100 = 3900 MHz max turbo 1 active cores
149cpu0: MSR_IA32_ENERGY_PERF_BIAS: 0x00000006 (balanced)
Len Brown1cc21f72015-02-23 00:34:57 -0500150cpu0: MSR_CORE_PERF_LIMIT_REASONS, 0x31200000 (Active: ) (Logged: Auto-HWP, Amps, MultiCoreTurbo, Transitions, )
151cpu0: MSR_GFX_PERF_LIMIT_REASONS, 0x00000000 (Active: ) (Logged: )
152cpu0: MSR_RING_PERF_LIMIT_REASONS, 0x0d000000 (Active: ) (Logged: Amps, PkgPwrL1, PkgPwrL2, )
153cpu0: MSR_RAPL_POWER_UNIT: 0x000a0e03 (0.125000 Watts, 0.000061 Joules, 0.000977 sec.)
154cpu0: MSR_PKG_POWER_INFO: 0x000002a0 (84 W TDP, RAPL 0 - 0 W, 0.000000 sec.)
155cpu0: MSR_PKG_POWER_LIMIT: 0x428348001a82a0 (UNlocked)
156cpu0: PKG Limit #1: ENabled (84.000000 Watts, 8.000000 sec, clamp DISabled)
157cpu0: PKG Limit #2: ENabled (105.000000 Watts, 0.002441* sec, clamp DISabled)
Len Brown889facb2012-11-08 00:48:57 -0500158cpu0: MSR_PP0_POLICY: 0
159cpu0: MSR_PP0_POWER_LIMIT: 0x00000000 (UNlocked)
160cpu0: Cores Limit: DISabled (0.000000 Watts, 0.000977 sec, clamp DISabled)
161cpu0: MSR_PP1_POLICY: 0
162cpu0: MSR_PP1_POWER_LIMIT: 0x00000000 (UNlocked)
163cpu0: GFX Limit: DISabled (0.000000 Watts, 0.000977 sec, clamp DISabled)
Len Brown1cc21f72015-02-23 00:34:57 -0500164cpu0: MSR_IA32_TEMPERATURE_TARGET: 0x00641400 (100 C)
165cpu0: MSR_IA32_PACKAGE_THERM_STATUS: 0x88340800 (48 C)
166cpu0: MSR_IA32_THERM_STATUS: 0x88340000 (48 C +/- 1)
167cpu1: MSR_IA32_THERM_STATUS: 0x88440000 (32 C +/- 1)
168cpu2: MSR_IA32_THERM_STATUS: 0x88450000 (31 C +/- 1)
169cpu3: MSR_IA32_THERM_STATUS: 0x88490000 (27 C +/- 1)
Len Brown75d2e442016-02-13 23:41:53 -0500170 Core CPU Avg_MHz Busy% Bzy_MHz TSC_MHz SMI CPU%c1 CPU%c3 CPU%c6 CPU%c7 CoreTmp PkgTmp PkgWatt CorWatt GFXWatt
Len Brown1cc21f72015-02-23 00:34:57 -0500171 - - 493 12.64 3898 3498 0 12.64 0.00 0.00 74.72 47 47 21.62 13.74 0.00
172 0 0 4 0.11 3894 3498 0 99.89 0.00 0.00 0.00 47 47 21.62 13.74 0.00
173 0 4 3897 99.98 3898 3498 0 0.02
174 1 1 7 0.17 3887 3498 0 0.04 0.00 0.00 99.79 32
175 1 5 0 0.00 3885 3498 0 0.21
176 2 2 29 0.76 3895 3498 0 0.10 0.01 0.01 99.13 32
177 2 6 2 0.06 3896 3498 0 0.80
178 3 3 1 0.02 3832 3498 0 0.03 0.00 0.00 99.95 28
179 3 7 0 0.00 3879 3498 0 0.04
180^C
181
Len Brown103a8fe2010-10-22 23:53:03 -0400182.fi
183The \fBmax efficiency\fP frequency, a.k.a. Low Frequency Mode, is the frequency
Len Browna7296172015-01-23 01:33:58 -0500184available at the minimum package voltage. The \fBTSC frequency\fP is the base
185frequency of the processor -- this should match the brand string
186in /proc/cpuinfo. This base frequency
Len Brown103a8fe2010-10-22 23:53:03 -0400187should be sustainable on all CPUs indefinitely, given nominal power and cooling.
188The remaining rows show what maximum turbo frequency is possible
Len Browna7296172015-01-23 01:33:58 -0500189depending on the number of idle cores. Note that not all information is
190available on all processors.
Len Brown103a8fe2010-10-22 23:53:03 -0400191.SH FORK EXAMPLE
192If turbostat is invoked with a command, it will fork that command
Len Brownb7d8c142016-02-13 23:36:17 -0500193and output the statistics gathered after the command exits.
194In this case, turbostat output goes to stderr, by default.
195Output can instead be saved to a file using the --out option.
Len Brown103a8fe2010-10-22 23:53:03 -0400196eg. Here a cycle soaker is run on 1 CPU (see %c0) for a few seconds
197until ^C while the other CPUs are mostly idle:
198
199.nf
Len Brown1cc21f72015-02-23 00:34:57 -0500200root@hsw: turbostat cat /dev/zero > /dev/null
Len Browne23da032012-02-06 18:37:16 -0500201^C
Len Brown75d2e442016-02-13 23:41:53 -0500202 CPU Avg_MHz Busy% Bzy_MHz TSC_MHz
Len Brown1cc21f72015-02-23 00:34:57 -0500203 - 482 12.51 3854 3498
204 0 0 0.01 1960 3498
205 4 0 0.00 2128 3498
206 1 0 0.00 3003 3498
207 5 3854 99.98 3855 3498
208 2 0 0.01 3504 3498
209 6 3 0.08 3884 3498
210 3 0 0.00 2553 3498
211 7 0 0.00 2126 3498
21210.783983 sec
Len Brownfc04cc62014-02-06 00:55:19 -0500213
Len Brown103a8fe2010-10-22 23:53:03 -0400214.fi
Len Brown1cc21f72015-02-23 00:34:57 -0500215Above the cycle soaker drives cpu5 up its 3.9 GHz turbo limit.
Len Brown75d2e442016-02-13 23:41:53 -0500216The first row shows the average MHz and Busy% across all the processors in the system.
Len Brown103a8fe2010-10-22 23:53:03 -0400217
Len Brownfc04cc62014-02-06 00:55:19 -0500218Note that the Avg_MHz column reflects the total number of cycles executed
Len Brown75d2e442016-02-13 23:41:53 -0500219divided by the measurement interval. If the Busy% column is 100%,
Len Brownfc04cc62014-02-06 00:55:19 -0500220then the processor was running at that speed the entire interval.
Len Brown75d2e442016-02-13 23:41:53 -0500221The Avg_MHz multiplied by the Busy% results in the Bzy_MHz --
Len Brownfc04cc62014-02-06 00:55:19 -0500222which is the average frequency while the processor was executing --
223not including any non-busy idle time.
224
Len Brown103a8fe2010-10-22 23:53:03 -0400225.SH NOTES
226
227.B "turbostat "
228must be run as root.
Len Browna7296172015-01-23 01:33:58 -0500229Alternatively, non-root users can be enabled to run turbostat this way:
230
231# setcap cap_sys_rawio=ep ./turbostat
232
233# chmod +r /dev/cpu/*/msr
Len Brown103a8fe2010-10-22 23:53:03 -0400234
235.B "turbostat "
236reads hardware counters, but doesn't write them.
237So it will not interfere with the OS or other programs, including
238multiple invocations of itself.
239
240\fBturbostat \fP
241may work poorly on Linux-2.6.20 through 2.6.29,
Len Browna7296172015-01-23 01:33:58 -0500242as \fBacpi-cpufreq \fPperiodically cleared the APERF and MPERF MSRs
Len Brown103a8fe2010-10-22 23:53:03 -0400243in those kernels.
244
Len Browna7296172015-01-23 01:33:58 -0500245AVG_MHz = APERF_delta/measurement_interval. This is the actual
246number of elapsed cycles divided by the entire sample interval --
Len Brownd8af6f52015-02-10 01:56:38 -0500247including idle time. Note that this calculation is resilient
Len Browna7296172015-01-23 01:33:58 -0500248to systems lacking a non-stop TSC.
249
250TSC_MHz = TSC_delta/measurement_interval.
251On a system with an invariant TSC, this value will be constant
252and will closely match the base frequency value shown
253in the brand string in /proc/cpuinfo. On a system where
254the TSC stops in idle, TSC_MHz will drop
255below the processor's base frequency.
256
Len Brown75d2e442016-02-13 23:41:53 -0500257Busy% = MPERF_delta/TSC_delta
Len Browna7296172015-01-23 01:33:58 -0500258
259Bzy_MHz = TSC_delta/APERF_delta/MPERF_delta/measurement_interval
260
261Note that these calculations depend on TSC_delta, so they
262are not reliable during intervals when TSC_MHz is not running at the base frequency.
263
264Turbostat data collection is not atomic.
265Extremely short measurement intervals (much less than 1 second),
266or system activity that prevents turbostat from being able
267to run on all CPUS to quickly collect data, will result in
268inconsistent results.
Len Brown2f32edf2012-09-21 23:45:46 -0400269
Len Brown103a8fe2010-10-22 23:53:03 -0400270The APERF, MPERF MSRs are defined to count non-halted cycles.
271Although it is not guaranteed by the architecture, turbostat assumes
272that they count at TSC rate, which is true on all processors tested to date.
273
274.SH REFERENCES
Len Brown103a8fe2010-10-22 23:53:03 -0400275Volume 3B: System Programming Guide"
276http://www.intel.com/products/processor/manuals/
277
278.SH FILES
279.ta
280.nf
281/dev/cpu/*/msr
282.fi
283
284.SH "SEE ALSO"
285msr(4), vmstat(8)
286.PP
Len Browne23da032012-02-06 18:37:16 -0500287.SH AUTHOR
Len Brown103a8fe2010-10-22 23:53:03 -0400288.nf
289Written by Len Brown <len.brown@intel.com>