aboutsummaryrefslogtreecommitdiffstats
path: root/tools/power/cpupower/utils/idle_monitor
diff options
context:
space:
mode:
authorThomas Renninger <trenn@suse.de>2011-08-12 01:11:37 +0200
committerDominik Brodowski <linux@dominikbrodowski.net>2011-08-15 20:03:10 +0200
commit7c74d2bc5a9d43d33d6f16c1e706147162e2bc52 (patch)
treef9a3578dca29ca782df483d9cdc8f5bc376d5ef2 /tools/power/cpupower/utils/idle_monitor
parentcpupower: Do not show an empty Idle_Stats monitor if no idle driver is available (diff)
downloadlinux-dev-7c74d2bc5a9d43d33d6f16c1e706147162e2bc52.tar.xz
linux-dev-7c74d2bc5a9d43d33d6f16c1e706147162e2bc52.zip
cpupower: Better detect offlined CPUs
Before, checking for offlined CPUs was done dirty and it was checked whether topology parsing returned -1 values. But this is a valid case on a Xen (and possibly other) kernels. Do proper online/offline checking, also take CONFIG_HOTPLUG_CPU option into account (no /sys/devices/../cpuX/online file). Signed-off-by: Thomas Renninger <trenn@suse.de> Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Diffstat (limited to 'tools/power/cpupower/utils/idle_monitor')
-rw-r--r--tools/power/cpupower/utils/idle_monitor/cpupower-monitor.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/tools/power/cpupower/utils/idle_monitor/cpupower-monitor.c b/tools/power/cpupower/utils/idle_monitor/cpupower-monitor.c
index ba4bf068380d..dd8e1ea6e6f2 100644
--- a/tools/power/cpupower/utils/idle_monitor/cpupower-monitor.c
+++ b/tools/power/cpupower/utils/idle_monitor/cpupower-monitor.c
@@ -190,9 +190,13 @@ void print_results(int topology_depth, int cpu)
}
}
}
- /* cpu offline */
- if (cpu_top.core_info[cpu].pkg == -1 ||
- cpu_top.core_info[cpu].core == -1) {
+ /*
+ * The monitor could still provide useful data, for example
+ * AMD HW counters partly sit in PCI config space.
+ * It's up to the monitor plug-in to check .is_online, this one
+ * is just for additional info.
+ */
+ if (!cpu_top.core_info[cpu].is_online) {
printf(_(" *is offline\n"));
return;
} else