From c9f08bee50c71b06685ccff8110e56a7c05662b7 Mon Sep 17 00:00:00 2001 From: Irina Tirdea Date: Sat, 8 Sep 2012 03:43:23 +0300 Subject: perf tools: add NO_BACKTRACE for application self-debugging perf has support for self-debugging by defining dump_stack function. This function uses backtrace and backtrace_symbols functions defined as GNU extensions. In Android, bionic does not offer support for these functions and compilation will fail with the following error: target C: libperf <= tools/perf/util/util.c tools/perf/util/util.c:4:22: fatal error: execinfo.h: No such file or directory compilation terminated. Add a compile-time option (NO_BACKTRACE) to enable or disable self-debugging functionality in perf. This can also help in debugging since it offers the possibility to turn on/off printing the backtrace. Signed-off-by: Irina Tirdea Cc: David Ahern Cc: Ingo Molnar Cc: Namhyung Kim Cc: Paul Mackerras Cc: Peter Zijlstra Cc: Steven Rostedt Link: http://lkml.kernel.org/r/1347065004-15306-12-git-send-email-irina.tirdea@intel.com Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/config/feature-tests.mak | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'tools/perf/config/feature-tests.mak') diff --git a/tools/perf/config/feature-tests.mak b/tools/perf/config/feature-tests.mak index 2f1156a62ab7..116690a669d2 100644 --- a/tools/perf/config/feature-tests.mak +++ b/tools/perf/config/feature-tests.mak @@ -179,3 +179,17 @@ int main(void) } endef endif + +ifndef NO_BACKTRACE +define SOURCE_BACKTRACE +#include +#include + +int main(void) +{ + backtrace(NULL, 0); + backtrace_symbols(NULL, 0); + return 0; +} +endef +endif -- cgit v1.2.3