turbostat.8 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225
  1. .TH TURBOSTAT 8
  2. .SH NAME
  3. turbostat \- Report processor frequency and idle statistics
  4. .SH SYNOPSIS
  5. .ft B
  6. .B turbostat
  7. .RB [ Options ]
  8. .RB command
  9. .br
  10. .B turbostat
  11. .RB [ Options ]
  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. \fBturbostat \fP
  19. requires that the processor
  20. supports an "invariant" TSC, plus the APERF and MPERF MSRs.
  21. \fBturbostat \fP will report idle cpu power state residency
  22. on processors that additionally support C-state residency counters.
  23. .SS Options
  24. The \fB-p\fP option limits output to the 1st thread in 1st core of each package.
  25. .PP
  26. The \fB-P\fP option limits output to the 1st thread in each Package.
  27. .PP
  28. The \fB-S\fP option limits output to a 1-line System Summary for each interval.
  29. .PP
  30. The \fB-v\fP option increases verbosity.
  31. .PP
  32. The \fB-s\fP option prints the SMI counter, equivalent to "-c 0x34"
  33. .PP
  34. The \fB-c MSR#\fP option includes the delta of the specified 32-bit MSR counter.
  35. .PP
  36. The \fB-C 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.
  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
  50. \fBpk\fP processor package number.
  51. \fBcor\fP processor core number.
  52. \fBCPU\fP Linux CPU (logical processor) number.
  53. Note that multiple CPUs per core indicate support for Intel(R) Hyper-Threading Technology.
  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.
  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.
  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. The first row of statistics is a summary for the entire system.
  66. Note that the summary is a weighted average.
  67. Subsequent rows show per-CPU statistics.
  68. .nf
  69. [root@x980]# ./turbostat
  70. cor CPU %c0 GHz TSC %c1 %c3 %c6 %pc3 %pc6
  71. 0.09 1.62 3.38 1.83 0.32 97.76 1.26 83.61
  72. 0 0 0.15 1.62 3.38 10.23 0.05 89.56 1.26 83.61
  73. 0 6 0.05 1.62 3.38 10.34
  74. 1 2 0.03 1.62 3.38 0.07 0.05 99.86
  75. 1 8 0.03 1.62 3.38 0.06
  76. 2 4 0.21 1.62 3.38 0.10 1.49 98.21
  77. 2 10 0.02 1.62 3.38 0.29
  78. 8 1 0.04 1.62 3.38 0.04 0.08 99.84
  79. 8 7 0.01 1.62 3.38 0.06
  80. 9 3 0.53 1.62 3.38 0.10 0.20 99.17
  81. 9 9 0.02 1.62 3.38 0.60
  82. 10 5 0.01 1.62 3.38 0.02 0.04 99.92
  83. 10 11 0.02 1.62 3.38 0.02
  84. .fi
  85. .SH SUMMARY EXAMPLE
  86. The "-s" option prints the column headers just once,
  87. and then the one line system summary for each sample interval.
  88. .nf
  89. [root@x980]# ./turbostat -s
  90. %c0 GHz TSC %c1 %c3 %c6 %pc3 %pc6
  91. 0.23 1.67 3.38 2.00 0.30 97.47 1.07 82.12
  92. 0.10 1.62 3.38 1.87 2.25 95.77 12.02 72.60
  93. 0.20 1.64 3.38 1.98 0.11 97.72 0.30 83.36
  94. 0.11 1.70 3.38 1.86 1.81 96.22 9.71 74.90
  95. .fi
  96. .SH VERBOSE EXAMPLE
  97. The "-v" option adds verbosity to the output:
  98. .nf
  99. GenuineIntel 11 CPUID levels; family:model:stepping 0x6:2c:2 (6:44:2)
  100. 12 * 133 = 1600 MHz max efficiency
  101. 25 * 133 = 3333 MHz TSC frequency
  102. 26 * 133 = 3467 MHz max turbo 4 active cores
  103. 26 * 133 = 3467 MHz max turbo 3 active cores
  104. 27 * 133 = 3600 MHz max turbo 2 active cores
  105. 27 * 133 = 3600 MHz max turbo 1 active cores
  106. .fi
  107. The \fBmax efficiency\fP frequency, a.k.a. Low Frequency Mode, is the frequency
  108. available at the minimum package voltage. The \fBTSC frequency\fP is the nominal
  109. maximum frequency of the processor if turbo-mode were not available. This frequency
  110. should be sustainable on all CPUs indefinitely, given nominal power and cooling.
  111. The remaining rows show what maximum turbo frequency is possible
  112. depending on the number of idle cores. Note that this information is
  113. not available on all processors.
  114. .SH FORK EXAMPLE
  115. If turbostat is invoked with a command, it will fork that command
  116. and output the statistics gathered when the command exits.
  117. eg. Here a cycle soaker is run on 1 CPU (see %c0) for a few seconds
  118. until ^C while the other CPUs are mostly idle:
  119. .nf
  120. [root@x980 lenb]# ./turbostat cat /dev/zero > /dev/null
  121. ^C
  122. cor CPU %c0 GHz TSC %c1 %c3 %c6 %pc3 %pc6
  123. 8.86 3.61 3.38 15.06 31.19 44.89 0.00 0.00
  124. 0 0 1.46 3.22 3.38 16.84 29.48 52.22 0.00 0.00
  125. 0 6 0.21 3.06 3.38 18.09
  126. 1 2 0.53 3.33 3.38 2.80 46.40 50.27
  127. 1 8 0.89 3.47 3.38 2.44
  128. 2 4 1.36 3.43 3.38 9.04 23.71 65.89
  129. 2 10 0.18 2.86 3.38 10.22
  130. 8 1 0.04 2.87 3.38 99.96 0.01 0.00
  131. 8 7 99.72 3.63 3.38 0.27
  132. 9 3 0.31 3.21 3.38 7.64 56.55 35.50
  133. 9 9 0.08 2.95 3.38 7.88
  134. 10 5 1.42 3.43 3.38 2.14 30.99 65.44
  135. 10 11 0.16 2.88 3.38 3.40
  136. .fi
  137. Above the cycle soaker drives cpu7 up its 3.6 Ghz turbo limit
  138. while the other processors are generally in various states of idle.
  139. Note that cpu1 and cpu7 are HT siblings within core8.
  140. As cpu7 is very busy, it prevents its sibling, cpu1,
  141. from entering a c-state deeper than c1.
  142. Note that turbostat reports average GHz of 3.63, while
  143. the arithmetic average of the GHz column above is lower.
  144. This is a weighted average, where the weight is %c0. ie. it is the total number of
  145. un-halted cycles elapsed per time divided by the number of CPUs.
  146. .SH SMI COUNTING EXAMPLE
  147. On Intel Nehalem and newer processors, MSR 0x34 is a System Management Mode Interrupt (SMI) counter.
  148. Using the -m option, you can display how many SMIs have fired since reset, or if there
  149. are SMIs during the measurement interval, you can display the delta using the -d option.
  150. .nf
  151. [root@x980 ~]# turbostat -m 0x34
  152. cor CPU %c0 GHz TSC MSR 0x034 %c1 %c3 %c6 %pc3 %pc6
  153. 1.41 1.82 3.38 0x00000000 8.92 37.82 51.85 17.37 0.55
  154. 0 0 3.73 2.03 3.38 0x00000055 1.72 48.25 46.31 17.38 0.55
  155. 0 6 0.14 1.63 3.38 0x00000056 5.30
  156. 1 2 2.51 1.80 3.38 0x00000056 15.65 29.33 52.52
  157. 1 8 0.10 1.65 3.38 0x00000056 18.05
  158. 2 4 1.16 1.68 3.38 0x00000056 5.87 24.47 68.50
  159. 2 10 0.10 1.63 3.38 0x00000056 6.93
  160. 8 1 3.84 1.91 3.38 0x00000056 1.36 50.65 44.16
  161. 8 7 0.08 1.64 3.38 0x00000056 5.12
  162. 9 3 1.82 1.73 3.38 0x00000056 7.59 24.21 66.38
  163. 9 9 0.09 1.68 3.38 0x00000056 9.32
  164. 10 5 1.66 1.65 3.38 0x00000056 15.10 50.00 33.23
  165. 10 11 1.72 1.65 3.38 0x00000056 15.05
  166. ^C
  167. [root@x980 ~]#
  168. .fi
  169. .SH NOTES
  170. .B "turbostat "
  171. must be run as root.
  172. .B "turbostat "
  173. reads hardware counters, but doesn't write them.
  174. So it will not interfere with the OS or other programs, including
  175. multiple invocations of itself.
  176. \fBturbostat \fP
  177. may work poorly on Linux-2.6.20 through 2.6.29,
  178. as \fBacpi-cpufreq \fPperiodically cleared the APERF and MPERF
  179. in those kernels.
  180. If the TSC column does not make sense, then
  181. the other numbers will also make no sense.
  182. Turbostat is lightweight, and its data collection is not atomic.
  183. These issues are usually caused by an extremely short measurement
  184. interval (much less than 1 second), or system activity that prevents
  185. turbostat from being able to run on all CPUS to quickly collect data.
  186. The APERF, MPERF MSRs are defined to count non-halted cycles.
  187. Although it is not guaranteed by the architecture, turbostat assumes
  188. that they count at TSC rate, which is true on all processors tested to date.
  189. .SH REFERENCES
  190. "Intel® Turbo Boost Technology
  191. in Intel® Core™ Microarchitecture (Nehalem) Based Processors"
  192. http://download.intel.com/design/processor/applnots/320354.pdf
  193. "Intel® 64 and IA-32 Architectures Software Developer's Manual
  194. Volume 3B: System Programming Guide"
  195. http://www.intel.com/products/processor/manuals/
  196. .SH FILES
  197. .ta
  198. .nf
  199. /dev/cpu/*/msr
  200. .fi
  201. .SH "SEE ALSO"
  202. msr(4), vmstat(8)
  203. .PP
  204. .SH AUTHOR
  205. .nf
  206. Written by Len Brown <len.brown@intel.com>