Skip to content

Commit a3cee97

Browse files
James-A-Clarkacmel
authored andcommitted
perf arm64: Fix build with refcount checking
With EXTRA_CFLAGS=-DREFCNT_CHECKING=1 and build-test, some unwrapped map accesses appear. Wrap it in the new accessor to fix the error: error: 'struct perf_cpu_map' has no member named 'map' Signed-off-by: James Clark <james.clark@arm.com> Acked-by: Ian Rogers <irogers@google.com> Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com> Cc: Ingo Molnar <mingo@redhat.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: John Garry <john.g.garry@oracle.com> Cc: Leo Yan <leo.yan@linaro.org> Cc: Mark Rutland <mark.rutland@arm.com> Cc: Mike Leach <mike.leach@linaro.org> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Will Deacon <will@kernel.org> Cc: linux-arm-kernel@lists.infradead.org Link: https://lore.kernel.org/r/20230504160845.2065510-1-james.clark@arm.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
1 parent 8669862 commit a3cee97

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

tools/perf/arch/arm64/util/header.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ static int _get_cpuid(char *buf, size_t sz, struct perf_cpu_map *cpus)
2929
char path[PATH_MAX];
3030
FILE *file;
3131

32-
scnprintf(path, PATH_MAX, "%s/devices/system/cpu/cpu%d"MIDR,
33-
sysfs, cpus->map[cpu]);
32+
scnprintf(path, PATH_MAX, "%s/devices/system/cpu/cpu%d" MIDR,
33+
sysfs, RC_CHK_ACCESS(cpus)->map[cpu].cpu);
3434

3535
file = fopen(path, "r");
3636
if (!file) {

tools/perf/arch/arm64/util/pmu.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ static struct perf_pmu *pmu__find_core_pmu(void)
1818
* The cpumap should cover all CPUs. Otherwise, some CPUs may
1919
* not support some events or have different event IDs.
2020
*/
21-
if (pmu->cpus->nr != cpu__max_cpu().cpu)
21+
if (RC_CHK_ACCESS(pmu->cpus)->nr != cpu__max_cpu().cpu)
2222
return NULL;
2323

2424
return pmu;

0 commit comments

Comments
 (0)