Re: [PATCH 1/3] ring-buffer: add counters for commit overrun andnmi dropped entries

From: Andrew Morton
Date: Thu Apr 30 2009 - 23:25:27 EST


On Thu, 30 Apr 2009 23:11:52 -0400 (EDT) Steven Rostedt <rostedt@xxxxxxxxxxx> wrote:

> > hm. Four functions in a row, all of which differ in but a single line.
> >
> > unsigned long
> > ring_buffer_commit_overrun_cpu(struct ring_buffer *buffer, int cpu)
> > {
> > return some_common_function(buffer, cpu)->commit_overrun;
> > }
> >
> > ?
>
> But that actually takes thought. I like my cut and paste ;-)

Well, we all like your cut-n-paste, Steve.

Should you decide to retire the paste pot, and if you can bear to move
`struct ring_buffer' into a header, these four functions could be made
static inlines, with pleasant runtime results.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/