Re: [RESEND PATCH V3] perf/x86: Consider pinned events for group validation

From: Andi Kleen
Date: Fri Jan 17 2020 - 11:22:39 EST


> So I still completely hate this, because it makes the counter scheduling
> more eratic.
>
> It changes a situation where we only have false-positives (we allow
> scheduling a group that might not ever get to run) into a situation
> where we can have both false-positives and false-negatives.
>
> Imagine the pinned event is for a currently running task; and that task
> only runs sporadically. Then you can sometimes not create the group, but
> mostly it'll work.

Right now we have real situations which always fail because of this.

>
> Yes, this is all very annoying, but I really don't see how this makes
> anything any better.

The problem this is trying to solve is that some -M metrics fail
systematically with the NMI watchdog on. Metrics use weak groups
to avoid needing to have the full knowledge how events
can be scheduled in the user tools. So they ely on weak groups working.

Some of the JSON metrics have groups which always validate, but never
schedule with the NMI watchdog on.

If you have a better proposal to solve this problem please share
it.

I suppose we could use export at least the number of available counters
in sysfs and then split the groups in the user tools (and assume
that's good enough and full counter constraints are not needed)
I have some older patches to export the number at least. But fixing the
group validation seems better.

-Andi