aboutsummaryrefslogtreecommitdiffstats
path: root/tools/power/cpupower/utils/idle_monitor/snb_idle.c
diff options
context:
space:
mode:
authorPrarit Bhargava <prarit@redhat.com>2017-07-31 07:56:06 -0400
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2017-07-31 14:17:30 +0200
commitd0e4a193c33adaa4f91128d5393aa3589c2f3e9e (patch)
tree3472fd34756f598658cf5b5e58865d01f699fca4 /tools/power/cpupower/utils/idle_monitor/snb_idle.c
parentpm-graph: package makefile and man pages (diff)
downloadlinux-dev-d0e4a193c33adaa4f91128d5393aa3589c2f3e9e.tar.xz
linux-dev-d0e4a193c33adaa4f91128d5393aa3589c2f3e9e.zip
tools/power/cpupower: allow running without cpu0
Linux-3.7 added CONFIG_BOOTPARAM_HOTPLUG_CPU0, allowing systems to offline cpu0. But when cpu0 is offline, cpupower monitor will not display all processor and Mperf information: [root@intel-skylake-dh-03 cpupower]# ./cpupower monitor WARNING: at least one cpu is offline |Idle_Stats CPU | POLL | C1-S | C1E- | C3-S | C6-S | C7s- | C8-S 4| 0.00| 0.00| 0.00| 0.00| 0.90| 0.00| 96.13 1| 0.00| 0.00| 5.49| 0.00| 0.01| 0.00| 92.26 5| 0.00| 0.00| 0.00| 0.00| 0.46| 0.00| 99.50 2| 45.42| 0.00| 0.00| 0.00| 22.94| 0.00| 28.84 6| 0.00| 37.54| 0.00| 0.00| 0.00| 0.00| 0.00 3| 0.00| 0.00| 0.00| 0.00| 0.30| 0.00| 91.99 7| 0.00| 0.00| 0.00| 0.00| 4.70| 0.00| 0.70 This patch replaces the hard-coded use of cpu0 in cpupower with the current cpu, allowing it to run without a cpu0. After the patch is applied, [root@intel-skylake-dh-03 cpupower]# ./cpupower monitor WARNING: at least one cpu is offline |Nehalem || Mperf || Idle_Stats CPU | C3 | C6 | PC3 | PC6 || C0 | Cx | Freq || POLL | C1-S | C1E- | C3-S | C6-S | C7s- | C8-S 4| 0.01| 1.27| 0.00| 0.00|| 0.04| 99.96| 3957|| 0.00| 0.00| 0.00| 0.00| 1.43| 0.00| 98.52 1| 0.00| 98.82| 0.00| 0.00|| 0.05| 99.95| 3361|| 0.00| 0.00| 0.01| 0.00| 0.03| 0.00| 99.88 5| 0.00| 98.82| 0.00| 0.00|| 0.09| 99.91| 3917|| 0.00| 0.00| 0.00| 0.00| 99.38| 0.00| 0.50 2| 0.33| 0.00| 0.00| 0.00|| 0.00|100.00| 3890|| 0.00| 0.00| 0.00| 0.00| 0.00| 0.00|100.00 6| 0.33| 0.00| 0.00| 0.00|| 0.01| 99.99| 3903|| 0.00| 0.00| 0.00| 0.00| 0.00| 0.00| 99.99 3| 0.01| 0.71| 0.00| 0.00|| 0.06| 99.94| 3678|| 0.00| 0.00| 0.00| 0.00| 0.80| 0.00| 99.13 7| 0.01| 0.71| 0.00| 0.00|| 0.03| 99.97| 3538|| 0.00| 0.69| 11.70| 0.00| 0.00| 0.00| 87.57 There are some minor cleanups included in this patch. Signed-off-by: Prarit Bhargava <prarit@redhat.com> Signed-off-by: Thomas Renninger <trenn@suse.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to '')
-rw-r--r--tools/power/cpupower/utils/idle_monitor/snb_idle.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/power/cpupower/utils/idle_monitor/snb_idle.c b/tools/power/cpupower/utils/idle_monitor/snb_idle.c
index efc8a69c9aba..a2b45219648d 100644
--- a/tools/power/cpupower/utils/idle_monitor/snb_idle.c
+++ b/tools/power/cpupower/utils/idle_monitor/snb_idle.c
@@ -120,7 +120,7 @@ static int snb_start(void)
previous_count[num][cpu] = val;
}
}
- snb_get_count(TSC, &tsc_at_measure_start, 0);
+ snb_get_count(TSC, &tsc_at_measure_start, base_cpu);
return 0;
}
@@ -129,7 +129,7 @@ static int snb_stop(void)
unsigned long long val;
int num, cpu;
- snb_get_count(TSC, &tsc_at_measure_end, 0);
+ snb_get_count(TSC, &tsc_at_measure_end, base_cpu);
for (num = 0; num < SNB_CSTATE_COUNT; num++) {
for (cpu = 0; cpu < cpu_count; cpu++) {