[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1425858924-31414-5-git-send-email-andi@firstfloor.org>
Date: Sun, 8 Mar 2015 16:55:24 -0700
From: Andi Kleen <andi@...stfloor.org>
To: acme@...nel.org
Cc: jolsa@...hat.com, linux-kernel@...r.kernel.org,
Andi Kleen <ak@...ux.intel.com>
Subject: [PATCH 4/4] perf, tools, stat: Always correctly indent ratio column
From: Andi Kleen <ak@...ux.intel.com>
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@...ux.intel.com>
---
tools/perf/builtin-stat.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c
index 05c7a00..0b5162d 100644
--- a/tools/perf/builtin-stat.c
+++ b/tools/perf/builtin-stat.c
@@ -1116,7 +1116,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[ctx][cpu]);
total = max(total, avg_stats(&runtime_stalled_cycles_back_stats[ctx][cpu]));
@@ -1185,7 +1186,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))) {
total = avg_stats(&runtime_cycles_stats[ctx][cpu]);
--
1.9.3
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists