diff options
author | Jean Pihet <jean.pihet@linaro.org> | 2013-09-26 07:36:37 -0400 |
---|---|---|
committer | Will Deacon <will.deacon@arm.com> | 2013-09-30 11:41:59 -0400 |
commit | 405ffbd4988118c56ff127792ebddae77d2c7a43 (patch) | |
tree | a6e57eacb60eb430d53576e94a60ccc391861ed1 /tools | |
parent | 7495f3742dda97612a77d92fa62f85cb7591ab14 (diff) |
perf tools: Check libunwind for availability of dwarf parsing feature
The newly added dwarf unwinding feature [1] requires:
. a recent version (>= 1.1) of libunwind,
. libunwind to be configured with --enable-debug-frame.
[1] http://www.spinics.net/lists/kernel/msg1598951.html
Add the corresponding API tests in the feature check list.
Acked-by: Jiri Olsa <jolsa@redhat.com>
Signed-off-by: Jean Pihet <jean.pihet@linaro.org>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/perf/config/Makefile | 6 | ||||
-rw-r--r-- | tools/perf/config/feature-tests.mak | 21 |
2 files changed, 25 insertions, 2 deletions
diff --git a/tools/perf/config/Makefile b/tools/perf/config/Makefile index 4796ce54e653..75b93d7f7860 100644 --- a/tools/perf/config/Makefile +++ b/tools/perf/config/Makefile | |||
@@ -226,9 +226,13 @@ endif | |||
226 | 226 | ||
227 | FLAGS_UNWIND=$(LIBUNWIND_CFLAGS) $(CFLAGS) $(LIBUNWIND_LDFLAGS) $(LDFLAGS) $(EXTLIBS) $(LIBUNWIND_LIBS) | 227 | FLAGS_UNWIND=$(LIBUNWIND_CFLAGS) $(CFLAGS) $(LIBUNWIND_LDFLAGS) $(LDFLAGS) $(EXTLIBS) $(LIBUNWIND_LIBS) |
228 | ifneq ($(call try-cc,$(SOURCE_LIBUNWIND),$(FLAGS_UNWIND),libunwind),y) | 228 | ifneq ($(call try-cc,$(SOURCE_LIBUNWIND),$(FLAGS_UNWIND),libunwind),y) |
229 | msg := $(warning No libunwind found, disabling post unwind support. Please install libunwind-dev[el] >= 0.99); | 229 | msg := $(warning No libunwind found, disabling post unwind support. Please install libunwind-dev[el] >= 1.1); |
230 | NO_LIBUNWIND := 1 | 230 | NO_LIBUNWIND := 1 |
231 | endif # Libunwind support | 231 | endif # Libunwind support |
232 | ifneq ($(call try-cc,$(SOURCE_LIBUNWIND_DEBUG_FRAME),$(FLAGS_UNWIND),libunwind debug_frame),y) | ||
233 | msg := $(warning No debug_frame support found in libunwind); | ||
234 | CFLAGS += -DNO_LIBUNWIND_DEBUG_FRAME | ||
235 | endif # debug_frame support in libunwind | ||
232 | endif # NO_LIBUNWIND | 236 | endif # NO_LIBUNWIND |
233 | 237 | ||
234 | ifndef NO_LIBUNWIND | 238 | ifndef NO_LIBUNWIND |
diff --git a/tools/perf/config/feature-tests.mak b/tools/perf/config/feature-tests.mak index d5a8dd44945f..40b21c0bc10a 100644 --- a/tools/perf/config/feature-tests.mak +++ b/tools/perf/config/feature-tests.mak | |||
@@ -185,7 +185,6 @@ extern int UNW_OBJ(dwarf_search_unwind_table) (unw_addr_space_t as, | |||
185 | unw_proc_info_t *pi, | 185 | unw_proc_info_t *pi, |
186 | int need_unwind_info, void *arg); | 186 | int need_unwind_info, void *arg); |
187 | 187 | ||
188 | |||
189 | #define dwarf_search_unwind_table UNW_OBJ(dwarf_search_unwind_table) | 188 | #define dwarf_search_unwind_table UNW_OBJ(dwarf_search_unwind_table) |
190 | 189 | ||
191 | int main(void) | 190 | int main(void) |
@@ -197,6 +196,26 @@ int main(void) | |||
197 | return 0; | 196 | return 0; |
198 | } | 197 | } |
199 | endef | 198 | endef |
199 | |||
200 | define SOURCE_LIBUNWIND_DEBUG_FRAME | ||
201 | #include <libunwind.h> | ||
202 | #include <stdlib.h> | ||
203 | |||
204 | extern int | ||
205 | UNW_OBJ(dwarf_find_debug_frame) (int found, unw_dyn_info_t *di_debug, | ||
206 | unw_word_t ip, unw_word_t segbase, | ||
207 | const char *obj_name, unw_word_t start, | ||
208 | unw_word_t end); | ||
209 | |||
210 | #define dwarf_find_debug_frame UNW_OBJ(dwarf_find_debug_frame) | ||
211 | |||
212 | int main(void) | ||
213 | { | ||
214 | dwarf_find_debug_frame(0, NULL, 0, 0, NULL, 0, 0); | ||
215 | return 0; | ||
216 | } | ||
217 | endef | ||
218 | |||
200 | endif | 219 | endif |
201 | 220 | ||
202 | ifndef NO_BACKTRACE | 221 | ifndef NO_BACKTRACE |