Libdw/dwarf build clean up
Subsystems (4)
Ian Rogers
reviewerv3 cover Libdw/dwarf build clean up
These patches were originally on top of:
https://lore.kernel.org/lkml/[email protected]/
where it was pointed out that a lot of the libdw conditional compilation was due to features that have now been standard for 10 or 15 years. The patches remove the conditional compilation assuming the features are in libdw where the feature test is expanded to check there pressence. The patch series is now on top of:
https://lore.kernel.org/lkml/[email protected]/
In the Makefile code, and for perf record --call-graph, dwarf tends to mean unwind or libdw support for dwarf things. To make it clearer when dwarf really just means libdw numerous build variables and defines are renamed.
There is some tech debt in the changes as perf check still reports the values using the old name and for features that are no longer tested. This can be cleanup for another day.
v3: Move PERF_HAVE_DWARF_REGS cleanup to follow up patch series. Add
build fix from patch series these changes are on top of.
v2: Instead of renaming PERF_HAVE_DWARF_REGS to PERF_HAVE_LIBDW_REGS,
remove it.
Ian Rogers (11):
perf build: Fix LIBDW_DIR
perf build: Rename NO_DWARF to NO_LIBDW
perf build: Remove defined but never used variable perf build: Rename test-dwarf to test-libdw
perf build: Combine libdw-dwarf-unwind into libdw feature tests perf build: Combine test-dwarf-getlocations into test-libdw perf build: Combine test-dwarf-getcfi into test-libdw perf probe: Move elfutils support check to libdw check perf libdw: Remove unnecessary defines
perf build: Rename HAVE_DWARF_SUPPORT to HAVE_LIBDW_SUPPORT perf build: Rename CONFIG_DWARF to CONFIG_LIBDW
tools/build/Makefile.feature | 11 +--- tools/build/feature/Makefile | 24 ++------ tools/build/feature/test-all.c | 16 +----- tools/build/feature/test-dwarf.c | 11 ---- tools/build/feature/test-dwarf_getcfi.c | 9 --- tools/build/feature/test-dwarf_getlocations.c | 13 ----- tools/build/feature/test-libdw-dwarf-unwind.c | 14 ----- tools/build/feature/test-libdw.c | 56 +++++++++++++++++++ tools/perf/Documentation/perf-check.txt | 6 +- tools/perf/Makefile.config | 47 +++++----------- tools/perf/Makefile.perf | 2 +- tools/perf/arch/arm/Makefile | 2 +- tools/perf/arch/arm/util/Build | 2 +- tools/perf/arch/arm64/Makefile | 2 +- tools/perf/arch/arm64/util/Build | 2 +- tools/perf/arch/csky/Makefile | 2 +- tools/perf/arch/csky/util/Build | 2 +- tools/perf/arch/loongarch/Makefile | 2 +- tools/perf/arch/loongarch/util/Build | 2 +- tools/perf/arch/mips/Makefile | 2 +- tools/perf/arch/mips/util/Build | 2 +- tools/perf/arch/powerpc/Makefile | 2 +- .../perf/arch/powerpc/annotate/instructions.c | 4 +- tools/perf/arch/powerpc/util/Build | 4 +- tools/perf/arch/riscv/Makefile | 2 +- tools/perf/arch/riscv/util/Build | 2 +- tools/perf/arch/s390/Makefile | 2 +- tools/perf/arch/s390/util/Build | 2 +- tools/perf/arch/sh/Makefile | 2 +- tools/perf/arch/sh/util/Build | 2 +- tools/perf/arch/sparc/Makefile | 2 +- tools/perf/arch/sparc/util/Build | 2 +- tools/perf/arch/x86/Makefile | 2 +- tools/perf/arch/x86/annotate/instructions.c | 2 +- tools/perf/arch/x86/util/Build | 2 +- tools/perf/arch/xtensa/Makefile | 2 +- tools/perf/arch/xtensa/util/Build | 2 +- tools/perf/builtin-annotate.c | 2 +- tools/perf/builtin-check.c | 6 +- tools/perf/builtin-probe.c | 14 ++--- tools/perf/builtin-report.c | 4 +- tools/perf/util/Build | 12 ++-- tools/perf/util/annotate-data.h | 8 +-- tools/perf/util/debuginfo.h | 6 +- tools/perf/util/disasm.c | 4 +- tools/perf/util/disasm.h | 4 +- tools/perf/util/dwarf-aux.c | 6 -- tools/perf/util/dwarf-aux.h | 54 ------------------ tools/perf/util/genelf.c | 4 +- tools/perf/util/genelf.h | 2 +- tools/perf/util/include/dwarf-regs.h | 6 +- tools/perf/util/probe-event.c | 4 +- tools/perf/util/probe-finder.c | 6 -- tools/perf/util/probe-finder.h | 6 +- 54 files changed, 154 insertions(+), 259 deletions(-) delete mode 100644 tools/build/feature/test-dwarf.c delete mode 100644 tools/build/feature/test-dwarf_getcfi.c delete mode 100644 tools/build/feature/test-dwarf_getlocations.c delete mode 100644 tools/build/feature/test-libdw-dwarf-unwind.c create mode 100644 tools/build/feature/test-libdw.c
Signature · 1 line
2.47.0.105.g07ac214952-goog
Ian Rogers
reviewerPATCH v3 1/11 perf build: Fix LIBDW_DIR
Testing with a LIBDW_DIR showed that in Makefile.config the dwarf feature tests need the LIBDW_DIR setting in the CFLAGS/LDFLAGS.
--- tools/perf/Makefile.config | 6 ++++++ 1 file changed, 6 insertions(+)
tools/perf/Makefile.config +6 -0
@@ -162,8 +162,14 @@ ifeq ($(findstring -static,${LDFLAGS}),-static) # Must put -ldl after -lebl for dependency DWARFLIBS += -ldl endif +FEATURE_CHECK_CFLAGS-dwarf := $(LIBDW_CFLAGS) +FEATURE_CHECK_LDFLAGS-dwarf := $(LIBDW_LDFLAGS) $(DWARFLIBS) FEATURE_CHECK_CFLAGS-libdw-dwarf-unwind := $(LIBDW_CFLAGS) FEATURE_CHECK_LDFLAGS-libdw-dwarf-unwind := $(LIBDW_LDFLAGS) $(DWARFLIBS) +FEATURE_CHECK_CFLAGS-dwarf_getlocations := $(LIBDW_CFLAGS) +FEATURE_CHECK_LDFLAGS-dwarf_getlocations := $(LIBDW_LDFLAGS) $(DWARFLIBS) +FEATURE_CHECK_CFLAGS-dwarf_getcfi := $(LIBDW_CFLAGS) +FEATURE_CHECK_LDFLAGS-dwarf_getcfi := $(LIBDW_LDFLAGS) $(DWARFLIBS) # for linking with debug library, run like: # make DEBUG=1 LIBBABELTRACE_DIR=/opt/libbabeltrace/
Signature · 1 line
2.47.0.105.g07ac214952-goog
Ian Rogers
reviewerPATCH v3 2/11 perf build: Rename NO_DWARF to NO_LIBDW
In reply to Ian RogersNO_DWARF could mean more than NO_LIBDW support, in particular no libunwind support. Rename to be more intention revealing.
--- tools/perf/Makefile.config | 16 ++++++++-------- tools/perf/Makefile.perf | 2 +- tools/perf/arch/arm/Makefile | 2 +- tools/perf/arch/arm64/Makefile | 2 +- tools/perf/arch/csky/Makefile | 2 +- tools/perf/arch/loongarch/Makefile | 2 +- tools/perf/arch/mips/Makefile | 2 +- tools/perf/arch/powerpc/Makefile | 2 +- tools/perf/arch/riscv/Makefile | 2 +- tools/perf/arch/s390/Makefile | 2 +- tools/perf/arch/sh/Makefile | 2 +- tools/perf/arch/sparc/Makefile | 2 +- tools/perf/arch/x86/Makefile | 2 +- tools/perf/arch/xtensa/Makefile | 2 +- tools/perf/builtin-probe.c | 2 +- 15 files changed, 22 insertions(+), 22 deletions(-)
tools/perf/Makefile.config +8 -8
@@ -432,7 +432,7 @@ ifeq ($(feature-file-handle), 1) endif ifdef NO_LIBELF - NO_DWARF := 1 + NO_LIBDW := 1 NO_LIBUNWIND := 1 NO_LIBDW_DWARF_UNWIND := 1 NO_LIBBPF := 1
@@ -474,9 +474,9 @@ else endif endif ifneq ($(feature-dwarf), 1) - ifndef NO_DWARF + ifndef NO_LIBDW $(warning No libdw.h found or old libdw.h found or elfutils is older than 0.138, disables dwarf support. Please install new elfutils-devel/libdw-dev) - NO_DWARF := 1 + NO_LIBDW := 1 endif else ifneq ($(feature-dwarf_getlocations), 1)
@@ -499,7 +499,7 @@ ifeq ($(feature-libaio), 1) endif endif -ifdef NO_DWARF +ifdef NO_LIBDW NO_LIBDW_DWARF_UNWIND := 1 endif
@@ -577,17 +577,17 @@ ifndef NO_LIBELF endif endif - ifndef NO_DWARF + ifndef NO_LIBDW ifeq ($(origin PERF_HAVE_DWARF_REGS), undefined) $(warning DWARF register mappings have not been defined for architecture $(SRCARCH), DWARF support disabled) - NO_DWARF := 1 + NO_LIBDW := 1 else CFLAGS += -DHAVE_DWARF_SUPPORT $(LIBDW_CFLAGS) LDFLAGS += $(LIBDW_LDFLAGS) EXTLIBS += ${DWARFLIBS} $(call detected,CONFIG_DWARF) endif # PERF_HAVE_DWARF_REGS - endif # NO_DWARF + endif # NO_LIBDW ifndef NO_LIBBPF ifeq ($(feature-bpf), 1)
@@ -636,7 +636,7 @@ ifdef PERF_HAVE_JITDUMP endif ifeq ($(SRCARCH),powerpc) - ifndef NO_DWARF + ifndef NO_LIBDW CFLAGS += -DHAVE_SKIP_CALLCHAIN_IDX endif endif
tools/perf/Makefile.perf +1 -1
@@ -40,7 +40,7 @@ include ../scripts/utilities.mak # # Define EXTRA_PERFLIBS to pass extra libraries to PERFLIBS. # -# Define NO_DWARF if you do not want debug-info analysis feature at all. +# Define NO_LIBDW if you do not want debug-info analysis feature at all. # # Define WERROR=0 to disable treating any warnings as errors. #
tools/perf/arch/arm/Makefile +1 -1
@@ -1,5 +1,5 @@ # SPDX-License-Identifier: GPL-2.0-only -ifndef NO_DWARF +ifndef NO_LIBDW PERF_HAVE_DWARF_REGS := 1 endif PERF_HAVE_JITDUMP := 1
tools/perf/arch/arm64/Makefile +1 -1
@@ -1,5 +1,5 @@ # SPDX-License-Identifier: GPL-2.0 -ifndef NO_DWARF +ifndef NO_LIBDW PERF_HAVE_DWARF_REGS := 1 endif PERF_HAVE_JITDUMP := 1
tools/perf/arch/csky/Makefile +1 -1
@@ -1,4 +1,4 @@ # SPDX-License-Identifier: GPL-2.0-only -ifndef NO_DWARF +ifndef NO_LIBDW PERF_HAVE_DWARF_REGS := 1 endif
tools/perf/arch/loongarch/Makefile +1 -1
@@ -1,5 +1,5 @@ # SPDX-License-Identifier: GPL-2.0 -ifndef NO_DWARF +ifndef NO_LIBDW PERF_HAVE_DWARF_REGS := 1 endif PERF_HAVE_ARCH_REGS_QUERY_REGISTER_OFFSET := 1
tools/perf/arch/mips/Makefile +1 -1
@@ -1,5 +1,5 @@ # SPDX-License-Identifier: GPL-2.0 -ifndef NO_DWARF +ifndef NO_LIBDW PERF_HAVE_DWARF_REGS := 1 endif
tools/perf/arch/powerpc/Makefile +1 -1
@@ -1,5 +1,5 @@ # SPDX-License-Identifier: GPL-2.0 -ifndef NO_DWARF +ifndef NO_LIBDW PERF_HAVE_DWARF_REGS := 1 endif
tools/perf/arch/riscv/Makefile +1 -1
@@ -1,4 +1,4 @@ -ifndef NO_DWARF +ifndef NO_LIBDW PERF_HAVE_DWARF_REGS := 1 endif PERF_HAVE_ARCH_REGS_QUERY_REGISTER_OFFSET := 1
tools/perf/arch/s390/Makefile +1 -1
@@ -1,5 +1,5 @@ # SPDX-License-Identifier: GPL-2.0-only -ifndef NO_DWARF +ifndef NO_LIBDW PERF_HAVE_DWARF_REGS := 1 endif HAVE_KVM_STAT_SUPPORT := 1
tools/perf/arch/sh/Makefile +1 -1
@@ -1,4 +1,4 @@ # SPDX-License-Identifier: GPL-2.0-only -ifndef NO_DWARF +ifndef NO_LIBDW PERF_HAVE_DWARF_REGS := 1 endif
tools/perf/arch/sparc/Makefile +1 -1
@@ -1,5 +1,5 @@ # SPDX-License-Identifier: GPL-2.0-only -ifndef NO_DWARF +ifndef NO_LIBDW PERF_HAVE_DWARF_REGS := 1 endif
tools/perf/arch/x86/Makefile +1 -1
@@ -1,5 +1,5 @@ # SPDX-License-Identifier: GPL-2.0 -ifndef NO_DWARF +ifndef NO_LIBDW PERF_HAVE_DWARF_REGS := 1 endif HAVE_KVM_STAT_SUPPORT := 1
tools/perf/arch/xtensa/Makefile +1 -1
@@ -1,4 +1,4 @@ # SPDX-License-Identifier: GPL-2.0-only -ifndef NO_DWARF +ifndef NO_LIBDW PERF_HAVE_DWARF_REGS := 1 endif
tools/perf/builtin-probe.c +1 -1
@@ -616,7 +616,7 @@ __cmd_probe(int argc, const char **argv)set_option_flag (options,'L' ,"line" ,PARSE_OPT_EXCLUSIVE );set_option_flag (options,'V' ,"vars" ,PARSE_OPT_EXCLUSIVE );#else -# define set_nobuild (s, l, c) set_option_nobuild(options, s, l, "NO_DWARF=1", c) +# define set_nobuild (s, l, c) set_option_nobuild(options, s, l, "NO_LIBDW=1", c)set_nobuild ('L' ,"line" , false);set_nobuild ('V' ,"vars" , false);set_nobuild ('\0' ,"externs" , false);
Signature · 1 line
2.47.0.105.g07ac214952-goog
Ian Rogers
reviewerPATCH v3 3/11 perf build: Remove defined but never used variable
In reply to Ian RogersPreviously NO_DWARF_UNWIND was part of conditional compilation but it is now unused so remove.
--- tools/perf/Makefile.config | 2 -- 1 file changed, 2 deletions(-)
tools/perf/Makefile.config +0 -2
@@ -756,8 +756,6 @@ endif ifeq ($(dwarf-post-unwind),1) CFLAGS += -DHAVE_DWARF_UNWIND_SUPPORT $(call detected,CONFIG_DWARF_UNWIND) -else - NO_DWARF_UNWIND := 1 endif ifndef NO_LOCAL_LIBUNWIND
Signature · 1 line
2.47.0.105.g07ac214952-goog
Ian Rogers
reviewerPATCH v3 4/11 perf build: Rename test-dwarf to test-libdw
In reply to Ian RogersBe more intention revealing that the dwarf test is actually testing for libdw support.
---
tools/build/Makefile.feature | 6 +++---
tools/build/feature/Makefile | 16 ++++++++--------
tools/build/feature/test-all.c | 6 +++---
.../build/feature/{test-dwarf.c => test-libdw.c} | 0
tools/perf/Makefile.config | 6 +++---
5 files changed, 17 insertions(+), 17 deletions(-)
rename tools/build/feature/{test-dwarf.c => test-libdw.c} (100%)tools/build/Makefile.feature +3 -3
@@ -30,7 +30,7 @@ endef # FEATURE_TESTS_BASIC := \ backtrace \ - dwarf \ + libdw \ dwarf_getlocations \ dwarf_getcfi \ eventfd \
@@ -120,7 +120,7 @@ ifeq ($(FEATURE_TESTS),all) endif FEATURE_DISPLAY ?= \ - dwarf \ + libdw \ dwarf_getlocations \ glibc \ libbfd \
@@ -233,7 +233,7 @@ endef # # generates feature value assignment for name, like: -# $(call feature_assign,dwarf) == feature-dwarf=1 +# $(call feature_assign,libdw) == feature-libdw=1 # feature_assign = feature-$(1)=$(feature-$(1))
tools/build/feature/Makefile +8 -8
@@ -5,7 +5,7 @@ FILES= \ test-all.bin \ test-backtrace.bin \ test-bionic.bin \ - test-dwarf.bin \ + test-libdw.bin \ test-dwarf_getlocations.bin \ test-dwarf_getcfi.bin \ test-eventfd.bin \
@@ -168,9 +168,9 @@ $(OUTPUT)test-libopencsd.bin: $(BUILD) # -lopencsd_c_api -lopencsd provided by # $(FEATURE_CHECK_LDFLAGS-libopencsd) -DWARFLIBS := -ldw +DWLIBS := -ldw ifeq ($(findstring -static,${LDFLAGS}),-static) - DWARFLIBS += -lelf -lz -llzma -lbz2 -lzstd + DWLIBS += -lelf -lz -llzma -lbz2 -lzstd LIBDW_VERSION := $(shell $(PKG_CONFIG) --modversion libdw).0.0 LIBDW_VERSION_1 := $(word 1, $(subst ., ,$(LIBDW_VERSION)))
@@ -179,21 +179,21 @@ ifeq ($(findstring -static,${LDFLAGS}),-static) # Elfutils merged libebl.a into libdw.a starting from version 0.177, # Link libebl.a only if libdw is older than this version. ifeq ($(shell test $(LIBDW_VERSION_2) -lt 177; echo $$?),0) - DWARFLIBS += -lebl + DWLIBS += -lebl endif # Must put -ldl after -lebl for dependency DWARFLIBS += -ldl endif -$(OUTPUT)test-dwarf.bin: - $(BUILD) $(DWARFLIBS) +$(OUTPUT)test-libdw.bin: + $(BUILD) $(DWLIBS) $(OUTPUT)test-dwarf_getlocations.bin: - $(BUILD) $(DWARFLIBS) + $(BUILD) $(DWLIBS) $(OUTPUT)test-dwarf_getcfi.bin: - $(BUILD) $(DWARFLIBS) + $(BUILD) $(DWLIBS) $(OUTPUT)test-libelf-getphdrnum.bin: $(BUILD) -lelf
tools/build/feature/test-all.c +3 -3
@@ -38,8 +38,8 @@# include "test-glibc.c" #undef main -#define main main_test_dwarf -# include "test-dwarf.c" +#define main main_test_libdw +# include "test-libdw.c" #undef main#define main main_test_dwarf_getlocations
@@ -187,7 +187,7 @@ int main(int argc, char *argv[])main_test_get_current_dir_name ();main_test_gettid ();main_test_glibc (); -main_test_dwarf (); +main_test_libdw ();main_test_dwarf_getlocations ();main_test_eventfd ();main_test_libelf_getphdrnum ();
tools/build/feature/test-libdw.c renamed from tools/build/feature/test-dwarf.c +0 -0
tools/perf/Makefile.config +3 -3
@@ -162,8 +162,8 @@ ifeq ($(findstring -static,${LDFLAGS}),-static) # Must put -ldl after -lebl for dependency DWARFLIBS += -ldl endif -FEATURE_CHECK_CFLAGS-dwarf := $(LIBDW_CFLAGS) -FEATURE_CHECK_LDFLAGS-dwarf := $(LIBDW_LDFLAGS) $(DWARFLIBS) +FEATURE_CHECK_CFLAGS-libdw := $(LIBDW_CFLAGS) +FEATURE_CHECK_LDFLAGS-libdw := $(LIBDW_LDFLAGS) $(DWARFLIBS) FEATURE_CHECK_CFLAGS-libdw-dwarf-unwind := $(LIBDW_CFLAGS) FEATURE_CHECK_LDFLAGS-libdw-dwarf-unwind := $(LIBDW_LDFLAGS) $(DWARFLIBS) FEATURE_CHECK_CFLAGS-dwarf_getlocations := $(LIBDW_CFLAGS)
@@ -473,7 +473,7 @@ else $(warning No libdw DWARF unwind found, Please install elfutils-devel/libdw-dev >= 0.158 and/or set LIBDW_DIR) endif endif - ifneq ($(feature-dwarf), 1) + ifneq ($(feature-libdw), 1) ifndef NO_LIBDW $(warning No libdw.h found or old libdw.h found or elfutils is older than 0.138, disables dwarf support. Please install new elfutils-devel/libdw-dev) NO_LIBDW := 1
Signature · 1 line
2.47.0.105.g07ac214952-goog
Ian Rogers
reviewerPATCH v3 5/11 perf build: Combine libdw-dwarf-unwind into libdw feature tests
In reply to Ian RogersSupport in libdw has been present for 10 years so let's simplify the build logic with a single feature test.
--- tools/build/Makefile.feature | 2 -- tools/build/feature/Makefile | 4 ---- tools/build/feature/test-all.c | 5 ----- tools/build/feature/test-libdw-dwarf-unwind.c | 14 -------------- tools/build/feature/test-libdw.c | 19 ++++++++++++++++++- tools/perf/Makefile.config | 8 -------- 6 files changed, 18 insertions(+), 34 deletions(-) delete mode 100644 tools/build/feature/test-libdw-dwarf-unwind.c
tools/build/Makefile.feature +0 -2
@@ -60,7 +60,6 @@ FEATURE_TESTS_BASIC := \ reallocarray \ stackprotector-all \ timerfd \ - libdw-dwarf-unwind \ zlib \ lzma \ get_cpuid \
@@ -133,7 +132,6 @@ FEATURE_DISPLAY ?= \ libpython \ libcrypto \ libunwind \ - libdw-dwarf-unwind \ libcapstone \ llvm-perf \ zlib \
tools/build/feature/Makefile +0 -4
@@ -52,7 +52,6 @@ FILES= \ test-pthread-barrier.bin \ test-stackprotector-all.bin \ test-timerfd.bin \ - test-libdw-dwarf-unwind.bin \ test-libbabeltrace.bin \ test-libcapstone.bin \ test-compile-32.bin \
@@ -317,9 +316,6 @@ $(OUTPUT)test-backtrace.bin: $(OUTPUT)test-timerfd.bin: $(BUILD) -$(OUTPUT)test-libdw-dwarf-unwind.bin: - $(BUILD) # -ldw provided by $(FEATURE_CHECK_LDFLAGS-libdw-dwarf-unwind) - $(OUTPUT)test-libbabeltrace.bin: $(BUILD) # -lbabeltrace provided by $(FEATURE_CHECK_LDFLAGS-libbabeltrace)
tools/build/feature/test-all.c +0 -5
@@ -98,10 +98,6 @@# include "test-stackprotector-all.c" #undef main -#define main main_test_libdw_dwarf_unwind -# include "test-libdw-dwarf-unwind.c" -#undef main -#define main main_test_zlib# include "test-zlib.c" #undef main
@@ -202,7 +198,6 @@ int main(int argc, char *argv[])main_test_numa_num_possible_cpus ();main_test_timerfd ();main_test_stackprotector_all (); -main_test_libdw_dwarf_unwind ();main_test_zlib ();main_test_pthread_attr_setaffinity_np ();main_test_pthread_barrier ();
tools/build/feature/test-libdw-dwarf-unwind.c deleted +0 -14
@@ -1,14 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0 - -#include <elfutils/libdwfl.h> - -int main (void ) -{ -/* -* This function is guarded via: __nonnull_attribute__ (1, 2). -* Passing '1' as arguments value. This code is never executed, -* only compiled. -*/ -dwfl_thread_getframes ((void *)1 , (void *)1 ,NULL ); -return 0 ; -}
tools/build/feature/test-libdw.c +18 -1
@@ -1,11 +1,28 @@// SPDX-License-Identifier: GPL-2.0 #include <dwarf.h> #include <elfutils/libdw.h> +#include <elfutils/libdwfl.h> #include <elfutils/version.h> -int main (void ) +int test_libdw (void ) {Dwarf *dbg =dwarf_begin (0 ,DWARF_C_READ );return (long )dbg; } + +int test_libdw_unwind (void ) +{ +/* +* This function is guarded via: __nonnull_attribute__ (1, 2). +* Passing '1' as arguments value. This code is never executed, +* only compiled. +*/ +dwfl_thread_getframes ((void *)1 , (void *)1 ,NULL ); +return 0 ; +} + +int main (void ) +{ +return test_libdw () +test_libdw_unwind (); +}
tools/perf/Makefile.config +0 -8
@@ -164,8 +164,6 @@ ifeq ($(findstring -static,${LDFLAGS}),-static) endif FEATURE_CHECK_CFLAGS-libdw := $(LIBDW_CFLAGS) FEATURE_CHECK_LDFLAGS-libdw := $(LIBDW_LDFLAGS) $(DWARFLIBS) -FEATURE_CHECK_CFLAGS-libdw-dwarf-unwind := $(LIBDW_CFLAGS) -FEATURE_CHECK_LDFLAGS-libdw-dwarf-unwind := $(LIBDW_LDFLAGS) $(DWARFLIBS) FEATURE_CHECK_CFLAGS-dwarf_getlocations := $(LIBDW_CFLAGS) FEATURE_CHECK_LDFLAGS-dwarf_getlocations := $(LIBDW_LDFLAGS) $(DWARFLIBS) FEATURE_CHECK_CFLAGS-dwarf_getcfi := $(LIBDW_CFLAGS)
@@ -467,12 +465,6 @@ else endif endif else - ifndef NO_LIBDW_DWARF_UNWIND - ifneq ($(feature-libdw-dwarf-unwind),1) - NO_LIBDW_DWARF_UNWIND := 1 - $(warning No libdw DWARF unwind found, Please install elfutils-devel/libdw-dev >= 0.158 and/or set LIBDW_DIR) - endif - endif ifneq ($(feature-libdw), 1) ifndef NO_LIBDW $(warning No libdw.h found or old libdw.h found or elfutils is older than 0.138, disables dwarf support. Please install new elfutils-devel/libdw-dev)
Signature · 1 line
2.47.0.105.g07ac214952-goog
Ian Rogers
reviewerPATCH v3 6/11 perf build: Combine test-dwarf-getlocations into test-libdw
In reply to Ian Rogersdwarf_getlocations support in libdw is more than 10 years old. Make libdw imply dwarf_getlocations support and simplify build logic.
--- tools/build/Makefile.feature | 2 -- tools/build/feature/Makefile | 4 ---- tools/build/feature/test-all.c | 5 ----- tools/build/feature/test-dwarf_getlocations.c | 13 ------------- tools/build/feature/test-libdw.c | 14 +++++++++++++- tools/perf/Makefile.config | 10 ++-------- 6 files changed, 15 insertions(+), 33 deletions(-) delete mode 100644 tools/build/feature/test-dwarf_getlocations.c
tools/build/Makefile.feature +0 -2
@@ -31,7 +31,6 @@ endef FEATURE_TESTS_BASIC := \ backtrace \ libdw \ - dwarf_getlocations \ dwarf_getcfi \ eventfd \ fortify-source \
@@ -120,7 +119,6 @@ endif FEATURE_DISPLAY ?= \ libdw \ - dwarf_getlocations \ glibc \ libbfd \ libbfd-buildid \
tools/build/feature/Makefile +0 -4
@@ -6,7 +6,6 @@ FILES= \ test-backtrace.bin \ test-bionic.bin \ test-libdw.bin \ - test-dwarf_getlocations.bin \ test-dwarf_getcfi.bin \ test-eventfd.bin \ test-fortify-source.bin \
@@ -188,9 +187,6 @@ endif $(OUTPUT)test-libdw.bin: $(BUILD) $(DWLIBS) -$(OUTPUT)test-dwarf_getlocations.bin: - $(BUILD) $(DWLIBS) - $(OUTPUT)test-dwarf_getcfi.bin: $(BUILD) $(DWLIBS)
tools/build/feature/test-all.c +0 -5
@@ -42,10 +42,6 @@# include "test-libdw.c" #undef main -#define main main_test_dwarf_getlocations -# include "test-dwarf_getlocations.c" -#undef main -#define main main_test_eventfd# include "test-eventfd.c" #undef main
@@ -184,7 +180,6 @@ int main(int argc, char *argv[])main_test_gettid ();main_test_glibc ();main_test_libdw (); -main_test_dwarf_getlocations ();main_test_eventfd ();main_test_libelf_getphdrnum ();main_test_libelf_gelf_getnote ();
tools/build/feature/test-dwarf_getlocations.c deleted +0 -13
@@ -1,13 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0 -#include <stdlib.h> -#include <elfutils/libdw.h> - -int main (void ) -{ -Dwarf_Addr base, start, end; -Dwarf_Attribute attr; -Dwarf_Op *op; -size_t nops; -ptrdiff_t offset =0 ; -return (int )dwarf_getlocations (&attr, offset, &base, &start, &end, &op, &nops); -}
tools/build/feature/test-libdw.c +13 -1
@@ -1,4 +1,5 @@// SPDX-License-Identifier: GPL-2.0 +#include <stdlib.h> #include <dwarf.h> #include <elfutils/libdw.h> #include <elfutils/libdwfl.h>
@@ -22,7 +23,18 @@ int test_libdw_unwind(void)return 0 ; } +int test_libdw_getlocations (void ) +{ +Dwarf_Addr base, start, end; +Dwarf_Attribute attr; +Dwarf_Op *op; +size_t nops; +ptrdiff_t offset =0 ; + +return (int )dwarf_getlocations (&attr, offset, &base, &start, &end, &op, &nops); +} +int main (void ) { -return test_libdw () +test_libdw_unwind (); +return test_libdw () +test_libdw_unwind () +test_libdw_getlocations (); }
tools/perf/Makefile.config +2 -8
@@ -164,8 +164,6 @@ ifeq ($(findstring -static,${LDFLAGS}),-static) endif FEATURE_CHECK_CFLAGS-libdw := $(LIBDW_CFLAGS) FEATURE_CHECK_LDFLAGS-libdw := $(LIBDW_LDFLAGS) $(DWARFLIBS) -FEATURE_CHECK_CFLAGS-dwarf_getlocations := $(LIBDW_CFLAGS) -FEATURE_CHECK_LDFLAGS-dwarf_getlocations := $(LIBDW_LDFLAGS) $(DWARFLIBS) FEATURE_CHECK_CFLAGS-dwarf_getcfi := $(LIBDW_CFLAGS) FEATURE_CHECK_LDFLAGS-dwarf_getcfi := $(LIBDW_LDFLAGS) $(DWARFLIBS)
@@ -467,15 +465,11 @@ else else ifneq ($(feature-libdw), 1) ifndef NO_LIBDW - $(warning No libdw.h found or old libdw.h found or elfutils is older than 0.138, disables dwarf support. Please install new elfutils-devel/libdw-dev) + $(warning No libdw.h found or old libdw.h found or elfutils is older than 0.157, disables dwarf support. Please install new elfutils-devel/libdw-dev) NO_LIBDW := 1 endif else - ifneq ($(feature-dwarf_getlocations), 1) - $(warning Old libdw.h, finding variables at given 'perf probe' point will not work, install elfutils-devel/libdw-dev >= 0.157) - else - CFLAGS += -DHAVE_DWARF_GETLOCATIONS_SUPPORT - endif # dwarf_getlocations + CFLAGS += -DHAVE_DWARF_GETLOCATIONS_SUPPORT ifneq ($(feature-dwarf_getcfi), 1) $(warning Old libdw.h, finding variables at given 'perf probe' point will not work, install elfutils-devel/libdw-dev >= 0.142) else
Signature · 1 line
2.47.0.105.g07ac214952-goog
Ian Rogers
reviewerPATCH v3 7/11 perf build: Combine test-dwarf-getcfi into test-libdw
In reply to Ian Rogersdwarf_getcfi support in libdw is 15 years old. Make libdw imply dwarf_getcfi support and simplify build logic.
--- tools/build/Makefile.feature | 1 - tools/build/feature/Makefile | 4 ---- tools/build/feature/test-dwarf_getcfi.c | 9 --------- tools/build/feature/test-libdw.c | 10 +++++++++- tools/perf/Makefile.config | 8 +------- 5 files changed, 10 insertions(+), 22 deletions(-) delete mode 100644 tools/build/feature/test-dwarf_getcfi.c
tools/build/Makefile.feature +0 -1
@@ -31,7 +31,6 @@ endef FEATURE_TESTS_BASIC := \ backtrace \ libdw \ - dwarf_getcfi \ eventfd \ fortify-source \ get_current_dir_name \
tools/build/feature/Makefile +0 -4
@@ -6,7 +6,6 @@ FILES= \ test-backtrace.bin \ test-bionic.bin \ test-libdw.bin \ - test-dwarf_getcfi.bin \ test-eventfd.bin \ test-fortify-source.bin \ test-get_current_dir_name.bin \
@@ -187,9 +186,6 @@ endif $(OUTPUT)test-libdw.bin: $(BUILD) $(DWLIBS) -$(OUTPUT)test-dwarf_getcfi.bin: - $(BUILD) $(DWLIBS) - $(OUTPUT)test-libelf-getphdrnum.bin: $(BUILD) -lelf
tools/build/feature/test-dwarf_getcfi.c deleted +0 -9
@@ -1,9 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0 -#include <stdio.h> -#include <elfutils/libdw.h> - -int main (void ) -{ -Dwarf *dwarf =NULL ; -return dwarf_getcfi (dwarf) ==NULL ; -}
tools/build/feature/test-libdw.c +9 -1
@@ -34,7 +34,15 @@ int test_libdw_getlocations(void)return (int )dwarf_getlocations (&attr, offset, &base, &start, &end, &op, &nops); } +int test_libdw_getcfi (void ) +{ +Dwarf *dwarf =NULL ; + +return dwarf_getcfi (dwarf) ==NULL ; +} +int main (void ) { -return test_libdw () +test_libdw_unwind () +test_libdw_getlocations (); +return test_libdw () +test_libdw_unwind () +test_libdw_getlocations () + +test_libdw_getcfi (); }
tools/perf/Makefile.config +1 -7
@@ -164,8 +164,6 @@ ifeq ($(findstring -static,${LDFLAGS}),-static) endif FEATURE_CHECK_CFLAGS-libdw := $(LIBDW_CFLAGS) FEATURE_CHECK_LDFLAGS-libdw := $(LIBDW_LDFLAGS) $(DWARFLIBS) -FEATURE_CHECK_CFLAGS-dwarf_getcfi := $(LIBDW_CFLAGS) -FEATURE_CHECK_LDFLAGS-dwarf_getcfi := $(LIBDW_LDFLAGS) $(DWARFLIBS) # for linking with debug library, run like: # make DEBUG=1 LIBBABELTRACE_DIR=/opt/libbabeltrace/
@@ -470,11 +468,7 @@ else endif else CFLAGS += -DHAVE_DWARF_GETLOCATIONS_SUPPORT - ifneq ($(feature-dwarf_getcfi), 1) - $(warning Old libdw.h, finding variables at given 'perf probe' point will not work, install elfutils-devel/libdw-dev >= 0.142) - else - CFLAGS += -DHAVE_DWARF_CFI_SUPPORT - endif # dwarf_getcfi + CFLAGS += -DHAVE_DWARF_CFI_SUPPORT endif # Dwarf support endif # libelf support endif # NO_LIBELF
Signature · 1 line
2.47.0.105.g07ac214952-goog
Ian Rogers
reviewerPATCH v3 8/11 perf probe: Move elfutils support check to libdw check
In reply to Ian RogersThe test _ELFUTILS_PREREQ(0, 142) is false for elfutils before 2009-06-13, but that is 15 years ago and very unlikely. Add a test to test-libdw.c and assume the libdw version is at least 0.142 to simplify the build logic.
--- tools/build/feature/test-libdw.c | 10 +++++++++- tools/perf/util/probe-finder.c | 2 -- tools/perf/util/probe-finder.h | 2 -- 3 files changed, 9 insertions(+), 5 deletions(-)
tools/build/feature/test-libdw.c +9 -1
@@ -41,8 +41,16 @@ int test_libdw_getcfi(void)return dwarf_getcfi (dwarf) ==NULL ; } +int test_elfutils (void ) +{ +Dwarf_CFI *cfi =NULL ; + +dwarf_cfi_end (cfi); +return 0 ; +} +int main (void ) {return test_libdw () +test_libdw_unwind () +test_libdw_getlocations () + -test_libdw_getcfi (); +test_libdw_getcfi () +test_elfutils (); }
tools/perf/util/probe-finder.c +0 -2
@@ -1379,9 +1379,7 @@ int debuginfo__find_trace_events(struct debuginfo *dbg,if (ret >=0 && tf.pf.skip_empty_arg) ret =fill_empty_trace_arg (pev, tf.tevs, tf.ntevs); -#if _ELFUTILS_PREREQ (0 ,142 )dwarf_cfi_end (tf.pf.cfi_eh); -#endif if (ret <0 || tf.ntevs ==0 ) {for (i =0 ; i < tf.ntevs; i++)
tools/perf/util/probe-finder.h +0 -2
@@ -63,12 +63,10 @@ struct probe_finder {struct intlist *lcache;/* Line cache for lazy match */ /* For variable searching */ -#if _ELFUTILS_PREREQ (0 ,142 )/* Call Frame Information from .eh_frame. Owned by this struct. */ Dwarf_CFI *cfi_eh;/* Call Frame Information from .debug_frame. Not owned. */ Dwarf_CFI *cfi_dbg; -#endif Dwarf_Op *fb_ops;/* Frame base attribute */ unsigned int machine;/* Target machine arch */ struct perf_probe_arg *pvar;/* Current target variable */
Signature · 1 line
2.47.0.105.g07ac214952-goog
Ian Rogers
reviewerPATCH v3 9/11 perf libdw: Remove unnecessary defines
In reply to Ian RogersAs HAVE_DWARF_GETLOCATIONS_SUPPORT and HAVE_DWARF_CFI_SUPPORT always match HAVE_DWARF_SUPPORT remove the macros and use HAVE_DWARF_SUPPORT. If building the file is guarded by CONFIG_DWARF then remove all ifs.
--- tools/perf/Documentation/perf-check.txt | 2 +- tools/perf/Makefile.config | 3 -- tools/perf/builtin-annotate.c | 2 +- tools/perf/builtin-check.c | 2 +- tools/perf/builtin-report.c | 2 +- tools/perf/util/dwarf-aux.c | 6 --- tools/perf/util/dwarf-aux.h | 54 ------------------------- tools/perf/util/probe-finder.c | 4 -- 8 files changed, 4 insertions(+), 71 deletions(-)
tools/perf/Documentation/perf-check.txt +1 -1
@@ -48,7 +48,7 @@ feature:: bpf_skeletons / HAVE_BPF_SKEL debuginfod / HAVE_DEBUGINFOD_SUPPORT dwarf / HAVE_DWARF_SUPPORT - dwarf_getlocations / HAVE_DWARF_GETLOCATIONS_SUPPORT + dwarf_getlocations / HAVE_DWARF_SUPPORT dwarf-unwind / HAVE_DWARF_UNWIND_SUPPORT auxtrace / HAVE_AUXTRACE_SUPPORT libaudit / HAVE_LIBAUDIT_SUPPORT
tools/perf/Makefile.config +0 -3
@@ -466,9 +466,6 @@ else $(warning No libdw.h found or old libdw.h found or elfutils is older than 0.157, disables dwarf support. Please install new elfutils-devel/libdw-dev) NO_LIBDW := 1 endif - else - CFLAGS += -DHAVE_DWARF_GETLOCATIONS_SUPPORT - CFLAGS += -DHAVE_DWARF_CFI_SUPPORT endif # Dwarf support endif # libelf support endif # NO_LIBELF
tools/perf/builtin-annotate.c +1 -1
@@ -840,7 +840,7 @@ int cmd_annotate(int argc, const char **argv) }#endif -#ifndef HAVE_DWARF_GETLOCATIONS_SUPPORT +#ifndef HAVE_DWARF_SUPPORT if (annotate.data_type) {pr_err ("Error: Data type profiling is disabled due to missing DWARF support\n" );return -ENOTSUP ;
tools/perf/builtin-check.c +1 -1
@@ -28,7 +28,7 @@ struct feature_status supported_features[] = {FEATURE_STATUS ("bpf_skeletons" ,HAVE_BPF_SKEL ),FEATURE_STATUS ("debuginfod" ,HAVE_DEBUGINFOD_SUPPORT ),FEATURE_STATUS ("dwarf" ,HAVE_DWARF_SUPPORT ), -FEATURE_STATUS ("dwarf_getlocations" ,HAVE_DWARF_GETLOCATIONS_SUPPORT ), +FEATURE_STATUS ("dwarf_getlocations" ,HAVE_DWARF_SUPPORT ),FEATURE_STATUS ("dwarf-unwind" ,HAVE_DWARF_UNWIND_SUPPORT ),FEATURE_STATUS ("auxtrace" ,HAVE_AUXTRACE_SUPPORT ), FEATURE_STATUS("libaudit", HAVE_LIBAUDIT_SUPPORT),
tools/perf/builtin-report.c +1 -1
@@ -1705,7 +1705,7 @@ int cmd_report(int argc, const char **argv) report.data_type = true; annotate_opts.annotate_src = false; -#ifndef HAVE_DWARF_GETLOCATIONS_SUPPORT +#ifndef HAVE_DWARF_SUPPORT pr_err ("Error: Data type profiling is disabled due to missing DWARF support\n" ); goto error;#endif
tools/perf/util/dwarf-aux.c +0 -6
@@ -1182,7 +1182,6 @@ int die_get_varname(Dwarf_Die *vr_die, struct strbuf *buf)return ret <0 ? ret :strbuf_addf (buf,"\t%s" ,dwarf_diename (vr_die)); } -#if defined(HAVE_DWARF_GETLOCATIONS_SUPPORT ) || defined(HAVE_DWARF_CFI_SUPPORT )static int reg_from_dwarf_op (Dwarf_Op *op) {switch (op->atom) {
@@ -1245,9 +1244,7 @@ static bool check_allowed_ops(Dwarf_Op *ops, size_t nops) }return true; } -#endif /* HAVE_DWARF_GETLOCATIONS_SUPPORT || HAVE_DWARF_CFI_SUPPORT */ -#ifdef HAVE_DWARF_GETLOCATIONS_SUPPORT /** * die_get_var_innermost_scope - Get innermost scope range of given variable DIE * @sp_die: a subprogram DIE
@@ -1697,9 +1694,7 @@ void die_collect_global_vars(Dwarf_Die *cu_die, struct die_var_type **var_types)die_find_child (cu_die, __die_collect_global_vars_cb, (void *)var_types, &die_mem); } -#endif /* HAVE_DWARF_GETLOCATIONS_SUPPORT */ -#ifdef HAVE_DWARF_CFI_SUPPORT /** * die_get_cfa - Get frame base information * @dwarf: a Dwarf info
@@ -1732,7 +1727,6 @@ int die_get_cfa(Dwarf *dwarf, u64 pc, int *preg, int *poffset) }return -1 ; } -#endif /* HAVE_DWARF_CFI_SUPPORT */ /* * die_has_loclist - Check if DW_AT_location of @vr_die is a location list
tools/perf/util/dwarf-aux.h +0 -54
73 lines not on this page · raw message
tools/perf/util/probe-finder.c +0 -4
@@ -602,7 +602,6 @@ static int call_probe_finder(Dwarf_Die *sc_die, struct probe_finder *pf) ret =dwarf_getlocation_addr (&fb_attr, pf->addr, &pf->fb_ops, &nops,1 );if (ret <=0 || nops ==0 ) { pf->fb_ops =NULL ; -#ifdef HAVE_DWARF_CFI_SUPPORT }else if (nops ==1 && pf->fb_ops[0 ].atom == DW_OP_call_frame_cfa && (pf->cfi_eh !=NULL || pf->cfi_dbg !=NULL )) { if ((dwarf_cfi_addrframe(pf->cfi_eh, pf->addr, &frame) != 0 &&
@@ -613,7 +612,6 @@ static int call_probe_finder(Dwarf_Die *sc_die, struct probe_finder *pf)free (frame);return -ENOENT ; } -#endif /* HAVE_DWARF_CFI_SUPPORT */ }/* Call finder's callback handler */
@@ -1138,7 +1136,6 @@ static int debuginfo__find_probes(struct debuginfo *dbg, pf->machine = ehdr.e_machine; -#ifdef HAVE_DWARF_CFI_SUPPORT do { GElf_Shdr shdr;
@@ -1148,7 +1145,6 @@ static int debuginfo__find_probes(struct debuginfo *dbg, pf->cfi_dbg =dwarf_getcfi (dbg->dbg); }while (0 ); -#endif /* HAVE_DWARF_CFI_SUPPORT */ ret =debuginfo__find_probe_location (dbg, pf);return ret;
Signature · 1 line
2.47.0.105.g07ac214952-goog
Ian Rogers
reviewerPATCH v3 10/11 perf build: Rename HAVE_DWARF_SUPPORT to HAVE_LIBDW_SUPPORT
In reply to Ian RogersIn Makefile.config for unwinding the name dwarf implies either libunwind or libdw. Make it clearer that HAVE_DWARF_SUPPORT is really just defined when libdw is present by renaming to HAVE_LIBDW_SUPPORT.
--- tools/perf/Documentation/perf-check.txt | 6 +++--- tools/perf/Makefile.config | 2 +- tools/perf/arch/powerpc/annotate/instructions.c | 4 ++-- tools/perf/arch/x86/annotate/instructions.c | 2 +- tools/perf/builtin-annotate.c | 2 +- tools/perf/builtin-check.c | 6 +++--- tools/perf/builtin-probe.c | 12 ++++++------ tools/perf/builtin-report.c | 4 ++-- tools/perf/util/annotate-data.h | 8 ++++---- tools/perf/util/debuginfo.h | 6 +++--- tools/perf/util/disasm.c | 4 ++-- tools/perf/util/disasm.h | 4 ++-- tools/perf/util/genelf.c | 4 ++-- tools/perf/util/genelf.h | 2 +- tools/perf/util/include/dwarf-regs.h | 6 +++--- tools/perf/util/probe-event.c | 4 ++-- tools/perf/util/probe-finder.h | 4 ++-- 17 files changed, 40 insertions(+), 40 deletions(-)
tools/perf/Documentation/perf-check.txt +3 -3
@@ -47,15 +47,15 @@ feature:: bpf / HAVE_LIBBPF_SUPPORT bpf_skeletons / HAVE_BPF_SKEL debuginfod / HAVE_DEBUGINFOD_SUPPORT - dwarf / HAVE_DWARF_SUPPORT - dwarf_getlocations / HAVE_DWARF_SUPPORT + dwarf / HAVE_LIBDW_SUPPORT + dwarf_getlocations / HAVE_LIBDW_SUPPORT dwarf-unwind / HAVE_DWARF_UNWIND_SUPPORT auxtrace / HAVE_AUXTRACE_SUPPORT libaudit / HAVE_LIBAUDIT_SUPPORT libbfd / HAVE_LIBBFD_SUPPORT libcapstone / HAVE_LIBCAPSTONE_SUPPORT libcrypto / HAVE_LIBCRYPTO_SUPPORT - libdw-dwarf-unwind / HAVE_DWARF_SUPPORT + libdw-dwarf-unwind / HAVE_LIBDW_SUPPORT libelf / HAVE_LIBELF_SUPPORT libnuma / HAVE_LIBNUMA_SUPPORT libopencsd / HAVE_CSTRACE_SUPPORT
tools/perf/Makefile.config +1 -1
@@ -559,7 +559,7 @@ ifndef NO_LIBELF $(warning DWARF register mappings have not been defined for architecture $(SRCARCH), DWARF support disabled) NO_LIBDW := 1 else - CFLAGS += -DHAVE_DWARF_SUPPORT $(LIBDW_CFLAGS) + CFLAGS += -DHAVE_LIBDW_SUPPORT $(LIBDW_CFLAGS) LDFLAGS += $(LIBDW_LDFLAGS) EXTLIBS += ${DWARFLIBS} $(call detected,CONFIG_DWARF)
tools/perf/arch/powerpc/annotate/instructions.c +2 -2
@@ -255,7 +255,7 @@ static struct ins_ops *check_ppc_insn(struct disasm_line *dl)* is moved to r31. update_insn_state_powerpc tracks these state * changes */ -#ifdef HAVE_DWARF_SUPPORT +#ifdef HAVE_LIBDW_SUPPORT static void update_insn_state_powerpc (struct type_state *state,struct data_loc_info *dloc,Dwarf_Die * cu_die__maybe_unused ,struct disasm_line *dl)
@@ -300,7 +300,7 @@ static void update_insn_state_powerpc(struct type_state *state, insn_offset, src->reg1, dst->reg1); pr_debug_type_name(&tsr->type, tsr->kind); } -#endif /* HAVE_DWARF_SUPPORT */ +#endif /* HAVE_LIBDW_SUPPORT */ static int powerpc__annotate_init (struct arch *arch,char *cpuid__maybe_unused ) {
tools/perf/arch/x86/annotate/instructions.c +1 -1
@@ -207,7 +207,7 @@ static int x86__annotate_init(struct arch *arch, char *cpuid)return err; } -#ifdef HAVE_DWARF_SUPPORT +#ifdef HAVE_LIBDW_SUPPORT static void update_insn_state_x86 (struct type_state *state,struct data_loc_info *dloc,Dwarf_Die *cu_die,struct disasm_line *dl)
tools/perf/builtin-annotate.c +1 -1
@@ -840,7 +840,7 @@ int cmd_annotate(int argc, const char **argv) }#endif -#ifndef HAVE_DWARF_SUPPORT +#ifndef HAVE_LIBDW_SUPPORT if (annotate.data_type) {pr_err ("Error: Data type profiling is disabled due to missing DWARF support\n" );return -ENOTSUP ;
tools/perf/builtin-check.c +3 -3
@@ -27,15 +27,15 @@ struct feature_status supported_features[] = {FEATURE_STATUS ("bpf" ,HAVE_LIBBPF_SUPPORT ),FEATURE_STATUS ("bpf_skeletons" ,HAVE_BPF_SKEL ),FEATURE_STATUS ("debuginfod" ,HAVE_DEBUGINFOD_SUPPORT ), -FEATURE_STATUS ("dwarf" ,HAVE_DWARF_SUPPORT ), -FEATURE_STATUS ("dwarf_getlocations" ,HAVE_DWARF_SUPPORT ), +FEATURE_STATUS ("dwarf" ,HAVE_LIBDW_SUPPORT ), +FEATURE_STATUS ("dwarf_getlocations" ,HAVE_LIBDW_SUPPORT ),FEATURE_STATUS ("dwarf-unwind" ,HAVE_DWARF_UNWIND_SUPPORT ),FEATURE_STATUS ("auxtrace" ,HAVE_AUXTRACE_SUPPORT ),FEATURE_STATUS ("libaudit" ,HAVE_LIBAUDIT_SUPPORT ),FEATURE_STATUS ("libbfd" ,HAVE_LIBBFD_SUPPORT ),FEATURE_STATUS ("libcapstone" ,HAVE_LIBCAPSTONE_SUPPORT ),FEATURE_STATUS ("libcrypto" ,HAVE_LIBCRYPTO_SUPPORT ), -FEATURE_STATUS ("libdw-dwarf-unwind" ,HAVE_DWARF_SUPPORT ), +FEATURE_STATUS ("libdw-dwarf-unwind" ,HAVE_LIBDW_SUPPORT ),FEATURE_STATUS ("libelf" ,HAVE_LIBELF_SUPPORT ),FEATURE_STATUS ("libnuma" ,HAVE_LIBNUMA_SUPPORT ), FEATURE_STATUS("libopencsd", HAVE_CSTRACE_SUPPORT),
tools/perf/builtin-probe.c +6 -6
@@ -229,7 +229,7 @@ static int opt_set_target_ns(const struct option *opt __maybe_unused,/* Command option callbacks */ -#ifdef HAVE_DWARF_SUPPORT +#ifdef HAVE_LIBDW_SUPPORT static int opt_show_lines (const struct option *opt,const char *str,int unset__maybe_unused ) {
@@ -505,7 +505,7 @@ static int perf_del_probe_events(struct strfilter *filter)return ret; } -#ifdef HAVE_DWARF_SUPPORT +#ifdef HAVE_LIBDW_SUPPORT #define PROBEDEF_STR \ "[EVENT=]FUNC[@SRC][+OFF|%return|:RL|;PT]|SRC:AL|SRC;PT [[NAME=]ARG ...]"#else
@@ -521,7 +521,7 @@ __cmd_probe(int argc, const char **argv)"perf probe [<options>] --add 'PROBEDEF' [--add 'PROBEDEF' ...]" ,"perf probe [<options>] --del '[GROUP:]EVENT' ..." ,"perf probe --list [GROUP:]EVENT ..." , -#ifdef HAVE_DWARF_SUPPORT +#ifdef HAVE_LIBDW_SUPPORT"perf probe [<options>] --line 'LINEDESC'" , "perf probe [<options>] --vars 'PROBEPOINT'", #endif
@@ -545,7 +545,7 @@ __cmd_probe(int argc, const char **argv)"\t\tFUNC:\tFunction name\n" "\t\tOFF:\tOffset from function entry (in byte)\n" "\t\t%return:\tPut the probe at function return\n" -#ifdef HAVE_DWARF_SUPPORT +#ifdef HAVE_LIBDW_SUPPORT"\t\tSRC:\tSource code path\n" "\t\tRL:\tRelative line number from function entry.\n" "\t\tAL:\tAbsolute line number in file.\n"
@@ -612,7 +612,7 @@ __cmd_probe(int argc, const char **argv)set_option_flag (options,'d' ,"del" ,PARSE_OPT_EXCLUSIVE );set_option_flag (options,'D' ,"definition" ,PARSE_OPT_EXCLUSIVE );set_option_flag (options,'l' ,"list" ,PARSE_OPT_EXCLUSIVE ); -#ifdef HAVE_DWARF_SUPPORT +#ifdef HAVE_LIBDW_SUPPORT set_option_flag (options,'L' ,"line" ,PARSE_OPT_EXCLUSIVE );set_option_flag (options,'V' ,"vars" ,PARSE_OPT_EXCLUSIVE );#else
@@ -694,7 +694,7 @@ __cmd_probe(int argc, const char **argv)if (ret <0 )pr_err_with_code (" Error: Failed to show functions." , ret);return ret; -#ifdef HAVE_DWARF_SUPPORT +#ifdef HAVE_LIBDW_SUPPORT case 'L' : ret =show_line_range (¶ms->line_range, params->target, params->nsi, params->uprobes);
tools/perf/builtin-report.c +2 -2
@@ -455,7 +455,7 @@ static int report__setup_sample_type(struct report *rep)if (!(evlist__combined_branch_type (session->evlist) &PERF_SAMPLE_BRANCH_ANY )) rep->nonany_branch_mode = true; -#if !defined(HAVE_LIBUNWIND_SUPPORT ) && !defined(HAVE_DWARF_SUPPORT ) +#if !defined(HAVE_LIBUNWIND_SUPPORT ) && !defined(HAVE_LIBDW_SUPPORT )if (dwarf_callchain_users) {ui__warning ("Please install libunwind or libdw " "development packages during the perf build.\n" );
@@ -1705,7 +1705,7 @@ int cmd_report(int argc, const char **argv) report.data_type = true; annotate_opts.annotate_src = false; -#ifndef HAVE_DWARF_SUPPORT +#ifndef HAVE_LIBDW_SUPPORT pr_err ("Error: Data type profiling is disabled due to missing DWARF support\n" ); goto error;#endif
tools/perf/util/annotate-data.h +4 -4
@@ -9,7 +9,7 @@#include "dwarf-regs.h" #include "annotate.h" -#ifdef HAVE_DWARF_SUPPORT +#ifdef HAVE_LIBDW_SUPPORT #include "debuginfo.h" #endif
@@ -165,7 +165,7 @@ struct annotated_data_stat { };extern struct annotated_data_stat ann_data_stat; -#ifdef HAVE_DWARF_SUPPORT +#ifdef HAVE_LIBDW_SUPPORT /* * Type information in a register, valid when @ok is true. * The @caller_saved registers are invalidated after a function call.
@@ -244,7 +244,7 @@ bool get_global_var_info(struct data_loc_info *dloc, u64 addr, const char **var_name, int *var_offset);void pr_debug_type_name (Dwarf_Die *die,enum type_state_kind kind); -#else /* HAVE_DWARF_SUPPORT */ +#else /* HAVE_LIBDW_SUPPORT */ static inline struct annotated_data_type *find_data_type (struct data_loc_info *dloc__maybe_unused )
@@ -276,7 +276,7 @@ static inline int hist_entry__annotate_data_tty(struct hist_entry *he __maybe_unreturn -1 ; } -#endif /* HAVE_DWARF_SUPPORT */ +#endif /* HAVE_LIBDW_SUPPORT */ #ifdef HAVE_SLANG_SUPPORT int hist_entry__annotate_data_tui(struct hist_entry *he, struct evsel *evsel,
tools/perf/util/debuginfo.h +3 -3
@@ -5,7 +5,7 @@#include <errno.h> #include <linux/compiler.h> -#ifdef HAVE_DWARF_SUPPORT +#ifdef HAVE_LIBDW_SUPPORT #include "dwarf-aux.h"
@@ -25,7 +25,7 @@ void debuginfo__delete(struct debuginfo *dbg);int debuginfo__get_text_offset (struct debuginfo *dbg,Dwarf_Addr *offs,bool adjust_offset); -#else /* HAVE_DWARF_SUPPORT */ +#else /* HAVE_LIBDW_SUPPORT */ /* dummy debug information structure */ struct debuginfo {
@@ -49,7 +49,7 @@ static inline int debuginfo__get_text_offset(struct debuginfo *dbg __maybe_unusereturn -EINVAL ; } -#endif /* HAVE_DWARF_SUPPORT */ +#endif /* HAVE_LIBDW_SUPPORT */ #ifdef HAVE_DEBUGINFOD_SUPPORT int get_source_from_debuginfod(const char *raw_path, const char *sbuild_id,
tools/perf/util/disasm.c +2 -2
@@ -151,14 +151,14 @@ static struct arch architectures[] = { .memory_ref_char = '(', .imm_char = '$', }, -#ifdef HAVE_DWARF_SUPPORT +#ifdef HAVE_LIBDW_SUPPORT .update_insn_state = update_insn_state_x86,#endif }, { .name = "powerpc", .init = powerpc__annotate_init, -#ifdef HAVE_DWARF_SUPPORT +#ifdef HAVE_LIBDW_SUPPORT .update_insn_state = update_insn_state_powerpc,#endif },
tools/perf/util/disasm.h +2 -2
@@ -4,7 +4,7 @@#include "map_symbol.h" -#ifdef HAVE_DWARF_SUPPORT +#ifdef HAVE_LIBDW_SUPPORT #include "dwarf-aux.h" #endif
@@ -39,7 +39,7 @@ struct arch {char memory_ref_char;char imm_char; } objdump; -#ifdef HAVE_DWARF_SUPPORT +#ifdef HAVE_LIBDW_SUPPORT void (*update_insn_state)(struct type_state *state,struct data_loc_info *dloc,Dwarf_Die *cu_die,struct disasm_line *dl);
tools/perf/util/genelf.c +2 -2
@@ -16,7 +16,7 @@#include <inttypes.h> #include <fcntl.h> #include <err.h> -#ifdef HAVE_DWARF_SUPPORT +#ifdef HAVE_LIBDW_SUPPORT #include <dwarf.h> #endif
@@ -499,7 +499,7 @@ jit_write_elf(int fd, uint64_t load_addr, const char *sym, shdr->sh_size =sizeof (bnote); shdr->sh_entsize =0 ; -#ifdef HAVE_DWARF_SUPPORT +#ifdef HAVE_LIBDW_SUPPORT if (debug && nr_debug_entries) { retval =jit_add_debug_info (e, load_addr, debug, nr_debug_entries);if (retval)
tools/perf/util/genelf.h +1 -1
@@ -8,7 +8,7 @@int jit_write_elf (int fd,uint64_t code_addr,const char *sym,const void *code,int csize,void *debug,int nr_debug_entries,void *unwinding,uint64_t unwinding_header_size,uint64_t unwinding_size); -#ifdef HAVE_DWARF_SUPPORT +#ifdef HAVE_LIBDW_SUPPORT /* genelf_debug.c */ int jit_add_debug_info (Elf *e,uint64_t code_addr,void *debug,int nr_debug_entries);#endif
tools/perf/util/include/dwarf-regs.h +3 -3
@@ -6,7 +6,7 @@#define DWARF_REG_PC 0xd3af9c/* random number */ #define DWARF_REG_FB 0xd3affb/* random number */ -#ifdef HAVE_DWARF_SUPPORT +#ifdef HAVE_LIBDW_SUPPORT const char *get_arch_regstr (unsigned int n);/* * get_dwarf_regstr - Returns ftrace register string from DWARF regnum
@@ -23,7 +23,7 @@ int get_arch_regnum(const char *name);*/ int get_dwarf_regnum (const char *name,unsigned int machine); -#else /* HAVE_DWARF_SUPPORT */ +#else /* HAVE_LIBDW_SUPPORT */ static inline int get_dwarf_regnum (const char *name__maybe_unused ,unsigned int machine__maybe_unused )
@@ -32,7 +32,7 @@ static inline int get_dwarf_regnum(const char *name __maybe_unused, }#endif -#if !defined(__powerpc__) || !defined(HAVE_DWARF_SUPPORT ) +#if !defined(__powerpc__) || !defined(HAVE_LIBDW_SUPPORT )static inline void get_powerpc_regs (u32 raw_insn__maybe_unused ,int is_source__maybe_unused ,struct annotated_op_loc *op_loc__maybe_unused ) {
tools/perf/util/probe-event.c +2 -2
@@ -342,7 +342,7 @@ static char *find_module_name(const char *module)return mod_name; } -#ifdef HAVE_DWARF_SUPPORT +#ifdef HAVE_LIBDW_SUPPORT static int kernel_get_module_dso (const char *module,struct dso **pdso) {
@@ -1250,7 +1250,7 @@ int show_available_vars(struct perf_probe_event *pevs, int npevs, return ret; } -#else /* !HAVE_DWARF_SUPPORT */ +#else /* !HAVE_LIBDW_SUPPORT */ static void debuginfo_cache__exit (void ) {
tools/perf/util/probe-finder.h +2 -2
@@ -21,7 +21,7 @@ static inline int is_c_varname(const char *name)return isalpha (name[0 ]) || name[0 ] =='_' ; } -#ifdef HAVE_DWARF_SUPPORT +#ifdef HAVE_LIBDW_SUPPORT #include "dwarf-aux.h" #include "debuginfo.h"
@@ -102,6 +102,6 @@ struct line_finder {int found; }; -#endif /* HAVE_DWARF_SUPPORT */ +#endif /* HAVE_LIBDW_SUPPORT */ #endif /*_PROBE_FINDER_H */
Signature · 1 line
2.47.0.105.g07ac214952-goog
Ian Rogers
reviewerPATCH v3 11/11 perf build: Rename CONFIG_DWARF to CONFIG_LIBDW
In reply to Ian RogersIn Makefile.config for unwinding the name dwarf implies either libunwind or libdw. Make it clearer that CONFIG_DWARF is really just defined when libdw is present by renaming to CONFIG_LIBDW.
--- tools/perf/Makefile.config | 2 +- tools/perf/arch/arm/util/Build | 2 +- tools/perf/arch/arm64/util/Build | 2 +- tools/perf/arch/csky/util/Build | 2 +- tools/perf/arch/loongarch/util/Build | 2 +- tools/perf/arch/mips/util/Build | 2 +- tools/perf/arch/powerpc/util/Build | 4 ++-- tools/perf/arch/riscv/util/Build | 2 +- tools/perf/arch/s390/util/Build | 2 +- tools/perf/arch/sh/util/Build | 2 +- tools/perf/arch/sparc/util/Build | 2 +- tools/perf/arch/x86/util/Build | 2 +- tools/perf/arch/xtensa/util/Build | 2 +- tools/perf/util/Build | 12 ++++++------ 14 files changed, 20 insertions(+), 20 deletions(-)
tools/perf/Makefile.config +1 -1
@@ -562,7 +562,7 @@ ifndef NO_LIBELF CFLAGS += -DHAVE_LIBDW_SUPPORT $(LIBDW_CFLAGS) LDFLAGS += $(LIBDW_LDFLAGS) EXTLIBS += ${DWARFLIBS} - $(call detected,CONFIG_DWARF) + $(call detected,CONFIG_LIBDW) endif # PERF_HAVE_DWARF_REGS endif # NO_LIBDW
tools/perf/arch/arm/util/Build +1 -1
@@ -1,6 +1,6 @@ perf-util-y += perf_regs.o -perf-util-$(CONFIG_DWARF) += dwarf-regs.o +perf-util-$(CONFIG_LIBDW) += dwarf-regs.o perf-util-$(CONFIG_LOCAL_LIBUNWIND) += unwind-libunwind.o perf-util-$(CONFIG_LIBDW_DWARF_UNWIND) += unwind-libdw.o
tools/perf/arch/arm64/util/Build +1 -1
@@ -4,7 +4,7 @@ perf-util-y += perf_regs.o perf-util-y += tsc.o perf-util-y += pmu.o perf-util-$(CONFIG_LIBTRACEEVENT) += kvm-stat.o -perf-util-$(CONFIG_DWARF) += dwarf-regs.o +perf-util-$(CONFIG_LIBDW) += dwarf-regs.o perf-util-$(CONFIG_LOCAL_LIBUNWIND) += unwind-libunwind.o perf-util-$(CONFIG_LIBDW_DWARF_UNWIND) += unwind-libdw.o
tools/perf/arch/csky/util/Build +1 -1
@@ -1,4 +1,4 @@ perf-util-y += perf_regs.o -perf-util-$(CONFIG_DWARF) += dwarf-regs.o +perf-util-$(CONFIG_LIBDW) += dwarf-regs.o perf-util-$(CONFIG_LIBDW_DWARF_UNWIND) += unwind-libdw.o
tools/perf/arch/loongarch/util/Build +1 -1
@@ -1,7 +1,7 @@ perf-util-y += header.o perf-util-y += perf_regs.o -perf-util-$(CONFIG_DWARF) += dwarf-regs.o +perf-util-$(CONFIG_LIBDW) += dwarf-regs.o perf-util-$(CONFIG_LOCAL_LIBUNWIND) += unwind-libunwind.o perf-util-$(CONFIG_LIBDW_DWARF_UNWIND) += unwind-libdw.o perf-util-$(CONFIG_LIBTRACEEVENT) += kvm-stat.o
tools/perf/arch/mips/util/Build +1 -1
@@ -1,3 +1,3 @@ perf-util-y += perf_regs.o -perf-util-$(CONFIG_DWARF) += dwarf-regs.o +perf-util-$(CONFIG_LIBDW) += dwarf-regs.o perf-util-$(CONFIG_LOCAL_LIBUNWIND) += unwind-libunwind.o
tools/perf/arch/powerpc/util/Build +2 -2
@@ -7,8 +7,8 @@ perf-util-y += sym-handling.o perf-util-y += evsel.o perf-util-y += event.o -perf-util-$(CONFIG_DWARF) += dwarf-regs.o -perf-util-$(CONFIG_DWARF) += skip-callchain-idx.o +perf-util-$(CONFIG_LIBDW) += dwarf-regs.o +perf-util-$(CONFIG_LIBDW) += skip-callchain-idx.o perf-util-$(CONFIG_LIBUNWIND) += unwind-libunwind.o perf-util-$(CONFIG_LIBDW_DWARF_UNWIND) += unwind-libdw.o
tools/perf/arch/riscv/util/Build +1 -1
@@ -2,5 +2,5 @@ perf-util-y += perf_regs.o perf-util-y += header.o perf-util-$(CONFIG_LIBTRACEEVENT) += kvm-stat.o -perf-util-$(CONFIG_DWARF) += dwarf-regs.o +perf-util-$(CONFIG_LIBDW) += dwarf-regs.o perf-util-$(CONFIG_LIBDW_DWARF_UNWIND) += unwind-libdw.o
tools/perf/arch/s390/util/Build +1 -1
@@ -2,7 +2,7 @@ perf-util-y += header.o perf-util-$(CONFIG_LIBTRACEEVENT) += kvm-stat.o perf-util-y += perf_regs.o -perf-util-$(CONFIG_DWARF) += dwarf-regs.o +perf-util-$(CONFIG_LIBDW) += dwarf-regs.o perf-util-$(CONFIG_LIBDW_DWARF_UNWIND) += unwind-libdw.o perf-util-y += machine.o
tools/perf/arch/sh/util/Build +1 -1
@@ -1 +1 @@ -perf-util-$(CONFIG_DWARF) += dwarf-regs.o +perf-util-$(CONFIG_LIBDW) += dwarf-regs.o
tools/perf/arch/sparc/util/Build +1 -1
@@ -1 +1 @@ -perf-util-$(CONFIG_DWARF) += dwarf-regs.o +perf-util-$(CONFIG_LIBDW) += dwarf-regs.o
tools/perf/arch/x86/util/Build +1 -1
@@ -12,7 +12,7 @@ perf-util-y += evsel.o perf-util-y += iostat.o perf-util-y += env.o -perf-util-$(CONFIG_DWARF) += dwarf-regs.o +perf-util-$(CONFIG_LIBDW) += dwarf-regs.o perf-util-$(CONFIG_BPF_PROLOGUE) += dwarf-regs.o perf-util-$(CONFIG_LOCAL_LIBUNWIND) += unwind-libunwind.o
tools/perf/arch/xtensa/util/Build +1 -1
@@ -1 +1 @@ -perf-$(CONFIG_DWARF) += dwarf-regs.o +perf-$(CONFIG_LIBDW) += dwarf-regs.o
tools/perf/util/Build +6 -6
@@ -200,11 +200,11 @@ ifndef CONFIG_SETNS perf-util-y += setns.o endif -perf-util-$(CONFIG_DWARF) += probe-finder.o -perf-util-$(CONFIG_DWARF) += dwarf-aux.o -perf-util-$(CONFIG_DWARF) += dwarf-regs.o -perf-util-$(CONFIG_DWARF) += debuginfo.o -perf-util-$(CONFIG_DWARF) += annotate-data.o +perf-util-$(CONFIG_LIBDW) += probe-finder.o +perf-util-$(CONFIG_LIBDW) += dwarf-aux.o +perf-util-$(CONFIG_LIBDW) += dwarf-regs.o +perf-util-$(CONFIG_LIBDW) += debuginfo.o +perf-util-$(CONFIG_LIBDW) += annotate-data.o perf-util-$(CONFIG_LIBDW_DWARF_UNWIND) += unwind-libdw.o perf-util-$(CONFIG_LOCAL_LIBUNWIND) += unwind-libunwind-local.o
@@ -235,7 +235,7 @@ perf-util-$(CONFIG_LIBLLVM) += llvm-c-helpers.o ifdef CONFIG_JITDUMP perf-util-$(CONFIG_LIBELF) += jitdump.o perf-util-$(CONFIG_LIBELF) += genelf.o -perf-util-$(CONFIG_DWARF) += genelf_debug.o +perf-util-$(CONFIG_LIBDW) += genelf_debug.o endif perf-util-y += perf-hooks.o
Signature · 1 line
2.47.0.105.g07ac214952-goog
Quoted 23 lines · Ian Rogers
These patches were originally on top of:
https://lore.kernel.org/lkml/[email protected]/
where it was pointed out that a lot of the libdw conditional compilation was due to features that have now been standard for 10 or 15 years. The patches remove the conditional compilation assuming the features are in libdw where the feature test is expanded to check there pressence. The patch series is now on top of:
https://lore.kernel.org/lkml/[email protected]/In the
Makefilecode, and forperf record --call-graph, dwarf tends to mean unwind or libdw support for dwarf things. To make it clearer when dwarf really just means libdw numerous build variables and defines are renamed.There is some tech debt in the changes as perf check still reports the values using the old name and for features that are no longer tested. This can be cleanup for another day.
v3: Move
PERF_HAVE_DWARF_REGScleanup to follow up patch series. Add
build fix from patch series these changes are on top of.
v2: Instead of renamingPERF_HAVE_DWARF_REGStoPERF_HAVE_LIBDW_REGS,
remove it.
Quoted 12 lines
Ian Rogers (11):
perf build: FixLIBDW_DIR
perf build: RenameNO_DWARFtoNO_LIBDW
perf build: Remove defined but never used variable perf build: Rename test-dwarf to test-libdw
perf build: Combine libdw-dwarf-unwind into libdw feature tests perf build: Combine test-dwarf-getlocations into test-libdw perf build: Combine test-dwarf-getcfi into test-libdw perf probe: Move elfutils support check to libdw check perf libdw: Remove unnecessary defines
perf build: RenameHAVE_DWARF_SUPPORTtoHAVE_LIBDW_SUPPORTperf build: RenameCONFIG_DWARFtoCONFIG_LIBDW
Thanks,
Namhyung
Quoted 65 lines
tools/build/Makefile.feature | 11 +--- tools/build/feature/Makefile | 24 ++------ tools/build/feature/test-all.c | 16 +----- tools/build/feature/test-dwarf.c | 11 ---- tools/build/feature/test-dwarf_getcfi.c | 9 --- tools/build/feature/test-dwarf_getlocations.c | 13 ----- tools/build/feature/test-libdw-dwarf-unwind.c | 14 ----- tools/build/feature/test-libdw.c | 56 +++++++++++++++++++ tools/perf/Documentation/perf-check.txt | 6 +- tools/perf/Makefile.config | 47 +++++----------- tools/perf/Makefile.perf | 2 +- tools/perf/arch/arm/Makefile | 2 +- tools/perf/arch/arm/util/Build | 2 +- tools/perf/arch/arm64/Makefile | 2 +- tools/perf/arch/arm64/util/Build | 2 +- tools/perf/arch/csky/Makefile | 2 +- tools/perf/arch/csky/util/Build | 2 +- tools/perf/arch/loongarch/Makefile | 2 +- tools/perf/arch/loongarch/util/Build | 2 +- tools/perf/arch/mips/Makefile | 2 +- tools/perf/arch/mips/util/Build | 2 +- tools/perf/arch/powerpc/Makefile | 2 +- .../perf/arch/powerpc/annotate/instructions.c | 4 +- tools/perf/arch/powerpc/util/Build | 4 +- tools/perf/arch/riscv/Makefile | 2 +- tools/perf/arch/riscv/util/Build | 2 +- tools/perf/arch/s390/Makefile | 2 +- tools/perf/arch/s390/util/Build | 2 +- tools/perf/arch/sh/Makefile | 2 +- tools/perf/arch/sh/util/Build | 2 +- tools/perf/arch/sparc/Makefile | 2 +- tools/perf/arch/sparc/util/Build | 2 +- tools/perf/arch/x86/Makefile | 2 +- tools/perf/arch/x86/annotate/instructions.c | 2 +- tools/perf/arch/x86/util/Build | 2 +- tools/perf/arch/xtensa/Makefile | 2 +- tools/perf/arch/xtensa/util/Build | 2 +- tools/perf/builtin-annotate.c | 2 +- tools/perf/builtin-check.c | 6 +- tools/perf/builtin-probe.c | 14 ++--- tools/perf/builtin-report.c | 4 +- tools/perf/util/Build | 12 ++-- tools/perf/util/annotate-data.h | 8 +-- tools/perf/util/debuginfo.h | 6 +- tools/perf/util/disasm.c | 4 +- tools/perf/util/disasm.h | 4 +- tools/perf/util/dwarf-aux.c | 6 -- tools/perf/util/dwarf-aux.h | 54 ------------------ tools/perf/util/genelf.c | 4 +- tools/perf/util/genelf.h | 2 +- tools/perf/util/include/dwarf-regs.h | 6 +- tools/perf/util/probe-event.c | 4 +- tools/perf/util/probe-finder.c | 6 -- tools/perf/util/probe-finder.h | 6 +- 54 files changed, 154 insertions(+), 259 deletions(-) delete mode 100644 tools/build/feature/test-dwarf.c delete mode 100644 tools/build/feature/test-dwarf_getcfi.c delete mode 100644 tools/build/feature/test-dwarf_getlocations.c delete mode 100644 tools/build/feature/test-libdw-dwarf-unwind.c create mode 100644 tools/build/feature/test-libdw.cSignature · 1 line
2.47.0.105.g07ac214952-goog
Quoted 10 lines · Ian Rogers
These patches were originally on top of:
https://lore.kernel.org/lkml/[email protected]/
where it was pointed out that a lot of the libdw conditional compilation was due to features that have now been standard for 10 or 15 years. The patches remove the conditional compilation assuming the features are in libdw where the feature test is expanded to check there pressence. The patch series is now on top of:
https://lore.kernel.org/lkml/[email protected]/[...]
Applied to perf-tools-next, thanks!
Best regards,
Namhyung