diff options
author | Steven Rostedt <srostedt@redhat.com> | 2009-05-07 19:52:20 -0400 |
---|---|---|
committer | Steven Rostedt <rostedt@goodmis.org> | 2009-05-07 19:52:20 -0400 |
commit | 7da3046d6ce6ea97494020081c509b642b7016af (patch) | |
tree | 8bd27902977bc821980331054a6b2c5876bf2918 /kernel/trace/ring_buffer_benchmark.c | |
parent | 0574ea421b90e0e45a72c447dd3c2c79ffd8c153 (diff) |
ring-buffer: add total count in ring-buffer-benchmark
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>
Diffstat (limited to 'kernel/trace/ring_buffer_benchmark.c')
-rw-r--r-- | kernel/trace/ring_buffer_benchmark.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/kernel/trace/ring_buffer_benchmark.c b/kernel/trace/ring_buffer_benchmark.c index a7c048bb4466..a21aa7b3d05e 100644 --- a/kernel/trace/ring_buffer_benchmark.c +++ b/kernel/trace/ring_buffer_benchmark.c | |||
@@ -285,6 +285,17 @@ static void ring_buffer_producer(void) | |||
285 | avg = 1000000 / hit; | 285 | avg = 1000000 / hit; |
286 | pr_info("%ld ns per entry\n", avg); | 286 | pr_info("%ld ns per entry\n", avg); |
287 | } | 287 | } |
288 | |||
289 | |||
290 | if (missed) { | ||
291 | if (time) | ||
292 | missed /= (long)time; | ||
293 | |||
294 | pr_info("Total iterations per millisec: %ld\n", hit + missed); | ||
295 | |||
296 | avg = 1000000 / (hit + missed); | ||
297 | pr_info("%ld ns per entry\n", avg); | ||
298 | } | ||
288 | } | 299 | } |
289 | 300 | ||
290 | static void wait_to_die(void) | 301 | static void wait_to_die(void) |