[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?
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.