OSDN Git Service

perf build: Add warning for when vmlinux.h generation fails
authorIan Rogers <irogers@google.com>
Wed, 22 Mar 2023 18:31:08 +0000 (11:31 -0700)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Tue, 4 Apr 2023 12:39:54 +0000 (09:39 -0300)
The warning advises on the NO_BPF_SKEL=1 option.

Suggested-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Ian Rogers <irogers@google.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: https://lore.kernel.org/r/20230322183108.1380882-1-irogers@google.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/Makefile.perf

index ed6b6a0..48aba18 100644 (file)
@@ -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