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 <[email protected]> Acked-by: Ian Rogers <[email protected]> Cc: Adrian Hunter <[email protected]> Cc: Alexander Shishkin <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Jiri Olsa <[email protected]> Cc: John Garry <[email protected]> Cc: Leo Yan <[email protected]> Cc: Mark Rutland <[email protected]> Cc: Mike Leach <[email protected]> Cc: Namhyung Kim <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Will Deacon <[email protected]> Cc: [email protected] Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
1 parent 8669862 commit a3cee97

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

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)