From: Sebastien GODARD Date: Sun, 15 Mar 2015 16:21:28 +0000 (+0100) Subject: Merge branch 'jaunix-mpstat' X-Git-Tag: v11.1.4~35 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=25be7e10e35c6167d285006c5cf6f1a8b2d98dae;p=sysstat Merge branch 'jaunix-mpstat' Signed-off-by: Sebastien GODARD --- 25be7e10e35c6167d285006c5cf6f1a8b2d98dae diff --cc mpstat.c index 9f8df52,1b41b25..d5c7b21 --- a/mpstat.c +++ b/mpstat.c @@@ -253,6 -254,19 +254,22 @@@ void write_irqcpu_stats(struct stats_ir printf("\n"); } + /* Calculate column widths */ + for (j = 0; j < ic_nr; j++) { + p0 = st_ic[curr] + j; - if (p0->irq_name[0] != '\0') { /* Nb of irq per proc may have varied... */ ++ 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) ++ /* ++ * 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;