提交 79103528 编写于 作者: A Andi Kleen 提交者: Arnaldo Carvalho de Melo

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: NAndi Kleen <ak@linux.intel.com>
Link: http://lkml.kernel.org/r/1426087682-22765-3-git-send-email-andi@firstfloor.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
上级 56f0fd45
...@@ -1094,6 +1094,8 @@ static void abs_printout(int id, int nr, struct perf_evsel *evsel, double avg) ...@@ -1094,6 +1094,8 @@ static void abs_printout(int id, int nr, struct perf_evsel *evsel, double avg)
if (total) { if (total) {
ratio = avg / total; ratio = avg / total;
fprintf(output, " # %5.2f insns per cycle ", ratio); fprintf(output, " # %5.2f insns per cycle ", ratio);
} else {
fprintf(output, " ");
} }
total = avg_stats(&runtime_stalled_cycles_front_stats[cpu]); total = avg_stats(&runtime_stalled_cycles_front_stats[cpu]);
total = max(total, avg_stats(&runtime_stalled_cycles_back_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) ...@@ -1163,6 +1165,8 @@ static void abs_printout(int id, int nr, struct perf_evsel *evsel, double avg)
if (total) { if (total) {
ratio = avg / total; ratio = avg / total;
fprintf(output, " # %8.3f GHz ", ratio); fprintf(output, " # %8.3f GHz ", ratio);
} else {
fprintf(output, " ");
} }
} else if (transaction_run && } else if (transaction_run &&
perf_evsel__cmp(evsel, nth_evsel(T_CYCLES_IN_TX))) { perf_evsel__cmp(evsel, nth_evsel(T_CYCLES_IN_TX))) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册