Revert "perf build: Make BUILD_BPF_SKEL default, rename to NO_BPF_SKEL"

This reverts commit a980755b.

We need to better polish building with BPF skels, so revert back to
making it an experimental feature that has to be explicitely enabled
using BUILD_BPF_SKEL=1.
Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent c3e6df97
...@@ -415,7 +415,6 @@ ifdef NO_LIBELF ...@@ -415,7 +415,6 @@ ifdef NO_LIBELF
NO_LIBUNWIND := 1 NO_LIBUNWIND := 1
NO_LIBDW_DWARF_UNWIND := 1 NO_LIBDW_DWARF_UNWIND := 1
NO_LIBBPF := 1 NO_LIBBPF := 1
NO_BPF_SKEL := 1
NO_JVMTI := 1 NO_JVMTI := 1
else else
ifeq ($(feature-libelf), 0) ifeq ($(feature-libelf), 0)
...@@ -655,22 +654,18 @@ ifndef NO_LIBBPF ...@@ -655,22 +654,18 @@ ifndef NO_LIBBPF
msg := $(warning BPF API too old. Please install recent kernel headers. BPF support in 'perf record' is disabled.) msg := $(warning BPF API too old. Please install recent kernel headers. BPF support in 'perf record' is disabled.)
NO_LIBBPF := 1 NO_LIBBPF := 1
endif endif
else
NO_BPF_SKEL := 1
endif endif
ifndef NO_BPF_SKEL ifdef BUILD_BPF_SKEL
$(call feature_check,clang-bpf-co-re) $(call feature_check,clang-bpf-co-re)
ifeq ($(feature-clang-bpf-co-re), 0) ifeq ($(feature-clang-bpf-co-re), 0)
dummy := $(error: ERROR: BPF skeletons unsupported. clang too old/not installed or build with NO_BPF_SKEL=1.) dummy := $(error Error: clang too old/not installed. Please install recent clang to build with BUILD_BPF_SKEL)
else endif
ifeq ($(filter -DHAVE_LIBBPF_SUPPORT, $(CFLAGS)),) ifeq ($(filter -DHAVE_LIBBPF_SUPPORT, $(CFLAGS)),)
dummy := $(error: ERROR: BPF skeletons unsupported. BPF skeleton support requires libbpf or build with NO_BPF_SKEL=1.) dummy := $(error Error: BPF skeleton support requires libbpf)
else
$(call detected,CONFIG_PERF_BPF_SKEL)
CFLAGS += -DHAVE_BPF_SKEL
endif
endif endif
$(call detected,CONFIG_PERF_BPF_SKEL)
CFLAGS += -DHAVE_BPF_SKEL
endif endif
dwarf-post-unwind := 1 dwarf-post-unwind := 1
......
...@@ -124,7 +124,7 @@ include ../scripts/utilities.mak ...@@ -124,7 +124,7 @@ include ../scripts/utilities.mak
# #
# Define NO_LIBDEBUGINFOD if you do not want support debuginfod # Define NO_LIBDEBUGINFOD if you do not want support debuginfod
# #
# Define NO_BPF_SKEL to disable BPF skeletons # Define BUILD_BPF_SKEL to enable BPF skeletons
# #
# Define BUILD_NONDISTRO to enable building an linking against libbfd and # Define BUILD_NONDISTRO to enable building an linking against libbfd and
# libiberty distribution license incompatible libraries. # libiberty distribution license incompatible libraries.
...@@ -1055,7 +1055,7 @@ SKELETONS += $(SKEL_OUT)/kwork_trace.skel.h $(SKEL_OUT)/sample_filter.skel.h ...@@ -1055,7 +1055,7 @@ SKELETONS += $(SKEL_OUT)/kwork_trace.skel.h $(SKEL_OUT)/sample_filter.skel.h
$(SKEL_TMP_OUT) $(LIBAPI_OUTPUT) $(LIBBPF_OUTPUT) $(LIBPERF_OUTPUT) $(LIBSUBCMD_OUTPUT) $(LIBSYMBOL_OUTPUT): $(SKEL_TMP_OUT) $(LIBAPI_OUTPUT) $(LIBBPF_OUTPUT) $(LIBPERF_OUTPUT) $(LIBSUBCMD_OUTPUT) $(LIBSYMBOL_OUTPUT):
$(Q)$(MKDIR) -p $@ $(Q)$(MKDIR) -p $@
ifndef NO_BPF_SKEL ifdef BUILD_BPF_SKEL
BPFTOOL := $(SKEL_TMP_OUT)/bootstrap/bpftool BPFTOOL := $(SKEL_TMP_OUT)/bootstrap/bpftool
BPF_INCLUDE := -I$(SKEL_TMP_OUT)/.. -I$(LIBBPF_INCLUDE) BPF_INCLUDE := -I$(SKEL_TMP_OUT)/.. -I$(LIBBPF_INCLUDE)
...@@ -1074,11 +1074,11 @@ bpf-skel: $(SKELETONS) ...@@ -1074,11 +1074,11 @@ bpf-skel: $(SKELETONS)
.PRECIOUS: $(SKEL_TMP_OUT)/%.bpf.o .PRECIOUS: $(SKEL_TMP_OUT)/%.bpf.o
else # NO_BPF_SKEL else # BUILD_BPF_SKEL
bpf-skel: bpf-skel:
endif # NO_BPF_SKEL endif # BUILD_BPF_SKEL
bpf-skel-clean: bpf-skel-clean:
$(call QUIET_CLEAN, bpf-skel) $(RM) -r $(SKEL_TMP_OUT) $(SKELETONS) $(call QUIET_CLEAN, bpf-skel) $(RM) -r $(SKEL_TMP_OUT) $(SKELETONS)
......
...@@ -2387,7 +2387,7 @@ int cmd_lock(int argc, const char **argv) ...@@ -2387,7 +2387,7 @@ int cmd_lock(int argc, const char **argv)
#ifndef HAVE_BPF_SKEL #ifndef HAVE_BPF_SKEL
set_option_nobuild(contention_options, 'b', "use-bpf", set_option_nobuild(contention_options, 'b', "use-bpf",
"NO_BPF_SKEL=1", false); "no BUILD_BPF_SKEL=1", false);
#endif #endif
if (argc) { if (argc) {
argc = parse_options(argc, argv, contention_options, argc = parse_options(argc, argv, contention_options,
......
...@@ -3981,7 +3981,7 @@ int cmd_record(int argc, const char **argv) ...@@ -3981,7 +3981,7 @@ int cmd_record(int argc, const char **argv)
#ifndef HAVE_BPF_SKEL #ifndef HAVE_BPF_SKEL
# define set_nobuild(s, l, m, c) set_option_nobuild(record_options, s, l, m, c) # define set_nobuild(s, l, m, c) set_option_nobuild(record_options, s, l, m, c)
set_nobuild('\0', "off-cpu", "NO_BPF_SKEL=1", true); set_nobuild('\0', "off-cpu", "no BUILD_BPF_SKEL=1", true);
# undef set_nobuild # undef set_nobuild
#endif #endif
......
...@@ -81,7 +81,6 @@ static void library_status(void) ...@@ -81,7 +81,6 @@ static void library_status(void)
STATUS(HAVE_ZSTD_SUPPORT, zstd); STATUS(HAVE_ZSTD_SUPPORT, zstd);
STATUS(HAVE_LIBPFM, libpfm4); STATUS(HAVE_LIBPFM, libpfm4);
STATUS(HAVE_LIBTRACEEVENT, libtraceevent); STATUS(HAVE_LIBTRACEEVENT, libtraceevent);
STATUS(HAVE_BPF_SKEL, BPF skeletons);
} }
int cmd_version(int argc, const char **argv) int cmd_version(int argc, const char **argv)
......
...@@ -28,7 +28,7 @@ test_offcpu_priv() { ...@@ -28,7 +28,7 @@ test_offcpu_priv() {
err=2 err=2
return return
fi fi
if perf version --build-options 2>&1 | grep HAVE_BPF_SKEL | grep -q OFF if perf record --off-cpu -o /dev/null --quiet true 2>&1 | grep BUILD_BPF_SKEL
then then
echo "off-cpu test [Skipped missing BPF support]" echo "off-cpu test [Skipped missing BPF support]"
err=2 err=2
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment