Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 169614
b: refs/heads/master
c: cced06c
h: refs/heads/master
v: v3
  • Loading branch information
Hitoshi Mitake authored and Ingo Molnar committed Nov 10, 2009
1 parent d5baa42 commit 1608059
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 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: 386d7e9e542c2115d5d300747e57f503458a1617
refs/heads/master: cced06c62a9db6bd6d77e3f0a57dbe47a26d881e
18 changes: 11 additions & 7 deletions trunk/tools/perf/bench/sched-messaging.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ static int use_pipes = 0;
static unsigned int loops = 100;
static unsigned int thread_mode = 0;
static unsigned int num_groups = 10;
static int simple = 0;

struct sender_context {
unsigned int num_fds;
Expand Down Expand Up @@ -261,9 +260,6 @@ static const struct option options[] = {
"Specify number of groups"),
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 @@ -316,16 +312,24 @@ int bench_sched_messaging(int argc, const char **argv,

timersub(&stop, &start, &diff);

if (simple)
printf("%lu.%03lu\n", diff.tv_sec, diff.tv_usec/1000);
else {
switch (bench_format) {
case BENCH_FORMAT_DEFAULT:
printf("(%d sender and receiver %s per group)\n",
num_fds, thread_mode ? "threads" : "processes");
printf("(%d groups == %d %s run)\n\n",
num_groups, num_groups * 2 * num_fds,
thread_mode ? "threads" : "processes");
printf("\tTotal time:%lu.%03lu sec\n",
diff.tv_sec, diff.tv_usec/1000);
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 1608059

Please sign in to comment.