aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnubhav Shelat <ashelat@redhat.com>2025-06-18 10:29:22 -0400
committerNamhyung Kim <namhyung@kernel.org>2025-06-20 13:49:46 -0700
commit13b38e6b8059de096ebddb5d770c2419943949b7 (patch)
tree9c43af2e1d80091fec251e61cb912cafc4099e8a
parentperf test: Add header shell test (diff)
downloadlinux-13b38e6b8059de096ebddb5d770c2419943949b7.tar.gz
linux-13b38e6b8059de096ebddb5d770c2419943949b7.zip
perf header: remove unecessary core id test
It is possible for systems to have a greater socket id number than the number of cpus present on a machine, so this test is obselete and should be removed. Signed-off-by: Anubhav Shelat <ashelat@redhat.com> Reviewed-by: Ian Rogers <irogers@google.com> Link: https://lore.kernel.org/r/20250618142921.4053400-2-ashelat@redhat.com Signed-off-by: Namhyung Kim <namhyung@kernel.org>
-rw-r--r--tools/perf/util/header.c16
1 files changed, 0 insertions, 16 deletions
diff --git a/tools/perf/util/header.c b/tools/perf/util/header.c
index e3cdc3b7b4ab..d7f6ff6974aa 100644
--- a/tools/perf/util/header.c
+++ b/tools/perf/util/header.c
@@ -2559,7 +2559,6 @@ static int process_cpu_topology(struct feat_fd *ff, void *data __maybe_unused)
int cpu_nr = ff->ph->env.nr_cpus_avail;
u64 size = 0;
struct perf_header *ph = ff->ph;
- bool do_core_id_test = true;
ph->env.cpu = calloc(cpu_nr, sizeof(*ph->env.cpu));
if (!ph->env.cpu)
@@ -2614,15 +2613,6 @@ static int process_cpu_topology(struct feat_fd *ff, void *data __maybe_unused)
return 0;
}
- /* On s390 the socket_id number is not related to the numbers of cpus.
- * The socket_id number might be higher than the numbers of cpus.
- * This depends on the configuration.
- * AArch64 is the same.
- */
- if (ph->env.arch && (!strncmp(ph->env.arch, "s390", 4)
- || !strncmp(ph->env.arch, "aarch64", 7)))
- do_core_id_test = false;
-
for (i = 0; i < (u32)cpu_nr; i++) {
if (do_read_u32(ff, &nr))
goto free_cpu;
@@ -2633,12 +2623,6 @@ static int process_cpu_topology(struct feat_fd *ff, void *data __maybe_unused)
if (do_read_u32(ff, &nr))
goto free_cpu;
- if (do_core_id_test && nr != (u32)-1 && nr > (u32)cpu_nr) {
- pr_debug("socket_id number is too big."
- "You may need to upgrade the perf tool.\n");
- goto free_cpu;
- }
-
ph->env.cpu[i].socket_id = nr;
size += sizeof(u32);
}