[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190411090658.GD4038@hirez.programming.kicks-ass.net>
Date: Thu, 11 Apr 2019 11:06:58 +0200
From: Peter Zijlstra <peterz@...radead.org>
To: kan.liang@...ux.intel.com
Cc: mingo@...hat.com, linux-kernel@...r.kernel.org, tglx@...utronix.de,
acme@...nel.org, jolsa@...nel.org, eranian@...gle.com,
alexander.shishkin@...ux.intel.com, ak@...ux.intel.com
Subject: Re: [PATCH V2 2/2] perf/x86/intel: Add Tremont core PMU support
On Wed, Apr 10, 2019 at 11:57:09AM -0700, kan.liang@...ux.intel.com wrote:
> +static struct event_constraint *
> +tnt_get_event_constraints(struct cpu_hw_events *cpuc, int idx,
> + struct perf_event *event)
That 'tnt' still cracks me up, I keep seeing explosions.
> +{
> + struct event_constraint *c;
> +
> + /*
> + * :ppp means to do reduced skid PEBS,
> + * which is available on PMC0 and fixed counter 0.
> + */
> + if (event->attr.precise_ip == 3) {
> + /* Force instruction:ppp on PMC0 and Fixed counter 0 */
> + if (EVENT_CONFIG(event->hw.config) == X86_CONFIG(.event=0xc0))
> + return &fixed0_counter0_constraint;
> +
> + return &counter0_constraint;
> + }
> +
> + c = intel_get_event_constraints(cpuc, idx, event);
> +
> + return c;
> +}
I changed that like so:
--- a/arch/x86/events/intel/core.c
+++ b/arch/x86/events/intel/core.c
@@ -3508,7 +3508,7 @@ tnt_get_event_constraints(struct cpu_hw_
*/
if (event->attr.precise_ip == 3) {
/* Force instruction:ppp on PMC0 and Fixed counter 0 */
- if (EVENT_CONFIG(event->hw.config) == X86_CONFIG(.event=0xc0))
+ if (constraint_match(&fixed_counter0_constraint, event->hw.config))
return &fixed0_counter0_constraint;
return &counter0_constraint;
And maybe we should do:
s/fixed_counter0_constraint/fixed0_constraint/'
Those two constraints only differ by a single character, that's bad for
reading comprehension.
In fact, I just did that too.
Powered by blists - more mailing lists