diff options
author | Thomas Renninger <trenn@suse.de> | 2011-08-11 19:11:37 -0400 |
---|---|---|
committer | Dominik Brodowski <linux@dominikbrodowski.net> | 2011-08-15 14:03:10 -0400 |
commit | 7c74d2bc5a9d43d33d6f16c1e706147162e2bc52 (patch) | |
tree | f9a3578dca29ca782df483d9cdc8f5bc376d5ef2 /tools/power/cpupower/utils/helpers/sysfs.h | |
parent | 88f984e0e235f82a5d34f4a99244eeb14e1413e0 (diff) |
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/helpers/sysfs.h')
-rw-r--r-- | tools/power/cpupower/utils/helpers/sysfs.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/tools/power/cpupower/utils/helpers/sysfs.h b/tools/power/cpupower/utils/helpers/sysfs.h index f9373e090637..8cb797bbceb0 100644 --- a/tools/power/cpupower/utils/helpers/sysfs.h +++ b/tools/power/cpupower/utils/helpers/sysfs.h | |||
@@ -7,6 +7,8 @@ | |||
7 | 7 | ||
8 | extern unsigned int sysfs_read_file(const char *path, char *buf, size_t buflen); | 8 | extern unsigned int sysfs_read_file(const char *path, char *buf, size_t buflen); |
9 | 9 | ||
10 | extern int sysfs_is_cpu_online(unsigned int cpu); | ||
11 | |||
10 | extern unsigned long sysfs_get_idlestate_latency(unsigned int cpu, | 12 | extern unsigned long sysfs_get_idlestate_latency(unsigned int cpu, |
11 | unsigned int idlestate); | 13 | unsigned int idlestate); |
12 | extern unsigned long sysfs_get_idlestate_usage(unsigned int cpu, | 14 | extern unsigned long sysfs_get_idlestate_usage(unsigned int cpu, |