summaryrefslogtreecommitdiffstats
path: root/tools/power/cpupower/utils/cpuidle-info.c
diff options
context:
space:
mode:
authorThomas Renninger <trenn@suse.de>2013-06-28 15:34:31 +0200
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2013-07-05 01:52:19 +0200
commitc4f3610eba69321b9cf35779cd67e68b5138cc16 (patch)
tree1e290acedef8572a22812c98709cf0754f5d36a9 /tools/power/cpupower/utils/cpuidle-info.c
parent0924c369bc5492cf181a066fc2d459aa18ffa5ac (diff)
downloadop-kernel-dev-c4f3610eba69321b9cf35779cd67e68b5138cc16.zip
op-kernel-dev-c4f3610eba69321b9cf35779cd67e68b5138cc16.tar.gz
cpupower: Introduce idle-set subcommand and C-state enabling/disabling
Example: cpupower idle-set -d 3 will disable C-state 3 on all processors (set commands are active on all CPUs by default), same as: cpupower -c all idle-set -d 3 Signed-off-by: Thomas Renninger <trenn@suse.de> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'tools/power/cpupower/utils/cpuidle-info.c')
-rw-r--r--tools/power/cpupower/utils/cpuidle-info.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/tools/power/cpupower/utils/cpuidle-info.c b/tools/power/cpupower/utils/cpuidle-info.c
index edd5dba..75e66de 100644
--- a/tools/power/cpupower/utils/cpuidle-info.c
+++ b/tools/power/cpupower/utils/cpuidle-info.c
@@ -48,10 +48,14 @@ static void cpuidle_cpu_output(unsigned int cpu, int verbose)
return;
for (idlestate = 0; idlestate < idlestates; idlestate++) {
+ int disabled = sysfs_is_idlestate_disabled(cpu, idlestate);
+ /* Disabled interface not supported on older kernels */
+ if (disabled < 0)
+ disabled = 0;
tmp = sysfs_get_idlestate_name(cpu, idlestate);
if (!tmp)
continue;
- printf("%s:\n", tmp);
+ printf("%s%s:\n", tmp, (disabled) ? " (DISABLED) " : "");
free(tmp);
tmp = sysfs_get_idlestate_desc(cpu, idlestate);
OpenPOWER on IntegriCloud