Linux Perf Users
 help / color / mirror / Atom feed
From: "Falcon, Thomas" <thomas.falcon@intel.com>
To: "namhyung@kernel.org" <namhyung@kernel.org>
Cc: "alexander.shishkin@linux.intel.com"
	<alexander.shishkin@linux.intel.com>,
	"peterz@infradead.org" <peterz@infradead.org>,
	"acme@kernel.org" <acme@kernel.org>,
	"linux-perf-users@vger.kernel.org"
	<linux-perf-users@vger.kernel.org>,
	"mingo@redhat.com" <mingo@redhat.com>,
	"Hunter, Adrian" <adrian.hunter@intel.com>,
	"irogers@google.com" <irogers@google.com>,
	"jolsa@kernel.org" <jolsa@kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"kan.liang@linux.intel.com" <kan.liang@linux.intel.com>,
	"mark.rutland@arm.com" <mark.rutland@arm.com>
Subject: Re: [PATCH] perf stat: Fix uniquify for hybrid systems
Date: Mon, 3 Mar 2025 17:14:00 +0000	[thread overview]
Message-ID: <9518fabeb6a2bb206cd9219f2e18af86e19663c5.camel@intel.com> (raw)
In-Reply-To: <Z8JQRbjuhILt7-B4@google.com>

On Fri, 2025-02-28 at 16:09 -0800, Namhyung Kim wrote:
> Hello,
> 
> On Fri, Feb 28, 2025 at 01:53:51PM -0600, Thomas Falcon wrote:
> > Currently, perf stat is omitting the pmu name for legacy events
> > on hybrid systems. git bisect indicated commit 357b965deba9 as the
> > cause:
> > 
> > Bisecting: 0 revisions left to test after this (roughly 0 steps)
> > [357b965deba9fb71467413e473764ec4e1694d8d] perf stat: Changes to
> > event
> > name uniquification
> > 
> > Include an additional check for hybrid architectures when
> > determining
> > whether to uniquify legacy events.
> > 
> > Before:
> > 
> > $ sudo ./perf stat -e cycles -a sleep 1
> > 
> >  Performance counter stats for 'system wide':
> > 
> >        173,903,751      cycles
> >        666,423,950      cycles
> > 
> >        1.006615048 seconds time elapsed
> > 
> > After:
> > 
> > $ sudo ./perf stat -e cycles -a sleep 1
> > 
> >  Performance counter stats for 'system wide':
> > 
> >        841,496,603      cpu_atom/cycles/
> >      3,308,929,412      cpu_core/cycles/
> > 
> >        1.002483283 seconds time elapsed
> > 
> > Fixes: 357b965deba9 ("perf stat: Changes to event name
> > uniquification")
> > Signed-off-by: Thomas Falcon <thomas.falcon@intel.com>
> 
> Thanks for the fix, but there's a similar patch in the list.
> Please take a look.
> 
> https://lore.kernel.org/r/20250226145526.632380-1-james.clark@linaro.org
> 

Will do, thanks!

Tom
> Thanks,
> Namhyung
> 
> > ---
> >  tools/perf/util/stat-display.c | 6 ++++--
> >  1 file changed, 4 insertions(+), 2 deletions(-)
> > 
> > diff --git a/tools/perf/util/stat-display.c b/tools/perf/util/stat-
> > display.c
> > index e65c7e9f15d1..df9f68080ec9 100644
> > --- a/tools/perf/util/stat-display.c
> > +++ b/tools/perf/util/stat-display.c
> > @@ -1676,6 +1676,7 @@ static bool evlist__disable_uniquify(const
> > struct evlist *evlist)
> >  
> >  static void evsel__set_needs_uniquify(struct evsel *counter, const
> > struct perf_stat_config *config)
> >  {
> > +	bool hybrid = (!config->hybrid_merge &&
> > evsel__is_hybrid(counter));
> >  	struct evsel *evsel;
> >  
> >  	if (counter->merged_stat) {
> > @@ -1688,7 +1689,8 @@ static void evsel__set_needs_uniquify(struct
> > evsel *counter, const struct perf_s
> >  		return;
> >  	}
> >  
> > -	if  (counter->core.attr.type < PERF_TYPE_MAX && counter-
> > >core.attr.type != PERF_TYPE_RAW) {
> > +	if (!hybrid && counter->core.attr.type < PERF_TYPE_MAX &&
> > +		counter->core.attr.type != PERF_TYPE_RAW) {
> >  		/* Legacy event, don't uniquify. */
> >  		return;
> >  	}
> > @@ -1705,7 +1707,7 @@ static void evsel__set_needs_uniquify(struct
> > evsel *counter, const struct perf_s
> >  		return;
> >  	}
> >  
> > -	if (!config->hybrid_merge && evsel__is_hybrid(counter)) {
> > +	if (hybrid) {
> >  		/* Unique hybrid counters necessary. */
> >  		counter->needs_uniquify = true;
> >  		return;
> > -- 
> > 2.48.1
> > 


      reply	other threads:[~2025-03-03 17:14 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-28 19:53 [PATCH] perf stat: Fix uniquify for hybrid systems Thomas Falcon
2025-03-01  0:09 ` Namhyung Kim
2025-03-03 17:14   ` Falcon, Thomas [this message]

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=9518fabeb6a2bb206cd9219f2e18af86e19663c5.camel@intel.com \
    --to=thomas.falcon@intel.com \
    --cc=acme@kernel.org \
    --cc=adrian.hunter@intel.com \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=irogers@google.com \
    --cc=jolsa@kernel.org \
    --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