tools/perf/build: Split out feature check: 'backtrace'

Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Link: http://lkml.kernel.org/n/tip-ihnwe6cvglVkudyvcavP1wql@git.kernel.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
This commit is contained in:
Ingo Molnar 2013-09-30 16:49:38 +02:00
parent 34ef21622f
commit 4cc9117a35
3 changed files with 16 additions and 1 deletions

View File

@ -124,6 +124,7 @@ FEATURE_TESTS = \
strlcpy \
libbfd \
on-exit \
backtrace \
libnuma
$(foreach test,$(FEATURE_TESTS),$(call feature_check,$(test),$(test)))
@ -448,7 +449,7 @@ ifndef NO_ON_EXIT
endif
ifndef NO_BACKTRACE
ifeq ($(call try-cc,$(SOURCE_BACKTRACE),,-DHAVE_BACKTRACE_SUPPORT),y)
ifeq ($(feature-backtrace), 1)
CFLAGS += -DHAVE_BACKTRACE_SUPPORT
endif
endif

View File

@ -22,6 +22,7 @@ FILES= \
test-strlcpy \
test-libbfd \
test-on-exit \
test-backtrace \
test-libnuma
CC := $(CC) -MD
@ -124,6 +125,9 @@ test-libbfd:
test-on-exit:
$(BUILD)
test-backtrace:
$(BUILD)
-include *.d */*.d
###############################

View File

@ -0,0 +1,10 @@
#include <execinfo.h>
#include <stdio.h>
int main(void)
{
backtrace(NULL, 0);
backtrace_symbols(NULL, 0);
return 0;
}