Skip to contentSkip to conversation

perf build: Add warning for when vmlinux.h generation fails

PATCH In review Ian Rogers 2 participants 2 messages Mar 22, 2023 perf events

lore
Share & tools
lore

Ian Rogers

author reviewer
#0 lore raw

PATCH 1/1 perf build: Add warning for when vmlinux.h generation fails

The warning advises on the NO_BPF_SKEL=1 option.

---
 tools/perf/Makefile.perf | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
tools/perf/Makefile.perf +5 -1
index ed6b6a070f79..48aba186ceb5 100644
@@ -1072,7 +1072,11 @@ VMLINUX_BTF ?= $(abspath $(firstword $(wildcard $(VMLINUX_BTF_PATHS))))
 
 $(SKEL_OUT)/vmlinux.h: $(VMLINUX_BTF) $(BPFTOOL)
 ifeq ($(VMLINUX_H),)
-	$(QUIET_GEN)$(BPFTOOL) btf dump file $< format c > $@
+	$(QUIET_GEN)$(BPFTOOL) btf dump file $< format c > $@ || \
+	(echo "Failure to generate vmlinux.h needed for the recommended BPF skeleton support." && \
+	echo "To disable this use the build option NO_BPF_SKEL=1." && \
+	echo "Alternatively point at a pre-generated vmlinux.h with VMLINUX_H=<path>." && \
+	false)
 else
 	$(Q)cp "$(VMLINUX_H)" $@
 endif
Signature · 1 line
2.40.0.rc1.284.g88254d51c5-goog
#1 lore raw

Em Wed, Mar 22, 2023 at 11:31:08AM -0700, Ian Rogers escreveu:

Quoted 1 line

The warning advises on the NO_BPF_SKEL=1 option.

Looks ok, applying.

- Arnaldo

Quoted 26 lines
---
 tools/perf/Makefile.perf | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
tools/perf/Makefile.perf +5 -1
index ed6b6a070f79..48aba186ceb5 100644
@@ -1072,7 +1072,11 @@ VMLINUX_BTF ?= $(abspath $(firstword $(wildcard $(VMLINUX_BTF_PATHS))))
 
 $(SKEL_OUT)/vmlinux.h: $(VMLINUX_BTF) $(BPFTOOL)
 ifeq ($(VMLINUX_H),)
-	$(QUIET_GEN)$(BPFTOOL) btf dump file $< format c > $@
+	$(QUIET_GEN)$(BPFTOOL) btf dump file $< format c > $@ || \
+	(echo "Failure to generate vmlinux.h needed for the recommended BPF skeleton support." && \
+	echo "To disable this use the build option NO_BPF_SKEL=1." && \
+	echo "Alternatively point at a pre-generated vmlinux.h with VMLINUX_H=<path>." && \
+	false)
 else
 	$(Q)cp "$(VMLINUX_H)" $@
 endif
Signature · 1 line
2.40.0.rc1.284.g88254d51c5-goog
Signature · 1 line
- Arnaldo