aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/bench
diff options
context:
space:
mode:
authorHitoshi Mitake <mitake@dcl.info.waseda.ac.jp>2009-11-10 10:04:01 -0500
committerIngo Molnar <mingo@elte.hu>2009-11-10 13:56:45 -0500
commitff676b193a401b23c84a79a7ec06559f3eaae917 (patch)
tree7b66a2bbc2659c7aab6b90ca16e9b9ecbb461253 /tools/perf/bench
parent79e295d4bd0f524257299e7c4e42f643f21abcc2 (diff)
perf bench: Improve sched-pipe.c with more comfortable output
This patch improves sched-pipe.c with more comfortable output. Change points are comment style description and formatting numerical values and its units. Example: | % ./perf bench sched pipe | # Running sched/pipe benchmark... | # Extecuted 1000000 pipe operations between two tasks | | Total time:5.822 [sec] | | 5.822553 usecs/op | 171745 ops/sec Signed-off-by: Hitoshi Mitake <mitake@dcl.info.waseda.ac.jp> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Paul Mackerras <paulus@samba.org> LKML-Reference: <1257865442-20252-3-git-send-email-mitake@dcl.info.waseda.ac.jp> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'tools/perf/bench')
-rw-r--r--tools/perf/bench/sched-pipe.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/tools/perf/bench/sched-pipe.c b/tools/perf/bench/sched-pipe.c
index a9ac186714b4..238185f97977 100644
--- a/tools/perf/bench/sched-pipe.c
+++ b/tools/perf/bench/sched-pipe.c
@@ -92,17 +92,18 @@ int bench_sched_pipe(int argc, const char **argv,
92 92
93 switch (bench_format) { 93 switch (bench_format) {
94 case BENCH_FORMAT_DEFAULT: 94 case BENCH_FORMAT_DEFAULT:
95 printf("(executing %d pipe operations between two tasks)\n\n", 95 printf("# Extecuted %d pipe operations between two tasks\n\n",
96 loops); 96 loops);
97 97
98 result_usec = diff.tv_sec * 1000000; 98 result_usec = diff.tv_sec * 1000000;
99 result_usec += diff.tv_usec; 99 result_usec += diff.tv_usec;
100 100
101 printf("\tTotal time:%lu.%03lu sec\n", 101 printf(" %14s: %lu.%03lu [sec]\n\n", "Total time",
102 diff.tv_sec, diff.tv_usec / 1000); 102 diff.tv_sec, diff.tv_usec/1000);
103 printf("\t\t%lf usecs/op\n", 103
104 printf(" %14lf usecs/op\n",
104 (double)result_usec / (double)loops); 105 (double)result_usec / (double)loops);
105 printf("\t\t%d ops/sec\n", 106 printf(" %14d ops/sec\n",
106 (int)((double)loops / 107 (int)((double)loops /
107 ((double)result_usec / (double)1000000))); 108 ((double)result_usec / (double)1000000)));
108 break; 109 break;