From 3ff9a25f95272f5f6a43ba9887c0ae4dccdd3fae Mon Sep 17 00:00:00 2001 From: Hitoshi Mitake Date: Tue, 10 Nov 2009 08:20:02 +0900 Subject: [PATCH] --- yaml --- r: 169615 b: refs/heads/master c: 158ba827f6deef4102c5247ed4b6a587f0bd6a07 h: refs/heads/master i: 169613: d5baa42a1c60abbf884d687477618824abc5f84f 169611: 2fce635ee7d436f3086252ad392dc586201f7d8a 169607: 0b1e7d7b0251b3ba67bb77830dfb578f9b05ea22 169599: 2e6fb7e882f6a77e69a031f20f74a6e9aa8d75b1 v: v3 --- [refs] | 2 +- trunk/tools/perf/bench/sched-pipe.c | 22 ++++++++++++++-------- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/[refs] b/[refs] index 5edf152fc836..0cd124ae31d7 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: cced06c62a9db6bd6d77e3f0a57dbe47a26d881e +refs/heads/master: 158ba827f6deef4102c5247ed4b6a587f0bd6a07 diff --git a/trunk/tools/perf/bench/sched-pipe.c b/trunk/tools/perf/bench/sched-pipe.c index 6a29100e9282..a9ac186714b4 100644 --- a/trunk/tools/perf/bench/sched-pipe.c +++ b/trunk/tools/perf/bench/sched-pipe.c @@ -30,14 +30,10 @@ #define LOOPS_DEFAULT 1000000 static int loops = LOOPS_DEFAULT; -static int simple = 0; static const struct option options[] = { OPT_INTEGER('l', "loop", &loops, "Specify number of loops"), - OPT_BOOLEAN('s', "simple-output", &simple, - "Do simple output (this maybe useful for" - "processing by scripts or graph tools like gnuplot)"), OPT_END() }; @@ -94,10 +90,8 @@ int bench_sched_pipe(int argc, const char **argv, return 0; } - if (simple) - printf("%lu.%03lu\n", - diff.tv_sec, diff.tv_usec / 1000); - else { + switch (bench_format) { + case BENCH_FORMAT_DEFAULT: printf("(executing %d pipe operations between two tasks)\n\n", loops); @@ -111,6 +105,18 @@ int bench_sched_pipe(int argc, const char **argv, printf("\t\t%d ops/sec\n", (int)((double)loops / ((double)result_usec / (double)1000000))); + break; + + case BENCH_FORMAT_SIMPLE: + printf("%lu.%03lu\n", + diff.tv_sec, diff.tv_usec / 1000); + break; + + default: + /* reaching here is something disaster */ + fprintf(stderr, "Unknown format:%d\n", bench_format); + exit(1); + break; } return 0;