Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 169615
b: refs/heads/master
c: 158ba82
h: refs/heads/master
i:
  169613: d5baa42
  169611: 2fce635
  169607: 0b1e7d7
  169599: 2e6fb7e
v: v3
  • Loading branch information
Hitoshi Mitake authored and Ingo Molnar committed Nov 10, 2009
1 parent 1608059 commit 3ff9a25
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 9 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: cced06c62a9db6bd6d77e3f0a57dbe47a26d881e
refs/heads/master: 158ba827f6deef4102c5247ed4b6a587f0bd6a07
22 changes: 14 additions & 8 deletions trunk/tools/perf/bench/sched-pipe.c
Original file line number Diff line number Diff line change
Expand Up @@ -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()
};

Expand Down Expand Up @@ -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);

Expand All @@ -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;
Expand Down

0 comments on commit 3ff9a25

Please sign in to comment.