Re: perf group read for inherited events
From: Vince Weaver
Date: Wed May 31 2017 - 17:09:41 EST
On Tue, 30 May 2017, Peter Zijlstra wrote:
> On Tue, May 30, 2017 at 01:55:33PM -0400, Vince Weaver wrote:
> > So the issue is currently if you were sampling, and you were sampling on
> > an event group, and you had set PERF_SAMPLE_READ to get all counts for a
> > group, and the event was also inherited....
>
> No, anything PERF_SAMPLE_READ (group or not) on inherited events is
> wrong.
ah, yes. I should fix the wording in the manpage as it's a bit confusing.
> > perf_event_open() would let
> > you do this even though the results would probably be wrong?
>
> Right, currently we have the filter on PERF_FORMAT_GROUP, but it should
> be PERF_SAMPLE_READ.
>
> So a !group SAMPLE_READ on inherited is currently allowed but returns
> 'interesting' values.
I'm not aware of anything that will break on fixing this.
Especially if we are always returning bad results then it would be better
to break things so we find people (if any) who are depending on the wrong
results.
Vince