diff options
author | Ingo Molnar <mingo@elte.hu> | 2011-04-24 09:05:10 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2011-04-26 14:04:54 -0400 |
commit | 11ba2b85f506306c8dfc9fe144aa4ddc43242855 (patch) | |
tree | 1fb26d4345b53300b29bb7044c165dd1a8230c73 /tools/perf/builtin-stat.c | |
parent | 5c543e3c442d6382db127152c7096ca6a55283de (diff) |
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: Peter Zijlstra <a.p.zijlstra@chello.nl>
Acked-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Link: http://lkml.kernel.org/n/tip-fd6x8r1cpyb6zhlrc4ix8m45@git.kernel.org
Diffstat (limited to 'tools/perf/builtin-stat.c')
-rw-r--r-- | tools/perf/builtin-stat.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c index 03f0e45f1479..3a29041f8575 100644 --- a/tools/perf/builtin-stat.c +++ b/tools/perf/builtin-stat.c | |||
@@ -442,7 +442,7 @@ static void abs_printout(int cpu, struct perf_evsel *evsel, double avg) | |||
442 | if (total) | 442 | if (total) |
443 | ratio = avg / total; | 443 | ratio = avg / total; |
444 | 444 | ||
445 | fprintf(stderr, " # %10.3f IPC ", ratio); | 445 | fprintf(stderr, " # ( %4.2f instructions per cycle )", ratio); |
446 | } else if (perf_evsel__match(evsel, HARDWARE, HW_BRANCH_MISSES) && | 446 | } else if (perf_evsel__match(evsel, HARDWARE, HW_BRANCH_MISSES) && |
447 | runtime_branches_stats[cpu].n != 0) { | 447 | runtime_branches_stats[cpu].n != 0) { |
448 | total = avg_stats(&runtime_branches_stats[cpu]); | 448 | total = avg_stats(&runtime_branches_stats[cpu]); |
@@ -450,7 +450,7 @@ static void abs_printout(int cpu, struct perf_evsel *evsel, double avg) | |||
450 | if (total) | 450 | if (total) |
451 | ratio = avg * 100 / total; | 451 | ratio = avg * 100 / total; |
452 | 452 | ||
453 | fprintf(stderr, " # %10.3f %% ", ratio); | 453 | fprintf(stderr, " # %10.3f %%", ratio); |
454 | 454 | ||
455 | } else if (runtime_nsecs_stats[cpu].n != 0) { | 455 | } else if (runtime_nsecs_stats[cpu].n != 0) { |
456 | total = avg_stats(&runtime_nsecs_stats[cpu]); | 456 | total = avg_stats(&runtime_nsecs_stats[cpu]); |
@@ -459,6 +459,13 @@ static void abs_printout(int cpu, struct perf_evsel *evsel, double avg) | |||
459 | ratio = 1000.0 * avg / total; | 459 | ratio = 1000.0 * avg / total; |
460 | 460 | ||
461 | fprintf(stderr, " # %10.3f M/sec", ratio); | 461 | fprintf(stderr, " # %10.3f M/sec", ratio); |
462 | } else if (perf_evsel__match(evsel, HARDWARE, HW_STALLED_CYCLES)) { | ||
463 | total = avg_stats(&runtime_cycles_stats[cpu]); | ||
464 | |||
465 | if (total) | ||
466 | ratio = avg / total * 100.0; | ||
467 | |||
468 | fprintf(stderr, " # (%5.2f%% of all cycles )", ratio); | ||
462 | } | 469 | } |
463 | } | 470 | } |
464 | 471 | ||