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>
This commit is contained in:
Thomas Renninger
2011-08-12 01:11:37 +02:00
committed by Dominik Brodowski
parent 88f984e0e2
commit 7c74d2bc5a
5 changed files with 66 additions and 4 deletions

View File

@@ -96,6 +96,9 @@ struct cpupower_topology {
int pkg;
int core;
int cpu;
/* flags */
unsigned int is_online:1;
} *core_info;
};