All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Ahern <dsahern@gmail.com>
To: acme@ghostprotocols.net, linux-kernel@vger.kernel.org
Cc: David Ahern <dsahern@gmail.com>, Borislav Petkov <bp@alien8.de>,
	Frederic Weisbecker <fweisbec@gmail.com>,
	Ingo Molnar <mingo@kernel.org>, Jiri Olsa <jolsa@redhat.com>,
	Namhyung Kim <namhyung@kernel.org>,
	Peter Zijlstra <a.p.zijlstra@chello.nl>,
	Stephane Eranian <eranian@google.com>
Subject: [PATCH 09/23] perf: make cfi unwind support based on CONFIG_LIBUNWIND
Date: Mon,  1 Apr 2013 21:54:23 -0600	[thread overview]
Message-ID: <1364874877-5618-10-git-send-email-dsahern@gmail.com> (raw)
In-Reply-To: <1364874877-5618-1-git-send-email-dsahern@gmail.com>

Signed-off-by: David Ahern <dsahern@gmail.com>
Cc: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Stephane Eranian <eranian@google.com>
---
 tools/perf/Makefile                 |   20 ++++++++++----------
 tools/perf/Pconfig                  |   15 +++++++++++++++
 tools/perf/arch/x86/Makefile        |    2 +-
 tools/perf/config/feature-tests.mak |    2 +-
 4 files changed, 27 insertions(+), 12 deletions(-)

diff --git a/tools/perf/Makefile b/tools/perf/Makefile
index 9bb12b5..5c060c8 100644
--- a/tools/perf/Makefile
+++ b/tools/perf/Makefile
@@ -36,9 +36,6 @@ include config/utilities.mak
 #
 # Define NO_DEMANGLE if you do not want C++ symbol demangling.
 #
-# Define NO_LIBUNWIND if you do not want libunwind dependency for dwarf
-# backtrace post unwind.
-#
 # Define NO_BACKTRACE if you do not want stack backtrace debug feature
 #
 # Define NO_LIBNUMA if you do not want numa perf benchmark
@@ -575,15 +572,19 @@ ifdef CONFIG_LIBELF
 else
     NO_DWARF := 1
     NO_DEMANGLE := 1
-    NO_LIBUNWIND := 1
+    ifdef CONFIG_LIBUNWIND
+        $(error CONFIG_LIBUNWIND depends on LIBELF)
+    endif
 endif
 
 # There's only x86 (both 32 and 64) support for CFI unwind so far
 ifneq ($(ARCH),x86)
-	NO_LIBUNWIND := 1
+ifdef CONFIG_LIBUNWIND
+	$(error CONFIG_LIBUNWIND only supported for x86 architecture)
+endif
 endif
 
-ifndef NO_LIBUNWIND
+ifdef CONFIG_LIBUNWIND
 # for linking with debug library, run like:
 # make DEBUG=1 LIBUNWIND_DIR=/opt/libunwind/
 ifdef LIBUNWIND_DIR
@@ -593,10 +594,9 @@ endif
 
 FLAGS_UNWIND=$(LIBUNWIND_CFLAGS) $(ALL_CFLAGS) $(LIBUNWIND_LDFLAGS) $(ALL_LDFLAGS) $(EXTLIBS) $(LIBUNWIND_LIBS)
 ifneq ($(call try-cc,$(SOURCE_LIBUNWIND),$(FLAGS_UNWIND),libunwind),y)
-	msg := $(warning No libunwind found, disabling post unwind support. Please install libunwind-dev[el] >= 0.99);
-	NO_LIBUNWIND := 1
+    $(error No libunwind found. Please install libunwind-dev[el] >= 0.99 or disable CONFIG_LIBUNWIND)
 endif # Libunwind support
-endif # NO_LIBUNWIND
+endif
 
 -include arch/$(ARCH)/Makefile
 
@@ -636,7 +636,7 @@ else
     LIB_OBJS += $(OUTPUT)util/symbol-minimal.o
 endif
 
-ifndef NO_LIBUNWIND
+ifdef CONFIG_LIBUNWIND
 	BASIC_CFLAGS += -DLIBUNWIND_SUPPORT
 	EXTLIBS += $(LIBUNWIND_LIBS)
 	BASIC_CFLAGS := $(LIBUNWIND_CFLAGS) $(BASIC_CFLAGS)
diff --git a/tools/perf/Pconfig b/tools/perf/Pconfig
index 334674c..d6e067e 100644
--- a/tools/perf/Pconfig
+++ b/tools/perf/Pconfig
@@ -1,3 +1,14 @@
+config ARCH
+    string
+    option env="ARCH"
+
+config X86
+    def_bool y if ARCH = "x86"
+    select HAVE_CFI_UNWIND_SUPPORT
+
+config HAVE_CFI_UNWIND_SUPPORT
+    bool
+
 config NEWT
     bool "Enable newt-based TUI"
 
@@ -11,6 +22,10 @@ config LIBELF
     bool "Enable support for libelf"
     depends on LIBC
 
+config LIBUNWIND
+    bool "Enable support for libunwind"
+    depends on HAVE_CFI_UNWIND_SUPPORT && LIBELF
+
 config LIBPERL
     bool "Enable support for perl scripting engine"
 
