Re: [PATCH 7/9] perf/x86/intel: Disable sampling read slots and topdown

From: Peter Zijlstra
Date: Wed May 29 2019 - 04:01:45 EST


On Tue, May 28, 2019 at 02:25:34PM -0400, Liang, Kan wrote:

> > > +static int icl_validate_group(struct cpu_hw_events *cpuc, int n)
> > > +{
> > > + bool has_sampling_slots = false, has_metrics = false;
> > > + struct perf_event *e;
> > > + int i;
> > > +
> > > + for (i = 0; i < n; i++) {
> > > + e = cpuc->event_list[i];
> > > + if (is_slots_event(e) && is_sampling_event(e))
> > > + has_sampling_slots = true;
> > > +
> > > + if (is_perf_metrics_event(e))
> > > + has_metrics = true;
> > > + }
> > > + if (unlikely(has_sampling_slots && has_metrics))
> > > + return -EINVAL;
> > > + return 0;
> > > +}
> >
> > Why this special hack, why not disallow sampling on SLOTS on creation?
>
> You mean unconditionally disable SLOTS sampling?
>
> The SLOTS doesn't have to be with Topdown metrics event.
> I think users may want to only sampling slot events. We should allow this
> usage.

Given the trainwreck these patches are, none of that is clear.