diff options
author | Thomas Renninger <trenn@suse.com> | 2015-12-01 17:14:15 +0100 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2015-12-03 02:30:30 +0100 |
commit | ce512b84045459f4a6c119a109c950c6bc4a6f3a (patch) | |
tree | 7dc8c24c52f5b870ce1a6c1a4b09adfdaa0e7d98 /tools/power/cpupower/utils/cpufreq-info.c | |
parent | e51207f0030474958e59bbc7e002f169bdb05c50 (diff) | |
download | op-kernel-dev-ce512b84045459f4a6c119a109c950c6bc4a6f3a.zip op-kernel-dev-ce512b84045459f4a6c119a109c950c6bc4a6f3a.tar.gz |
cpupower: Do not analyse offlined cpus
Use sysfs_is_cpu_online(cpu) instead of cpufreq_cpu_exists(cpu) to detect offlined cpus.
Re-arrange printfs slightly to have a consistent output even if you have multiple CPUs
as output and even if offlined cores are in between.
Signed-off-by: Thomas Renninger <trenn@suse.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'tools/power/cpupower/utils/cpufreq-info.c')
-rw-r--r-- | tools/power/cpupower/utils/cpufreq-info.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/tools/power/cpupower/utils/cpufreq-info.c b/tools/power/cpupower/utils/cpufreq-info.c index 0e67643..522b357 100644 --- a/tools/power/cpupower/utils/cpufreq-info.c +++ b/tools/power/cpupower/utils/cpufreq-info.c @@ -14,6 +14,7 @@ #include <getopt.h> #include "cpufreq.h" +#include "helpers/sysfs.h" #include "helpers/helpers.h" #include "helpers/bitmask.h" @@ -647,11 +648,14 @@ int cmd_freq_info(int argc, char **argv) if (!bitmask_isbitset(cpus_chosen, cpu)) continue; - if (cpufreq_cpu_exists(cpu)) { - printf(_("couldn't analyze CPU %d as it doesn't seem to be present\n"), cpu); + + printf(_("analyzing CPU %d:\n"), cpu); + + if (sysfs_is_cpu_online(cpu) != 1) { + printf(_(" *is offline\n")); + printf("\n"); continue; } - printf(_("analyzing CPU %d:\n"), cpu); switch (output_param) { case 'b': @@ -693,6 +697,7 @@ int cmd_freq_info(int argc, char **argv) } if (ret) return ret; + printf("\n"); } return ret; } |