From 0a4f2b6a3ba5066947a8cbd7cfa26fb8a9280625 Mon Sep 17 00:00:00 2001 From: Jiri Olsa Date: Wed, 19 Feb 2014 16:52:58 +0100 Subject: perf tools: Setup default dwarf post unwinder Factor NO_LIBDW_DWARF_UNWIND makefile variable and code that selects default DWARf post unwinder based on detected features (libdw and libunwind support) If both are detected the libunwind is selected as default. Simple 'make' will try to add: - libunwind unwinder if present - libdw unwinder if present - disable dwarf unwind if non of libunwind and libdw libraries are present If one of the DWARF unwind libraries is detected, message is displayed which one (libunwind/libdw) is compiled in. Examples: - compile in libdw unwinder if present: $ make NO_LIBUNWIND=1 - compile in libdw (with libdw installation directory) unwinder if present: $ make LIBDW_DIR=/opt/elfutils/ NO_LIBUNWIND=1 BUILD: Doing 'make -j4' parallel build Auto-detecting system features: ... dwarf: [ on ] ... glibc: [ on ] ... gtk2: [ on ] ... libaudit: [ on ] ... libbfd: [ on ] ... libelf: [ on ] ... libnuma: [ on ] ... libperl: [ on ] ... libpython: [ on ] ... libslang: [ on ] ... libunwind: [ on ] ... libdw-dwarf-unwind: [ on ] ... DWARF post unwind library: libdw - disable post dwarf unwind completely: $ make NO_LIBUNWIND=1 NO_LIBDW_DWARF_UNWIND=1 BUILD: Doing 'make -j4' parallel build Auto-detecting system features: ... dwarf: [ on ] ... glibc: [ on ] ... gtk2: [ on ] ... libaudit: [ on ] ... libbfd: [ on ] ... libelf: [ on ] ... libnuma: [ on ] ... libperl: [ on ] ... libpython: [ on ] ... libslang: [ on ] ... libunwind: [ on ] ... libdw-dwarf-unwind: [ on ] ... DWARF post unwind library: libunwind Signed-off-by: Jiri Olsa Cc: Corey Ashford Cc: David Ahern Cc: Frederic Weisbecker Cc: Ingo Molnar Cc: Jean Pihet Cc: Namhyung Kim Cc: Paul Mackerras Cc: Peter Zijlstra Link: http://lkml.kernel.org/r/1392825179-5228-6-git-send-email-jolsa@redhat.com [ Add suggestion about setting LIBDW_DIR when not finding libdw ] Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/arch/x86/Makefile | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'tools/perf/arch') diff --git a/tools/perf/arch/x86/Makefile b/tools/perf/arch/x86/Makefile index 37c4652cc48a..1641542e3636 100644 --- a/tools/perf/arch/x86/Makefile +++ b/tools/perf/arch/x86/Makefile @@ -4,12 +4,14 @@ LIB_OBJS += $(OUTPUT)arch/$(ARCH)/util/dwarf-regs.o endif ifndef NO_LIBUNWIND LIB_OBJS += $(OUTPUT)arch/$(ARCH)/util/unwind-libunwind.o -LIB_OBJS += $(OUTPUT)arch/$(ARCH)/tests/regs_load.o -LIB_OBJS += $(OUTPUT)arch/$(ARCH)/tests/dwarf-unwind.o endif ifndef NO_LIBDW_DWARF_UNWIND LIB_OBJS += $(OUTPUT)arch/$(ARCH)/util/unwind-libdw.o endif +ifndef NO_DWARF_UNWIND +LIB_OBJS += $(OUTPUT)arch/$(ARCH)/tests/regs_load.o +LIB_OBJS += $(OUTPUT)arch/$(ARCH)/tests/dwarf-unwind.o +endif LIB_OBJS += $(OUTPUT)arch/$(ARCH)/util/header.o LIB_OBJS += $(OUTPUT)arch/$(ARCH)/util/tsc.o LIB_H += arch/$(ARCH)/util/tsc.h -- cgit v1.2.3