Skip to contentSkip to conversation

perf tools riscv: Fix perf tool build error on riscv

PATCH Applied Eric Lin 2 participants 2 messages Dec 31, 2022 – Jan 2, 2023

Subsystems (2)
lore
Share & tools
lore

Eric Lin

author
#0 lore raw

PATCH 1/1 perf tools riscv: Fix perf tool build error on riscv

Since the definition of 'struct perf_sample' has been moved to sample.h, we need to include this header file to fix the build error as follows:

arch/riscv/util/unwind-libdw.c: In function 'libdw__arch_set_initial_registers':
arch/riscv/util/unwind-libdw.c:12:50: error: invalid use of undefined type 'struct perf_sample'
12 | struct regs_dump *user_regs = &ui->sample->user_regs;
| ^~

Fixes 9823147da6c8 ("perf tools: Move 'struct perf_sample' to a separate header file to disentangle headers")
---
 tools/perf/arch/riscv/util/unwind-libdw.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/arch/riscv/util/unwind-libdw.c +1 -1
index 19536e172850..54a198714eb8 100644
@@ -4,7 +4,7 @@
 #include <elfutils/libdwfl.h>
 #include "../../util/unwind-libdw.h"
 #include "../../util/perf_regs.h"
-#include "../../util/event.h"
+#include "../../util/sample.h"
 
 bool libdw__arch_set_initial_registers(Dwfl_Thread *thread, void *arg)
 {
Signature · 1 line
2.17.1
maintainer Applied
#1 lore raw

Em Sat, Dec 31, 2022 at 05:27:31AM +0000, Eric Lin escreveu:

Quoted 7 lines

Since the definition of 'struct perf_sample' has been moved to sample.h, we need to include this header file to fix the build error as follows:

arch/riscv/util/unwind-libdw.c: In function 'libdw__arch_set_initial_registers':
arch/riscv/util/unwind-libdw.c:12:50: error: invalid use of undefined type 'struct perf_sample'
12 | struct regs_dump *user_regs = &ui->sample->user_regs;
| ^~

Thanks, applied.

- Arnaldo

Quoted 21 lines
Fixes 9823147da6c8 ("perf tools: Move 'struct perf_sample' to a separate header file to disentangle headers")
---
 tools/perf/arch/riscv/util/unwind-libdw.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/arch/riscv/util/unwind-libdw.c +1 -1
index 19536e172850..54a198714eb8 100644
@@ -4,7 +4,7 @@
 #include <elfutils/libdwfl.h>
 #include "../../util/unwind-libdw.h"
 #include "../../util/perf_regs.h"
-#include "../../util/event.h"
+#include "../../util/sample.h"
 
 bool libdw__arch_set_initial_registers(Dwfl_Thread *thread, void *arg)
 {
Signature · 1 line
2.17.1
Signature · 1 line
- Arnaldo