All of lore.kernel.org
 help / color / mirror / Atom feed
From: Namhyung Kim <namhyung@kernel.org>
To: James Clark <james.clark@linaro.org>
Cc: linux-perf-users@vger.kernel.org, acme@kernel.org,
	irogers@google.com, Peter Zijlstra <peterz@infradead.org>,
	Ingo Molnar <mingo@redhat.com>,
	Mark Rutland <mark.rutland@arm.com>,
	Alexander Shishkin <alexander.shishkin@linux.intel.com>,
	Jiri Olsa <jolsa@kernel.org>,
	Adrian Hunter <adrian.hunter@intel.com>,
	"Liang, Kan" <kan.liang@linux.intel.com>,
	Yicong Yang <yangyicong@hisilicon.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] perf cpumap: Fix die and cluster IDs
Date: Wed, 18 Dec 2024 21:14:50 -0800	[thread overview]
Message-ID: <Z2OryhgI8IpxktAG@google.com> (raw)
In-Reply-To: <20241218115552.912517-1-james.clark@linaro.org>

Hello,

On Wed, Dec 18, 2024 at 11:55:51AM +0000, James Clark wrote:
> Now that filename__read_int() returns -errno instead of -1 these
> statements need to be updated otherwise error values will be used as
> die IDs.
> 
> This appears as a -2 die ID when the platform doesn't export one:
> 
>   $ perf stat --per-core -a -- true
> 
>   S36-D-2-C0            1               9.45 msec cpu-clock
> 
> And the session topology test fails:
> 
>   $ perf test -vvv topology
> 
>   CPU 0, core 0, socket 36
>   CPU 1, core 1, socket 36
>   CPU 2, core 2, socket 36
>   CPU 3, core 3, socket 36
>   FAILED tests/topology.c:137 Cpu map - Die ID doesn't match
>   ---- end(-1) ----
>   38: Session topology                                                : FAILED!
> 
> Fixes: 05be17eed774 ("tool api fs: Correctly encode errno for read/write open failures")
> Signed-off-by: James Clark <james.clark@linaro.org>

I think I reported the same issue earlier, anyway.

Acked-by: Namhyung Kim <namhyung@kernel.org>

Thanks,
Namhyung

> ---
>  tools/perf/util/cpumap.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/tools/perf/util/cpumap.c b/tools/perf/util/cpumap.c
> index 27094211edd8..5c329ad614e9 100644
> --- a/tools/perf/util/cpumap.c
> +++ b/tools/perf/util/cpumap.c
> @@ -293,7 +293,7 @@ struct aggr_cpu_id aggr_cpu_id__die(struct perf_cpu cpu, void *data)
>  
>  	die = cpu__get_die_id(cpu);
>  	/* There is no die_id on legacy system. */
> -	if (die == -1)
> +	if (die < 0)
>  		die = 0;
>  
>  	/*
> @@ -322,7 +322,7 @@ struct aggr_cpu_id aggr_cpu_id__cluster(struct perf_cpu cpu, void *data)
>  	struct aggr_cpu_id id;
>  
>  	/* There is no cluster_id on legacy system. */
> -	if (cluster == -1)
> +	if (cluster < 0)
>  		cluster = 0;
>  
>  	id = aggr_cpu_id__die(cpu, data);
> -- 
> 2.34.1
> 

  reply	other threads:[~2024-12-19  5:14 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-18 11:55 [PATCH] perf cpumap: Fix die and cluster IDs James Clark
2024-12-19  5:14 ` Namhyung Kim [this message]
2025-01-28 19:15 ` Namhyung Kim

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=Z2OryhgI8IpxktAG@google.com \
    --to=namhyung@kernel.org \
    --cc=acme@kernel.org \
    --cc=adrian.hunter@intel.com \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=irogers@google.com \
    --cc=james.clark@linaro.org \
    --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=peterz@infradead.org \
    --cc=yangyicong@hisilicon.com \
    /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.