Skip to content

Commit

Permalink
cpupower: Fix number of idle states
Browse files Browse the repository at this point in the history
The number of idle states was wrong.
The POLL idle state (on X86) was missed out:
Number of idle states: 4
Available idle states: C1-NHM C3-NHM C6-NHM

While the POLL is not a real idle state, its
statistics should still be shown. It's now also
explained in a detailed manpage.
This should fix a bug of missing the first idle
state on other archs.

Signed-off-by: Thomas Renninger <trenn@suse.de>
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
  • Loading branch information
Thomas Renninger authored and Dominik Brodowski committed Mar 3, 2012
1 parent e03bd1a commit 0b37ee6
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions tools/power/cpupower/utils/cpuidle-info.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,8 @@ static void cpuidle_cpu_output(unsigned int cpu, int verbose)
}

printf(_("Number of idle states: %d\n"), idlestates);

printf(_("Available idle states:"));
for (idlestate = 1; idlestate < idlestates; idlestate++) {
for (idlestate = 0; idlestate < idlestates; idlestate++) {
tmp = sysfs_get_idlestate_name(cpu, idlestate);
if (!tmp)
continue;
Expand All @@ -57,7 +56,7 @@ static void cpuidle_cpu_output(unsigned int cpu, int verbose)
if (!verbose)
return;

for (idlestate = 1; idlestate < idlestates; idlestate++) {
for (idlestate = 0; idlestate < idlestates; idlestate++) {
tmp = sysfs_get_idlestate_name(cpu, idlestate);
if (!tmp)
continue;
Expand Down

0 comments on commit 0b37ee6

Please sign in to comment.