]> granicus.if.org Git - sysstat/commitdiff
SVG: A_PWR_CPU activity: Don't display offline CPU
authorSebastien GODARD <sysstat@users.noreply.github.com>
Wed, 7 Feb 2018 14:24:22 +0000 (15:24 +0100)
committerSebastien GODARD <sysstat@users.noreply.github.com>
Wed, 7 Feb 2018 14:24:22 +0000 (15:24 +0100)
Offline CPU are no longer displayed.
This should also apply to CPU frequency statistics and its graphs.

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

index bf8ad82e097c671b592af4d7fee2f88b63b5d492..e2867af0ef573350e0c7bc55b375d888362f4d3e 100644 (file)
@@ -4188,6 +4188,10 @@ __print_funct_t svg_print_pwr_cpufreq_stats(struct activity *a, int curr, int ac
                        spc = (struct stats_pwr_cpufreq *) ((char *) a->buf[curr]  + i * a->msize);
                        spp = (struct stats_pwr_cpufreq *) ((char *) a->buf[!curr] + i * a->msize);
 
+                       if (!spc->cpufreq)
+                               /* This CPU is offline: Don't display it */
+                               continue;
+
                        /* Should current CPU (including CPU "all") be displayed? */
                        if (!(a->bitmap->b_array[i >> 3] & (1 << (i & 0x07))))
                                /* No */
@@ -4221,7 +4225,7 @@ __print_funct_t svg_print_pwr_cpufreq_stats(struct activity *a, int curr, int ac
                        draw_activity_graphs(a->g_nr, g_type,
                                             title, g_title, item_name, group,
                                             spmin + i, spmax + i, out + i, outsize + i,
-                                            svg_p, record_hdr, FALSE);
+                                            svg_p, record_hdr, i);
                }
 
                /* Free remaining structures */