Re: [PATCH 16/48] perf core: Add backward attribute to perf event
From: Jiri Olsa
Date: Wed Feb 24 2016 - 08:22:12 EST
On Wed, Feb 24, 2016 at 02:08:50PM +0100, Jiri Olsa wrote:
> On Mon, Feb 22, 2016 at 09:10:43AM +0000, Wang Nan wrote:
>
> SNIP
>
> > + if (is_write_backward(output_event) != is_write_backward(event))
> > + goto out;
> > +
> > + /*
> > * If both events generate aux data, they must be on the same PMU
> > */
> > if (has_aux(event) && has_aux(output_event) &&
> > diff --git a/kernel/events/ring_buffer.c b/kernel/events/ring_buffer.c
> > index 37c11c6..80b1fa7 100644
> > --- a/kernel/events/ring_buffer.c
> > +++ b/kernel/events/ring_buffer.c
> > @@ -233,6 +233,8 @@ out:
> > int perf_output_begin(struct perf_output_handle *handle,
> > struct perf_event *event, unsigned int size)
> > {
> > + if (unlikely(is_write_backward(event)))
> > + return __perf_output_begin(handle, event, size, true);
> > return __perf_output_begin(handle, event, size, false);
>
> could this be just:
> return __perf_output_begin(handle, event, size,
> is_write_backward(event))
>
> also not sure if it's worth to have __perf_output_begin
> if the only difference to perf_output_begin is 'backward'
> argument that could be figured out from the event argument
> anyway
nevermind my second comment, just saw it being used also in next patches ;-)
jirka