Skip to content

Commit

Permalink
ring-buffer: add total count in ring-buffer-benchmark
Browse files Browse the repository at this point in the history
It is nice to see the overhead of the benchmark test when tracing is
disabled. That is, we turn off the ring buffer just to see what the
cost of running the loop that calls into the ring buffer is.

Currently, if no entries wer made, we get 0. This is not informative.
This patch changes it to check if we had any "missed" (non recorded)
events. If so, a total count is also reported.

[ Impact: evaluate the over head of the ring buffer benchmark test ]

Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
  • Loading branch information
Steven Rostedt authored and Steven Rostedt committed May 7, 2009
1 parent 0574ea4 commit 7da3046
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions kernel/trace/ring_buffer_benchmark.c
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,17 @@ static void ring_buffer_producer(void)
avg = 1000000 / hit;
pr_info("%ld ns per entry\n", avg);
}


if (missed) {
if (time)
missed /= (long)time;

pr_info("Total iterations per millisec: %ld\n", hit + missed);

avg = 1000000 / (hit + missed);
pr_info("%ld ns per entry\n", avg);
}
}

static void wait_to_die(void)
Expand Down

0 comments on commit 7da3046

Please sign in to comment.