diff options
author | Ingo Molnar <mingo@elte.hu> | 2012-02-07 10:00:06 +0100 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2012-02-07 10:00:41 +0100 |
commit | 52fce956a7568504a1da90c14b9bf2deaad401bd (patch) | |
tree | 5f9ed93cbdfa8f8356fc0daea8fa2da07eeae7bd /tools/perf/builtin-stat.c | |
parent | 290436c9c61ac983b1bd425da67242a4357c7701 (diff) | |
parent | 9dac6a29e0ce0cd9dec497baa123e216b00b525d (diff) |
Merge tag 'perf-core-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core
perf/core fixes and improvements.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'tools/perf/builtin-stat.c')
-rw-r--r-- | tools/perf/builtin-stat.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c index 459b8620a5d..d14b37ad763 100644 --- a/tools/perf/builtin-stat.c +++ b/tools/perf/builtin-stat.c @@ -576,6 +576,8 @@ static void nsec_printout(int cpu, struct perf_evsel *evsel, double avg) if (perf_evsel__match(evsel, SOFTWARE, SW_TASK_CLOCK)) fprintf(output, " # %8.3f CPUs utilized ", avg / avg_stats(&walltime_nsecs_stats)); + else + fprintf(output, " "); } /* used for get_ratio_color() */ @@ -844,12 +846,18 @@ static void abs_printout(int cpu, struct perf_evsel *evsel, double avg) fprintf(output, " # %8.3f GHz ", ratio); } else if (runtime_nsecs_stats[cpu].n != 0) { + char unit = 'M'; + total = avg_stats(&runtime_nsecs_stats[cpu]); if (total) ratio = 1000.0 * avg / total; + if (ratio < 0.001) { + ratio *= 1000; + unit = 'K'; + } - fprintf(output, " # %8.3f M/sec ", ratio); + fprintf(output, " # %8.3f %c/sec ", ratio, unit); } else { fprintf(output, " "); } |