[PATCH 8/8] perf stat: Align scaled output of cpu-clock

From: Arnaldo Carvalho de Melo
Date: Mon Feb 06 2012 - 17:10:49 EST


From: Namhyung Kim <namhyung.kim@xxxxxxx>

The output of cpu-clock event is controlled in nsec_printout(),
but its alignment was broken:

Performance counter stats for 'sleep 1':

6,038,774 instructions # 0.00 insns per cycle
180 faults # 0.007 K/sec [99.95%]
1,282,201 branches # 0.053 M/sec [99.84%]
24126.221811 cpu-clock [99.62%]
24121.689540 task-clock # 24.098 CPUs utilized [99.52%]

1.001001017 seconds time elapsed

This patch fixes this:

Performance counter stats for 'sleep 1':

13,540,843 instructions # 0.00 insns per cycle
180 faults # 0.007 K/sec [99.94%]
2,875,386 branches # 0.119 M/sec [99.82%]
24144.221137 cpu-clock [99.61%]
24133.515366 task-clock # 24.109 CPUs utilized [99.52%]

1.001020946 seconds time elapsed

Cc: Ingo Molnar <mingo@xxxxxxx>
Cc: Namhyung Kim <namhyung@xxxxxxxxx>
Cc: Paul Mackerras <paulus@xxxxxxxxx>
Cc: Peter Zijlstra <a.p.zijlstra@xxxxxxxxx>
Link: http://lkml.kernel.org/r/1328514285-26232-2-git-send-email-namhyung.kim@xxxxxxx
Signed-off-by: Namhyung Kim <namhyung.kim@xxxxxxx>
Signed-off-by: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>
---
tools/perf/builtin-stat.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c
index 32d930eb..d14b37a 100644
--- a/tools/perf/builtin-stat.c
+++ b/tools/perf/builtin-stat.c
@@ -576,6 +576,8 @@ static void nsec_printout(int cpu, struct perf_evsel *evsel, double avg)
if (perf_evsel__match(evsel, SOFTWARE, SW_TASK_CLOCK))
fprintf(output, " # %8.3f CPUs utilized ",
avg / avg_stats(&walltime_nsecs_stats));
+ else
+ fprintf(output, " ");
}

/* used for get_ratio_color() */
--
1.7.9.123.g65da0

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/