diff --git a/tools/perf/arch/x86/Makefile b/tools/perf/arch/x86/Makefile
index 815841c..3a6dc3d 100644
--- a/tools/perf/arch/x86/Makefile
+++ b/tools/perf/arch/x86/Makefile
@@ -2,7 +2,7 @@ ifndef NO_DWARF
 PERF_HAVE_DWARF_REGS := 1
 LIB_OBJS += $(OUTPUT)arch/$(ARCH)/util/dwarf-regs.o
 endif
-ifndef NO_LIBUNWIND
+ifdef CONFIG_LIBUNWIND
 LIB_OBJS += $(OUTPUT)arch/$(ARCH)/util/unwind.o
 endif
 LIB_OBJS += $(OUTPUT)arch/$(ARCH)/util/header.o
diff --git a/tools/perf/config/feature-tests.mak b/tools/perf/config/feature-tests.mak
index 7ec044f..b0c28b2 100644
--- a/tools/perf/config/feature-tests.mak
+++ b/tools/perf/config/feature-tests.mak
@@ -167,7 +167,7 @@ int main(void)
 }
 endef
 
-ifndef NO_LIBUNWIND
+ifdef CONFIG_LIBUNWIND
 define SOURCE_LIBUNWIND
 #include <libunwind.h>
 #include <stdlib.h>
-- 
1.7.10.1


  parent reply	other threads:[~2013-04-02  3:59 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-02  3:54 [PATCH 00/23] perf: integrate with kconfig and CONFIG driven features David Ahern
2013-04-02  3:54 ` [PATCH 01/23] perf: initial infrasructure for kconfig David Ahern
2013-04-02  8:22   ` Paul Bolle
2013-04-02 15:09     ` David Ahern
2013-04-02  3:54 ` [PATCH 02/23] perf: make perl support based on CONFIG_LIBPERL David Ahern
2013-04-02  3:54 ` [PATCH 03/23] perf: make python support based on CONFIG_LIBPYTHON David Ahern
2013-04-02  3:54 ` [PATCH 04/23] perf: make gtk2 support based on CONFIG_GTK2 David Ahern
2013-04-02  3:54 ` [PATCH 05/23] perf: make newt support based on CONFIG_NEWT David Ahern
2013-04-02  3:54 ` [PATCH 06/23] perf: remove NEWT_SUPPORT in favor of CONFIG_NEWT David Ahern
2013-04-02  3:54 ` [PATCH 07/23] perf: remove GTK2_SUPPORT in favor of CONFIG_GTK2 David Ahern
2013-04-02  3:54 ` [PATCH 08/23] perf: make elf support based on CONFIG_LIBELF David Ahern
2013-04-02  3:54 ` David Ahern [this message]
2013-04-02  9:32   ` [PATCH 09/23] perf: make cfi unwind support based on CONFIG_LIBUNWIND Paul Bolle
2013-04-02 15:20     ` David Ahern
2013-04-04  8:02       ` Paul Bolle
2013-04-02  3:54 ` [PATCH 10/23] perf: make demangle support based on CONFIG_DEMANGLE David Ahern
2013-04-02  9:26   ` Paul Bolle
2013-04-02  3:54 ` [PATCH 11/23] perf: make dwarf support based on CONFIG_DWARF David Ahern
2013-04-02  3:54 ` [PATCH 12/23] perf: add BIONIC config option David Ahern
2013-04-02  3:54 ` [PATCH 13/23] perf: make numa support based on CONFIG_LIBNUMA David Ahern
2013-04-02  3:54 ` [PATCH 14/23] perf: make backtrace support based on CONFIG_BACKTRACE David Ahern
2013-04-02  3:54 ` [PATCH 15/23] perf: make libaudit support based on CONFIG_LIBAUDIT David Ahern
2013-04-02  3:54 ` [PATCH 16/23] perf: consolidate CONFIG_LIBUNWIND checks in Makefile David Ahern
2013-04-02  3:54 ` [PATCH 17/23] perf: remove LIBUNWIND_SUPPORT in favor of CONFIG_LIBUNWIND David Ahern
2013-04-02  3:54 ` [PATCH 18/23] perf: deprecate LIBELF_SUPPORT in favor of CONFIG_LIBELF David Ahern
2013-04-02  3:54 ` [PATCH 19/23] perf: deprecate DWARF_SUPPORT in favor of CONFIG_DWARF David Ahern
2013-04-02  3:54 ` [PATCH 20/23] perf: consolidate CONFIG_LIBELF checks in Makefile David Ahern
2013-04-02  9:37   ` Paul Bolle
2013-04-02 15:21     ` David Ahern
2013-04-02  3:54 ` [PATCH 21/23] perf: consolidate CONFIG_DWARF " David Ahern
2013-04-02  3:54 ` [PATCH 22/23] perf: only add elf to EXTLIBS if CONFIG_LIBELF is set David Ahern
2013-04-02  3:54 ` [PATCH 23/23] perf: only add elf-based object files " David Ahern

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1364874877-5618-10-git-send-email-dsahern@gmail.com \
    --to=dsahern@gmail.com \
    --cc=a.p.zijlstra@chello.nl \
    --cc=acme@ghostprotocols.net \
    --cc=bp@alien8.de \
    --cc=eranian@google.com \
    --cc=fweisbec@gmail.com \
    --cc=jolsa@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=namhyung@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.