blob: 2dafba4900ab770577c41b948e3ce5b721795a09 [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 Brownd8af6f52015-02-10 01:56:38 -050012.RB [ "\--interval seconds" ]
Len Brown103a8fe2010-10-22 23:53:03 -040013.SH DESCRIPTION
Len Brown889facb2012-11-08 00:48:57 -050014\fBturbostat \fP reports processor topology, frequency,
Len Browna7296172015-01-23 01:33:58 -050015idle power-state statistics, temperature and power on X86 processors.
16There are two ways to invoke turbostat.
17The first method is to supply a
18\fBcommand\fP, which is forked and statistics are printed
Len Brownda67e2b2017-02-15 00:30:22 -050019in one-shot upon its completion.
Len Browna7296172015-01-23 01:33:58 -050020The second method is to omit the command,
Len Brownda67e2b2017-02-15 00:30:22 -050021and turbostat displays statistics every 5 seconds interval.
Len Brownd8af6f52015-02-10 01:56:38 -050022The 5-second interval can be changed using the --interval option.
Len Brown1cc21f72015-02-23 00:34:57 -050023.PP
Len Brownd8af6f52015-02-10 01:56:38 -050024Some information is not available on older processors.
Len Brown103a8fe2010-10-22 23:53:03 -040025.SS Options
Len Brown1cc21f72015-02-23 00:34:57 -050026Options can be specified with a single or double '-', and only as much of the option
27name as necessary to disambiguate it from others is necessary. Note that options are case-sensitive.
Len Brown388e9c82016-12-22 23:57:55 -050028.PP
29\fB--add attributes\fP add column with counter having specified 'attributes'. The 'location' attribute is required, all others are optional.
30.nf
Len Brownda67e2b2017-02-15 00:30:22 -050031 location: {\fBmsrDDD\fP | \fBmsr0xXXX\fP | \fB/sys/path...\fP}
Len Brown388e9c82016-12-22 23:57:55 -050032 msrDDD is a decimal offset, eg. msr16
33 msr0xXXX is a hex offset, eg. msr0x10
Len Brownda67e2b2017-02-15 00:30:22 -050034 /sys/path... is an absolute path to a sysfs attribute
Len Brown388e9c82016-12-22 23:57:55 -050035
36 scope: {\fBcpu\fP | \fBcore\fP | \fBpackage\fP}
37 sample and print the counter for every cpu, core, or package.
38 default: cpu
39
40 size: {\fBu32\fP | \fBu64\fP }
41 MSRs are read as 64-bits, u32 truncates the displayed value to 32-bits.
42 default: u64
43
44 format: {\fBraw\fP | \fBdelta\fP | \fBpercent\fP}
45 'raw' shows the MSR contents in hex.
46 'delta' shows the difference in values during the measurement interval.
47 'percent' shows the delta as a percentage of the cycles elapsed.
48 default: delta
Len Brownda67e2b2017-02-15 00:30:22 -050049
50 name: "name_string"
51 Any string that does not match a key-word above is used
52 as the column header.
Len Brown388e9c82016-12-22 23:57:55 -050053.fi
54.PP
Len Brown4e4e1e72017-02-21 22:33:42 -050055\fB--cpu cpu-set\fP limit output to system summary plus the specified cpu-set. If cpu-set is the string "core", then the system summary plus the first CPU in each core are printed -- eg. subsequent HT siblings are not printed. Or if cpu-set is the string "package", then the system summary plus the first CPU in each package is printed. Otherwise, the system summary plus the specified set of CPUs are printed. The cpu-set is ordered from low to high, comma delimited with ".." and "-" permitted to denote a range. eg. 1,2,8,14..17,21-44
Len Brown1ef7d212017-02-10 23:54:15 -050056.PP
Len Brown3f44a5c2017-10-17 15:42:56 -040057\fB--hide column\fP do not show the specified built-in columns. May be invoked multiple times, or with a comma-separated list of column names. Use "--hide sysfs" to hide the sysfs statistics columns as a group.
Len Brown812db3f2017-02-10 00:25:41 -050058.PP
Len Brown3f44a5c2017-10-17 15:42:56 -040059\fB--enable column\fP show the specified built-in columns, which are otherwise disabled, by default. Currently the only built-in counters disabled by default are "usec" and "Time_Of_Day_Seconds".
60The column name "all" can be used to enable all disabled-by-default built-in counters.
61.PP
62\fB--show column\fP show only the specified built-in columns. May be invoked multiple times, or with a comma-separated list of column names. Use "--show sysfs" to show the sysfs statistics columns as a group.
Len Brown812db3f2017-02-10 00:25:41 -050063.PP
Len Brownd8af6f52015-02-10 01:56:38 -050064\fB--Dump\fP displays the raw counter values.
Len Browne23da032012-02-06 18:37:16 -050065.PP
Len Brown96e47152017-01-21 02:26:00 -050066\fB--quiet\fP Do not decode and print the system configuration header information.
Len Brown103a8fe2010-10-22 23:53:03 -040067.PP
Len Brown2a0609c2016-02-12 22:44:48 -050068\fB--interval seconds\fP overrides the default 5.0 second measurement interval.
Len Brownf9240812012-10-06 15:26:31 -040069.PP
Len Brownb7d8c142016-02-13 23:36:17 -050070\fB--out output_file\fP turbostat output is written to the specified output_file.
71The file is truncated if it already exists, and it is created if it does not exist.
72.PP
Len Brownd8af6f52015-02-10 01:56:38 -050073\fB--help\fP displays usage for the most common parameters.
Len Brown8e180f32012-09-22 01:25:08 -040074.PP
Len Brownd8af6f52015-02-10 01:56:38 -050075\fB--Joules\fP displays energy in Joules, rather than dividing Joules by time to print power in Watts.
Len Brown8e180f32012-09-22 01:25:08 -040076.PP
Len Brownda67e2b2017-02-15 00:30:22 -050077\fB--list\fP display column header names available for use by --show and --hide, then exit.
78.PP
Len Brownd8af6f52015-02-10 01:56:38 -050079\fB--Summary\fP limits output to a 1-line System Summary for each interval.
80.PP
81\fB--TCC temperature\fP sets the Thermal Control Circuit temperature for systems which do not export that value. This is used for making sense of the Digital Thermal Sensor outputs, as they return degrees Celsius below the TCC activation temperature.
82.PP
83\fB--version\fP displays the version.
84.PP
85The \fBcommand\fP parameter forks \fBcommand\fP, and upon its exit,
Len Brown103a8fe2010-10-22 23:53:03 -040086displays the statistics gathered since it was forked.
87.PP
Len Brownda67e2b2017-02-15 00:30:22 -050088.SH ROW DESCRIPTIONS
89The system configuration dump (if --quiet is not used) is followed by statistics. The first row of the statistics labels the content of each column (below). The second row of statistics is the system summary line. The system summary line has a '-' in the columns for the Package, Core, and CPU. The contents of the system summary line depends on the type of column. Columns that count items (eg. IRQ) show the sum across all CPUs in the system. Columns that show a percentage show the average across all CPUs in the system. Columns that dump raw MSR values simply show 0 in the summary. After the system summary row, each row describes a specific Package/Core/CPU. Note that if the --cpu parameter is used to limit which specific CPUs are displayed, turbostat will still collect statistics for all CPUs in the system and will still show the system summary for all CPUs in the system.
90.SH COLUMN DESCRIPTIONS
Len Brown103a8fe2010-10-22 23:53:03 -040091.nf
Len Brown3f44a5c2017-10-17 15:42:56 -040092\fBusec\fP For each CPU, the number of microseconds elapsed during counter collection, including thread migration -- if any. This counter is disabled by default, and is enabled with "--enable usec", or --debug. On the summary row, usec refers to the total elapsed time to collect the counters on all cpus.
93\fBTime_Of_Day_Seconds\fP For each CPU, the gettimeofday(2) value (seconds.subsec since Epoch) when the counters ending the measurement interval were collected. This column is disabled by default, and can be enabled with "--enable Time_Of_Day_Seconds" or "--debug". On the summary row, Time_Of_Day_Seconds refers to the timestamp following collection of counters on the last CPU.
Len Brownda67e2b2017-02-15 00:30:22 -050094\fBCore\fP processor core number. Note that multiple CPUs per core indicate support for Intel(R) Hyper-Threading Technology (HT).
Len Brown1cc21f72015-02-23 00:34:57 -050095\fBCPU\fP Linux CPU (logical processor) number. Yes, it is okay that on many systems the CPUs are not listed in numerical order -- for efficiency reasons, turbostat runs in topology order, so HT siblings appear together.
Len Brownda67e2b2017-02-15 00:30:22 -050096\fBPackage\fP processor package number -- not present on systems with a single processor package.
97\fBAvg_MHz\fP number of cycles executed divided by time elapsed. Note that this includes idle-time when 0 instructions are executed.
98\fBBusy%\fP percent of the measurement interval that the CPU executes instructions, aka. % of time in "C0" state.
99\fBBzy_MHz\fP average clock rate while the CPU was not idle (ie. in "c0" state).
Len Brownfc04cc62014-02-06 00:55:19 -0500100\fBTSC_MHz\fP average MHz that the TSC ran during the entire interval.
Len Brownda67e2b2017-02-15 00:30:22 -0500101\fBIRQ\fP The number of interrupts serviced by that CPU during the measurement interval. The system total line is the sum of interrupts serviced across all CPUs. turbostat parses /proc/interrupts to generate this summary.
102\fBSMI\fP The number of System Management Interrupts serviced CPU during the measurement interval. While this counter is actually per-CPU, SMI are triggered on all processors, so the number should be the same for all CPUs.
103\fBC1, C2, C3...\fP The number times Linux requested the C1, C2, C3 idle state during the measurement interval. The system summary line shows the sum for all CPUs. These are C-state names as exported in /sys/devices/system/cpu/cpu*/cpuidle/state*/name. While their names are generic, their attributes are processor specific. They the system description section of output shows what MWAIT sub-states they are mapped to on each system.
104\fBC1%, C2%, C3%\fP The residency percentage that Linux requested C1, C2, C3.... The system summary is the average of all CPUs in the system. Note that these are software, reflecting what was requested. The hardware counters reflect what was actually achieved.
105\fBCPU%c1, CPU%c3, CPU%c6, CPU%c7\fP show the percentage residency in hardware core idle states. These numbers are from hardware residency counters.
Len Brownfc04cc62014-02-06 00:55:19 -0500106\fBCoreTmp\fP Degrees Celsius reported by the per-core Digital Thermal Sensor.
107\fBPkgTtmp\fP Degrees Celsius reported by the per-package Package Thermal Monitor.
Doug Smythiesab23d112017-03-04 14:48:49 -0800108\fBGFX%rc6\fP The percentage of time the GPU is in the "render C6" state, rc6, during the measurement interval. From /sys/class/drm/card0/power/rc6_residency_ms.
109\fBGFXMHz\fP Instantaneous snapshot of what sysfs presents at the end of the measurement interval. From /sys/class/graphics/fb0/device/drm/card0/gt_cur_freq_mhz.
Len Brownda67e2b2017-02-15 00:30:22 -0500110\fBPkg%pc2, Pkg%pc3, Pkg%pc6, Pkg%pc7\fP percentage residency in hardware package idle states. These numbers are from hardware residency counters.
Len Brownfc04cc62014-02-06 00:55:19 -0500111\fBPkgWatt\fP Watts consumed by the whole package.
112\fBCorWatt\fP Watts consumed by the core part of the package.
113\fBGFXWatt\fP Watts consumed by the Graphics part of the package -- available only on client processors.
114\fBRAMWatt\fP Watts consumed by the DRAM DIMMS -- available only on server processors.
Len Brown889facb2012-11-08 00:48:57 -0500115\fBPKG_%\fP percent of the interval that RAPL throttling was active on the Package.
116\fBRAM_%\fP percent of the interval that RAPL throttling was active on DRAM.
Len Brown103a8fe2010-10-22 23:53:03 -0400117.fi
Len Brownda67e2b2017-02-15 00:30:22 -0500118.SH TOO MUCH INFORMATION EXAMPLE
119By default, turbostat dumps all possible information -- a system configuration header, followed by columns for all counters.
120This is ideal for remote debugging, use the "--out" option to save everything to a text file, and get that file to the expert helping you debug.
Len Brown103a8fe2010-10-22 23:53:03 -0400121.PP
Len Brownda67e2b2017-02-15 00:30:22 -0500122When you are not interested in all that information, and there are several ways to see only what you want. First the "--quiet" option will skip the configuration information, and turbostat will show only the counter columns. Second, you can reduce the columns with the "--hide" and "--show" options. If you use the "--show" option, then turbostat will show only the columns you list. If you use the "--hide" option, turbostat will show all columns, except the ones you list.
123.PP
Len Browndd778a52017-02-21 23:21:13 -0500124To find out what columns are available for --show and --hide, the "--list" option is available. For convenience, the special strings "sysfs" can be used to refer to all of the sysfs C-state counters at once:
Len Brown1cc21f72015-02-23 00:34:57 -0500125.nf
Len Brownda67e2b2017-02-15 00:30:22 -0500126sudo ./turbostat --show sysfs --quiet sleep 10
12710.003837 sec
128 C1 C1E C3 C6 C7s C1% C1E% C3% C6% C7s%
129 4 21 2 2 459 0.14 0.82 0.00 0.00 98.93
130 1 17 2 2 130 0.00 0.02 0.00 0.00 99.80
131 0 0 0 0 31 0.00 0.00 0.00 0.00 99.95
132 2 1 0 0 52 1.14 6.49 0.00 0.00 92.21
133 1 2 0 0 52 0.00 0.08 0.00 0.00 99.86
134 0 0 0 0 71 0.00 0.00 0.00 0.00 99.89
135 0 0 0 0 25 0.00 0.00 0.00 0.00 99.96
136 0 0 0 0 74 0.00 0.00 0.00 0.00 99.94
137 0 1 0 0 24 0.00 0.00 0.00 0.00 99.84
Len Brown1cc21f72015-02-23 00:34:57 -0500138.fi
Len Brownda67e2b2017-02-15 00:30:22 -0500139.PP
140.SH ONE SHOT COMMAND EXAMPLE
141If turbostat is invoked with a command, it will fork that command
142and output the statistics gathered after the command exits.
143In this case, turbostat output goes to stderr, by default.
144Output can instead be saved to a file using the --out option.
145In this example, the "sleep 10" command is forked, and turbostat waits for it to complete before saving all statistics into "ts.out". Note that "sleep 10" is not part of turbostat, but is simply an example of a command that turbostat can fork. The "ts.out" file is what you want to edit in a very wide window, paste into a spreadsheet, or attach to a bugzilla entry.
Len Brown103a8fe2010-10-22 23:53:03 -0400146
Len Brown103a8fe2010-10-22 23:53:03 -0400147.nf
Len Brownda67e2b2017-02-15 00:30:22 -0500148[root@hsw]# ./turbostat -o ts.out sleep 10
149[root@hsw]#
150.fi
151
152.SH PERIODIC INTERVAL EXAMPLE
153Without a command to fork, turbostat displays statistics ever 5 seconds.
154Periodic output goes to stdout, by default, unless --out is used to specify an output file.
155The 5-second interval can be changed with the "-i sec" option.
156.nf
157sudo ./turbostat --quiet --hide sysfs,IRQ,SMI,CoreTmp,PkgTmp,GFX%rc6,GFXMHz,PkgWatt,CorWatt,GFXWatt
158 Core CPU Avg_MHz Busy% Bzy_MHz TSC_MHz CPU%c1 CPU%c3 CPU%c6 CPU%c7
159 - - 488 12.52 3900 3498 12.50 0.00 0.00 74.98
160 0 0 5 0.13 3900 3498 99.87 0.00 0.00 0.00
161 0 4 3897 99.99 3900 3498 0.01
162 1 1 0 0.00 3856 3498 0.01 0.00 0.00 99.98
163 1 5 0 0.00 3861 3498 0.01
164 2 2 1 0.02 3889 3498 0.03 0.00 0.00 99.95
165 2 6 0 0.00 3863 3498 0.05
166 3 3 0 0.01 3869 3498 0.02 0.00 0.00 99.97
167 3 7 0 0.00 3878 3498 0.03
168 Core CPU Avg_MHz Busy% Bzy_MHz TSC_MHz CPU%c1 CPU%c3 CPU%c6 CPU%c7
169 - - 491 12.59 3900 3498 12.42 0.00 0.00 74.99
170 0 0 27 0.69 3900 3498 99.31 0.00 0.00 0.00
171 0 4 3898 99.99 3900 3498 0.01
172 1 1 0 0.00 3883 3498 0.01 0.00 0.00 99.99
173 1 5 0 0.00 3898 3498 0.01
174 2 2 0 0.01 3889 3498 0.02 0.00 0.00 99.98
175 2 6 0 0.00 3889 3498 0.02
176 3 3 0 0.00 3856 3498 0.01 0.00 0.00 99.99
177 3 7 0 0.00 3897 3498 0.01
178.fi
179This example also shows the use of the --hide option to skip columns that are not wanted.
180Note that cpu4 in this example is 99.99% busy, while the other CPUs are all under 1% busy.
181Notice that cpu4's HT sibling is cpu0, which is under 1% busy, but can get into CPU%c1 only,
182because its cpu4's activity on shared hardware keeps it from entering a deeper C-state.
183
184.SH SYSTEM CONFIGURATION INFORMATION EXAMPLE
185
186By default, turbostat always dumps system configuration information
187before taking measurements. In the example above, "--quiet" is used
188to suppress that output. Here is an example of the configuration information:
189.nf
190turbostat version 2017.02.15 - Len Brown <lenb@kernel.org>
Len Brown1cc21f72015-02-23 00:34:57 -0500191CPUID(0): GenuineIntel 13 CPUID levels; family:model:stepping 0x6:3c:3 (6:60:3)
Len Brownda67e2b2017-02-15 00:30:22 -0500192CPUID(1): SSE3 MONITOR - EIST TM2 TSC MSR ACPI-TM TM
193CPUID(6): APERF, TURBO, DTS, PTM, No-HWP, No-HWPnotify, No-HWPwindow, No-HWPepp, No-HWPpkg, EPB
194cpu4: MSR_IA32_MISC_ENABLE: 0x00850089 (TCC EIST No-MWAIT PREFETCH TURBO)
195CPUID(7): No-SGX
196cpu4: MSR_MISC_PWR_MGMT: 0x00400000 (ENable-EIST_Coordination DISable-EPB DISable-OOB)
Len Brown1cc21f72015-02-23 00:34:57 -0500197RAPL: 3121 sec. Joule Counter Range, at 84 Watts
Len Brownda67e2b2017-02-15 00:30:22 -0500198cpu4: MSR_PLATFORM_INFO: 0x80838f3012300
1998 * 100.0 = 800.0 MHz max efficiency frequency
20035 * 100.0 = 3500.0 MHz base frequency
201cpu4: MSR_IA32_POWER_CTL: 0x0004005d (C1E auto-promotion: DISabled)
202cpu4: MSR_TURBO_RATIO_LIMIT: 0x25262727
20337 * 100.0 = 3700.0 MHz max turbo 4 active cores
20438 * 100.0 = 3800.0 MHz max turbo 3 active cores
20539 * 100.0 = 3900.0 MHz max turbo 2 active cores
20639 * 100.0 = 3900.0 MHz max turbo 1 active cores
207cpu4: MSR_CONFIG_TDP_NOMINAL: 0x00000023 (base_ratio=35)
208cpu4: MSR_CONFIG_TDP_LEVEL_1: 0x00000000 ()
209cpu4: MSR_CONFIG_TDP_LEVEL_2: 0x00000000 ()
210cpu4: MSR_CONFIG_TDP_CONTROL: 0x80000000 ( lock=1)
211cpu4: MSR_TURBO_ACTIVATION_RATIO: 0x00000000 (MAX_NON_TURBO_RATIO=0 lock=0)
212cpu4: MSR_PKG_CST_CONFIG_CONTROL: 0x1e000400 (UNdemote-C3, UNdemote-C1, demote-C3, demote-C1, UNlocked: pkg-cstate-limit=0: pc0)
213cpu4: POLL: CPUIDLE CORE POLL IDLE
214cpu4: C1: MWAIT 0x00
215cpu4: C1E: MWAIT 0x01
216cpu4: C3: MWAIT 0x10
217cpu4: C6: MWAIT 0x20
218cpu4: C7s: MWAIT 0x32
219cpu4: MSR_MISC_FEATURE_CONTROL: 0x00000000 (L2-Prefetch L2-Prefetch-pair L1-Prefetch L1-IP-Prefetch)
Len Brown889facb2012-11-08 00:48:57 -0500220cpu0: MSR_IA32_ENERGY_PERF_BIAS: 0x00000006 (balanced)
Len Brownda67e2b2017-02-15 00:30:22 -0500221cpu0: MSR_CORE_PERF_LIMIT_REASONS, 0x31200000 (Active: ) (Logged: Transitions, MultiCoreTurbo, Amps, Auto-HWP, )
Len Brown1cc21f72015-02-23 00:34:57 -0500222cpu0: MSR_GFX_PERF_LIMIT_REASONS, 0x00000000 (Active: ) (Logged: )
223cpu0: MSR_RING_PERF_LIMIT_REASONS, 0x0d000000 (Active: ) (Logged: Amps, PkgPwrL1, PkgPwrL2, )
224cpu0: MSR_RAPL_POWER_UNIT: 0x000a0e03 (0.125000 Watts, 0.000061 Joules, 0.000977 sec.)
225cpu0: MSR_PKG_POWER_INFO: 0x000002a0 (84 W TDP, RAPL 0 - 0 W, 0.000000 sec.)
226cpu0: MSR_PKG_POWER_LIMIT: 0x428348001a82a0 (UNlocked)
227cpu0: PKG Limit #1: ENabled (84.000000 Watts, 8.000000 sec, clamp DISabled)
228cpu0: PKG Limit #2: ENabled (105.000000 Watts, 0.002441* sec, clamp DISabled)
Len Brown889facb2012-11-08 00:48:57 -0500229cpu0: MSR_PP0_POLICY: 0
230cpu0: MSR_PP0_POWER_LIMIT: 0x00000000 (UNlocked)
231cpu0: Cores Limit: DISabled (0.000000 Watts, 0.000977 sec, clamp DISabled)
232cpu0: MSR_PP1_POLICY: 0
233cpu0: MSR_PP1_POWER_LIMIT: 0x00000000 (UNlocked)
234cpu0: GFX Limit: DISabled (0.000000 Watts, 0.000977 sec, clamp DISabled)
Len Brown1cc21f72015-02-23 00:34:57 -0500235cpu0: MSR_IA32_TEMPERATURE_TARGET: 0x00641400 (100 C)
Len Brownda67e2b2017-02-15 00:30:22 -0500236cpu0: MSR_IA32_PACKAGE_THERM_STATUS: 0x884c0800 (24 C)
237cpu0: MSR_IA32_THERM_STATUS: 0x884c0000 (24 C +/- 1)
238cpu1: MSR_IA32_THERM_STATUS: 0x88510000 (19 C +/- 1)
239cpu2: MSR_IA32_THERM_STATUS: 0x884e0000 (22 C +/- 1)
240cpu3: MSR_IA32_THERM_STATUS: 0x88510000 (19 C +/- 1)
241cpu4: MSR_PKGC3_IRTL: 0x00008842 (valid, 67584 ns)
242cpu4: MSR_PKGC6_IRTL: 0x00008873 (valid, 117760 ns)
243cpu4: MSR_PKGC7_IRTL: 0x00008891 (valid, 148480 ns)
Len Brown103a8fe2010-10-22 23:53:03 -0400244.fi
245The \fBmax efficiency\fP frequency, a.k.a. Low Frequency Mode, is the frequency
Len Browna7296172015-01-23 01:33:58 -0500246available at the minimum package voltage. The \fBTSC frequency\fP is the base
247frequency of the processor -- this should match the brand string
248in /proc/cpuinfo. This base frequency
Len Brown103a8fe2010-10-22 23:53:03 -0400249should be sustainable on all CPUs indefinitely, given nominal power and cooling.
250The remaining rows show what maximum turbo frequency is possible
Len Browna7296172015-01-23 01:33:58 -0500251depending on the number of idle cores. Note that not all information is
252available on all processors.
Len Brownda67e2b2017-02-15 00:30:22 -0500253.SH ADD COUNTER EXAMPLE
254Here we limit turbostat to showing just the CPU number for cpu0 - cpu3.
255We add a counter showing the 32-bit raw value of MSR 0x199 (MSR_IA32_PERF_CTL),
256labeling it with the column header, "PRF_CTRL", and display it only once,
257afte the conclusion of a 0.1 second sleep.
Len Brown103a8fe2010-10-22 23:53:03 -0400258.nf
Len Brownda67e2b2017-02-15 00:30:22 -0500259sudo ./turbostat --quiet --cpu 0-3 --show CPU --add msr0x199,u32,raw,PRF_CTRL sleep .1
2600.101604 sec
261CPU PRF_CTRL
262- 0x00000000
2630 0x00000c00
2641 0x00000800
2652 0x00000a00
2663 0x00000800
Len Brownfc04cc62014-02-06 00:55:19 -0500267
Len Brown103a8fe2010-10-22 23:53:03 -0400268.fi
Len Brownfc04cc62014-02-06 00:55:19 -0500269
Len Brown8aa2ed02017-07-15 14:57:37 -0400270.SH SIGNALS
271
272SIGINT will interrupt interval-mode.
273The end-of-interval data will be collected and displayed before turbostat exits.
Len Brown103a8fe2010-10-22 23:53:03 -0400274.SH NOTES
275
276.B "turbostat "
277must be run as root.
Len Browna7296172015-01-23 01:33:58 -0500278Alternatively, non-root users can be enabled to run turbostat this way:
279
280# setcap cap_sys_rawio=ep ./turbostat
281
282# chmod +r /dev/cpu/*/msr
Len Brown103a8fe2010-10-22 23:53:03 -0400283
284.B "turbostat "
285reads hardware counters, but doesn't write them.
286So it will not interfere with the OS or other programs, including
287multiple invocations of itself.
288
289\fBturbostat \fP
290may work poorly on Linux-2.6.20 through 2.6.29,
Len Browna7296172015-01-23 01:33:58 -0500291as \fBacpi-cpufreq \fPperiodically cleared the APERF and MPERF MSRs
Len Brown103a8fe2010-10-22 23:53:03 -0400292in those kernels.
293
Len Browna7296172015-01-23 01:33:58 -0500294AVG_MHz = APERF_delta/measurement_interval. This is the actual
295number of elapsed cycles divided by the entire sample interval --
Len Brownd8af6f52015-02-10 01:56:38 -0500296including idle time. Note that this calculation is resilient
Len Browna7296172015-01-23 01:33:58 -0500297to systems lacking a non-stop TSC.
298
299TSC_MHz = TSC_delta/measurement_interval.
300On a system with an invariant TSC, this value will be constant
301and will closely match the base frequency value shown
302in the brand string in /proc/cpuinfo. On a system where
303the TSC stops in idle, TSC_MHz will drop
304below the processor's base frequency.
305
Len Brown75d2e442016-02-13 23:41:53 -0500306Busy% = MPERF_delta/TSC_delta
Len Browna7296172015-01-23 01:33:58 -0500307
308Bzy_MHz = TSC_delta/APERF_delta/MPERF_delta/measurement_interval
309
310Note that these calculations depend on TSC_delta, so they
311are not reliable during intervals when TSC_MHz is not running at the base frequency.
312
313Turbostat data collection is not atomic.
314Extremely short measurement intervals (much less than 1 second),
315or system activity that prevents turbostat from being able
316to run on all CPUS to quickly collect data, will result in
317inconsistent results.
Len Brown2f32edf2012-09-21 23:45:46 -0400318
Len Brown103a8fe2010-10-22 23:53:03 -0400319The APERF, MPERF MSRs are defined to count non-halted cycles.
320Although it is not guaranteed by the architecture, turbostat assumes
321that they count at TSC rate, which is true on all processors tested to date.
322
323.SH REFERENCES
Len Brown103a8fe2010-10-22 23:53:03 -0400324Volume 3B: System Programming Guide"
325http://www.intel.com/products/processor/manuals/
326
327.SH FILES
328.ta
329.nf
330/dev/cpu/*/msr
331.fi
332
333.SH "SEE ALSO"
334msr(4), vmstat(8)
335.PP
Len Browne23da032012-02-06 18:37:16 -0500336.SH AUTHOR
Len Brown103a8fe2010-10-22 23:53:03 -0400337.nf
338Written by Len Brown <len.brown@intel.com>