]> granicus.if.org Git - sysstat/commitdiff
sar: A_PWR_CPUFREQ activity: Don't display offline CPU
authorSebastien GODARD <sysstat@users.noreply.github.com>
Sun, 10 Dec 2017 08:42:02 +0000 (09:42 +0100)
committerSebastien GODARD <sysstat@users.noreply.github.com>
Sun, 10 Dec 2017 08:42:02 +0000 (09:42 +0100)
Offline processors won't be displayed any more in sar/sadc output.
Start here with A_PWR_CPUFREQ activity.

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
pr_stats.c

index 2d14913bca6cf4169eba84efae62a680146616a3..0e9f66e76c722842debd1afe3ed7710a38ebba1d 100644 (file)
@@ -1914,6 +1914,10 @@ void stub_print_pwr_cpufreq_stats(struct activity *a, int curr, int dispavg)
                 */
                spc = (struct stats_pwr_cpufreq *) ((char *) a->buf[curr] + i * a->msize);
 
+               if (!spc->cpufreq)
+                       /* This CPU is offline: Don't display it */
+                       continue;
+
                /*
                 * Note: a->nr is in [1, NR_CPUS + 1].
                 * Bitmap size is provided for (NR_CPUS + 1) CPUs.