linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] perf header: exempt x86_64 from core id test
@ 2025-06-17 15:08 Anubhav Shelat
  2025-06-17 16:46 ` Ian Rogers
  0 siblings, 1 reply; 3+ messages in thread
From: Anubhav Shelat @ 2025-06-17 15:08 UTC (permalink / raw)
  To: mpetlan, acme, namhyung, irogers, linux-perf-users
  Cc: peterz, mingo, mark.rutland, alexander.shishkin, jolsa,
	adrian.hunter, kan.liang, dapeng1.mi, james.clark, Anubhav Shelat

On a VM running on an x86_64 architecture, it is possible for the socket
id to be greater than the processor number. So exclude x86_64 arch from
the core id test.

Signed-off-by: Anubhav Shelat <ashelat@redhat.com>
---
 tools/perf/util/header.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/tools/perf/util/header.c b/tools/perf/util/header.c
index e3cdc3b7b4ab..c1b4651d0c6a 100644
--- a/tools/perf/util/header.c
+++ b/tools/perf/util/header.c
@@ -2618,9 +2618,12 @@ static int process_cpu_topology(struct feat_fd *ff, void *data __maybe_unused)
 	 * The socket_id number might be higher than the numbers of cpus.
 	 * This depends on the configuration.
 	 * AArch64 is the same.
+	 * It is also possible for a VM running x86_64 to have a larger
+	 * socket_id number than the number of cpus.
 	 */
 	if (ph->env.arch && (!strncmp(ph->env.arch, "s390", 4)
-			  || !strncmp(ph->env.arch, "aarch64", 7)))
+			  || !strncmp(ph->env.arch, "aarch64", 7)
+			  || !strncmp(ph->env.arch, "x86_64", 6)))
 		do_core_id_test = false;
 
 	for (i = 0; i < (u32)cpu_nr; i++) {
-- 
2.49.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-06-18 13:55 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-17 15:08 [PATCH] perf header: exempt x86_64 from core id test Anubhav Shelat
2025-06-17 16:46 ` Ian Rogers
2025-06-18 13:55   ` Anubhav Shelat

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).