diff options
author | Andi Kleen <ak@linux.intel.com> | 2015-03-11 18:28:02 +0300 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2015-03-13 13:47:44 +0300 |
commit | 7910352852f377f6d12286f922299d7ad1cfb2e3 (patch) | |
tree | cad68cf241a918bf957c78c3566c0279f8263d18 /tools | |
parent | 56f0fd45d8df51542930b9b2e1acee5034b53479 (diff) | |
download | linux-7910352852f377f6d12286f922299d7ad1cfb2e3.tar.xz |
perf stat: Always correctly indent ratio column
When cycles or instructions do not print anything, as in being,
--per-socket or --per-core modi, the ratio column was not correctly
indented for them. This lead to some ratios not lining up with the
others. Always indent correctly when nothing is printed.
Signed-off-by: Andi Kleen <ak@linux.intel.com>
Link: http://lkml.kernel.org/r/1426087682-22765-3-git-send-email-andi@firstfloor.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/perf/builtin-stat.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c index c95dbdad98c3..d4d1b77da0bd 100644 --- a/tools/perf/builtin-stat.c +++ b/tools/perf/builtin-stat.c @@ -1094,6 +1094,8 @@ static void abs_printout(int id, int nr, struct perf_evsel *evsel, double avg) if (total) { ratio = avg / total; fprintf(output, " # %5.2f insns per cycle ", ratio); + } else { + fprintf(output, " "); } total = avg_stats(&runtime_stalled_cycles_front_stats[cpu]); total = max(total, avg_stats(&runtime_stalled_cycles_back_stats[cpu])); @@ -1163,6 +1165,8 @@ static void abs_printout(int id, int nr, struct perf_evsel *evsel, double avg) if (total) { ratio = avg / total; fprintf(output, " # %8.3f GHz ", ratio); + } else { + fprintf(output, " "); } } else if (transaction_run && perf_evsel__cmp(evsel, nth_evsel(T_CYCLES_IN_TX))) { |