Re: perf: behavior of poll() changed in 3.18

From: Jiri Olsa
Date: Tue Jan 20 2015 - 13:13:41 EST


On Tue, Jan 20, 2015 at 12:03:19PM -0500, Vince Weaver wrote:
> Hello
>
> Some of my code that used poll() on a perf_event fd broke sometime between
> 3.17 and current. (My perf_event_test validation testsuite caught this
> too but I haven't been running it as regularly as I should).
>
> I bisected this to:
>
> commit 179033b3e064d2cd3f5f9945e76b0a0f0fbf4883
> Author: Jiri Olsa <jolsa@xxxxxxxxxx>
> Date: Thu Aug 7 11:48:26 2014 -0400
>
> perf: Add PERF_EVENT_STATE_EXIT state for events with exited task
>
>
> Before, when polling, my code would get a
> result=0/WIFEXITED()
> return when a child with events being polled exited.
>
> Now instead I get a
> result=1/POLLHUP
> return.
>
> Needless to say this broke my code. Is there a reason this change was
> made?

hi,
I made this change to get notification that monitored
process exited. We use it in 'perf record' to find out
that we have nothing more to monitor and quit.

The logic is to return POLLHUP (via poll syscall) when
the monitored process exits for the event.

Could you please share your test code?

thanks,
jirka
--
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/