Commit 11ba2b85 authored by Ingo Molnar's avatar Ingo Molnar

perf stat: Print stalled cycles percentage

Print:

           611,527 cycles
           400,553 instructions             # (  0.71 instructions per cycle )
            77,809 stalled-cycles           # ( 12.71% of all cycles )

        0.000610987  seconds time elapsed
Acked-by: default avatarPeter Zijlstra <a.p.zijlstra@chello.nl>
Acked-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
Link: http://lkml.kernel.org/n/tip-fd6x8r1cpyb6zhlrc4ix8m45@git.kernel.org
parent 5c543e3c
...@@ -442,7 +442,7 @@ static void abs_printout(int cpu, struct perf_evsel *evsel, double avg) ...@@ -442,7 +442,7 @@ static void abs_printout(int cpu, struct perf_evsel *evsel, double avg)
if (total) if (total)
ratio = avg / total; ratio = avg / total;
fprintf(stderr, " # %10.3f IPC ", ratio); fprintf(stderr, " # ( %4.2f instructions per cycle )", ratio);
} else if (perf_evsel__match(evsel, HARDWARE, HW_BRANCH_MISSES) && } else if (perf_evsel__match(evsel, HARDWARE, HW_BRANCH_MISSES) &&
runtime_branches_stats[cpu].n != 0) { runtime_branches_stats[cpu].n != 0) {
total = avg_stats(&runtime_branches_stats[cpu]); total = avg_stats(&runtime_branches_stats[cpu]);
...@@ -450,7 +450,7 @@ static void abs_printout(int cpu, struct perf_evsel *evsel, double avg) ...@@ -450,7 +450,7 @@ static void abs_printout(int cpu, struct perf_evsel *evsel, double avg)
if (total) if (total)
ratio = avg * 100 / total; ratio = avg * 100 / total;
fprintf(stderr, " # %10.3f %% ", ratio); fprintf(stderr, " # %10.3f %%", ratio);
} else if (runtime_nsecs_stats[cpu].n != 0) { } else if (runtime_nsecs_stats[cpu].n != 0) {
total = avg_stats(&runtime_nsecs_stats[cpu]); total = avg_stats(&runtime_nsecs_stats[cpu]);
...@@ -459,6 +459,13 @@ static void abs_printout(int cpu, struct perf_evsel *evsel, double avg) ...@@ -459,6 +459,13 @@ static void abs_printout(int cpu, struct perf_evsel *evsel, double avg)
ratio = 1000.0 * avg / total; ratio = 1000.0 * avg / total;
fprintf(stderr, " # %10.3f M/sec", ratio); fprintf(stderr, " # %10.3f M/sec", ratio);
} else if (perf_evsel__match(evsel, HARDWARE, HW_STALLED_CYCLES)) {
total = avg_stats(&runtime_cycles_stats[cpu]);
if (total)
ratio = avg / total * 100.0;
fprintf(stderr, " # (%5.2f%% of all cycles )", ratio);
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment