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