Skip to contentSkip to conversation

perf build: Error for BPF skeletons without LIBBPF

PATCH Applied Ian Rogers 3 participants 3 messages May 20, 2022 – May 23, 2022

Subsystems (4)
lore
Share & tools
lore

Ian Rogers

author reviewer
#0 lore raw

PATCH 1/1 perf build: Error for BPF skeletons without LIBBPF

LIBBPF requires LIBELF so doing "make BUILD_BPF_SKEL=1 NO_LIBELF=1" fails with compiler errors about missing declarations. Similar could happen if libbpf feature detection fails. Prefer to error when BUILD_BPF_SKEL is enabled but LIBBPF isn't.

---
 tools/perf/Makefile.config | 3 +++
 1 file changed, 3 insertions(+)
tools/perf/Makefile.config +3 -0
index d9b699ad402c..bedb734bd6f2 100644
@@ -664,6 +664,9 @@ ifdef BUILD_BPF_SKEL
   ifeq ($(feature-clang-bpf-co-re), 0)
     dummy := $(error Error: clang too old/not installed. Please install recent clang to build with BUILD_BPF_SKEL)
   endif
+  ifeq ($(filter -DHAVE_LIBBPF_SUPPORT, $(CFLAGS)),)
+    dummy := $(error Error: BPF skeleton support requires libbpf)
+  endif
   $(call detected,CONFIG_PERF_BPF_SKEL)
   CFLAGS += -DHAVE_BPF_SKEL
 endif
Signature · 1 line
2.36.1.124.g0e6072fb45-goog
Acked-by on v1 1/1
#1 lore raw
Quoted 6 lines · Ian Rogers

LIBBPF requires LIBELF so doing "make BUILD_BPF_SKEL=1 NO_LIBELF=1" fails with compiler errors about missing declarations. Similar could happen if libbpf feature detection fails. Prefer to error when BUILD_BPF_SKEL is enabled but LIBBPF isn't.

thanks,
jirka

Quoted 21 lines
---
 tools/perf/Makefile.config | 3 +++
 1 file changed, 3 insertions(+)
tools/perf/Makefile.config +3 -0
index d9b699ad402c..bedb734bd6f2 100644
@@ -664,6 +664,9 @@ ifdef BUILD_BPF_SKEL
   ifeq ($(feature-clang-bpf-co-re), 0)
     dummy := $(error Error: clang too old/not installed. Please install recent clang to build with BUILD_BPF_SKEL)
   endif
+  ifeq ($(filter -DHAVE_LIBBPF_SUPPORT, $(CFLAGS)),)
+    dummy := $(error Error: BPF skeleton support requires libbpf)
+  endif
   $(call detected,CONFIG_PERF_BPF_SKEL)
   CFLAGS += -DHAVE_BPF_SKEL
 endif
Signature · 1 line
2.36.1.124.g0e6072fb45-goog
maintainer Applied
#2 lore raw

Em Mon, May 23, 2022 at 11:12:16AM +0200, Jiri Olsa escreveu:

Quoted 9 lines · Ian Rogers
Quoted 6 lines

LIBBPF requires LIBELF so doing "make BUILD_BPF_SKEL=1 NO_LIBELF=1" fails with compiler errors about missing declarations. Similar could happen if libbpf feature detection fails. Prefer to error when BUILD_BPF_SKEL is enabled but LIBBPF isn't.

Thanks, applied.

- Arnaldo

Quoted 24 lines

thanks,
jirka

Quoted 21 lines
---
 tools/perf/Makefile.config | 3 +++
 1 file changed, 3 insertions(+)
tools/perf/Makefile.config +3 -0
index d9b699ad402c..bedb734bd6f2 100644
@@ -664,6 +664,9 @@ ifdef BUILD_BPF_SKEL
   ifeq ($(feature-clang-bpf-co-re), 0)
     dummy := $(error Error: clang too old/not installed. Please install recent clang to build with BUILD_BPF_SKEL)
   endif
+  ifeq ($(filter -DHAVE_LIBBPF_SUPPORT, $(CFLAGS)),)
+    dummy := $(error Error: BPF skeleton support requires libbpf)
+  endif
   $(call detected,CONFIG_PERF_BPF_SKEL)
   CFLAGS += -DHAVE_BPF_SKEL
 endif
Signature · 1 line
2.36.1.124.g0e6072fb45-goog
Signature · 1 line
- Arnaldo