turbostat
Report processor frequency and power statistics
TLDR
Display statistics every 5 seconds
Display statistics every specified amount of seconds
Do not decode and print the system configuration header information
Display useful information about CPU every 1 second, without header information
Display help
SYNOPSIS
turbostat [options] [interval]
PARAMETERS
-i, --interval
Specify the measurement interval in seconds. Defaults to 5 seconds.
-c, --cpu
Monitor only the specified CPUs (e.g., 0-3,5). Defaults to all CPUs.
-s, --system
Report system-wide statistics (average across all CPUs/sockets). This is the default.
-S, --socket
Report statistics per CPU socket/package.
-P, --package
Alias for --socket.
-C, --core
Report statistics per CPU core.
-h, --help
Display help message and exit.
-v, --version
Display version information and exit.
-q, --quiet
Do not print the header line. Useful for scripting.
-r, --raw
Display raw MSR values instead of decoded human-readable metrics.
-j, --json
Output data in JSON format (available in newer versions).
--csv
Output data in CSV format.
--no-header
Suppress printing the header row only (unlike -q which suppresses all informational output).
--show
Specify a comma-separated list of columns to display.
--hide
Specify a comma-separated list of columns to hide.
--enable
Enable specific columns that might be disabled by default.
--disable
Disable specific columns.
--msr
Display raw values of specified MSRs (e.g., 0x199,0x610).
--msr-range
Display raw values of MSRs within a specified range.
--dump-msr
Dump all known MSRs. Very verbose.
--debug-msr
Show additional debug information about MSR access.
--output
Redirect output to a specified file.
--x2apic
Use x2APIC IDs for CPU enumeration.
--poll-msr
Use polling MSR access instead of /dev/cpu/*/msr (slower).
--cpu-top
Show the top power-consuming CPUs when combined with --interval.
DESCRIPTION
turbostat is a Linux command-line utility that provides detailed, real-time statistics about processor activity, including frequencies, idle states (C-states), temperature, and power consumption. It operates by directly reading Model Specific Registers (MSRs) available on modern Intel and some AMD CPUs, offering a very low-overhead way to monitor CPU behavior. This tool is invaluable for performance tuning, power optimization, and diagnosing issues like CPU throttling or unexpected power usage. It can report system-wide, per-socket, or per-core statistics, making it highly flexible for various analysis needs. Its output is typically tabular, presenting metrics such as average frequency, busy percentage, C-state residency, core temperature, and package/DRAM power usage.
CAVEATS
turbostat requires root privileges or the CAP_SYS_RAWIO
capability to access Model Specific Registers (MSRs), which are essential for its operation. The availability and accuracy of certain metrics, especially power consumption (RAPL) and specific C-states, depend heavily on the underlying CPU architecture and model. Not all metrics are supported on all processors, and some readings might be estimates. Running turbostat continuously can have a minor, though generally negligible, overhead.
UNDERSTANDING OUTPUT COLUMNS
Key columns in turbostat output provide insights into CPU behavior:
Avg_MHz: Average CPU clock speed during the interval.
Busy%: Percentage of time the CPU was not in an idle state (C0).
Bzy_MHz: Average clock speed when the CPU was busy (in C0 state).
TSC_MHz: Nominal Turbo Speed Clock (TSC) frequency.
C1, C3, C6, C7%: Percentage of time spent in various C-states. Higher C-state numbers indicate deeper idle states, saving more power but with higher wake-up latency.
PkgTmp: Package temperature in Celsius.
PkgWatt: Total package power consumption in Watts (via RAPL).
RAMWatt: DRAM power consumption in Watts (if supported).
GFXWatt: Integrated graphics power consumption in Watts (if supported).
MODEL SPECIFIC REGISTERS (MSRS)
turbostat operates by reading and interpreting Model Specific Registers (MSRs). MSRs are control registers specific to a particular processor family or model, used to configure, enable, and gather data from various CPU features, including power management, thermal sensors, and performance counters. Direct MSR access is why turbostat requires elevated privileges.
HISTORY
turbostat was primarily developed by Intel engineers, notably Len Brown, as part of the linux-tools
or kernel-tools
package. Its development has closely tracked new CPU architectures and their features, with continuous updates to incorporate support for new MSRs, power management features (like RAPL), and improved C-state reporting. It has become a standard utility for low-level CPU performance and power analysis in the Linux ecosystem, particularly favored for its direct MSR access and minimal overhead.