public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: John Garry <john.garry@huawei.com>
Cc: Jiri Olsa <jolsa@redhat.com>,
	peterz@infradead.org, mingo@redhat.com, mark.rutland@arm.com,
	alexander.shishkin@linux.intel.com, namhyung@kernel.org,
	irogers@google.com, kan.liang@linux.intel.com,
	linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] perf pmu: Fix event list for uncore PMUs
Date: Tue, 21 Dec 2021 17:48:55 -0300	[thread overview]
Message-ID: <YcI9twHCIiFyUDOu@kernel.org> (raw)
In-Reply-To: <43e185f6-9fa7-6ae1-e4fd-c90c6a50f68f@huawei.com>

Em Tue, Dec 21, 2021 at 10:14:42AM +0000, John Garry escreveu:
> On 21/12/2021 09:35, Jiri Olsa wrote:
> > On Tue, Dec 21, 2021 at 09:10:37AM +0000, John Garry wrote:
> > > On 21/12/2021 07:58, Jiri Olsa wrote:
> > > > > +	/* Different names -> never duplicates */
> > > > > +	if (strcmp(alias_a->name, alias_b->name))
> > > > > +		return false;
> > > > > +	if (!alias_a->pmu)
> > > > > +		return true;
> > > > > +	if (!alias_b->pmu)
> > > > > +		return true;
> > > > nit could be:
> > > > 
> > > > 	if (!alias_a->pmu || !alias_b->pmu)
> > > > 		return true;
> > > > 
> > > > would be great to have more comments explaining the check
> > > > 
> > > 
> > > This is just a sanity check that both strings are non-NULL as we do a
> > > strcmp() next. So would this be better:
> > > 
> > > if (!alias_a->pmu || !alias_b->pmu || !strcmp(alias_a->pmu, alias_b->pmu))
> > > 	return true
> > > 
> > > ?
> > > 
> > > It will spill a line.
> > 
> > sure, it cought my eye because the is_cpu check later is done on
> > the same line, so I started wondering what's the difference ;-)
> > 
> 
> Now thinking a bit more I am not confident that this patch is a full fix.
> 
> arm have heterogeneous CPU systems as well - which are not "hybrid" - and I
> need to ensure that aliasing is still working properly there, as I think
> that this following check would stop removing duplicates there:
> 
> +	/* uncore PMUs */
> +	if (!alias_a->is_cpu && !alias_b->is_cpu)
> +		return true;
> +	return false;

I was about to process this, do you think its better to revert the
original patch while this gets fixed?

- Arnaldo

  reply	other threads:[~2021-12-21 20:49 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-16 15:53 [PATCH] perf pmu: Fix event list for uncore PMUs John Garry
2021-12-18  1:47 ` Arnaldo Carvalho de Melo
2021-12-20  8:38   ` John Garry
2021-12-20 16:34     ` Liang, Kan
2021-12-21  6:59       ` Xing Zhengjun
2021-12-21  7:58 ` Jiri Olsa
2021-12-21  9:10   ` John Garry
2021-12-21  9:35     ` Jiri Olsa
2021-12-21 10:14       ` John Garry
2021-12-21 20:48         ` Arnaldo Carvalho de Melo [this message]
2021-12-22 13:08           ` John Garry

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=YcI9twHCIiFyUDOu@kernel.org \
    --to=acme@kernel.org \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=irogers@google.com \
    --cc=john.garry@huawei.com \
    --cc=jolsa@redhat.com \
    --cc=kan.liang@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mingo@redhat.com \
    --cc=namhyung@kernel.org \
    --cc=peterz@infradead.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox