Read Linux CPU Idle States with cpupower
Run cpupower idle-info before you blame the CPU governor for a power or latency complaint that turns out to be a missing package.
The route
Jump straight to the step you need, or tick off Done means at the end.
This is a read-only check of the idle states Linux exposes, plus how to inspect a chosen set of cores and read the counters without overclaiming. The examples follow the cpupower-idle-info(1) manpage installed with linux-tools-common version 6.8.0-139.139.
Allow about ten minutes. You need a shell and the matching cpupower tools for the running kernel. Nothing here changes a CPU setting, disables an idle state, restarts a service or needs elevated privileges: it only reads kernel-exported information, so the figures will shift while the machine runs.
1. Check that the matching tool is installed
Ask the wrapper which tool package it can find:
$ cpupower --version
$ cpupower help
A working installation prints the package version or a command summary. On the reference machine, the wrapper is present but the kernel-specific executable is absent: it warns about linux-tools-6.8.0-139-generic and exits with status 2. That is a packaging problem, not proof the CPU has no idle states.
Checkpoint
Run uname -r and compare the kernel release against the package named in the warning. If the tool is missing, installing the matching package changes the system, so that is outside this read-only check; do not guess a package version from a different kernel.
2. Display the default idle information
Run the idle-info subcommand without options:
$ cpupower idle-info
The output is per-CPU idle information, and by default that means core zero only. It reads state descriptions and statistics from /sys/devices/system/cpu/cpu*/cpuidle/state* and from the system cpuidle directory. A typical machine reports names such as POLL, C1, C1E, C3 and C6, but the actual names are platform, firmware and driver dependent.
Do not treat a state name as a promise about the processor. The BIOS or hardware can export states that do not exactly describe the physical capability, and hardware may override a kernel request. POLL is a busy loop on x86, not a power-saving hardware state.
3. Inspect specific cores
Use the global -c or --cpu option before the subcommand to look at other cores:
$ cpupower -c 0,2,4 idle-info
$ cpupower --cpu 0-3 idle-info
- Individual numbers, ranges and stepped ranges all work. For example,
0-7:2selects 0, 2, 4 and 6. - Use
allfor every CPU. A broad query produces a large report, and it is easy to forget the default was only core zero. - Keep the list explicit when comparing a pinned workload. A vague query makes the comparison meaningless.
Checkpoint
Record the selected CPU list alongside the output. Comparing core zero with a later all-core report can otherwise look like a firmware or scheduling change when it is only a different query.
4. Request a compact summary
Use -f or --silent when you only need the summary of available C-states:
$ cpupower idle-info --silent
Handy for a quick inventory, but it deliberately hides the detail you need during real diagnosis. Reach for the normal report when you need per-state descriptions or counters. This is a display choice, not a power-management switch.
5. Read counters without overclaiming
Idle statistics update only when the kernel enters or leaves a state. A system that is very quiet or very busy can show a snapshot that does not represent a longer interval. Run the same command twice with a known gap if you want to see whether the figures are actually moving:
cpupower idle-info > /tmp/idle-before.txt
sleep 5
cpupower idle-info > /tmp/idle-after.txt
diff -u /tmp/idle-before.txt /tmp/idle-after.txt
The files under /tmp are temporary observation data. Remove them once you are done: rm -- /tmp/idle-before.txt /tmp/idle-after.txt. That is only reversible in the sense that you can take a fresh measurement; it does not restore an old counter value.
For hardware residency measurements on recent x86 systems, use the separate cpupower monitor tool when it is installed. Idle-info reports the cpuidle subsystem's view, not a guarantee of exactly how long the hardware spent in each state.
6. Avoid the obsolete proc format
The -e or --proc option prints the old /proc/acpi/processor/*/power format. The manpage marks it deprecated and notes the kernel interface has been removed for some time. Do not build new scripts around it. If an old script still needs that output, treat it as migration work and verify the target kernel rather than assuming the option still works.
Done means
- Tool confirmed. The matching kernel-specific cpupower executable is installed, or its absence is recorded as a packaging failure.
- Scope understood. You know an unqualified query reports core zero only.
- CPU list logged. Any selected CPU list is written down with the measurement.
- Counters read correctly. You distinguish changing cpuidle statistics from hardware residency measurements.
- Options used appropriately. You use
--silentonly for a compact report and skip the deprecated proc format for new work.