Re: [PATCH 3/6] perf/core: Add a callback to perf events

Frederic Weisbecker
2009-11-02T13:01:50Z

On Mon, Nov 02, 2009 at 02:49:32PM +1100, Paul Mackerras wrote:
> Frederic Weisbecker writes:
>
> > @@ -4335,6 +4336,15 @@ perf_event_alloc(struct perf_event_attr *attr,
> >
> > event->state = PERF_EVENT_STATE_INACTIVE;
> >
> > + if (!callback) {
> > + if (parent_event)
> > + event->callback = parent_event->callback;
> > + else
> > + event->callback = NULL;
> > + } else {
> > + event->callback = callback;
> > + }
>
> Wouldn't this be simpler and clearer as:
>
> if (!callback && parent_event)
> callback = parent_event->callback;
> event->callback = callback;
>
> ?
>
> Paul.

Yep, I'm going to change that.
Thanks.