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