Re: [PATCH 01/20] perf: Add PERF_EVENT_STATE_EXIT state for events with exited task

Jiri Olsa
2014-08-11T12:22:48Z

On Mon, Aug 11, 2014 at 02:01:02PM +0200, Peter Zijlstra wrote:

SNIP

> > struct perf_event *event = file->private_data;
> > struct ring_buffer *rb;
> > - unsigned int events = POLL_HUP;
> > + unsigned int events = POLLHUP;
>
> Should not that be an independent bugfix? It is a silly little thing
> indeed, but it does change behaviour.

ok, I'll send it in a separate patch plus your suggestion
below in v2

>
> > poll_wait(file, &event->waitq, wait);
> > +
> > + if (event->state == PERF_EVENT_STATE_EXIT)
> > + return POLLHUP;
> > +
>
> So, seeing how events is already POLLHUP here, why not return that?
>
> > /*
> > * Pin the event->rb by taking event->mmap_mutex; otherwise
> > * perf_event_set_output() can swizzle our rb and make us miss wakeups.
> > @@ -7484,6 +7489,9 @@ __perf_event_exit_task(struct perf_event *child_event,
> > if (child_event->parent) {
> > sync_child_event(child_event, child);
> > free_event(child_event);
> > + } else {
> > + child_event->state = PERF_EVENT_STATE_EXIT;
> > + perf_event_wakeup(child_event);
> > }
> > }
>
> In any case, ACK on this patch, I'll assume you want to take the lot
> through acme seeing how its mostly tools bits.

yep

thanks,
jirka