]> www.infradead.org Git - users/jedix/linux-maple.git/commit
perf tools: Fix compilation error on arm64
authorLeo Yan <leo.yan@arm.com>
Fri, 14 Feb 2025 11:10:25 +0000 (11:10 +0000)
committerNamhyung Kim <namhyung@kernel.org>
Fri, 14 Feb 2025 19:12:12 +0000 (11:12 -0800)
commitd18c882f85745f3c622e74b93151514b745de2ca
tree560bcb006eba2387e788ffe868c88a57d34de068
parent7c1e94f5dc9ea0f38b8fac14ae8193233e4f6afe
perf tools: Fix compilation error on arm64

Since the commit dc6d2bc2d893 ("perf sample: Make user_regs and
intr_regs optional"), the building for Arm64 reports error:

arch/arm64/util/unwind-libdw.c: In function ‘libdw__arch_set_initial_registers’:
arch/arm64/util/unwind-libdw.c:11:32: error: initialization of ‘struct regs_dump *’ from incompatible pointer type ‘struct regs_dump **’ [-Werror=incompatible-pointer-types]
   11 |  struct regs_dump *user_regs = &ui->sample->user_regs;
      |                                ^
cc1: all warnings being treated as errors
make[6]: *** [/home/niayan01/linux/tools/build/Makefile.build:85: arch/arm64/util/unwind-libdw.o] Error 1
make[5]: *** [/home/niayan01/linux/tools/build/Makefile.build:138: util] Error 2
arch/arm64/tests/dwarf-unwind.c: In function ‘test__arch_unwind_sample’:
arch/arm64/tests/dwarf-unwind.c:48:27: error: initialization of ‘struct regs_dump *’ from incompatible pointer type ‘struct regs_dump **’ [-Werror=incompatible-pointer-types]
   48 |  struct regs_dump *regs = &sample->user_regs;
      |                           ^

To fix the issue, use the helper perf_sample__user_regs() to retrieve
the user_regs.

Fixes: dc6d2bc2d893 ("perf sample: Make user_regs and intr_regs optional")
Signed-off-by: Leo Yan <leo.yan@arm.com>
Reviewed-by: James Clark <james.clark@linaro.org>
Link: https://lore.kernel.org/r/20250214111025.14478-1-leo.yan@arm.com
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
tools/perf/arch/arm64/tests/dwarf-unwind.c
tools/perf/arch/arm64/util/unwind-libdw.c