Skip to content

Commit 9a2d517

Browse files
committed
Revert "perf build: Make BUILD_BPF_SKEL default, rename to NO_BPF_SKEL"
This reverts commit a980755. 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: Arnaldo Carvalho de Melo <acme@redhat.com>
1 parent c3e6df9 commit 9a2d517

File tree

6 files changed

+14
-20
lines changed

6 files changed

+14
-20
lines changed

tools/perf/Makefile.config

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -415,7 +415,6 @@ ifdef NO_LIBELF
415415
NO_LIBUNWIND := 1
416416
NO_LIBDW_DWARF_UNWIND := 1
417417
NO_LIBBPF := 1
418-
NO_BPF_SKEL := 1
419418
NO_JVMTI := 1
420419
else
421420
ifeq ($(feature-libelf), 0)
@@ -655,22 +654,18 @@ ifndef NO_LIBBPF
655654
msg := $(warning BPF API too old. Please install recent kernel headers. BPF support in 'perf record' is disabled.)
656655
NO_LIBBPF := 1
657656
endif
658-
else
659-
NO_BPF_SKEL := 1
660657
endif
661658

662-
ifndef NO_BPF_SKEL
659+
ifdef BUILD_BPF_SKEL
663660
$(call feature_check,clang-bpf-co-re)
664661
ifeq ($(feature-clang-bpf-co-re), 0)
665-
dummy := $(error: ERROR: BPF skeletons unsupported. clang too old/not installed or build with NO_BPF_SKEL=1.)
666-
else
667-
ifeq ($(filter -DHAVE_LIBBPF_SUPPORT, $(CFLAGS)),)
668-
dummy := $(error: ERROR: BPF skeletons unsupported. BPF skeleton support requires libbpf or build with NO_BPF_SKEL=1.)
669-
else
670-
$(call detected,CONFIG_PERF_BPF_SKEL)
671-
CFLAGS += -DHAVE_BPF_SKEL
672-
endif
662+
dummy := $(error Error: clang too old/not installed. Please install recent clang to build with BUILD_BPF_SKEL)
663+
endif
664+
ifeq ($(filter -DHAVE_LIBBPF_SUPPORT, $(CFLAGS)),)
665+
dummy := $(error Error: BPF skeleton support requires libbpf)
673666
endif
667+
$(call detected,CONFIG_PERF_BPF_SKEL)
668+
CFLAGS += -DHAVE_BPF_SKEL
674669
endif
675670

676671
dwarf-post-unwind := 1

tools/perf/Makefile.perf

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ include ../scripts/utilities.mak
124124
#
125125
# Define NO_LIBDEBUGINFOD if you do not want support debuginfod
126126
#
127-
# Define NO_BPF_SKEL to disable BPF skeletons
127+
# Define BUILD_BPF_SKEL to enable BPF skeletons
128128
#
129129
# Define BUILD_NONDISTRO to enable building an linking against libbfd and
130130
# libiberty distribution license incompatible libraries.
@@ -1055,7 +1055,7 @@ SKELETONS += $(SKEL_OUT)/kwork_trace.skel.h $(SKEL_OUT)/sample_filter.skel.h
10551055
$(SKEL_TMP_OUT) $(LIBAPI_OUTPUT) $(LIBBPF_OUTPUT) $(LIBPERF_OUTPUT) $(LIBSUBCMD_OUTPUT) $(LIBSYMBOL_OUTPUT):
10561056
$(Q)$(MKDIR) -p $@
10571057

1058-
ifndef NO_BPF_SKEL
1058+
ifdef BUILD_BPF_SKEL
10591059
BPFTOOL := $(SKEL_TMP_OUT)/bootstrap/bpftool
10601060
BPF_INCLUDE := -I$(SKEL_TMP_OUT)/.. -I$(LIBBPF_INCLUDE)
10611061

@@ -1074,11 +1074,11 @@ bpf-skel: $(SKELETONS)
10741074

10751075
.PRECIOUS: $(SKEL_TMP_OUT)/%.bpf.o
10761076

1077-
else # NO_BPF_SKEL
1077+
else # BUILD_BPF_SKEL
10781078

10791079
bpf-skel:
10801080

1081-
endif # NO_BPF_SKEL
1081+
endif # BUILD_BPF_SKEL
10821082

10831083
bpf-skel-clean:
10841084
$(call QUIET_CLEAN, bpf-skel) $(RM) -r $(SKEL_TMP_OUT) $(SKELETONS)

tools/perf/builtin-lock.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2387,7 +2387,7 @@ int cmd_lock(int argc, const char **argv)
23872387

23882388
#ifndef HAVE_BPF_SKEL
23892389
set_option_nobuild(contention_options, 'b', "use-bpf",
2390-
"NO_BPF_SKEL=1", false);
2390+
"no BUILD_BPF_SKEL=1", false);
23912391
#endif
23922392
if (argc) {
23932393
argc = parse_options(argc, argv, contention_options,

tools/perf/builtin-record.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3981,7 +3981,7 @@ int cmd_record(int argc, const char **argv)
39813981

39823982
#ifndef HAVE_BPF_SKEL
39833983
# define set_nobuild(s, l, m, c) set_option_nobuild(record_options, s, l, m, c)
3984-
set_nobuild('\0', "off-cpu", "NO_BPF_SKEL=1", true);
3984+
set_nobuild('\0', "off-cpu", "no BUILD_BPF_SKEL=1", true);
39853985
# undef set_nobuild
39863986
#endif
39873987

tools/perf/builtin-version.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,6 @@ static void library_status(void)
8181
STATUS(HAVE_ZSTD_SUPPORT, zstd);
8282
STATUS(HAVE_LIBPFM, libpfm4);
8383
STATUS(HAVE_LIBTRACEEVENT, libtraceevent);
84-
STATUS(HAVE_BPF_SKEL, BPF skeletons);
8584
}
8685

8786
int cmd_version(int argc, const char **argv)

tools/perf/tests/shell/record_offcpu.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ test_offcpu_priv() {
2828
err=2
2929
return
3030
fi
31-
if perf version --build-options 2>&1 | grep HAVE_BPF_SKEL | grep -q OFF
31+
if perf record --off-cpu -o /dev/null --quiet true 2>&1 | grep BUILD_BPF_SKEL
3232
then
3333
echo "off-cpu test [Skipped missing BPF support]"
3434
err=2

0 commit comments

Comments
 (0)