diff options
Diffstat (limited to 'tools/perf/config/feature-checks/test-libunwind.c')
-rw-r--r-- | tools/perf/config/feature-checks/test-libunwind.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/tools/perf/config/feature-checks/test-libunwind.c b/tools/perf/config/feature-checks/test-libunwind.c new file mode 100644 index 000000000000..43b9369bcab7 --- /dev/null +++ b/tools/perf/config/feature-checks/test-libunwind.c | |||
@@ -0,0 +1,27 @@ | |||
1 | #include <libunwind.h> | ||
2 | #include <stdlib.h> | ||
3 | |||
4 | extern int UNW_OBJ(dwarf_search_unwind_table) (unw_addr_space_t as, | ||
5 | unw_word_t ip, | ||
6 | unw_dyn_info_t *di, | ||
7 | unw_proc_info_t *pi, | ||
8 | int need_unwind_info, void *arg); | ||
9 | |||
10 | |||
11 | #define dwarf_search_unwind_table UNW_OBJ(dwarf_search_unwind_table) | ||
12 | |||
13 | static unw_accessors_t accessors; | ||
14 | |||
15 | int main(void) | ||
16 | { | ||
17 | unw_addr_space_t addr_space; | ||
18 | |||
19 | addr_space = unw_create_addr_space(&accessors, 0); | ||
20 | if (addr_space) | ||
21 | return 0; | ||
22 | |||
23 | unw_init_remote(NULL, addr_space, NULL); | ||
24 | dwarf_search_unwind_table(addr_space, 0, NULL, NULL, 0, NULL); | ||
25 | |||
26 | return 0; | ||
27 | } | ||