Re: Why is PERF_FORMAT_GROUP incompatible with inherited events?

From: Peter Zijlstra
Date: Sun Feb 14 2010 - 05:12:38 EST


On Fri, 2010-02-12 at 14:02 +1100, Paul Mackerras wrote:
> We currently have this code in perf_event_alloc() in kernel/perf_event.c:
>
> /*
> * we currently do not support PERF_FORMAT_GROUP on inherited events
> */
> if (attr->inherit && (attr->read_format & PERF_FORMAT_GROUP))
> goto done;
>
> plus there is a comment "XXX PERF_FORMAT_GROUP vs inherited events
> seems difficult" next to perf_output_read_group() (but there isn't a
> similar comment on perf_read_hw()).
>
> First, what is the difficulty referred to here?

IIRC its the fact that we have to go collect the count delta from all
the child counters, which can be quite a lot of work depending on the
number of cpus and children around.

> Secondly, if the difficulty is just to do with the intersection of
> sampling counters, inheritance, and group readout (as seems to be the
> case), could we please allow group readout on ordinary counting
> (non-sampling) counters? That is, change the test above to something
> like:
>
> if (attr->inherit && attr->sample_period &&
> (attr->read_format & PERF_FORMAT_GROUP))
> goto done;
>
> Any objections to that change? If it's OK, could we get it into .33
> and .32-stable?

Yeah, that's still broken, you can't do a read without collecting all
the child counts.


--
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/