Re: perf: behavior of poll() changed in 3.18
From: Vince Weaver
Date: Thu Jan 22 2015 - 01:52:46 EST
On Wed, 21 Jan 2015, Jiri Olsa wrote:
>
> However if we revert this code, we'll loose nice (and standard) way
> to check if the event is still valid.. not sure how to handle this.
there's likely no need to revert as my code wasn't really released and
I've already fixed it to work with the new interface.
I was mostly asking just so I could update the manpage to explain the new
behavior, as tools that expect to be backwards compatible will have to
handle both ways of detecting a process dieing.
> > Part of why my code doesn't just exit on POLLHUP is because you can
> > get that result for reasons other than a process exit (for example,
> > if you are using ioctl(PERF_EVENT_IOC_REFRESH)
>
> Nope, this is related to POOL_HUP (notice the '_') which you'll get
> accompanied with SIGIO if you setup this.
So what happens if you are using a signal handler to monitor a child and
the child exits?
It's a shame the poll and signal handler interfaces are subtly different,
though I guess some of that is probably due to historical reasons.
Vince
--
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/