blob: e4d0690cccf9e888a2e920bcb783d17958b81470 [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
14\fBturbostat \fP reports processor topology, frequency
15and idle power state statistics on modern X86 processors.
16Either \fBcommand\fP is forked and statistics are printed
17upon its completion, or statistics are printed periodically.
18
19\fBturbostat \fP
20requires that the processor
21supports an "invariant" TSC, plus the APERF and MPERF MSRs.
22\fBturbostat \fP will report idle cpu power state residency
23on processors that additionally support C-state residency counters.
24
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.
60\fB%pc2, %pc3, %pc6, %pc7\fP percentage residency in hardware package idle states.
Len Brown103a8fe2010-10-22 23:53:03 -040061.fi
62.PP
63.SH EXAMPLE
64Without any parameters, turbostat prints out counters ever 5 seconds.
65(override interval with "-i sec" option, or specify a command
66for turbostat to fork).
67
Len Browne23da032012-02-06 18:37:16 -050068The first row of statistics is a summary for the entire system.
69Note that the summary is a weighted average.
Len Brown103a8fe2010-10-22 23:53:03 -040070Subsequent rows show per-CPU statistics.
71
72.nf
73[root@x980]# ./turbostat
Len Browne23da032012-02-06 18:37:16 -050074cor CPU %c0 GHz TSC %c1 %c3 %c6 %pc3 %pc6
Len Brownc98d5d92012-06-04 00:56:40 -040075 0.09 1.62 3.38 1.83 0.32 97.76 1.26 83.61
76 0 0 0.15 1.62 3.38 10.23 0.05 89.56 1.26 83.61
77 0 6 0.05 1.62 3.38 10.34
78 1 2 0.03 1.62 3.38 0.07 0.05 99.86
79 1 8 0.03 1.62 3.38 0.06
80 2 4 0.21 1.62 3.38 0.10 1.49 98.21
81 2 10 0.02 1.62 3.38 0.29
82 8 1 0.04 1.62 3.38 0.04 0.08 99.84
83 8 7 0.01 1.62 3.38 0.06
84 9 3 0.53 1.62 3.38 0.10 0.20 99.17
85 9 9 0.02 1.62 3.38 0.60
86 10 5 0.01 1.62 3.38 0.02 0.04 99.92
87 10 11 0.02 1.62 3.38 0.02
Len Browne23da032012-02-06 18:37:16 -050088.fi
89.SH SUMMARY EXAMPLE
90The "-s" option prints the column headers just once,
91and then the one line system summary for each sample interval.
92
93.nf
94[root@x980]# ./turbostat -s
95 %c0 GHz TSC %c1 %c3 %c6 %pc3 %pc6
Len Brownc98d5d92012-06-04 00:56:40 -040096 0.23 1.67 3.38 2.00 0.30 97.47 1.07 82.12
97 0.10 1.62 3.38 1.87 2.25 95.77 12.02 72.60
98 0.20 1.64 3.38 1.98 0.11 97.72 0.30 83.36
99 0.11 1.70 3.38 1.86 1.81 96.22 9.71 74.90
Len Brown103a8fe2010-10-22 23:53:03 -0400100.fi
101.SH VERBOSE EXAMPLE
102The "-v" option adds verbosity to the output:
103
104.nf
105GenuineIntel 11 CPUID levels; family:model:stepping 0x6:2c:2 (6:44:2)
10612 * 133 = 1600 MHz max efficiency
10725 * 133 = 3333 MHz TSC frequency
10826 * 133 = 3467 MHz max turbo 4 active cores
10926 * 133 = 3467 MHz max turbo 3 active cores
11027 * 133 = 3600 MHz max turbo 2 active cores
11127 * 133 = 3600 MHz max turbo 1 active cores
112
113.fi
114The \fBmax efficiency\fP frequency, a.k.a. Low Frequency Mode, is the frequency
115available at the minimum package voltage. The \fBTSC frequency\fP is the nominal
116maximum frequency of the processor if turbo-mode were not available. This frequency
117should be sustainable on all CPUs indefinitely, given nominal power and cooling.
118The remaining rows show what maximum turbo frequency is possible
119depending on the number of idle cores. Note that this information is
120not available on all processors.
121.SH FORK EXAMPLE
122If turbostat is invoked with a command, it will fork that command
123and output the statistics gathered when the command exits.
124eg. Here a cycle soaker is run on 1 CPU (see %c0) for a few seconds
125until ^C while the other CPUs are mostly idle:
126
127.nf
128[root@x980 lenb]# ./turbostat cat /dev/zero > /dev/null
Len Browne23da032012-02-06 18:37:16 -0500129^C
130cor CPU %c0 GHz TSC %c1 %c3 %c6 %pc3 %pc6
Len Brownc98d5d92012-06-04 00:56:40 -0400131 8.86 3.61 3.38 15.06 31.19 44.89 0.00 0.00
132 0 0 1.46 3.22 3.38 16.84 29.48 52.22 0.00 0.00
133 0 6 0.21 3.06 3.38 18.09
134 1 2 0.53 3.33 3.38 2.80 46.40 50.27
135 1 8 0.89 3.47 3.38 2.44
136 2 4 1.36 3.43 3.38 9.04 23.71 65.89
137 2 10 0.18 2.86 3.38 10.22
138 8 1 0.04 2.87 3.38 99.96 0.01 0.00
139 8 7 99.72 3.63 3.38 0.27
140 9 3 0.31 3.21 3.38 7.64 56.55 35.50
141 9 9 0.08 2.95 3.38 7.88
142 10 5 1.42 3.43 3.38 2.14 30.99 65.44
143 10 11 0.16 2.88 3.38 3.40
Len Brown103a8fe2010-10-22 23:53:03 -0400144.fi
Len Brownc98d5d92012-06-04 00:56:40 -0400145Above the cycle soaker drives cpu7 up its 3.6 Ghz turbo limit
Len Brown103a8fe2010-10-22 23:53:03 -0400146while the other processors are generally in various states of idle.
147
Len Brownc98d5d92012-06-04 00:56:40 -0400148Note that cpu1 and cpu7 are HT siblings within core8.
149As cpu7 is very busy, it prevents its sibling, cpu1,
150from entering a c-state deeper than c1.
Len Brown103a8fe2010-10-22 23:53:03 -0400151
Len Brownc98d5d92012-06-04 00:56:40 -0400152Note that turbostat reports average GHz of 3.63, while
Len Browne23da032012-02-06 18:37:16 -0500153the arithmetic average of the GHz column above is lower.
Len Brown103a8fe2010-10-22 23:53:03 -0400154This is a weighted average, where the weight is %c0. ie. it is the total number of
155un-halted cycles elapsed per time divided by the number of CPUs.
Len Brown8e180f32012-09-22 01:25:08 -0400156.SH SMI COUNTING EXAMPLE
157On Intel Nehalem and newer processors, MSR 0x34 is a System Management Mode Interrupt (SMI) counter.
158Using the -m option, you can display how many SMIs have fired since reset, or if there
159are SMIs during the measurement interval, you can display the delta using the -d option.
160.nf
161[root@x980 ~]# turbostat -m 0x34
162cor CPU %c0 GHz TSC MSR 0x034 %c1 %c3 %c6 %pc3 %pc6
163 1.41 1.82 3.38 0x00000000 8.92 37.82 51.85 17.37 0.55
164 0 0 3.73 2.03 3.38 0x00000055 1.72 48.25 46.31 17.38 0.55
165 0 6 0.14 1.63 3.38 0x00000056 5.30
166 1 2 2.51 1.80 3.38 0x00000056 15.65 29.33 52.52
167 1 8 0.10 1.65 3.38 0x00000056 18.05
168 2 4 1.16 1.68 3.38 0x00000056 5.87 24.47 68.50
169 2 10 0.10 1.63 3.38 0x00000056 6.93
170 8 1 3.84 1.91 3.38 0x00000056 1.36 50.65 44.16
171 8 7 0.08 1.64 3.38 0x00000056 5.12
172 9 3 1.82 1.73 3.38 0x00000056 7.59 24.21 66.38
173 9 9 0.09 1.68 3.38 0x00000056 9.32
174 10 5 1.66 1.65 3.38 0x00000056 15.10 50.00 33.23
175 10 11 1.72 1.65 3.38 0x00000056 15.05
176^C
177[root@x980 ~]#
178.fi
Len Brown103a8fe2010-10-22 23:53:03 -0400179.SH NOTES
180
181.B "turbostat "
182must be run as root.
183
184.B "turbostat "
185reads hardware counters, but doesn't write them.
186So it will not interfere with the OS or other programs, including
187multiple invocations of itself.
188
189\fBturbostat \fP
190may work poorly on Linux-2.6.20 through 2.6.29,
191as \fBacpi-cpufreq \fPperiodically cleared the APERF and MPERF
192in those kernels.
193
Len Brown2f32edf2012-09-21 23:45:46 -0400194If the TSC column does not make sense, then
195the other numbers will also make no sense.
196Turbostat is lightweight, and its data collection is not atomic.
197These issues are usually caused by an extremely short measurement
198interval (much less than 1 second), or system activity that prevents
199turbostat from being able to run on all CPUS to quickly collect data.
200
Len Brown103a8fe2010-10-22 23:53:03 -0400201The APERF, MPERF MSRs are defined to count non-halted cycles.
202Although it is not guaranteed by the architecture, turbostat assumes
203that they count at TSC rate, which is true on all processors tested to date.
204
205.SH REFERENCES
206"Intel® Turbo Boost Technology
207in Intel® Core™ Microarchitecture (Nehalem) Based Processors"
208http://download.intel.com/design/processor/applnots/320354.pdf
209
210"Intel® 64 and IA-32 Architectures Software Developer's Manual
211Volume 3B: System Programming Guide"
212http://www.intel.com/products/processor/manuals/
213
214.SH FILES
215.ta
216.nf
217/dev/cpu/*/msr
218.fi
219
220.SH "SEE ALSO"
221msr(4), vmstat(8)
222.PP
Len Browne23da032012-02-06 18:37:16 -0500223.SH AUTHOR
Len Brown103a8fe2010-10-22 23:53:03 -0400224.nf
225Written by Len Brown <len.brown@intel.com>