perf c2c: Use more intention revealing iterator
Use perf_cpu_map__for_each_cpu() in setup_nodes. Signed-off-by: Ian Rogers <irogers@google.com> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com> Cc: Andi Kleen <ak@linux.intel.com> Cc: Ingo Molnar <mingo@redhat.com> Cc: James Clark <james.clark@arm.com> Cc: Jiri Olsa <jolsa@redhat.com> Cc: John Garry <john.garry@huawei.com> Cc: Kajol Jain <kjain@linux.ibm.com> Cc: Kan Liang <kan.liang@linux.intel.com> Cc: Leo Yan <leo.yan@linaro.org> Cc: Mark Rutland <mark.rutland@arm.com> Cc: Mathieu Poirier <mathieu.poirier@linaro.org> Cc: Mike Leach <mike.leach@linaro.org> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Paul Clarke <pc@us.ibm.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Riccardo Mancini <rickyman7@gmail.com> Cc: Stephane Eranian <eranian@google.com> Cc: Suzuki Poulouse <suzuki.poulose@arm.com> Cc: Vineet Singh <vineet.singh@intel.com> Cc: coresight@lists.linaro.org Cc: linux-arm-kernel@lists.infradead.org Cc: zhengjun.xing@intel.com Link: https://lore.kernel.org/r/20220105061351.120843-46-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
This commit is contained in:
parent
7263f3498b
commit
84d2f4f037
@ -2015,7 +2015,7 @@ static int setup_nodes(struct perf_session *session)
|
||||
{
|
||||
struct numa_node *n;
|
||||
unsigned long **nodes;
|
||||
int node, cpu;
|
||||
int node, cpu, idx;
|
||||
int *cpu2node;
|
||||
|
||||
if (c2c.node_info > 2)
|
||||
@ -2057,13 +2057,13 @@ static int setup_nodes(struct perf_session *session)
|
||||
if (perf_cpu_map__empty(map))
|
||||
continue;
|
||||
|
||||
for (cpu = 0; cpu < map->nr; cpu++) {
|
||||
set_bit(map->map[cpu], set);
|
||||
perf_cpu_map__for_each_cpu(cpu, idx, map) {
|
||||
set_bit(cpu, set);
|
||||
|
||||
if (WARN_ONCE(cpu2node[map->map[cpu]] != -1, "node/cpu topology bug"))
|
||||
if (WARN_ONCE(cpu2node[cpu] != -1, "node/cpu topology bug"))
|
||||
return -EINVAL;
|
||||
|
||||
cpu2node[map->map[cpu]] = node;
|
||||
cpu2node[cpu] = node;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user