Skip to content

Commit e310718

Browse files
committed
tools/perf/build: Fix feature-libunwind-debug-frame handling
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>
1 parent bb4c550 commit e310718

3 files changed

Lines changed: 11 additions & 6 deletions

File tree

‎tools/perf/config/Makefile‎

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -329,8 +329,14 @@ ifndef NO_LIBUNWIND
329329
msg := $(warning No libunwind found, disabling post unwind support. Please install libunwind-dev[el] >= 1.1);
330330
NO_LIBUNWIND := 1
331331
else
332-
ifneq ($(feature-libunwind-debug-frame), 1)
333-
msg := $(warning No debug_frame support found in libunwind);
332+
ifeq ($(ARCH),arm)
333+
$(call feature_check,libunwind-debug-frame)
334+
ifneq ($(feature-libunwind-debug-frame), 1)
335+
msg := $(warning No debug_frame support found in libunwind);
336+
CFLAGS += -DNO_LIBUNWIND_DEBUG_FRAME
337+
endif
338+
else
339+
# non-ARM has no dwarf_find_debug_frame() function:
334340
CFLAGS += -DNO_LIBUNWIND_DEBUG_FRAME
335341
endif
336342
endif

‎tools/perf/config/feature-checks/Makefile‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,9 @@ test-libnuma:
7676
test-libunwind:
7777
$(BUILD) $(LIBUNWIND_LIBS) -lelf
7878

79+
test-libunwind-debug-frame:
80+
$(BUILD) $(LIBUNWIND_LIBS) -lelf
81+
7982
test-libaudit:
8083
$(BUILD) -laudit
8184

‎tools/perf/config/feature-checks/test-all.c‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,6 @@
4949
# include "test-libunwind.c"
5050
#undef main
5151

52-
#define main main_test_libunwind_debug_frame
53-
# include "test-libunwind-debug-frame.c"
54-
#undef main
55-
5652
#define main main_test_libaudit
5753
# include "test-libaudit.c"
5854
#undef main

0 commit comments

Comments
 (0)