lkml.org 
[lkml]   [2009]   [May]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 3/4] ring-buffer: add total count in ring-buffer-benchmark
On Fri, 08 May 2009 00:32:53 -0400 Steven Rostedt <rostedt@goodmis.org> wrote:

> --- a/kernel/trace/ring_buffer_benchmark.c
> +++ b/kernel/trace/ring_buffer_benchmark.c
> @@ -285,6 +285,17 @@ static void ring_buffer_producer(void)
> avg = 1000000 / hit;
> pr_info("%ld ns per entry\n", avg);
> }
> +
> +

s/\n\n/\n/

> + if (missed) {
> + if (time)
> + missed /= (long)time;
> +
> + pr_info("Total iterations per millisec: %ld\n", hit + missed);
> +
> + avg = 1000000 / (hit + missed);

s/1000000/USEC_PER_SEC/?
Hopefully we can't have hit+missed==0.

They're counters and hence should have unsigned types.

But even unsigned up-counters can add to zero if wrapping occurs.


> + pr_info("%ld ns per entry\n", avg);
> + }
> }


\
 
 \ /
  Last update: 2009-05-08 06:57    [from the cache]
©2003-2011 Jasper Spaans