[MODERATED] Re: [PATCH v3 2/6] PERFv3
Peter Zijlstra <[email protected]>
| Newsgroups | org.kernel.lore.historical-speck |
|---|---|
| Message-ID | <[email protected]> |
On Thu, Feb 07, 2019 at 03:41:04PM -0800, speck for Andi Kleen wrote:
> +static struct event_constraint *
> +skl_get_event_constraints(struct cpu_hw_events *cpuc, int idx,
> + struct perf_event *event)
> +{
> + struct event_constraint *c;
> +
> + c = hsw_get_event_constraints(cpuc, idx, event);
> +
> + if (!perf_enable_all_counters) {
> + cpuc->counter3_constraint = *c;
> + c = &cpuc->counter3_constraint;
> +
> + /*
> + * Without TFA we must not use PMC3.
> + */
> + __clear_bit(3, c->idxmsk);
> + }
> +
> + return c;
> +}
This is obviously broken... what if all 6 events are in use and have
different constraints?