Re: [PATCH] RFC: perf: Make overflow signals inheritable

From: Peter Zijlstra
Date: Mon Jul 07 2014 - 05:13:22 EST


On Wed, Jun 25, 2014 at 04:12:09PM -0400, Christopher Covington wrote:
> In order to get a signal from the perf events framework (use an
> "event_limit"), one must not not only call perf_event_open() with the
> appropriate sample_period, watermark, and wakeup_watermark values,
> but also set the FASYNC flag on the resulting file descriptor with
> fcntl().

Tell me more; why are you wanting this?

> If the inherit attribute is also set, one would expect child
> tasks to cause signals like their parents. They don't, though,
> because their FASYNC setting isn't set (and can't be by the user
> since only the parent has a file descriptor). To fix this, allow the
> parent's FASYNC value to be passed along to child events when the
> inherit attribute is set. Overflow counts are still per process and
> per CPU.

There's more issues though; the comment you deleted isn't explicit about
this (it maybe should have been).

This would mean the inherited children would get signals; they might not
be expecting them.

When they do get a signal, they should be calling IOC_REFRESH to re-arm
the signal, but that explicitly doesn't work for inherited events. Which
leads me to believe you didn't actually test this.

Attachment: pgpMLj4Ch2VXc.pgp
Description: PGP signature