blob: 0d7dc2cfefb57ebe1db21daa5e8ce84cba12a91f [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 Brown103a8fe2010-10-22 23:53:03 -040012.RB [ "\-i interval_sec" ]
13.SH DESCRIPTION
Len Brown889facb2012-11-08 00:48:57 -050014\fBturbostat \fP reports processor topology, frequency,
15idle power-state statistics, temperature and power on modern X86 processors.
Len Brown103a8fe2010-10-22 23:53:03 -040016Either \fBcommand\fP is forked and statistics are printed
17upon its completion, or statistics are printed periodically.
18
19\fBturbostat \fP
Len Brown889facb2012-11-08 00:48:57 -050020must be run on root, and
21minimally requires that the processor
Len Brown103a8fe2010-10-22 23:53:03 -040022supports an "invariant" TSC, plus the APERF and MPERF MSRs.
Len Brown889facb2012-11-08 00:48:57 -050023Additional information is reported depending on hardware counter support.
Len Brown103a8fe2010-10-22 23:53:03 -040024
25.SS Options
Len Brownf9240812012-10-06 15:26:31 -040026The \fB-p\fP option limits output to the 1st thread in 1st core of each package.
Len Brownc98d5d92012-06-04 00:56:40 -040027.PP
Len Brownf9240812012-10-06 15:26:31 -040028The \fB-P\fP option limits output to the 1st thread in each Package.
Len Brownc98d5d92012-06-04 00:56:40 -040029.PP
Len Brownf9240812012-10-06 15:26:31 -040030The \fB-S\fP option limits output to a 1-line System Summary for each interval.
Len Browne23da032012-02-06 18:37:16 -050031.PP
Len Brown103a8fe2010-10-22 23:53:03 -040032The \fB-v\fP option increases verbosity.
33.PP
Len Brownf9240812012-10-06 15:26:31 -040034The \fB-s\fP option prints the SMI counter, equivalent to "-c 0x34"
Len Brown2f32edf2012-09-21 23:45:46 -040035.PP
Len Brownf9240812012-10-06 15:26:31 -040036The \fB-c MSR#\fP option includes the delta of the specified 32-bit MSR counter.
37.PP
38The \fB-C MSR#\fP option includes the delta of the specified 64-bit MSR counter.
Len Brown8e180f32012-09-22 01:25:08 -040039.PP
40The \fB-m MSR#\fP option includes the the specified 32-bit MSR value.
41.PP
42The \fB-M MSR#\fP option includes the the specified 64-bit MSR value.
Len Brown103a8fe2010-10-22 23:53:03 -040043.PP
44The \fB-i interval_sec\fP option prints statistics every \fiinterval_sec\fP seconds.
45The default is 5 seconds.
46.PP
47The \fBcommand\fP parameter forks \fBcommand\fP and upon its exit,
48displays the statistics gathered since it was forked.
49.PP
50.SH FIELD DESCRIPTIONS
51.nf
Arun Thomas9b6cf1a2011-08-17 00:34:14 +020052\fBpk\fP processor package number.
Len Browne23da032012-02-06 18:37:16 -050053\fBcor\fP processor core number.
Len Brown103a8fe2010-10-22 23:53:03 -040054\fBCPU\fP Linux CPU (logical processor) number.
Len Browne23da032012-02-06 18:37:16 -050055Note that multiple CPUs per core indicate support for Intel(R) Hyper-Threading Technology.
Len Brown103a8fe2010-10-22 23:53:03 -040056\fB%c0\fP percent of the interval that the CPU retired instructions.
57\fBGHz\fP average clock rate while the CPU was in c0 state.
58\fBTSC\fP average GHz that the TSC ran during the entire interval.
Len Browne23da032012-02-06 18:37:16 -050059\fB%c1, %c3, %c6, %c7\fP show the percentage residency in hardware core idle states.
Len Brown889facb2012-11-08 00:48:57 -050060\fBCTMP\fP Degrees Celsius reported by the per-core Digital Thermal Sensor.
61\fBPTMP\fP Degrees Celsius reported by the per-package Package Thermal Monitor.
Len Browne23da032012-02-06 18:37:16 -050062\fB%pc2, %pc3, %pc6, %pc7\fP percentage residency in hardware package idle states.
Len Brown889facb2012-11-08 00:48:57 -050063\fBPkg_W\fP Watts consumed by the whole package.
64\fBCor_W\fP Watts consumed by the core part of the package.
65\fBGFX_W\fP Watts consumed by the Graphics part of the package -- available only on client processors.
66\fBRAM_W\fP Watts consumed by the DRAM DIMMS -- available only on server processors.
67\fBPKG_%\fP percent of the interval that RAPL throttling was active on the Package.
68\fBRAM_%\fP percent of the interval that RAPL throttling was active on DRAM.
Len Brown103a8fe2010-10-22 23:53:03 -040069.fi
70.PP
71.SH EXAMPLE
72Without any parameters, turbostat prints out counters ever 5 seconds.
73(override interval with "-i sec" option, or specify a command
74for turbostat to fork).
75
Len Browne23da032012-02-06 18:37:16 -050076The first row of statistics is a summary for the entire system.
Len Brown889facb2012-11-08 00:48:57 -050077For residency % columns, the summary is a weighted average.
78For Temperature columns, the summary is the column maximum.
79For Watts columns, the summary is a system total.
Len Brown103a8fe2010-10-22 23:53:03 -040080Subsequent rows show per-CPU statistics.
81
82.nf
Len Brown889facb2012-11-08 00:48:57 -050083[root@sandy]# ./turbostat
84cor CPU %c0 GHz TSC %c1 %c3 %c6 %c7 CTMP PTMP %pc2 %pc3 %pc6 %pc7 Pkg_W Cor_W GFX_W
85 0.06 0.80 2.29 0.11 0.00 0.00 99.83 47 40 0.26 0.01 0.44 98.78 3.49 0.12 0.14
86 0 0 0.07 0.80 2.29 0.07 0.00 0.00 99.86 40 40 0.26 0.01 0.44 98.78 3.49 0.12 0.14
87 0 4 0.03 0.80 2.29 0.12
88 1 1 0.04 0.80 2.29 0.25 0.01 0.00 99.71 40
89 1 5 0.16 0.80 2.29 0.13
90 2 2 0.05 0.80 2.29 0.06 0.01 0.00 99.88 40
91 2 6 0.03 0.80 2.29 0.08
92 3 3 0.05 0.80 2.29 0.08 0.00 0.00 99.87 47
93 3 7 0.04 0.84 2.29 0.09
Len Browne23da032012-02-06 18:37:16 -050094.fi
95.SH SUMMARY EXAMPLE
96The "-s" option prints the column headers just once,
97and then the one line system summary for each sample interval.
98
99.nf
Len Brown889facb2012-11-08 00:48:57 -0500100[root@wsm]# turbostat -S
101 %c0 GHz TSC %c1 %c3 %c6 CTMP %pc3 %pc6
102 1.40 2.81 3.38 10.78 43.47 44.35 42 13.67 2.09
103 1.34 2.90 3.38 11.48 58.96 28.23 41 19.89 0.15
104 1.55 2.72 3.38 26.73 37.66 34.07 42 2.53 2.80
105 1.37 2.83 3.38 16.95 60.05 21.63 42 5.76 0.20
Len Brown103a8fe2010-10-22 23:53:03 -0400106.fi
107.SH VERBOSE EXAMPLE
108The "-v" option adds verbosity to the output:
109
110.nf
Len Brown889facb2012-11-08 00:48:57 -0500111[root@ivy]# turbostat -v
112turbostat v3.0 November 23, 2012 - Len Brown <lenb@kernel.org>
113CPUID(0): GenuineIntel 13 CPUID levels; family:model:stepping 0x6:3a:9 (6:58:9)
114CPUID(6): APERF, DTS, PTM, EPB
115RAPL: 851 sec. Joule Counter Range
116cpu0: MSR_NHM_PLATFORM_INFO: 0x81010f0012300
11716 * 100 = 1600 MHz max efficiency
11835 * 100 = 3500 MHz TSC frequency
119cpu0: MSR_NHM_SNB_PKG_CST_CFG_CTL: 0x1e008402 (UNdemote-C3, UNdemote-C1, demote-C3, demote-C1, locked: pkg-cstate-limit=2: pc6-noret)
120cpu0: MSR_NHM_TURBO_RATIO_LIMIT: 0x25262727
12137 * 100 = 3700 MHz max turbo 4 active cores
12238 * 100 = 3800 MHz max turbo 3 active cores
12339 * 100 = 3900 MHz max turbo 2 active cores
12439 * 100 = 3900 MHz max turbo 1 active cores
125cpu0: MSR_IA32_ENERGY_PERF_BIAS: 0x00000006 (balanced)
126cpu0: MSR_RAPL_POWER_UNIT: 0x000a1003 (0.125000 Watts, 0.000015 Joules, 0.000977 sec.)
127cpu0: MSR_PKG_POWER_INFO: 0x01e00268 (77 W TDP, RAPL 60 - 0 W, 0.000000 sec.)
128cpu0: MSR_PKG_POWER_LIMIT: 0x830000148268 (UNlocked)
129cpu0: PKG Limit #1: ENabled (77.000000 Watts, 1.000000 sec, clamp DISabled)
130cpu0: PKG Limit #2: ENabled (96.000000 Watts, 0.000977* sec, clamp DISabled)
131cpu0: MSR_PP0_POLICY: 0
132cpu0: MSR_PP0_POWER_LIMIT: 0x00000000 (UNlocked)
133cpu0: Cores Limit: DISabled (0.000000 Watts, 0.000977 sec, clamp DISabled)
134cpu0: MSR_PP1_POLICY: 0
135cpu0: MSR_PP1_POWER_LIMIT: 0x00000000 (UNlocked)
136cpu0: GFX Limit: DISabled (0.000000 Watts, 0.000977 sec, clamp DISabled)
137cpu0: MSR_IA32_TEMPERATURE_TARGET: 0x00691400 (105 C)
138cpu0: MSR_IA32_PACKAGE_THERM_STATUS: 0x884e0000 (27 C)
139cpu0: MSR_IA32_THERM_STATUS: 0x88560000 (19 C +/- 1)
140cpu1: MSR_IA32_THERM_STATUS: 0x88560000 (19 C +/- 1)
141cpu2: MSR_IA32_THERM_STATUS: 0x88540000 (21 C +/- 1)
142cpu3: MSR_IA32_THERM_STATUS: 0x884e0000 (27 C +/- 1)
143 ...
Len Brown103a8fe2010-10-22 23:53:03 -0400144.fi
145The \fBmax efficiency\fP frequency, a.k.a. Low Frequency Mode, is the frequency
146available at the minimum package voltage. The \fBTSC frequency\fP is the nominal
147maximum frequency of the processor if turbo-mode were not available. This frequency
148should be sustainable on all CPUs indefinitely, given nominal power and cooling.
149The remaining rows show what maximum turbo frequency is possible
150depending on the number of idle cores. Note that this information is
151not available on all processors.
152.SH FORK EXAMPLE
153If turbostat is invoked with a command, it will fork that command
154and output the statistics gathered when the command exits.
155eg. Here a cycle soaker is run on 1 CPU (see %c0) for a few seconds
156until ^C while the other CPUs are mostly idle:
157
158.nf
159[root@x980 lenb]# ./turbostat cat /dev/zero > /dev/null
Len Browne23da032012-02-06 18:37:16 -0500160^C
161cor CPU %c0 GHz TSC %c1 %c3 %c6 %pc3 %pc6
Len Brownc98d5d92012-06-04 00:56:40 -0400162 8.86 3.61 3.38 15.06 31.19 44.89 0.00 0.00
163 0 0 1.46 3.22 3.38 16.84 29.48 52.22 0.00 0.00
164 0 6 0.21 3.06 3.38 18.09
165 1 2 0.53 3.33 3.38 2.80 46.40 50.27
166 1 8 0.89 3.47 3.38 2.44
167 2 4 1.36 3.43 3.38 9.04 23.71 65.89
168 2 10 0.18 2.86 3.38 10.22
169 8 1 0.04 2.87 3.38 99.96 0.01 0.00
170 8 7 99.72 3.63 3.38 0.27
171 9 3 0.31 3.21 3.38 7.64 56.55 35.50
172 9 9 0.08 2.95 3.38 7.88
173 10 5 1.42 3.43 3.38 2.14 30.99 65.44
174 10 11 0.16 2.88 3.38 3.40
Len Brown103a8fe2010-10-22 23:53:03 -0400175.fi
Len Brown889facb2012-11-08 00:48:57 -0500176Above the cycle soaker drives cpu7 up its 3.6 GHz turbo limit
Len Brown103a8fe2010-10-22 23:53:03 -0400177while the other processors are generally in various states of idle.
178
Len Brownc98d5d92012-06-04 00:56:40 -0400179Note that cpu1 and cpu7 are HT siblings within core8.
180As cpu7 is very busy, it prevents its sibling, cpu1,
181from entering a c-state deeper than c1.
Len Brown103a8fe2010-10-22 23:53:03 -0400182
Len Brownc98d5d92012-06-04 00:56:40 -0400183Note that turbostat reports average GHz of 3.63, while
Len Browne23da032012-02-06 18:37:16 -0500184the arithmetic average of the GHz column above is lower.
Len Brown103a8fe2010-10-22 23:53:03 -0400185This is a weighted average, where the weight is %c0. ie. it is the total number of
186un-halted cycles elapsed per time divided by the number of CPUs.
Len Brown8e180f32012-09-22 01:25:08 -0400187.SH SMI COUNTING EXAMPLE
188On Intel Nehalem and newer processors, MSR 0x34 is a System Management Mode Interrupt (SMI) counter.
189Using the -m option, you can display how many SMIs have fired since reset, or if there
190are SMIs during the measurement interval, you can display the delta using the -d option.
191.nf
192[root@x980 ~]# turbostat -m 0x34
193cor CPU %c0 GHz TSC MSR 0x034 %c1 %c3 %c6 %pc3 %pc6
194 1.41 1.82 3.38 0x00000000 8.92 37.82 51.85 17.37 0.55
195 0 0 3.73 2.03 3.38 0x00000055 1.72 48.25 46.31 17.38 0.55
196 0 6 0.14 1.63 3.38 0x00000056 5.30
197 1 2 2.51 1.80 3.38 0x00000056 15.65 29.33 52.52
198 1 8 0.10 1.65 3.38 0x00000056 18.05
199 2 4 1.16 1.68 3.38 0x00000056 5.87 24.47 68.50
200 2 10 0.10 1.63 3.38 0x00000056 6.93
201 8 1 3.84 1.91 3.38 0x00000056 1.36 50.65 44.16
202 8 7 0.08 1.64 3.38 0x00000056 5.12
203 9 3 1.82 1.73 3.38 0x00000056 7.59 24.21 66.38
204 9 9 0.09 1.68 3.38 0x00000056 9.32
205 10 5 1.66 1.65 3.38 0x00000056 15.10 50.00 33.23
206 10 11 1.72 1.65 3.38 0x00000056 15.05
207^C
208[root@x980 ~]#
209.fi
Len Brown103a8fe2010-10-22 23:53:03 -0400210.SH NOTES
211
212.B "turbostat "
213must be run as root.
214
215.B "turbostat "
216reads hardware counters, but doesn't write them.
217So it will not interfere with the OS or other programs, including
218multiple invocations of itself.
219
220\fBturbostat \fP
221may work poorly on Linux-2.6.20 through 2.6.29,
222as \fBacpi-cpufreq \fPperiodically cleared the APERF and MPERF
223in those kernels.
224
Len Brown2f32edf2012-09-21 23:45:46 -0400225If the TSC column does not make sense, then
226the other numbers will also make no sense.
227Turbostat is lightweight, and its data collection is not atomic.
228These issues are usually caused by an extremely short measurement
229interval (much less than 1 second), or system activity that prevents
230turbostat from being able to run on all CPUS to quickly collect data.
231
Len Brown103a8fe2010-10-22 23:53:03 -0400232The APERF, MPERF MSRs are defined to count non-halted cycles.
233Although it is not guaranteed by the architecture, turbostat assumes
234that they count at TSC rate, which is true on all processors tested to date.
235
236.SH REFERENCES
237"Intel® Turbo Boost Technology
238in Intel® Core™ Microarchitecture (Nehalem) Based Processors"
239http://download.intel.com/design/processor/applnots/320354.pdf
240
241"Intel® 64 and IA-32 Architectures Software Developer's Manual
242Volume 3B: System Programming Guide"
243http://www.intel.com/products/processor/manuals/
244
245.SH FILES
246.ta
247.nf
248/dev/cpu/*/msr
249.fi
250
251.SH "SEE ALSO"
252msr(4), vmstat(8)
253.PP
Len Browne23da032012-02-06 18:37:16 -0500254.SH AUTHOR
Len Brown103a8fe2010-10-22 23:53:03 -0400255.nf
256Written by Len Brown <len.brown@intel.com>