diff options
Diffstat (limited to 'tools/perf/bench/sched-pipe.c')
-rw-r--r-- | tools/perf/bench/sched-pipe.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/tools/perf/bench/sched-pipe.c b/tools/perf/bench/sched-pipe.c index 238185f97977..4f77c7c27640 100644 --- a/tools/perf/bench/sched-pipe.c +++ b/tools/perf/bench/sched-pipe.c | |||
@@ -1,6 +1,6 @@ | |||
1 | /* | 1 | /* |
2 | * | 2 | * |
3 | * builtin-bench-pipe.c | 3 | * sched-pipe.c |
4 | * | 4 | * |
5 | * pipe: Benchmark for pipe() | 5 | * pipe: Benchmark for pipe() |
6 | * | 6 | * |
@@ -87,7 +87,8 @@ int bench_sched_pipe(int argc, const char **argv, | |||
87 | if (pid) { | 87 | if (pid) { |
88 | retpid = waitpid(pid, &wait_stat, 0); | 88 | retpid = waitpid(pid, &wait_stat, 0); |
89 | assert((retpid == pid) && WIFEXITED(wait_stat)); | 89 | assert((retpid == pid) && WIFEXITED(wait_stat)); |
90 | return 0; | 90 | } else { |
91 | exit(0); | ||
91 | } | 92 | } |
92 | 93 | ||
93 | switch (bench_format) { | 94 | switch (bench_format) { |
@@ -99,7 +100,8 @@ int bench_sched_pipe(int argc, const char **argv, | |||
99 | result_usec += diff.tv_usec; | 100 | result_usec += diff.tv_usec; |
100 | 101 | ||
101 | printf(" %14s: %lu.%03lu [sec]\n\n", "Total time", | 102 | printf(" %14s: %lu.%03lu [sec]\n\n", "Total time", |
102 | diff.tv_sec, diff.tv_usec/1000); | 103 | diff.tv_sec, |
104 | (unsigned long) (diff.tv_usec/1000)); | ||
103 | 105 | ||
104 | printf(" %14lf usecs/op\n", | 106 | printf(" %14lf usecs/op\n", |
105 | (double)result_usec / (double)loops); | 107 | (double)result_usec / (double)loops); |
@@ -110,7 +112,8 @@ int bench_sched_pipe(int argc, const char **argv, | |||
110 | 112 | ||
111 | case BENCH_FORMAT_SIMPLE: | 113 | case BENCH_FORMAT_SIMPLE: |
112 | printf("%lu.%03lu\n", | 114 | printf("%lu.%03lu\n", |
113 | diff.tv_sec, diff.tv_usec / 1000); | 115 | diff.tv_sec, |
116 | (unsigned long) (diff.tv_usec / 1000)); | ||
114 | break; | 117 | break; |
115 | 118 | ||
116 | default: | 119 | default: |