]> granicus.if.org Git - sysstat/commitdiff
Merge branch 'jaunix-mpstat'
authorSebastien GODARD <sysstat@users.noreply.github.com>
Sun, 15 Mar 2015 16:21:28 +0000 (17:21 +0100)
committerSebastien GODARD <sysstat@users.noreply.github.com>
Sun, 15 Mar 2015 16:21:28 +0000 (17:21 +0100)
Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
1  2 
mpstat.c

diff --cc mpstat.c
index 9f8df520ba13421e04bbb6e3448e7d9d48a32fd1,1b41b254fdb97ac850b44465dc9fd80613ac4429..d5c7b214867d4ec2ca90da82f058a494fa834b80
+++ b/mpstat.c
@@@ -253,6 -254,19 +254,22 @@@ void write_irqcpu_stats(struct stats_ir
                printf("\n");
        }
  
 -              if (p0->irq_name[0] != '\0') { /* Nb of irq per proc may have varied... */
+       /* Calculate column widths */
+       for (j = 0; j < ic_nr; j++) {
+               p0 = st_ic[curr] + j;
 -                      /* normal space for printing a number is 14 chars 
 -                       * (space + 10 digits + period + mantissa) */
 -                      if (colwidth[j] < 14)
++              if (p0->irq_name[0] != '\0') {
+                       /* Width is IRQ name + 2 for the trailing "/s" */
+                       colwidth[j] = strlen(p0->irq_name) + 2;
++                      /*
++                       * Normal space for printing a number is 14 chars
++                       * (space + 10 digits + period + mantissa).
++                       */
++                      if (colwidth[j] < 14) {
+                               colwidth[j] = 10;
++                      }
+               }
+       }
        for (cpu = 1; cpu <= cpu_nr; cpu++) {
  
                scc = st_cpu[curr] + cpu;