All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Liang, Kan" <kan.liang@linux.intel.com>
To: Peter Zijlstra <peterz@infradead.org>
Cc: mingo@redhat.com, linux-kernel@vger.kernel.org,
	tglx@linutronix.de, acme@kernel.org, jolsa@kernel.org,
	eranian@google.com, alexander.shishkin@linux.intel.com,
	ak@linux.intel.com
Subject: Re: [PATCH V2 2/2] perf/x86/intel: Add Tremont core PMU support
Date: Thu, 11 Apr 2019 09:30:10 -0400	[thread overview]
Message-ID: <9ef797ad-bce6-2883-8245-20bdf0b79142@linux.intel.com> (raw)
In-Reply-To: <20190411090658.GD4038@hirez.programming.kicks-ass.net>



On 4/11/2019 5:06 AM, Peter Zijlstra wrote:
> On Wed, Apr 10, 2019 at 11:57:09AM -0700, kan.liang@linux.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.
>

Boom!

>> +{
>> +	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))

Should be
	if (constraint_match(&fixed0_counter0_constraint, event->hw.config))
>   			return &fixed0_counter0_constraint;
>   
>   		return &counter0_constraint;
> 
> 
> And maybe we should do:
> 
> 	s/fixed_counter0_constraint/fixed0_constraint/'
>

Yes, definitely. It has already caused confusions. :)

Thanks,
Kan

> Those two constraints only differ by a single character, that's bad for
> reading comprehension.
> 
> In fact, I just did that too.
> 

  reply	other threads:[~2019-04-11 13:30 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-10 18:57 [PATCH V2 0/2] perf: Add Tremont support kan.liang
2019-04-10 18:57 ` [PATCH V2 1/2] perf/x86/intel: Fix the checking for instruction event kan.liang
2019-04-10 18:57 ` [PATCH V2 2/2] perf/x86/intel: Add Tremont core PMU support kan.liang
2019-04-11  9:06   ` Peter Zijlstra
2019-04-11 13:30     ` Liang, Kan [this message]
2019-04-11 13:33       ` Peter Zijlstra
2019-04-11 14:13         ` Liang, Kan
2019-04-16 11:41   ` [tip:perf/core] " tip-bot for Kan Liang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9ef797ad-bce6-2883-8245-20bdf0b79142@linux.intel.com \
    --to=kan.liang@linux.intel.com \
    --cc=acme@kernel.org \
    --cc=ak@linux.intel.com \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=eranian@google.com \
    --cc=jolsa@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.