diff options
| author | He Kuang <hekuang@huawei.com> | 2016-05-10 03:40:31 -0400 |
|---|---|---|
| committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2016-05-11 11:24:58 -0400 |
| commit | b1d960000ca12508c25776f1fd375ee81578ae1f (patch) | |
| tree | 575f82beb8c1c676040a5486321bd4ec6a7bf2cc /tools/build | |
| parent | 83302e79b18f75266e4a44281e8432f61d57d441 (diff) | |
perf build: Add build-test for libunwind cross-platforms support
Currently only test for local libunwind. We should check all supported
platforms so we can use them to parse perf.data with callchain info on
different machines.
Signed-off-by: He Kuang <hekuang@huawei.com>
Acked-by: Jiri Olsa <jolsa@kernel.org>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Ekaterina Tumanova <tumanova@linux.vnet.ibm.com>
Cc: Josh Poimboeuf <jpoimboe@redhat.com>
Cc: Kan Liang <kan.liang@intel.com>
Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Pekka Enberg <penberg@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Cc: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/r/1462866037-30382-4-git-send-email-hekuang@huawei.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/build')
| -rw-r--r-- | tools/build/Makefile.feature | 4 | ||||
| -rw-r--r-- | tools/build/feature/Makefile | 16 | ||||
| -rw-r--r-- | tools/build/feature/test-libunwind-aarch64.c | 26 | ||||
| -rw-r--r-- | tools/build/feature/test-libunwind-arm.c | 27 | ||||
| -rw-r--r-- | tools/build/feature/test-libunwind-x86.c | 27 | ||||
| -rw-r--r-- | tools/build/feature/test-libunwind-x86_64.c | 27 |
6 files changed, 127 insertions, 0 deletions
diff --git a/tools/build/Makefile.feature b/tools/build/Makefile.feature index 9f878619077a..7e36e91ef6d4 100644 --- a/tools/build/Makefile.feature +++ b/tools/build/Makefile.feature | |||
| @@ -49,6 +49,10 @@ FEATURE_TESTS_BASIC := \ | |||
| 49 | libslang \ | 49 | libslang \ |
| 50 | libcrypto \ | 50 | libcrypto \ |
| 51 | libunwind \ | 51 | libunwind \ |
| 52 | libunwind-x86 \ | ||
| 53 | libunwind-x86_64 \ | ||
| 54 | libunwind-arm \ | ||
| 55 | libunwind-aarch64 \ | ||
| 52 | pthread-attr-setaffinity-np \ | 56 | pthread-attr-setaffinity-np \ |
| 53 | stackprotector-all \ | 57 | stackprotector-all \ |
| 54 | timerfd \ | 58 | timerfd \ |
diff --git a/tools/build/feature/Makefile b/tools/build/feature/Makefile index 4ae94dbfdab9..f4fe3bc59b60 100644 --- a/tools/build/feature/Makefile +++ b/tools/build/feature/Makefile | |||
| @@ -27,6 +27,10 @@ FILES= \ | |||
| 27 | test-libcrypto.bin \ | 27 | test-libcrypto.bin \ |
| 28 | test-libunwind.bin \ | 28 | test-libunwind.bin \ |
| 29 | test-libunwind-debug-frame.bin \ | 29 | test-libunwind-debug-frame.bin \ |
| 30 | test-libunwind-x86.bin \ | ||
| 31 | test-libunwind-x86_64.bin \ | ||
| 32 | test-libunwind-arm.bin \ | ||
| 33 | test-libunwind-aarch64.bin \ | ||
| 30 | test-pthread-attr-setaffinity-np.bin \ | 34 | test-pthread-attr-setaffinity-np.bin \ |
| 31 | test-stackprotector-all.bin \ | 35 | test-stackprotector-all.bin \ |
| 32 | test-timerfd.bin \ | 36 | test-timerfd.bin \ |
| @@ -103,6 +107,18 @@ $(OUTPUT)test-libunwind.bin: | |||
| 103 | 107 | ||
| 104 | $(OUTPUT)test-libunwind-debug-frame.bin: | 108 | $(OUTPUT)test-libunwind-debug-frame.bin: |
| 105 | $(BUILD) -lelf | 109 | $(BUILD) -lelf |
| 110 | $(OUTPUT)test-libunwind-x86.bin: | ||
| 111 | $(BUILD) -lelf -lunwind-x86 | ||
| 112 | |||
| 113 | $(OUTPUT)test-libunwind-x86_64.bin: | ||
| 114 | $(BUILD) -lelf -lunwind-x86_64 | ||
| 115 | |||
| 116 | $(OUTPUT)test-libunwind-arm.bin: | ||
| 117 | $(BUILD) -lelf -lunwind-arm | ||
| 118 | |||
| 119 | $(OUTPUT)test-libunwind-aarch64.bin: | ||
| 120 | $(BUILD) -lelf -lunwind-aarch64 | ||
| 121 | |||
| 106 | 122 | ||
| 107 | $(OUTPUT)test-libaudit.bin: | 123 | $(OUTPUT)test-libaudit.bin: |
| 108 | $(BUILD) -laudit | 124 | $(BUILD) -laudit |
diff --git a/tools/build/feature/test-libunwind-aarch64.c b/tools/build/feature/test-libunwind-aarch64.c new file mode 100644 index 000000000000..fc03fb64e8c1 --- /dev/null +++ b/tools/build/feature/test-libunwind-aarch64.c | |||
| @@ -0,0 +1,26 @@ | |||
| 1 | #include <libunwind-aarch64.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 | #define dwarf_search_unwind_table UNW_OBJ(dwarf_search_unwind_table) | ||
| 11 | |||
| 12 | static unw_accessors_t accessors; | ||
| 13 | |||
| 14 | int main(void) | ||
| 15 | { | ||
| 16 | unw_addr_space_t addr_space; | ||
| 17 | |||
| 18 | addr_space = unw_create_addr_space(&accessors, 0); | ||
| 19 | if (addr_space) | ||
| 20 | return 0; | ||
| 21 | |||
| 22 | unw_init_remote(NULL, addr_space, NULL); | ||
| 23 | dwarf_search_unwind_table(addr_space, 0, NULL, NULL, 0, NULL); | ||
| 24 | |||
| 25 | return 0; | ||
| 26 | } | ||
diff --git a/tools/build/feature/test-libunwind-arm.c b/tools/build/feature/test-libunwind-arm.c new file mode 100644 index 000000000000..632d95ec641f --- /dev/null +++ b/tools/build/feature/test-libunwind-arm.c | |||
| @@ -0,0 +1,27 @@ | |||
| 1 | #include <libunwind-arm.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 | } | ||
diff --git a/tools/build/feature/test-libunwind-x86.c b/tools/build/feature/test-libunwind-x86.c new file mode 100644 index 000000000000..3561edce305e --- /dev/null +++ b/tools/build/feature/test-libunwind-x86.c | |||
| @@ -0,0 +1,27 @@ | |||
| 1 | #include <libunwind-x86.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 | } | ||
diff --git a/tools/build/feature/test-libunwind-x86_64.c b/tools/build/feature/test-libunwind-x86_64.c new file mode 100644 index 000000000000..5add2517b2a1 --- /dev/null +++ b/tools/build/feature/test-libunwind-x86_64.c | |||
| @@ -0,0 +1,27 @@ | |||
| 1 | #include <libunwind-x86_64.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 | } | ||
