blob: 8e7b29af78f65cd17169f0030d81b952528d79f3 [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 Browne23da032012-02-06 18:37:16 -05007.RB [ "\-s" ]
Len Brown103a8fe2010-10-22 23:53:03 -04008.RB [ "\-v" ]
Len Brown2f32edf2012-09-21 23:45:46 -04009.RB [ "\-m MSR#" ]
Len Brown103a8fe2010-10-22 23:53:03 -040010.RB [ "\-M MSR#" ]
11.RB command
12.br
13.B turbostat
Len Browne23da032012-02-06 18:37:16 -050014.RB [ "\-s" ]
Len Brown103a8fe2010-10-22 23:53:03 -040015.RB [ "\-v" ]
Len Brown2f32edf2012-09-21 23:45:46 -040016.RB [ "\-m MSR#" ]
Len Brown103a8fe2010-10-22 23:53:03 -040017.RB [ "\-M MSR#" ]
18.RB [ "\-i interval_sec" ]
19.SH DESCRIPTION
20\fBturbostat \fP reports processor topology, frequency
21and idle power state statistics on modern X86 processors.
22Either \fBcommand\fP is forked and statistics are printed
23upon its completion, or statistics are printed periodically.
24
25\fBturbostat \fP
26requires that the processor
27supports an "invariant" TSC, plus the APERF and MPERF MSRs.
28\fBturbostat \fP will report idle cpu power state residency
29on processors that additionally support C-state residency counters.
30
31.SS Options
Len Brownc98d5d92012-06-04 00:56:40 -040032The \fB-s\fP option limits output to a 1-line system summary for each interval.
33.PP
34The \fB-c\fP option limits output to the 1st thread in each core.
35.PP
36The \fB-p\fP option limits output to the 1st thread in each package.
Len Browne23da032012-02-06 18:37:16 -050037.PP
Len Brown103a8fe2010-10-22 23:53:03 -040038The \fB-v\fP option increases verbosity.
39.PP
Len Brown2f32edf2012-09-21 23:45:46 -040040The \fB-m MSR#\fP option dumps the specified 32-bit MSR,
41in addition to the usual frequency and idle statistics.
42.PP
43The \fB-M MSR#\fP option dumps the specified 64-bit MSR,
Len Brown103a8fe2010-10-22 23:53:03 -040044in addition to the usual frequency and idle statistics.
45.PP
46The \fB-i interval_sec\fP option prints statistics every \fiinterval_sec\fP seconds.
47The default is 5 seconds.
48.PP
49The \fBcommand\fP parameter forks \fBcommand\fP and upon its exit,
50displays the statistics gathered since it was forked.
51.PP
52.SH FIELD DESCRIPTIONS
53.nf
Arun Thomas9b6cf1a2011-08-17 00:34:14 +020054\fBpk\fP processor package number.
Len Browne23da032012-02-06 18:37:16 -050055\fBcor\fP processor core number.
Len Brown103a8fe2010-10-22 23:53:03 -040056\fBCPU\fP Linux CPU (logical processor) number.
Len Browne23da032012-02-06 18:37:16 -050057Note that multiple CPUs per core indicate support for Intel(R) Hyper-Threading Technology.
Len Brown103a8fe2010-10-22 23:53:03 -040058\fB%c0\fP percent of the interval that the CPU retired instructions.
59\fBGHz\fP average clock rate while the CPU was in c0 state.
60\fBTSC\fP average GHz that the TSC ran during the entire interval.
Len Browne23da032012-02-06 18:37:16 -050061\fB%c1, %c3, %c6, %c7\fP show the percentage residency in hardware core idle states.
62\fB%pc2, %pc3, %pc6, %pc7\fP percentage residency in hardware package idle states.
Len Brown103a8fe2010-10-22 23:53:03 -040063.fi
64.PP
65.SH EXAMPLE
66Without any parameters, turbostat prints out counters ever 5 seconds.
67(override interval with "-i sec" option, or specify a command
68for turbostat to fork).
69
Len Browne23da032012-02-06 18:37:16 -050070The first row of statistics is a summary for the entire system.
71Note that the summary is a weighted average.
Len Brown103a8fe2010-10-22 23:53:03 -040072Subsequent rows show per-CPU statistics.
73
74.nf
75[root@x980]# ./turbostat
Len Browne23da032012-02-06 18:37:16 -050076cor CPU %c0 GHz TSC %c1 %c3 %c6 %pc3 %pc6
Len Brownc98d5d92012-06-04 00:56:40 -040077 0.09 1.62 3.38 1.83 0.32 97.76 1.26 83.61
78 0 0 0.15 1.62 3.38 10.23 0.05 89.56 1.26 83.61
79 0 6 0.05 1.62 3.38 10.34
80 1 2 0.03 1.62 3.38 0.07 0.05 99.86
81 1 8 0.03 1.62 3.38 0.06
82 2 4 0.21 1.62 3.38 0.10 1.49 98.21
83 2 10 0.02 1.62 3.38 0.29
84 8 1 0.04 1.62 3.38 0.04 0.08 99.84
85 8 7 0.01 1.62 3.38 0.06
86 9 3 0.53 1.62 3.38 0.10 0.20 99.17
87 9 9 0.02 1.62 3.38 0.60
88 10 5 0.01 1.62 3.38 0.02 0.04 99.92
89 10 11 0.02 1.62 3.38 0.02
Len Browne23da032012-02-06 18:37:16 -050090.fi
91.SH SUMMARY EXAMPLE
92The "-s" option prints the column headers just once,
93and then the one line system summary for each sample interval.
94
95.nf
96[root@x980]# ./turbostat -s
97 %c0 GHz TSC %c1 %c3 %c6 %pc3 %pc6
Len Brownc98d5d92012-06-04 00:56:40 -040098 0.23 1.67 3.38 2.00 0.30 97.47 1.07 82.12
99 0.10 1.62 3.38 1.87 2.25 95.77 12.02 72.60
100 0.20 1.64 3.38 1.98 0.11 97.72 0.30 83.36
101 0.11 1.70 3.38 1.86 1.81 96.22 9.71 74.90
Len Brown103a8fe2010-10-22 23:53:03 -0400102.fi
103.SH VERBOSE EXAMPLE
104The "-v" option adds verbosity to the output:
105
106.nf
107GenuineIntel 11 CPUID levels; family:model:stepping 0x6:2c:2 (6:44:2)
10812 * 133 = 1600 MHz max efficiency
10925 * 133 = 3333 MHz TSC frequency
11026 * 133 = 3467 MHz max turbo 4 active cores
11126 * 133 = 3467 MHz max turbo 3 active cores
11227 * 133 = 3600 MHz max turbo 2 active cores
11327 * 133 = 3600 MHz max turbo 1 active cores
114
115.fi
116The \fBmax efficiency\fP frequency, a.k.a. Low Frequency Mode, is the frequency
117available at the minimum package voltage. The \fBTSC frequency\fP is the nominal
118maximum frequency of the processor if turbo-mode were not available. This frequency
119should be sustainable on all CPUs indefinitely, given nominal power and cooling.
120The remaining rows show what maximum turbo frequency is possible
121depending on the number of idle cores. Note that this information is
122not available on all processors.
123.SH FORK EXAMPLE
124If turbostat is invoked with a command, it will fork that command
125and output the statistics gathered when the command exits.
126eg. Here a cycle soaker is run on 1 CPU (see %c0) for a few seconds
127until ^C while the other CPUs are mostly idle:
128
129.nf
130[root@x980 lenb]# ./turbostat cat /dev/zero > /dev/null
Len Browne23da032012-02-06 18:37:16 -0500131^C
132cor CPU %c0 GHz TSC %c1 %c3 %c6 %pc3 %pc6
Len Brownc98d5d92012-06-04 00:56:40 -0400133 8.86 3.61 3.38 15.06 31.19 44.89 0.00 0.00
134 0 0 1.46 3.22 3.38 16.84 29.48 52.22 0.00 0.00
135 0 6 0.21 3.06 3.38 18.09
136 1 2 0.53 3.33 3.38 2.80 46.40 50.27
137 1 8 0.89 3.47 3.38 2.44
138 2 4 1.36 3.43 3.38 9.04 23.71 65.89
139 2 10 0.18 2.86 3.38 10.22
140 8 1 0.04 2.87 3.38 99.96 0.01 0.00
141 8 7 99.72 3.63 3.38 0.27
142 9 3 0.31 3.21 3.38 7.64 56.55 35.50
143 9 9 0.08 2.95 3.38 7.88
144 10 5 1.42 3.43 3.38 2.14 30.99 65.44
145 10 11 0.16 2.88 3.38 3.40
Len Brown103a8fe2010-10-22 23:53:03 -0400146.fi
Len Brownc98d5d92012-06-04 00:56:40 -0400147Above the cycle soaker drives cpu7 up its 3.6 Ghz turbo limit
Len Brown103a8fe2010-10-22 23:53:03 -0400148while the other processors are generally in various states of idle.
149
Len Brownc98d5d92012-06-04 00:56:40 -0400150Note that cpu1 and cpu7 are HT siblings within core8.
151As cpu7 is very busy, it prevents its sibling, cpu1,
152from entering a c-state deeper than c1.
Len Brown103a8fe2010-10-22 23:53:03 -0400153
Len Brownc98d5d92012-06-04 00:56:40 -0400154Note that turbostat reports average GHz of 3.63, while
Len Browne23da032012-02-06 18:37:16 -0500155the arithmetic average of the GHz column above is lower.
Len Brown103a8fe2010-10-22 23:53:03 -0400156This is a weighted average, where the weight is %c0. ie. it is the total number of
157un-halted cycles elapsed per time divided by the number of CPUs.
158.SH NOTES
159
160.B "turbostat "
161must be run as root.
162
163.B "turbostat "
164reads hardware counters, but doesn't write them.
165So it will not interfere with the OS or other programs, including
166multiple invocations of itself.
167
168\fBturbostat \fP
169may work poorly on Linux-2.6.20 through 2.6.29,
170as \fBacpi-cpufreq \fPperiodically cleared the APERF and MPERF
171in those kernels.
172
Len Brown2f32edf2012-09-21 23:45:46 -0400173If the TSC column does not make sense, then
174the other numbers will also make no sense.
175Turbostat is lightweight, and its data collection is not atomic.
176These issues are usually caused by an extremely short measurement
177interval (much less than 1 second), or system activity that prevents
178turbostat from being able to run on all CPUS to quickly collect data.
179
Len Brown103a8fe2010-10-22 23:53:03 -0400180The APERF, MPERF MSRs are defined to count non-halted cycles.
181Although it is not guaranteed by the architecture, turbostat assumes
182that they count at TSC rate, which is true on all processors tested to date.
183
184.SH REFERENCES
185"Intel® Turbo Boost Technology
186in Intel® Core™ Microarchitecture (Nehalem) Based Processors"
187http://download.intel.com/design/processor/applnots/320354.pdf
188
189"Intel® 64 and IA-32 Architectures Software Developer's Manual
190Volume 3B: System Programming Guide"
191http://www.intel.com/products/processor/manuals/
192
193.SH FILES
194.ta
195.nf
196/dev/cpu/*/msr
197.fi
198
199.SH "SEE ALSO"
200msr(4), vmstat(8)
201.PP
Len Browne23da032012-02-06 18:37:16 -0500202.SH AUTHOR
Len Brown103a8fe2010-10-22 23:53:03 -0400203.nf
204Written by Len Brown <len.brown@intel.com>