Len Brown | 103a8fe | 2010-10-22 23:53:03 -0400 | [diff] [blame] | 1 | .TH TURBOSTAT 8 |
| 2 | .SH NAME |
| 3 | turbostat \- Report processor frequency and idle statistics |
| 4 | .SH SYNOPSIS |
| 5 | .ft B |
| 6 | .B turbostat |
Len Brown | e23da03 | 2012-02-06 18:37:16 -0500 | [diff] [blame] | 7 | .RB [ "\-s" ] |
Len Brown | 103a8fe | 2010-10-22 23:53:03 -0400 | [diff] [blame] | 8 | .RB [ "\-v" ] |
Len Brown | 2f32edf | 2012-09-21 23:45:46 -0400 | [diff] [blame^] | 9 | .RB [ "\-m MSR#" ] |
Len Brown | 103a8fe | 2010-10-22 23:53:03 -0400 | [diff] [blame] | 10 | .RB [ "\-M MSR#" ] |
| 11 | .RB command |
| 12 | .br |
| 13 | .B turbostat |
Len Brown | e23da03 | 2012-02-06 18:37:16 -0500 | [diff] [blame] | 14 | .RB [ "\-s" ] |
Len Brown | 103a8fe | 2010-10-22 23:53:03 -0400 | [diff] [blame] | 15 | .RB [ "\-v" ] |
Len Brown | 2f32edf | 2012-09-21 23:45:46 -0400 | [diff] [blame^] | 16 | .RB [ "\-m MSR#" ] |
Len Brown | 103a8fe | 2010-10-22 23:53:03 -0400 | [diff] [blame] | 17 | .RB [ "\-M MSR#" ] |
| 18 | .RB [ "\-i interval_sec" ] |
| 19 | .SH DESCRIPTION |
| 20 | \fBturbostat \fP reports processor topology, frequency |
| 21 | and idle power state statistics on modern X86 processors. |
| 22 | Either \fBcommand\fP is forked and statistics are printed |
| 23 | upon its completion, or statistics are printed periodically. |
| 24 | |
| 25 | \fBturbostat \fP |
| 26 | requires that the processor |
| 27 | supports an "invariant" TSC, plus the APERF and MPERF MSRs. |
| 28 | \fBturbostat \fP will report idle cpu power state residency |
| 29 | on processors that additionally support C-state residency counters. |
| 30 | |
| 31 | .SS Options |
Len Brown | c98d5d9 | 2012-06-04 00:56:40 -0400 | [diff] [blame] | 32 | The \fB-s\fP option limits output to a 1-line system summary for each interval. |
| 33 | .PP |
| 34 | The \fB-c\fP option limits output to the 1st thread in each core. |
| 35 | .PP |
| 36 | The \fB-p\fP option limits output to the 1st thread in each package. |
Len Brown | e23da03 | 2012-02-06 18:37:16 -0500 | [diff] [blame] | 37 | .PP |
Len Brown | 103a8fe | 2010-10-22 23:53:03 -0400 | [diff] [blame] | 38 | The \fB-v\fP option increases verbosity. |
| 39 | .PP |
Len Brown | 2f32edf | 2012-09-21 23:45:46 -0400 | [diff] [blame^] | 40 | The \fB-m MSR#\fP option dumps the specified 32-bit MSR, |
| 41 | in addition to the usual frequency and idle statistics. |
| 42 | .PP |
| 43 | The \fB-M MSR#\fP option dumps the specified 64-bit MSR, |
Len Brown | 103a8fe | 2010-10-22 23:53:03 -0400 | [diff] [blame] | 44 | in addition to the usual frequency and idle statistics. |
| 45 | .PP |
| 46 | The \fB-i interval_sec\fP option prints statistics every \fiinterval_sec\fP seconds. |
| 47 | The default is 5 seconds. |
| 48 | .PP |
| 49 | The \fBcommand\fP parameter forks \fBcommand\fP and upon its exit, |
| 50 | displays the statistics gathered since it was forked. |
| 51 | .PP |
| 52 | .SH FIELD DESCRIPTIONS |
| 53 | .nf |
Arun Thomas | 9b6cf1a | 2011-08-17 00:34:14 +0200 | [diff] [blame] | 54 | \fBpk\fP processor package number. |
Len Brown | e23da03 | 2012-02-06 18:37:16 -0500 | [diff] [blame] | 55 | \fBcor\fP processor core number. |
Len Brown | 103a8fe | 2010-10-22 23:53:03 -0400 | [diff] [blame] | 56 | \fBCPU\fP Linux CPU (logical processor) number. |
Len Brown | e23da03 | 2012-02-06 18:37:16 -0500 | [diff] [blame] | 57 | Note that multiple CPUs per core indicate support for Intel(R) Hyper-Threading Technology. |
Len Brown | 103a8fe | 2010-10-22 23:53:03 -0400 | [diff] [blame] | 58 | \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 Brown | e23da03 | 2012-02-06 18:37:16 -0500 | [diff] [blame] | 61 | \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 Brown | 103a8fe | 2010-10-22 23:53:03 -0400 | [diff] [blame] | 63 | .fi |
| 64 | .PP |
| 65 | .SH EXAMPLE |
| 66 | Without any parameters, turbostat prints out counters ever 5 seconds. |
| 67 | (override interval with "-i sec" option, or specify a command |
| 68 | for turbostat to fork). |
| 69 | |
Len Brown | e23da03 | 2012-02-06 18:37:16 -0500 | [diff] [blame] | 70 | The first row of statistics is a summary for the entire system. |
| 71 | Note that the summary is a weighted average. |
Len Brown | 103a8fe | 2010-10-22 23:53:03 -0400 | [diff] [blame] | 72 | Subsequent rows show per-CPU statistics. |
| 73 | |
| 74 | .nf |
| 75 | [root@x980]# ./turbostat |
Len Brown | e23da03 | 2012-02-06 18:37:16 -0500 | [diff] [blame] | 76 | cor CPU %c0 GHz TSC %c1 %c3 %c6 %pc3 %pc6 |
Len Brown | c98d5d9 | 2012-06-04 00:56:40 -0400 | [diff] [blame] | 77 | 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 Brown | e23da03 | 2012-02-06 18:37:16 -0500 | [diff] [blame] | 90 | .fi |
| 91 | .SH SUMMARY EXAMPLE |
| 92 | The "-s" option prints the column headers just once, |
| 93 | and 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 Brown | c98d5d9 | 2012-06-04 00:56:40 -0400 | [diff] [blame] | 98 | 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 Brown | 103a8fe | 2010-10-22 23:53:03 -0400 | [diff] [blame] | 102 | .fi |
| 103 | .SH VERBOSE EXAMPLE |
| 104 | The "-v" option adds verbosity to the output: |
| 105 | |
| 106 | .nf |
| 107 | GenuineIntel 11 CPUID levels; family:model:stepping 0x6:2c:2 (6:44:2) |
| 108 | 12 * 133 = 1600 MHz max efficiency |
| 109 | 25 * 133 = 3333 MHz TSC frequency |
| 110 | 26 * 133 = 3467 MHz max turbo 4 active cores |
| 111 | 26 * 133 = 3467 MHz max turbo 3 active cores |
| 112 | 27 * 133 = 3600 MHz max turbo 2 active cores |
| 113 | 27 * 133 = 3600 MHz max turbo 1 active cores |
| 114 | |
| 115 | .fi |
| 116 | The \fBmax efficiency\fP frequency, a.k.a. Low Frequency Mode, is the frequency |
| 117 | available at the minimum package voltage. The \fBTSC frequency\fP is the nominal |
| 118 | maximum frequency of the processor if turbo-mode were not available. This frequency |
| 119 | should be sustainable on all CPUs indefinitely, given nominal power and cooling. |
| 120 | The remaining rows show what maximum turbo frequency is possible |
| 121 | depending on the number of idle cores. Note that this information is |
| 122 | not available on all processors. |
| 123 | .SH FORK EXAMPLE |
| 124 | If turbostat is invoked with a command, it will fork that command |
| 125 | and output the statistics gathered when the command exits. |
| 126 | eg. Here a cycle soaker is run on 1 CPU (see %c0) for a few seconds |
| 127 | until ^C while the other CPUs are mostly idle: |
| 128 | |
| 129 | .nf |
| 130 | [root@x980 lenb]# ./turbostat cat /dev/zero > /dev/null |
Len Brown | e23da03 | 2012-02-06 18:37:16 -0500 | [diff] [blame] | 131 | ^C |
| 132 | cor CPU %c0 GHz TSC %c1 %c3 %c6 %pc3 %pc6 |
Len Brown | c98d5d9 | 2012-06-04 00:56:40 -0400 | [diff] [blame] | 133 | 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 Brown | 103a8fe | 2010-10-22 23:53:03 -0400 | [diff] [blame] | 146 | .fi |
Len Brown | c98d5d9 | 2012-06-04 00:56:40 -0400 | [diff] [blame] | 147 | Above the cycle soaker drives cpu7 up its 3.6 Ghz turbo limit |
Len Brown | 103a8fe | 2010-10-22 23:53:03 -0400 | [diff] [blame] | 148 | while the other processors are generally in various states of idle. |
| 149 | |
Len Brown | c98d5d9 | 2012-06-04 00:56:40 -0400 | [diff] [blame] | 150 | Note that cpu1 and cpu7 are HT siblings within core8. |
| 151 | As cpu7 is very busy, it prevents its sibling, cpu1, |
| 152 | from entering a c-state deeper than c1. |
Len Brown | 103a8fe | 2010-10-22 23:53:03 -0400 | [diff] [blame] | 153 | |
Len Brown | c98d5d9 | 2012-06-04 00:56:40 -0400 | [diff] [blame] | 154 | Note that turbostat reports average GHz of 3.63, while |
Len Brown | e23da03 | 2012-02-06 18:37:16 -0500 | [diff] [blame] | 155 | the arithmetic average of the GHz column above is lower. |
Len Brown | 103a8fe | 2010-10-22 23:53:03 -0400 | [diff] [blame] | 156 | This is a weighted average, where the weight is %c0. ie. it is the total number of |
| 157 | un-halted cycles elapsed per time divided by the number of CPUs. |
| 158 | .SH NOTES |
| 159 | |
| 160 | .B "turbostat " |
| 161 | must be run as root. |
| 162 | |
| 163 | .B "turbostat " |
| 164 | reads hardware counters, but doesn't write them. |
| 165 | So it will not interfere with the OS or other programs, including |
| 166 | multiple invocations of itself. |
| 167 | |
| 168 | \fBturbostat \fP |
| 169 | may work poorly on Linux-2.6.20 through 2.6.29, |
| 170 | as \fBacpi-cpufreq \fPperiodically cleared the APERF and MPERF |
| 171 | in those kernels. |
| 172 | |
Len Brown | 2f32edf | 2012-09-21 23:45:46 -0400 | [diff] [blame^] | 173 | If the TSC column does not make sense, then |
| 174 | the other numbers will also make no sense. |
| 175 | Turbostat is lightweight, and its data collection is not atomic. |
| 176 | These issues are usually caused by an extremely short measurement |
| 177 | interval (much less than 1 second), or system activity that prevents |
| 178 | turbostat from being able to run on all CPUS to quickly collect data. |
| 179 | |
Len Brown | 103a8fe | 2010-10-22 23:53:03 -0400 | [diff] [blame] | 180 | The APERF, MPERF MSRs are defined to count non-halted cycles. |
| 181 | Although it is not guaranteed by the architecture, turbostat assumes |
| 182 | that they count at TSC rate, which is true on all processors tested to date. |
| 183 | |
| 184 | .SH REFERENCES |
| 185 | "Intel® Turbo Boost Technology |
| 186 | in Intel® Core™ Microarchitecture (Nehalem) Based Processors" |
| 187 | http://download.intel.com/design/processor/applnots/320354.pdf |
| 188 | |
| 189 | "Intel® 64 and IA-32 Architectures Software Developer's Manual |
| 190 | Volume 3B: System Programming Guide" |
| 191 | http://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" |
| 200 | msr(4), vmstat(8) |
| 201 | .PP |
Len Brown | e23da03 | 2012-02-06 18:37:16 -0500 | [diff] [blame] | 202 | .SH AUTHOR |
Len Brown | 103a8fe | 2010-10-22 23:53:03 -0400 | [diff] [blame] | 203 | .nf |
| 204 | Written by Len Brown <len.brown@intel.com> |