]> granicus.if.org Git - sysstat/commitdiff
A_IRQ: sar: Always display a header line for each sample
authorSebastien GODARD <sysstat@users.noreply.github.com>
Sun, 6 Feb 2022 16:41:46 +0000 (17:41 +0100)
committerSebastien GODARD <sysstat@users.noreply.github.com>
Sun, 6 Feb 2022 16:41:46 +0000 (17:41 +0100)
Make sure that the header line gets printed with each sample.
This is because CPU can go offline or come back online, and so the
header line needs to be updated accordingly.

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

index e9023cf7620255558f580080f8cf3fe933344a73..6d62fd786c6dddfa44bb74494bda2ead92c6ab9c 100644 (file)
@@ -356,10 +356,12 @@ __print_funct_t print_irq_stats(struct activity *a, int prev, int curr,
        /* Identify offline and unselected CPU, and keep persistent statistics values */
        get_global_int_statistics(a, prev, curr, flags, masked_cpu_bitmap);
 
-       if (dish || DISPLAY_ZERO_OMIT(flags)) {
-               print_hdr_line(timestamp[!curr], a, FIRST, DISPLAY_PRETTY(flags) ? -1 : 0, 9,
-                              masked_cpu_bitmap);
-       }
+       /*
+        * Always display header line. The columns may vary if e.g. a CPU goes offline
+        * and/or comes back online.
+        */
+       print_hdr_line(timestamp[!curr], a, FIRST, DISPLAY_PRETTY(flags) ? -1 : 0, 9,
+                      masked_cpu_bitmap);
 
        for (i = 0; i < a->nr2; i++) {