Skip to content

Commit 13b38e6

Browse files
AnubhavS1namhyung
authored andcommitted
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 <[email protected]> Reviewed-by: Ian Rogers <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Namhyung Kim <[email protected]>
1 parent 2d58468 commit 13b38e6

File tree

1 file changed

+0
-16
lines changed

1 file changed

+0
-16
lines changed

tools/perf/util/header.c

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2559,7 +2559,6 @@ static int process_cpu_topology(struct feat_fd *ff, void *data __maybe_unused)
25592559
int cpu_nr = ff->ph->env.nr_cpus_avail;
25602560
u64 size = 0;
25612561
struct perf_header *ph = ff->ph;
2562-
bool do_core_id_test = true;
25632562

25642563
ph->env.cpu = calloc(cpu_nr, sizeof(*ph->env.cpu));
25652564
if (!ph->env.cpu)
@@ -2614,15 +2613,6 @@ static int process_cpu_topology(struct feat_fd *ff, void *data __maybe_unused)
26142613
return 0;
26152614
}
26162615

2617-
/* On s390 the socket_id number is not related to the numbers of cpus.
2618-
* The socket_id number might be higher than the numbers of cpus.
2619-
* This depends on the configuration.
2620-
* AArch64 is the same.
2621-
*/
2622-
if (ph->env.arch && (!strncmp(ph->env.arch, "s390", 4)
2623-
|| !strncmp(ph->env.arch, "aarch64", 7)))
2624-
do_core_id_test = false;
2625-
26262616
for (i = 0; i < (u32)cpu_nr; i++) {
26272617
if (do_read_u32(ff, &nr))
26282618
goto free_cpu;
@@ -2633,12 +2623,6 @@ static int process_cpu_topology(struct feat_fd *ff, void *data __maybe_unused)
26332623
if (do_read_u32(ff, &nr))
26342624
goto free_cpu;
26352625

2636-
if (do_core_id_test && nr != (u32)-1 && nr > (u32)cpu_nr) {
2637-
pr_debug("socket_id number is too big."
2638-
"You may need to upgrade the perf tool.\n");
2639-
goto free_cpu;
2640-
}
2641-
26422626
ph->env.cpu[i].socket_id = nr;
26432627
size += sizeof(u32);
26442628
}

0 commit comments

Comments
 (0)