lkml.org 
[lkml]   [2010]   [Oct]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[RFC PATCH 09/11] perf: Add libunwind dependency for dwarf cfi unwinding
Date
This is not mandatory, but required to get dwarf cfi unwinding
support.

Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Stephane Eranian <eranian@google.com>
Cc: Cyrill Gorcunov <gorcunov@openvz.org>
Cc: Tom Zanussi <tzanussi@gmail.com>
Cc: Masami Hiramatsu <mhiramat@redhat.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Robert Richter <robert.richter@amd.com>
Cc: Frank Ch. Eigler <fche@redhat.com>
---
tools/perf/Makefile | 19 +++++++++++++++++++
tools/perf/feature-tests.mak | 14 ++++++++++++++
2 files changed, 33 insertions(+), 0 deletions(-)
diff --git a/tools/perf/Makefile b/tools/perf/Makefile
index addef2f..0c46ac7 100644
--- a/tools/perf/Makefile
+++ b/tools/perf/Makefile
@@ -518,6 +518,20 @@ ifneq ($(call try-cc,$(SOURCE_DWARF),$(FLAGS_DWARF)),y)
endif # Dwarf support
endif # NO_DWARF

+
+# Only x86-32 is supported for now
+ifneq ($(ARCH),x86)
+ NO_LIBUNWIND := 1
+endif
+
+ifndef NO_LIBUNWIND
+FLAGS_UNWIND=$(ALL_CFLAGS) -lunwind-x86 -lunwind-ptrace $(ALL_LDFLAGS) $(EXTLIBS)
+ifneq ($(call try-cc,$(SOURCE_LIBUNWIND),$(FLAGS_UNWIND)),y)
+ msg := $(warning No libunwind found. Please install libunwind >= 0.99);
+ NO_LIBUNWIND := 1
+endif # Libunwind support
+endif # NO_LIBUNWIND
+
-include arch/$(ARCH)/Makefile

ifeq ($(uname_S),Darwin)
@@ -564,6 +578,11 @@ else
endif # PERF_HAVE_DWARF_REGS
endif # NO_DWARF

+ifndef NO_LIBUNWIND
+ BASIC_CFLAGS += -DLIBUNWIND_SUPPORT
+ EXTLIBS += -lunwind-ptrace -lunwind-x86
+endif
+
ifdef NO_NEWT
BASIC_CFLAGS += -DNO_NEWT_SUPPORT
else
diff --git a/tools/perf/feature-tests.mak b/tools/perf/feature-tests.mak
index b253db6..367b213 100644
--- a/tools/perf/feature-tests.mak
+++ b/tools/perf/feature-tests.mak
@@ -90,6 +90,20 @@ int main(void)
endef
endif

+ifndef NO_LIBUNWIND
+define SOURCE_LIBUNWIND
+#include <libunwind.h>
+#include <stdlib.h>
+
+int main(void)
+{
+ unw_addr_space_t addr_space;
+ addr_space = unw_create_addr_space(NULL, 0);
+ return 0;
+}
+endef
+endif
+
define SOURCE_BFD
#include <bfd.h>

--
1.6.2.3


\
 
 \ /
  Last update: 2010-10-22 21:17    [from the cache]
©2003-2011 Jasper Spaans