Linux 6.16-rc6
[linux-2.6-block.git] / tools / power / x86 / turbostat / turbostat.8
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 [ "\--interval seconds" ]
13 .SH DESCRIPTION
14 \fBturbostat \fP reports processor topology, frequency,
15 idle power-state statistics, temperature and power on X86 processors.
16 There are two ways to invoke turbostat.
17 The first method is to supply a
18 \fBcommand\fP, which is forked and statistics are printed
19 in one-shot upon its completion.
20 The second method is to omit the command,
21 and turbostat displays statistics every 5 seconds interval.
22 The 5-second interval can be changed using the --interval option.
23 .PP
24 Some information is not available on older processors.
25 .SS Options
26 Options can be specified with a single or double '-', and only as much of the option
27 name as necessary to disambiguate it from others is necessary.  Note that options are case-sensitive.
28 .PP
29 \fB--add attributes\fP add column with counter having specified 'attributes'.  The 'location' attribute is required, all others are optional.
30 .nf
31         location: {\fBmsrDDD\fP | \fBmsr0xXXX\fP | \fB/sys/path...\fP | \fBperf/<device>/<event>\fP}
32                 msrDDD is a decimal offset, eg. msr16
33                 msr0xXXX is a hex offset, eg. msr0x10
34                 /sys/path... is an absolute path to a sysfs attribute
35                 <device> is a perf device from /sys/bus/event_source/devices/<device> eg. cstate_core
36                         On Intel hybrid platforms, instead of one "cpu" perf device there are two, "cpu_core" and "cpu_atom" devices for P and E cores respectively.
37                         Turbostat, in this case, allow user to use "cpu" device and will automatically detect the type of a CPU and translate it to "cpu_core" and "cpu_atom" accordingly.
38                         For a complete example see "ADD PERF COUNTER EXAMPLE #2 (using virtual "cpu" device)".
39                 <event> is a perf event for given device from /sys/bus/event_source/devices/<device>/events/<event> eg. c1-residency
40                         perf/cstate_core/c1-residency would then use /sys/bus/event_source/devices/cstate_core/events/c1-residency
41
42         scope: {\fBcpu\fP | \fBcore\fP | \fBpackage\fP}
43                 sample and print the counter for every cpu, core, or package.
44                 default: cpu
45
46         size: {\fBu32\fP | \fBu64\fP }
47                 MSRs are read as 64-bits, u32 truncates the displayed value to 32-bits.
48                 default: u64
49
50         format: {\fBraw\fP | \fBdelta\fP | \fBpercent\fP}
51                 'raw' shows the MSR contents in hex.
52                 'delta' shows the difference in values during the measurement interval.
53                 'percent' shows the delta as a percentage of the cycles elapsed.
54                 default: delta
55
56         name: "name_string"
57                 Any string that does not match a key-word above is used
58                 as the column header.
59 .fi
60 .PP
61 \fB--add pmt,[attr_name=attr_value, ...]\fP add column with a PMT (Intel Platform Monitoring Technology) counter in a similar way to --add option above, but require PMT metadata to be supplied to correctly read and display the counter. The metadata can be found in the Intel PMT XML files, hosted at https://github.com/intel/Intel-PMT. For a complete example see "ADD PMT COUNTER EXAMPLE".
62 .nf
63         name="name_string"
64                 For column header.
65
66         type={\fBraw\fP}
67                 'raw' shows the counter contents in hex.
68                 default: raw
69
70         format={\fBraw\fP | \fBdelta\fP}
71                 'raw' shows the counter contents in hex.
72                 'delta' shows the difference in values during the measurement interval.
73                 default: raw
74
75         domain={\fBcpu%u\fP | \fBcore%u\fP | \fBpackage%u\fP}
76                 'cpu' per cpu/thread counter.
77                 'core' per core counter.
78                 'package' per package counter.
79                 '%u' denotes id of the domain that the counter is associated with. For example core4 would mean that the counter is associated with core number 4.
80
81         offset=\fB%u\fP
82                 '%u' offset within the PMT MMIO region.
83
84         lsb=\fB%u\fP
85                 '%u' least significant bit within the 64 bit value read from 'offset'. Together with 'msb', used to form a read mask.
86
87         msb=\fB%u\fP
88                 '%u' most significant bit within the 64 bit value read from 'offset'. Together with 'lsb', used to form a read mask.
89
90         guid=\fB%x\fP
91                 '%x' hex identifier of the PMT MMIO region.
92 .fi
93 .PP
94 \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
95 .PP
96 \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.
97 .PP
98 \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", "Time_Of_Day_Seconds", "APIC" and "X2APIC".
99 The column name "all" can be used to enable all disabled-by-default built-in counters.
100 .PP
101 \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.
102 .PP
103 \fB--show CATEGORY --hide CATEGORY\fP  Show and hide also accept a single CATEGORY of columns: "all", "topology", "idle", "frequency", "power", "cpuidle", "hwidle", "swidle", "other".  "idle" (enabled by default), includes "hwidle" and "pct_idle".  "cpuidle" (default disabled) includes cpuidle software invocation counters.  "swidle" includes "cpuidle" plus "pct_idle".  "hwidle" includes only hardware based idle residency counters.  Older versions of turbostat used the term "sysfs" for what is now "swidle".
104 .PP
105 \fB--Dump\fP displays the raw counter values.
106 .PP
107 \fB--quiet\fP Do not decode and print the system configuration header information.
108 .PP
109 \fB--no-msr\fP Disable all the uses of the MSR driver.
110 .PP
111 \fB--no-perf\fP Disable all the uses of the perf API.
112 .PP
113 \fB--interval seconds\fP overrides the default 5.0 second measurement interval.
114 .PP
115 \fB--num_iterations num\fP number of the measurement iterations.
116 .PP
117 \fB--out output_file\fP turbostat output is written to the specified output_file.
118 The file is truncated if it already exists, and it is created if it does not exist.
119 .PP
120 \fB--help\fP displays usage for the most common parameters.
121 .PP
122 \fB--Joules\fP displays energy in Joules, rather than dividing Joules by time to print power in Watts.
123 .PP
124 \fB--list\fP display column header names available for use by --show and --hide, then exit.
125 .PP
126 \fB--Summary\fP limits output to a 1-line System Summary for each interval.
127 .PP
128 \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.
129 .PP
130 \fB--version\fP displays the version.
131 .PP
132 The \fBcommand\fP parameter forks \fBcommand\fP, and upon its exit,
133 displays the statistics gathered since it was forked.
134 .PP
135 .SH ROW DESCRIPTIONS
136 The 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.
137 .SH COLUMN DESCRIPTIONS
138 .PP
139 \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 snapshot the procfs/sysfs and collect the counters on all cpus.
140 .PP
141 \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.
142 .PP
143 \fBCore\fP processor core number.  Note that multiple CPUs per core indicate support for Intel(R) Hyper-Threading Technology (HT).
144 .PP
145 \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.
146 .PP
147 \fBPackage\fP processor package number -- not present on systems with a single processor package.
148 .PP
149 \fBAvg_MHz\fP number of cycles executed divided by time elapsed.  Note that this includes idle-time when 0 instructions are executed.
150 .PP
151 \fBBusy%\fP percent of the measurement interval that the CPU executes instructions, aka. % of time in "C0" state.
152 .PP
153 \fBBzy_MHz\fP average clock rate while the CPU was not idle (ie. in "c0" state).
154 .PP
155 \fBTSC_MHz\fP average MHz that the TSC ran during the entire interval.
156 .PP
157 \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.
158 .PP
159 \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.
160 .PP
161 \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.  These counters are in the "cpuidle" group, which is disabled, by default.
162 .PP
163 \fBC1+, C2+, C3+...\fP The idle governor idle state misprediction statistics. Inidcates the number times Linux requested the C1, C2, C3 idle state during the measurement interval, but should have requested a deeper idle state (if it exists and enabled). These statistics come from the /sys/devices/system/cpu/cpu*/cpuidle/state*/below file.  These counters are in the "cpuidle" group, which is disabled, by default.
164 .PP
165 \fBC1-, C2-, C3-...\fP The idle governor idle state misprediction statistics. Inidcates the number times Linux requested the C1, C2, C3 idle state during the measurement interval, but should have requested a shallower idle state (if it exists and enabled). These statistics come from the /sys/devices/system/cpu/cpu*/cpuidle/state*/above file.  These counters are in the "cpuidle" group, which is disabled, by default.
166 .PP
167 \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.  These counters are in the "pct_idle" group, which is enabled by default.
168 .PP
169 \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 and are in the "hwidle" group, which is enabled, by default.
170 .PP
171 \fBCoreTmp\fP Degrees Celsius reported by the per-core Digital Thermal Sensor.
172 .PP
173 \fBPkgTmp\fP Degrees Celsius reported by the per-package Package Thermal Monitor.
174 .PP
175 \fBCoreThr\fP Core Thermal Throttling events during the measurement interval.  Note that events since boot can be find in /sys/devices/system/cpu/cpu*/thermal_throttle/*
176 .PP
177 \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 or /sys/class/drm/card0/gt/gt0/rc6_residency_ms or /sys/class/drm/card0/device/tile0/gtN/gtidle/idle_residency_ms depending on the graphics driver being used.
178 .PP
179 \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 or /sys/class/drm/card0/gt_cur_freq_mhz or /sys/class/drm/card0/gt/gt0/rps_cur_freq_mhz or /sys/class/drm/card0/device/tile0/gtN/freq0/cur_freq depending on the graphics driver being used.
180 .PP
181 \fBGFXAMHz\fP Instantaneous snapshot of what sysfs presents at the end of the measurement interval. From /sys/class/graphics/fb0/device/drm/card0/gt_act_freq_mhz or /sys/class/drm/card0/gt_act_freq_mhz or /sys/class/drm/card0/gt/gt0/rps_act_freq_mhz or /sys/class/drm/card0/device/tile0/gtN/freq0/act_freq depending on the graphics driver being used.
182 .PP
183 \fBSAM%mc6\fP The percentage of time the SA Media is in the "module C6" state, mc6, during the measurement interval. From /sys/class/drm/card0/gt/gt1/rc6_residency_ms or /sys/class/drm/card0/device/tile0/gtN/gtidle/idle_residency_ms depending on the graphics driver being used.
184 .PP
185 \fBSAMMHz\fP Instantaneous snapshot of what sysfs presents at the end of the measurement interval. From /sys/class/drm/card0/gt/gt1/rps_cur_freq_mhz or /sys/class/drm/card0/device/tile0/gtN/freq0/cur_freq depending on the graphics driver being used.
186 .PP
187 \fBSAMAMHz\fP Instantaneous snapshot of what sysfs presents at the end of the measurement interval. From /sys/class/drm/card0/gt/gt1/rps_act_freq_mhz or /sys/class/drm/card0/device/tile0/gtN/freq0/act_freq depending on the graphics driver being used.
188 .PP
189 \fBPkg%pc2, Pkg%pc3, Pkg%pc6, Pkg%pc7\fP percentage residency in hardware package idle states.  These numbers are from hardware residency counters.
190 .PP
191 \fBPkgWatt\fP Watts consumed by the whole package.
192 .PP
193 \fBCorWatt\fP Watts consumed by the core part of the package.
194 .PP
195 \fBGFXWatt\fP Watts consumed by the Graphics part of the package -- available only on client processors.
196 .PP
197 \fBRAMWatt\fP Watts consumed by the DRAM DIMMS -- available only on server processors.
198 .PP
199 \fBSysWatt\fP Watts consumed by the whole platform (RAPL PSYS).
200 .PP
201 \fBPKG_%\fP percent of the interval that RAPL throttling was active on the Package.  Note that the system summary is the sum of the package throttling time, and thus may be higher than 100% on a multi-package system.  Note that the meaning of this field is model specific.  For example, some hardware increments this counter when RAPL responds to thermal limits, but does not increment this counter when RAPL responds to power limits.  Comparing PkgWatt and PkgTmp to system limits is necessary.
202 .PP
203 \fBRAM_%\fP percent of the interval that RAPL throttling was active on DRAM.
204 .PP
205 \fBUncMHz\fP per-package uncore MHz, instantaneous sample.
206 .PP
207 \fBUMHz1.0\fP per-package uncore MHz for pm_domain=1 and fabric_cluster=0, instantaneous sample.  System summary is the average of all packages.
208 Intel Granite Rapids systems use pm_domains 0-2 for CPUs, and 3-4 for IO, with cluster always 0.
209 For the "--show" and "--hide" options, use "UncMHz" to operate on all UMHz*.* as a group.
210 .SH TOO MUCH INFORMATION EXAMPLE
211 By default, turbostat dumps all possible information -- a system configuration header, followed by columns for all counters.
212 This 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.
213 .PP
214 When 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.
215 .PP
216 To find out what columns are available for --show and --hide, the "--list" option is available.  Usually, the CATEGORY names above are used to refer to groups of counters.  Also, for convenience, the special string "sysfs" can be used to refer to all of the sysfs C-state counters at once:
217 .PP
218 .nf
219 sudo ./turbostat --show sysfs --quiet sleep 10
220 10.003837 sec
221         C1      C1E     C3      C6      C7s     C1%     C1E%    C3%     C6%     C7s%
222         4       21      2       2       459     0.14    0.82    0.00    0.00    98.93
223         1       17      2       2       130     0.00    0.02    0.00    0.00    99.80
224         0       0       0       0       31      0.00    0.00    0.00    0.00    99.95
225         2       1       0       0       52      1.14    6.49    0.00    0.00    92.21
226         1       2       0       0       52      0.00    0.08    0.00    0.00    99.86
227         0       0       0       0       71      0.00    0.00    0.00    0.00    99.89
228         0       0       0       0       25      0.00    0.00    0.00    0.00    99.96
229         0       0       0       0       74      0.00    0.00    0.00    0.00    99.94
230         0       1       0       0       24      0.00    0.00    0.00    0.00    99.84
231 .fi
232 .PP
233 .SH ONE SHOT COMMAND EXAMPLE
234 If turbostat is invoked with a command, it will fork that command
235 and output the statistics gathered after the command exits.
236 In this case, turbostat output goes to stderr, by default.
237 Output can instead be saved to a file using the --out option.
238 In 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.
239
240 .nf
241 [root@hsw]# ./turbostat -o ts.out sleep 10
242 [root@hsw]#
243 .fi
244
245 .SH PERIODIC INTERVAL EXAMPLE
246 Without a command to fork, turbostat displays statistics ever 5 seconds.
247 Periodic output goes to stdout, by default, unless --out is used to specify an output file.
248 The 5-second interval can be changed with the "-i sec" option.
249 .nf
250 sudo turbostat --quiet --show CPU,frequency
251         Core    CPU     Avg_MHz Busy%   Bzy_MHz TSC_MHz CPU%c7  UncMhz
252         -       -       524     12.48   4198    3096    74.53   3800
253         0       0       4       0.09    4081    3096    98.88   3800
254         0       4       1       0.02    4063    3096
255         1       1       2       0.06    4063    3096    99.60
256         1       5       2       0.05    4070    3096
257         2       2       4178    99.52   4199    3096    0.00
258         2       6       3       0.08    4159    3096
259         3       3       1       0.04    4046    3096    99.66
260         3       7       0       0.01    3989    3096
261         Core    CPU     Avg_MHz Busy%   Bzy_MHz TSC_MHz CPU%c7  UncMhz
262         -       -       525     12.52   4198    3096    74.54   3800
263         0       0       4       0.10    4051    3096    99.49   3800
264         0       4       2       0.04    3993    3096
265         1       1       3       0.07    4054    3096    99.56
266         1       5       4       0.10    4018    3096
267         2       2       4178    99.51   4199    3096    0.00
268         2       6       4       0.09    4143    3096
269         3       3       2       0.06    4026    3096    99.10
270         3       7       7       0.17    4074    3096
271 .fi
272 This example also shows the use of the --show option to show only the desired columns.
273
274 .SH SYSTEM CONFIGURATION INFORMATION EXAMPLE
275
276 By default, turbostat always dumps system configuration information
277 before taking measurements.  In the example above, "--quiet" is used
278 to suppress that output.  Here is an example of the configuration information:
279 .nf
280 turbostat version 2022.04.16 - Len Brown <lenb@kernel.org>
281 Kernel command line: BOOT_IMAGE=/boot/vmlinuz-5.18.0-rc6-00001-ge6891250e3b5 ...
282 CPUID(0): GenuineIntel 0x16 CPUID levels
283 CPUID(1): family:model:stepping 0x6:9e:9 (6:158:9) microcode 0xea
284 CPUID(0x80000000): max_extended_levels: 0x80000008
285 CPUID(1): SSE3 MONITOR - EIST TM2 TSC MSR ACPI-TM HT TM
286 CPUID(6): APERF, TURBO, DTS, PTM, HWP, HWPnotify, HWPwindow, HWPepp, No-HWPpkg, EPB
287 cpu7: MSR_IA32_MISC_ENABLE: 0x00850089 (TCC EIST MWAIT PREFETCH TURBO)
288 CPUID(7): SGX
289 cpu7: MSR_IA32_FEATURE_CONTROL: 0x00000005 (Locked )
290 CPUID(0x15): eax_crystal: 2 ebx_tsc: 258 ecx_crystal_hz: 0
291 TSC: 3096 MHz (24000000 Hz * 258 / 2 / 1000000)
292 CPUID(0x16): base_mhz: 3100 max_mhz: 4200 bus_mhz: 100
293 cpu7: MSR_MISC_PWR_MGMT: 0x00401cc0 (ENable-EIST_Coordination DISable-EPB DISable-OOB)
294 RAPL: 5825 sec. Joule Counter Range, at 45 Watts
295 cpu7: MSR_PLATFORM_INFO: 0x80839f1011f00
296 8 * 100.0 = 800.0 MHz max efficiency frequency
297 31 * 100.0 = 3100.0 MHz base frequency
298 cpu7: MSR_IA32_POWER_CTL: 0x002c005d (C1E auto-promotion: DISabled)
299 cpu7: MSR_TURBO_RATIO_LIMIT: 0x2728292a
300 39 * 100.0 = 3900.0 MHz max turbo 4 active cores
301 40 * 100.0 = 4000.0 MHz max turbo 3 active cores
302 41 * 100.0 = 4100.0 MHz max turbo 2 active cores
303 42 * 100.0 = 4200.0 MHz max turbo 1 active cores
304 cpu7: MSR_CONFIG_TDP_NOMINAL: 0x0000001f (base_ratio=31)
305 cpu7: MSR_CONFIG_TDP_LEVEL_1: 0x00000000 ()
306 cpu7: MSR_CONFIG_TDP_LEVEL_2: 0x00000000 ()
307 cpu7: MSR_CONFIG_TDP_CONTROL: 0x80000000 ( lock=1)
308 cpu7: MSR_TURBO_ACTIVATION_RATIO: 0x00000000 (MAX_NON_TURBO_RATIO=0 lock=0)
309 cpu7: MSR_PKG_CST_CONFIG_CONTROL: 0x1e008008 (UNdemote-C3, UNdemote-C1, demote-C3, demote-C1, locked, pkg-cstate-limit=8 (unlimited))
310 Uncore Frequency pkg0 die0: 800 - 3900 MHz (800 - 3900 MHz)
311 /dev/cpu_dma_latency: 2000000000 usec (default)
312 current_driver: intel_idle
313 current_governor: menu
314 current_governor_ro: menu
315 cpu7: POLL: CPUIDLE CORE POLL IDLE
316 cpu7: C1: MWAIT 0x00
317 cpu7: C1E: MWAIT 0x01
318 cpu7: C3: MWAIT 0x10
319 cpu7: C6: MWAIT 0x20
320 cpu7: C7s: MWAIT 0x33
321 cpu7: C8: MWAIT 0x40
322 cpu7: C9: MWAIT 0x50
323 cpu7: C10: MWAIT 0x60
324 cpu7: cpufreq driver: intel_pstate
325 cpu7: cpufreq governor: performance
326 cpufreq intel_pstate no_turbo: 0
327 cpu7: MSR_MISC_FEATURE_CONTROL: 0x00000000 (L2-Prefetch L2-Prefetch-pair L1-Prefetch L1-IP-Prefetch)
328 cpu0: MSR_PM_ENABLE: 0x00000001 (HWP)
329 cpu0: MSR_HWP_CAPABILITIES: 0x01101f53 (high 83 guar 31 eff 16 low 1)
330 cpu0: MSR_HWP_REQUEST: 0x00005353 (min 83 max 83 des 0 epp 0x0 window 0x0 pkg 0x0)
331 cpu0: MSR_HWP_INTERRUPT: 0x00000001 (EN_Guaranteed_Perf_Change, Dis_Excursion_Min)
332 cpu0: MSR_HWP_STATUS: 0x00000004 (No-Guaranteed_Perf_Change, No-Excursion_Min)
333 cpu0: EPB: 6 (balanced)
334 cpu0: MSR_RAPL_POWER_UNIT: 0x000a0e03 (0.125000 Watts, 0.000061 Joules, 0.000977 sec.)
335 cpu0: MSR_PKG_POWER_INFO: 0x00000168 (45 W TDP, RAPL 0 - 0 W, 0.000000 sec.)
336 cpu0: MSR_PKG_POWER_LIMIT: 0x42820800218208 (UNlocked)
337 cpu0: PKG Limit #1: ENabled (65.000 Watts, 64.000000 sec, clamp ENabled)
338 cpu0: PKG Limit #2: ENabled (65.000 Watts, 0.002441* sec, clamp DISabled)
339 cpu0: MSR_VR_CURRENT_CONFIG: 0x00000000
340 cpu0: PKG Limit #4: 0.000000 Watts (UNlocked)
341 cpu0: MSR_DRAM_POWER_LIMIT: 0x5400de00000000 (UNlocked)
342 cpu0: DRAM Limit: DISabled (0.000 Watts, 0.000977 sec, clamp DISabled)
343 cpu0: MSR_PP0_POLICY: 0
344 cpu0: MSR_PP0_POWER_LIMIT: 0x00000000 (UNlocked)
345 cpu0: Cores Limit: DISabled (0.000 Watts, 0.000977 sec, clamp DISabled)
346 cpu0: MSR_PP1_POLICY: 0
347 cpu0: MSR_PP1_POWER_LIMIT: 0x00000000 (UNlocked)
348 cpu0: GFX Limit: DISabled (0.000 Watts, 0.000977 sec, clamp DISabled)
349 cpu0: MSR_IA32_TEMPERATURE_TARGET: 0x00640000 (100 C) (100 default - 0 offset)
350 cpu0: MSR_IA32_PACKAGE_THERM_STATUS: 0x88200800 (68 C)
351 cpu0: MSR_IA32_PACKAGE_THERM_INTERRUPT: 0x00000003 (100 C, 100 C)
352 cpu7: MSR_PKGC3_IRTL: 0x0000884e (valid, 79872 ns)
353 cpu7: MSR_PKGC6_IRTL: 0x00008876 (valid, 120832 ns)
354 cpu7: MSR_PKGC7_IRTL: 0x00008894 (valid, 151552 ns)
355 cpu7: MSR_PKGC8_IRTL: 0x000088fa (valid, 256000 ns)
356 cpu7: MSR_PKGC9_IRTL: 0x0000894c (valid, 339968 ns)
357 cpu7: MSR_PKGC10_IRTL: 0x00008bf2 (valid, 1034240 ns)
358 .fi
359 .PP
360 The \fBmax efficiency\fP frequency, a.k.a. Low Frequency Mode, is the frequency
361 available at the minimum package voltage.  The \fBTSC frequency\fP is the base
362 frequency of the processor -- this should match the brand string
363 in /proc/cpuinfo.  This base frequency
364 should be sustainable on all CPUs indefinitely, given nominal power and cooling.
365 The remaining rows show what maximum turbo frequency is possible
366 depending on the number of idle cores.  Note that not all information is
367 available on all processors.
368 .SH ADD COUNTER EXAMPLE
369 Here we limit turbostat to showing just the CPU number for cpu0 - cpu3.
370 We add a counter showing the 32-bit raw value of MSR 0x199 (MSR_IA32_PERF_CTL),
371 labeling it with the column header, "PRF_CTRL", and display it only once,
372 after the conclusion of a 0.1 second sleep.
373 .nf
374 sudo ./turbostat --quiet --cpu 0-3 --show CPU --add msr0x199,u32,raw,PRF_CTRL sleep .1
375 0.101604 sec
376 CPU       PRF_CTRL
377 -       0x00000000
378 0       0x00000c00
379 1       0x00000800
380 2       0x00000a00
381 3       0x00000800
382
383 .fi
384
385 .SH ADD PERF COUNTER EXAMPLE
386 Here we limit turbostat to showing just the CPU number for cpu0 - cpu3.
387 We add a counter showing time spent in C1 core cstate,
388 labeling it with the column header, "pCPU%c1", and display it only once,
389 after the conclusion of 0.1 second sleep.
390 We also show CPU%c1 built-in counter that should show similar values.
391 .nf
392 sudo ./turbostat --quiet --cpu 0-3 --show CPU,CPU%c1 --add perf/cstate_core/c1-residency,cpu,delta,percent,pCPU%c1 sleep .1
393 0.102448 sec
394 CPU     pCPU%c1 CPU%c1
395 -       34.89   34.89
396 0       45.99   45.99
397 1       45.94   45.94
398 2       23.83   23.83
399 3       23.84   23.84
400
401 .fi
402
403 .SH ADD PERF COUNTER EXAMPLE #2 (using virtual cpu device)
404 Here we run on hybrid, Raptor Lake platform.
405 We limit turbostat to show output for just cpu0 (pcore) and cpu12 (ecore).
406 We add a counter showing number of L3 cache misses, using virtual "cpu" device,
407 labeling it with the column header, "VCMISS".
408 We add a counter showing number of L3 cache misses, using virtual "cpu_core" device,
409 labeling it with the column header, "PCMISS". This will fail on ecore cpu12.
410 We add a counter showing number of L3 cache misses, using virtual "cpu_atom" device,
411 labeling it with the column header, "ECMISS". This will fail on pcore cpu0.
412 We display it only once, after the conclusion of 0.1 second sleep.
413 .nf
414 sudo ./turbostat --quiet --cpu 0,12 --show CPU --add perf/cpu/cache-misses,cpu,delta,raw,VCMISS --add perf/cpu_core/cache-misses,cpu,delta,raw,PCMISS --add perf/cpu_atom/cache-misses,cpu,delta,raw,ECMISS sleep .1
415 turbostat: added_perf_counters_init_: perf/cpu_atom/cache-misses: failed to open counter on cpu0
416 turbostat: added_perf_counters_init_: perf/cpu_core/cache-misses: failed to open counter on cpu12
417 0.104630 sec
418 CPU                 ECMISS                  PCMISS                  VCMISS
419 -       0x0000000000000000      0x0000000000000000      0x0000000000000000
420 0       0x0000000000000000      0x0000000000007951      0x0000000000007796
421 12      0x000000000001137a      0x0000000000000000      0x0000000000011392
422
423 .fi
424
425 .SH ADD PMT COUNTER EXAMPLE
426 Here we limit turbostat to showing just the CPU number 0.
427 We add two counters, showing crystal clock count and the DC6 residency.
428 All the parameters passed are based on the metadata found in the PMT XML files.
429
430 For the crystal clock count, we
431 label it with the column header, "XTAL",
432 we set the type to 'raw', to read the number of clock ticks in hex,
433 we set the format to 'delta', to display the difference in ticks during the measurement interval,
434 we set the domain to 'package0', to collect it and associate it with the whole package number 0,
435 we set the offset to '0', which is a offset of the counter within the PMT MMIO region,
436 we set the lsb and msb to cover all 64 bits of the read 64 bit value,
437 and finally we set the guid to '0x1a067102', that identifies the PMT MMIO region to which the 'offset' is applied to read the counter value.
438
439 For the DC6 residency counter, we
440 label it with the column header, "Die%c6",
441 we set the type to 'txtal_time', to obtain the percent residency value
442 we set the format to 'delta', to display the difference in ticks during the measurement interval,
443 we set the domain to 'package0', to collect it and associate it with the whole package number 0,
444 we set the offset to '0', which is a offset of the counter within the PMT MMIO region,
445 we set the lsb and msb to cover all 64 bits of the read 64 bit value,
446 and finally we set the guid to '0x1a067102', that identifies the PMT MMIO region to which the 'offset' is applied to read the counter value.
447
448 .nf
449 sudo ./turbostat --quiet --cpu 0 --show CPU --add pmt,name=XTAL,type=raw,format=delta,domain=package0,offset=0,lsb=0,msb=63,guid=0x1a067102 --add pmt,name=Die%c6,type=txtal_time,format=delta,domain=package0,offset=120,lsb=0,msb=63,guid=0x1a067102
450 0.104352 sec
451 CPU                   XTAL      Die%c6
452 -       0x0000006d4d957ca7      0.00
453 0       0x0000006d4d957ca7      0.00
454 0.102448 sec
455 .fi
456
457 .SH INPUT
458
459 For interval-mode, turbostat will immediately end the current interval
460 when it sees a newline on standard input.
461 turbostat will then start the next interval.
462 Control-C will be send a SIGINT to turbostat,
463 which will immediately abort the program with no further processing.
464 .SH SIGNALS
465
466 SIGINT will interrupt interval-mode.
467 The end-of-interval data will be collected and displayed before turbostat exits.
468
469 SIGUSR1 will end current interval,
470 end-of-interval data will be collected and displayed before turbostat
471 starts a new interval.
472 .SH NOTES
473
474 .B "turbostat "
475 must be run as root.
476 Alternatively, non-root users can be enabled to run turbostat this way:
477
478 # setcap cap_sys_admin,cap_sys_rawio,cap_sys_nice=+ep path/to/turbostat
479
480 # chmod +r /dev/cpu/*/msr
481
482 # chmod +r /dev/cpu_dma_latency
483
484 .B "turbostat "
485 reads hardware counters, but doesn't write them.
486 So it will not interfere with the OS or other programs, including
487 multiple invocations of itself.
488
489 \fBturbostat \fP
490 may work poorly on Linux-2.6.20 through 2.6.29,
491 as \fBacpi-cpufreq \fPperiodically cleared the APERF and MPERF MSRs
492 in those kernels.
493
494 AVG_MHz = APERF_delta/measurement_interval.  This is the actual
495 number of elapsed cycles divided by the entire sample interval --
496 including idle time.  Note that this calculation is resilient
497 to systems lacking a non-stop TSC.
498
499 TSC_MHz = TSC_delta/measurement_interval.
500 On a system with an invariant TSC, this value will be constant
501 and will closely match the base frequency value shown
502 in the brand string in /proc/cpuinfo.  On a system where
503 the TSC stops in idle, TSC_MHz will drop
504 below the processor's base frequency.
505
506 Busy% = MPERF_delta/TSC_delta
507
508 Bzy_MHz = TSC_delta*APERF_delta/MPERF_delta/measurement_interval
509
510 Note that these calculations depend on TSC_delta, so they
511 are not reliable during intervals when TSC_MHz is not running at the base frequency.
512
513 Turbostat data collection is not atomic.
514 Extremely short measurement intervals (much less than 1 second),
515 or system activity that prevents turbostat from being able
516 to run on all CPUS to quickly collect data, will result in
517 inconsistent results.
518
519 The APERF, MPERF MSRs are defined to count non-halted cycles.
520 Although it is not guaranteed by the architecture, turbostat assumes
521 that they count at TSC rate, which is true on all processors tested to date.
522
523 .SH REFERENCES
524 Volume 3B: System Programming Guide"
525 https://www.intel.com/products/processor/manuals/
526
527 .SH RUN THE LATEST VERSION
528 If turbostat complains that it doesn't recognize your processor,
529 please try the latest version.
530
531 The latest version of turbostat does not require the latest version of the Linux kernel.
532 However, some features, such as perf(1) counters, do require kernel support.
533
534 The latest turbostat release is available in the upstream Linux Kernel source tree.
535 eg. "git pull https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git"
536 and run make in tools/power/x86/turbostat/.
537
538 n.b. "make install" will update your system manually, but a distro update may subsequently downgrade your turbostat to an older version.
539 For this reason, manually installing to /usr/local/bin may be what you want.
540
541 Note that turbostat/Makefile has a "make snapshot" target, which will create a tar file
542 that can build without a local kernel source tree.
543
544 If the upstream version isn't new enough, the development tree can be found here:
545 "git pull https://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux.git turbostat"
546
547 If the development tree doesn't work, please contact the author via chat,
548 or via email with the word "turbostat" on the Subject line.
549
550 .SH FILES
551 .ta
552 .nf
553 /sys/bus/event_source/devices/
554 /dev/cpu/*/msr
555 /sys/class/intel_pmt/
556 /sys/devices/system/cpu/
557 .fi
558
559 .SH "SEE ALSO"
560 perf(1), msr(4), vmstat(8)
561 .PP
562 .SH AUTHOR
563 .nf
564 Written by Len Brown <len.brown@intel.com>