Skip to content

Commit 13e17c9

Browse files
captain5050namhyung
authored andcommitted
perf build: Make libunwind opt-in rather than opt-out
Having multiple unwinding libraries makes the perf code harder to understand and we have unused/untested code paths. Perf made BPF support an opt-out rather than opt-in feature. As libbpf has a libelf dependency, elfutils that provides libelf will also provide libdw. When libdw is present perf will use libdw unwinding rather than libunwind unwinding even if libunwind support is compiled in. Rather than have libunwind built into perf and never used, explicitly disable the support and make it opt-in. Signed-off-by: Ian Rogers <irogers@google.com> Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com> Link: https://lore.kernel.org/r/20241028193619.247727-1-irogers@google.com Closes: https://lore.kernel.org/linux-perf-users/CAP-5=fUXkp-d7gkzX4eF+nbjb2978dZsiHZ9abGHN=BN1qAcbg@mail.gmail.com/ Signed-off-by: Namhyung Kim <namhyung@kernel.org>
1 parent aa5c906 commit 13e17c9

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

tools/perf/Makefile.config

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,10 @@ ifneq ($(SRCARCH),$(filter $(SRCARCH),x86 arm arm64 powerpc s390 csky riscv loon
9595
NO_LIBDW_DWARF_UNWIND := 1
9696
endif
9797

98+
ifneq ($(LIBUNWIND),1)
99+
NO_LIBUNWIND := 1
100+
endif
101+
98102
ifeq ($(LIBUNWIND_LIBS),)
99103
NO_LIBUNWIND := 1
100104
endif

tools/perf/Makefile.perf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ include ../scripts/utilities.mak
5252
#
5353
# Define NO_LIBELF if you do not want libelf dependency (e.g. cross-builds)
5454
#
55-
# Define NO_LIBUNWIND if you do not want libunwind dependency for dwarf
55+
# Define LIBUNWIND if you do not want libunwind dependency for dwarf
5656
# backtrace post unwind.
5757
#
5858
# Define NO_BACKTRACE if you do not want stack backtrace debug feature

tools/perf/tests/make

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ make_no_gtk2 := NO_GTK2=1
8181
make_no_ui := NO_SLANG=1 NO_GTK2=1
8282
make_no_demangle := NO_DEMANGLE=1
8383
make_no_libelf := NO_LIBELF=1
84-
make_no_libunwind := NO_LIBUNWIND=1
84+
make_libunwind := LIBUNWIND=1
8585
make_no_libdw_dwarf_unwind := NO_LIBDW_DWARF_UNWIND=1
8686
make_no_backtrace := NO_BACKTRACE=1
8787
make_no_libcapstone := NO_CAPSTONE=1
@@ -121,7 +121,7 @@ make_static := LDFLAGS=-static NO_PERF_READ_VDSO32=1 NO_PERF_READ_VDSOX3
121121

122122
# all the NO_* variable combined
123123
make_minimal := NO_LIBPERL=1 NO_LIBPYTHON=1 NO_GTK2=1
124-
make_minimal += NO_DEMANGLE=1 NO_LIBELF=1 NO_LIBUNWIND=1 NO_BACKTRACE=1
124+
make_minimal += NO_DEMANGLE=1 NO_LIBELF=1 NO_BACKTRACE=1
125125
make_minimal += NO_LIBNUMA=1 NO_LIBAUDIT=1 NO_LIBBIONIC=1
126126
make_minimal += NO_LIBDW_DWARF_UNWIND=1 NO_AUXTRACE=1 NO_LIBBPF=1
127127
make_minimal += NO_LIBCRYPTO=1 NO_SDT=1 NO_JVMTI=1 NO_LIBZSTD=1
@@ -153,7 +153,7 @@ run += make_no_gtk2
153153
run += make_no_ui
154154
run += make_no_demangle
155155
run += make_no_libelf
156-
run += make_no_libunwind
156+
run += make_libunwind
157157
run += make_no_libdw_dwarf_unwind
158158
run += make_no_backtrace
159159
run += make_no_libcapstone

0 commit comments

Comments
 (0)