Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1410174

[PATCH v7 06/14] perf tools: Separate local/remote libunwind config

From He Kuang <hekuang@huawei.com>
Newsgroups linux.kernel
Subject [PATCH v7 06/14] perf tools: Separate local/remote libunwind config
Date 2016-05-31 13:30 +0200
Message-ID <rEQ1Z-24b-45@gated-at.bofh.it> (permalink)
References <rEPSh-20r-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


CONFIG_LIBUNWIND/NO_LIBUNWIND are changed to
CONFIG_LOCAL_LIBUNWIND/NO_LOCAL_LIBUNWIND for retaining local unwind
features. The new CONFIG_LIBUNWIND stands for either local or remote
or both unwind are supported, and NO_LIBUNWIND means that neither
local nor remote unwind is supported.

LIBUNWIND_LIBS is eliminated in LDFLAGS if local libunwind is not
supported.

Signed-off-by: He Kuang <hekuang@huawei.com>
---
 tools/perf/arch/arm/util/Build   |  2 +-
 tools/perf/arch/arm64/util/Build |  2 +-
 tools/perf/arch/x86/util/Build   |  2 +-
 tools/perf/config/Makefile       | 21 ++++++++++++++++++---
 4 files changed, 21 insertions(+), 6 deletions(-)

diff --git a/tools/perf/arch/arm/util/Build b/tools/perf/arch/arm/util/Build
index d22e3d0..f98da17 100644
--- a/tools/perf/arch/arm/util/Build
+++ b/tools/perf/arch/arm/util/Build
@@ -1,4 +1,4 @@
 libperf-$(CONFIG_DWARF) += dwarf-regs.o
 
-libperf-$(CONFIG_LIBUNWIND)          += unwind-libunwind.o
+libperf-$(CONFIG_LOCAL_LIBUNWIND)    += unwind-libunwind.o
 libperf-$(CONFIG_LIBDW_DWARF_UNWIND) += unwind-libdw.o
diff --git a/tools/perf/arch/arm64/util/Build b/tools/perf/arch/arm64/util/Build
index e58123a8..02f41db 100644
--- a/tools/perf/arch/arm64/util/Build
+++ b/tools/perf/arch/arm64/util/Build
@@ -1,2 +1,2 @@
 libperf-$(CONFIG_DWARF)     += dwarf-regs.o
-libperf-$(CONFIG_LIBUNWIND) += unwind-libunwind.o
+libperf-$(CONFIG_LOCAL_LIBUNWIND) += unwind-libunwind.o
diff --git a/tools/perf/arch/x86/util/Build b/tools/perf/arch/x86/util/Build
index 4659703..bc24b75 100644
--- a/tools/perf/arch/x86/util/Build
+++ b/tools/perf/arch/x86/util/Build
@@ -7,7 +7,7 @@ libperf-y += perf_regs.o
 libperf-$(CONFIG_DWARF) += dwarf-regs.o
 libperf-$(CONFIG_BPF_PROLOGUE) += dwarf-regs.o
 
-libperf-$(CONFIG_LIBUNWIND)          += unwind-libunwind.o
+libperf-$(CONFIG_LOCAL_LIBUNWIND)    += unwind-libunwind.o
 libperf-$(CONFIG_LIBDW_DWARF_UNWIND) += unwind-libdw.o
 
 libperf-$(CONFIG_AUXTRACE) += auxtrace.o
diff --git a/tools/perf/config/Makefile b/tools/perf/config/Makefile
index 118df2d..2a8915d 100644
--- a/tools/perf/config/Makefile
+++ b/tools/perf/config/Makefile
@@ -353,10 +353,21 @@ ifeq ($(ARCH),powerpc)
 endif
 
 ifndef NO_LIBUNWIND
+  have_libunwind :=
   ifneq ($(feature-libunwind), 1)
     msg := $(warning No libunwind found. Please install libunwind-dev[el] >= 1.1 and/or set LIBUNWIND_DIR);
+    NO_LOCAL_LIBUNWIND := 1
+  else
+    have_libunwind := 1
+    CFLAGS += -DHAVE_LIBUNWIND_LOCAL_SUPPORT
+    $(call detected,CONFIG_LOCAL_LIBUNWIND)
+  endif
+
+  ifneq ($(have_libunwind), 1)
     NO_LIBUNWIND := 1
   endif
+else
+  NO_LOCAL_LIBUNWIND := 1
 endif
 
 ifndef NO_LIBBPF
@@ -394,7 +405,7 @@ else
   NO_DWARF_UNWIND := 1
 endif
 
