diff options
| -rw-r--r-- | tools/perf/bench/sched-pipe.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/tools/perf/bench/sched-pipe.c b/tools/perf/bench/sched-pipe.c index 3214ed20b1aa..6a29100e9282 100644 --- a/tools/perf/bench/sched-pipe.c +++ b/tools/perf/bench/sched-pipe.c | |||
| @@ -26,6 +26,7 @@ | |||
| 26 | #include <errno.h> | 26 | #include <errno.h> |
| 27 | #include <assert.h> | 27 | #include <assert.h> |
| 28 | #include <sys/time.h> | 28 | #include <sys/time.h> |
| 29 | #include <sys/types.h> | ||
| 29 | 30 | ||
| 30 | #define LOOPS_DEFAULT 1000000 | 31 | #define LOOPS_DEFAULT 1000000 |
| 31 | static int loops = LOOPS_DEFAULT; | 32 | static int loops = LOOPS_DEFAULT; |
| @@ -58,8 +59,8 @@ int bench_sched_pipe(int argc, const char **argv, | |||
| 58 | * discarding returned value of read(), write() | 59 | * discarding returned value of read(), write() |
| 59 | * causes error in building environment for perf | 60 | * causes error in building environment for perf |
| 60 | */ | 61 | */ |
| 61 | int ret; | 62 | int ret, wait_stat; |
| 62 | pid_t pid; | 63 | pid_t pid, retpid; |
| 63 | 64 | ||
| 64 | argc = parse_options(argc, argv, options, | 65 | argc = parse_options(argc, argv, options, |
| 65 | bench_sched_pipe_usage, 0); | 66 | bench_sched_pipe_usage, 0); |
| @@ -87,8 +88,11 @@ int bench_sched_pipe(int argc, const char **argv, | |||
| 87 | gettimeofday(&stop, NULL); | 88 | gettimeofday(&stop, NULL); |
| 88 | timersub(&stop, &start, &diff); | 89 | timersub(&stop, &start, &diff); |
| 89 | 90 | ||
| 90 | if (pid) | 91 | if (pid) { |
| 92 | retpid = waitpid(pid, &wait_stat, 0); | ||
| 93 | assert((retpid == pid) && WIFEXITED(wait_stat)); | ||
| 91 | return 0; | 94 | return 0; |
| 95 | } | ||
| 92 | 96 | ||
| 93 | if (simple) | 97 | if (simple) |
| 94 | printf("%lu.%03lu\n", | 98 | printf("%lu.%03lu\n", |
