tools/perf/build: Fix feature-libunwind-debug-frame handling
authorIngo Molnar <mingo@kernel.org>
Thu, 14 Nov 2013 07:25:24 +0000 (08:25 +0100)
committerIngo Molnar <mingo@kernel.org>
Thu, 14 Nov 2013 17:00:45 +0000 (18:00 +0100)
Set feature-libunwind-debug-frame. We don't want it in
CORE_FEATURE_TESTS because it's not the generic case, but we
need to set it in the !feature-libunwind case.

Also, because x86 distributions typically don't have
dwarf_find_debug_frame() unwinding method:

  test-libunwind-debug-frame.c:(.text+0x31): undefined reference to `_Ux86_64_dwarf_find_debug_frame'

Restrict this new API to ARM for the time being.

With this patch test-all.c works again, so repeat perf builds
are  fast again:

  comet:~/tip> perf stat --null --repeat 5 make -C tools/perf/
  [...]

       0,452899660 seconds time elapsed                                          ( +-  0,11% )

While with before it was:

  comet:~/tip> perf stat --null --repeat 5 make -C tools/perf/
  [...]

       1,674001829 seconds time elapsed                                          ( +-  0,16% )

[ Includes fix to config/feature-checks/Makefile from Will Deacon. ]

Tested-by: Will Deacon <will.deacon@arm.com>
Tested-by: Jean Pihet <jean.pihet@linaro.org>
Cc: Russell King <rmk@arm.linux.org.uk>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Arnaldo Carvalho de Melo <acme@infradead.org>
Cc: Jiri Olsa <jolsa@redhat.com>
Link: http://lkml.kernel.org/n/tip-scsoctqzmou3rpkixCHezy9e@git.kernel.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
tools/perf/config/Makefile
tools/perf/config/feature-checks/Makefile
tools/perf/config/feature-checks/test-all.c

index 861379ec7632f0b4a73b313e8e7b217b2733bda3..f7d11a811c743e6e2836270f4579124007140d32 100644 (file)
@@ -329,8 +329,14 @@ ifndef NO_LIBUNWIND
     msg := $(warning No libunwind found, disabling post unwind support. Please install libunwind-dev[el] >= 1.1);
     NO_LIBUNWIND := 1
   else
-    ifneq ($(feature-libunwind-debug-frame), 1)
-      msg := $(warning No debug_frame support found in libunwind);
+    ifeq ($(ARCH),arm)
+      $(call feature_check,libunwind-debug-frame)
+      ifneq ($(feature-libunwind-debug-frame), 1)
+        msg := $(warning No debug_frame support found in libunwind);
+        CFLAGS += -DNO_LIBUNWIND_DEBUG_FRAME
+      endif
+    else
+      # non-ARM has no dwarf_find_debug_frame() function:
       CFLAGS += -DNO_LIBUNWIND_DEBUG_FRAME
     endif
   endif
index e8e195f49a4ee7695a80b2a4d535fb35a5aac504..87e790017c6988b856e3b4e8b47f572a9d8beea9 100644 (file)
@@ -76,6 +76,9 @@ test-libnuma:
 test-libunwind:
        $(BUILD) $(LIBUNWIND_LIBS) -lelf
 
+test-libunwind-debug-frame:
+       $(BUILD) $(LIBUNWIND_LIBS) -lelf
+
 test-libaudit:
        $(BUILD) -laudit
 
index 799865b607721e247b847711cf656ef375ada341..59e7a705e146d4eb8ea029ebf74878411f8e3898 100644 (file)
 # include "test-libunwind.c"
 #undef main
 
-#define main main_test_libunwind_debug_frame
-# include "test-libunwind-debug-frame.c"
-#undef main
-
 #define main main_test_libaudit
 # include "test-libaudit.c"
 #undef main