-ifndef NO_LIBUNWIND
+ifndef NO_LOCAL_LIBUNWIND
   ifeq ($(ARCH),$(filter $(ARCH),arm arm64))
     $(call feature_check,libunwind-debug-frame)
     ifneq ($(feature-libunwind-debug-frame), 1)
@@ -405,10 +416,14 @@ ifndef NO_LIBUNWIND
     # non-ARM has no dwarf_find_debug_frame() function:
     CFLAGS += -DNO_LIBUNWIND_DEBUG_FRAME
   endif
-  CFLAGS  += -DHAVE_LIBUNWIND_SUPPORT
   EXTLIBS += $(LIBUNWIND_LIBS)
+  LDFLAGS += $(LIBUNWIND_LIBS)
+endif
+
+ifndef NO_LIBUNWIND
+  CFLAGS  += -DHAVE_LIBUNWIND_SUPPORT
   CFLAGS  += $(LIBUNWIND_CFLAGS)
-  LDFLAGS += $(LIBUNWIND_LDFLAGS) $(LIBUNWIND_LIBS)
+  LDFLAGS += $(LIBUNWIND_LDFLAGS)
 endif
 
 ifndef NO_LIBAUDIT
-- 
1.8.5.2

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v7 00/14] Add support for remote unwind He Kuang <hekuang@huawei.com> - 2016-05-31 13:30 +0200
  [PATCH v7 11/14] perf tools: Change fixed name of libunwind__arch_reg_id to macro He Kuang <hekuang@huawei.com> - 2016-05-31 13:30 +0200
  [PATCH v7 06/14] perf tools: Separate local/remote libunwind config He Kuang <hekuang@huawei.com> - 2016-05-31 13:30 +0200
    Re: [PATCH v7 06/14] perf tools: Separate local/remote libunwind  config Jiri Olsa <jolsa@redhat.com> - 2016-06-01 10:40 +0200
  [PATCH v7 07/14] perf tools: Rename unwind-libunwind.c to unwind-libunwind-local.c He Kuang <hekuang@huawei.com> - 2016-05-31 13:30 +0200
  [PATCH v7 13/14] perf callchain: Support x86 target platform He Kuang <hekuang@huawei.com> - 2016-05-31 13:30 +0200
    Re: [PATCH v7 13/14] perf callchain: Support x86 target platform Jiri Olsa <jolsa@redhat.com> - 2016-06-01 10:50 +0200
      Re: [PATCH v7 13/14] perf callchain: Support x86 target platform Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-06-01 14:50 +0200
        Re: [PATCH v7 13/14] perf callchain: Support x86 target platform Jiri Olsa <jolsa@redhat.com> - 2016-06-01 15:20 +0200
    Re: [PATCH v7 13/14] perf callchain: Support x86 target platform Jiri Olsa <jolsa@redhat.com> - 2016-06-01 10:50 +0200
      Re: [PATCH v7 13/14] perf callchain: Support x86 target platform Hekuang <hekuang@huawei.com> - 2016-06-01 12:00 +0200
    Re: [PATCH v7 13/14] perf callchain: Support x86 target platform Jiri Olsa <jolsa@redhat.com> - 2016-06-01 10:50 +0200
  [PATCH v7 09/14] perf tools: Export normalize_arch() function He Kuang <hekuang@huawei.com> - 2016-05-31 13:30 +0200
  [PATCH v7 03/14] perf tools: Introducing struct unwind_libunwind_ops for local unwind He Kuang <hekuang@huawei.com> - 2016-05-31 13:30 +0200
    Re: [PATCH v7 03/14] perf tools: Introducing struct  unwind_libunwind_ops for local unwind Jiri Olsa <jolsa@redhat.com> - 2016-06-01 10:40 +0200
    Re: [PATCH v7 03/14] perf tools: Introducing struct  unwind_libunwind_ops for local unwind Jiri Olsa <jolsa@redhat.com> - 2016-06-01 10:50 +0200
  [PATCH v7 14/14] perf callchain: Support aarch64 cross-platform He Kuang <hekuang@huawei.com> - 2016-05-31 13:30 +0200
    Re: [PATCH v7 14/14] perf callchain: Support aarch64 cross-platform Jiri Olsa <jolsa@redhat.com> - 2016-06-01 10:50 +0200
      Re: [PATCH v7 14/14] perf callchain: Support aarch64 cross-platform Hekuang <hekuang@huawei.com> - 2016-06-01 12:10 +0200

csiph-web