Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

perf tools: Fix compile error on sample->user_regs

It's recently changed to allocate dynamically but misses to update some
arch-dependent codes to use perf_sample__user_regs().

Fixes: dc6d2bc2d893a878 ("perf sample: Make user_regs and intr_regs optional")
Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Reviewed-by: Ian Rogers <irogers@google.com>
Link: https://lore.kernel.org/r/20250214191641.756664-1-namhyung@kernel.org
Signed-off-by: Namhyung Kim <namhyung@kernel.org>

+8 -8
+1 -1
tools/perf/arch/arm/tests/dwarf-unwind.c
··· 45 45 int test__arch_unwind_sample(struct perf_sample *sample, 46 46 struct thread *thread) 47 47 { 48 - struct regs_dump *regs = &sample->user_regs; 48 + struct regs_dump *regs = perf_sample__user_regs(sample); 49 49 u64 *buf; 50 50 51 51 buf = calloc(1, sizeof(u64) * PERF_REGS_MAX);
+1 -1
tools/perf/arch/arm/util/unwind-libdw.c
··· 8 8 bool libdw__arch_set_initial_registers(Dwfl_Thread *thread, void *arg) 9 9 { 10 10 struct unwind_info *ui = arg; 11 - struct regs_dump *user_regs = &ui->sample->user_regs; 11 + struct regs_dump *user_regs = perf_sample__user_regs(ui->sample); 12 12 Dwarf_Word dwarf_regs[PERF_REG_ARM_MAX]; 13 13 14 14 #define REG(r) ({ \
+1 -1
tools/perf/arch/csky/util/unwind-libdw.c
··· 10 10 bool libdw__arch_set_initial_registers(Dwfl_Thread *thread, void *arg) 11 11 { 12 12 struct unwind_info *ui = arg; 13 - struct regs_dump *user_regs = &ui->sample->user_regs; 13 + struct regs_dump *user_regs = perf_sample__user_regs(ui->sample); 14 14 Dwarf_Word dwarf_regs[PERF_REG_CSKY_MAX]; 15 15 16 16 #define REG(r) ({ \
+1 -1
tools/perf/arch/loongarch/util/unwind-libdw.c
··· 10 10 bool libdw__arch_set_initial_registers(Dwfl_Thread *thread, void *arg) 11 11 { 12 12 struct unwind_info *ui = arg; 13 - struct regs_dump *user_regs = &ui->sample->user_regs; 13 + struct regs_dump *user_regs = perf_sample__user_regs(ui->sample); 14 14 Dwarf_Word dwarf_regs[PERF_REG_LOONGARCH_MAX]; 15 15 16 16 #define REG(r) ({ \
+1 -1
tools/perf/arch/powerpc/tests/dwarf-unwind.c
··· 45 45 int test__arch_unwind_sample(struct perf_sample *sample, 46 46 struct thread *thread) 47 47 { 48 - struct regs_dump *regs = &sample->user_regs; 48 + struct regs_dump *regs = perf_sample__user_regs(sample); 49 49 u64 *buf; 50 50 51 51 buf = calloc(1, sizeof(u64) * PERF_REGS_MAX);
+1 -1
tools/perf/arch/powerpc/util/unwind-libdw.c
··· 16 16 bool libdw__arch_set_initial_registers(Dwfl_Thread *thread, void *arg) 17 17 { 18 18 struct unwind_info *ui = arg; 19 - struct regs_dump *user_regs = &ui->sample->user_regs; 19 + struct regs_dump *user_regs = perf_sample__user_regs(ui->sample); 20 20 Dwarf_Word dwarf_regs[32], dwarf_nip; 21 21 size_t i; 22 22
+1 -1
tools/perf/arch/riscv/util/unwind-libdw.c
··· 10 10 bool libdw__arch_set_initial_registers(Dwfl_Thread *thread, void *arg) 11 11 { 12 12 struct unwind_info *ui = arg; 13 - struct regs_dump *user_regs = &ui->sample->user_regs; 13 + struct regs_dump *user_regs = perf_sample__user_regs(ui->sample); 14 14 Dwarf_Word dwarf_regs[32]; 15 15 16 16 #define REG(r) ({ \
+1 -1
tools/perf/arch/s390/util/unwind-libdw.c
··· 11 11 bool libdw__arch_set_initial_registers(Dwfl_Thread *thread, void *arg) 12 12 { 13 13 struct unwind_info *ui = arg; 14 - struct regs_dump *user_regs = &ui->sample->user_regs; 14 + struct regs_dump *user_regs = perf_sample__user_regs(ui->sample); 15 15 Dwarf_Word dwarf_regs[ARRAY_SIZE(s390_dwarf_regs)]; 16 16 17 17 #define REG(r) ({ \