aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf
diff options
context:
space:
mode:
Diffstat (limited to 'tools/perf')
-rw-r--r--tools/perf/builtin-record.c10
-rw-r--r--tools/perf/config/Makefile2
-rw-r--r--tools/perf/tests/builtin-test.c2
-rw-r--r--tools/perf/tests/tests.h2
-rw-r--r--tools/perf/util/unwind.h7
5 files changed, 13 insertions, 10 deletions
diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c
index 7b8f0e6068b3..eb524f91bffe 100644
--- a/tools/perf/builtin-record.c
+++ b/tools/perf/builtin-record.c
@@ -649,7 +649,7 @@ error:
649 return ret; 649 return ret;
650} 650}
651 651
652#ifdef HAVE_LIBUNWIND_SUPPORT 652#ifdef HAVE_DWARF_UNWIND_SUPPORT
653static int get_stack_size(char *str, unsigned long *_size) 653static int get_stack_size(char *str, unsigned long *_size)
654{ 654{
655 char *endptr; 655 char *endptr;
@@ -675,7 +675,7 @@ static int get_stack_size(char *str, unsigned long *_size)
675 max_size, str); 675 max_size, str);
676 return -1; 676 return -1;
677} 677}
678#endif /* HAVE_LIBUNWIND_SUPPORT */ 678#endif /* HAVE_DWARF_UNWIND_SUPPORT */
679 679
680int record_parse_callchain(const char *arg, struct record_opts *opts) 680int record_parse_callchain(const char *arg, struct record_opts *opts)
681{ 681{
@@ -704,7 +704,7 @@ int record_parse_callchain(const char *arg, struct record_opts *opts)
704 "needed for -g fp\n"); 704 "needed for -g fp\n");
705 break; 705 break;
706 706
707#ifdef HAVE_LIBUNWIND_SUPPORT 707#ifdef HAVE_DWARF_UNWIND_SUPPORT
708 /* Dwarf style */ 708 /* Dwarf style */
709 } else if (!strncmp(name, "dwarf", sizeof("dwarf"))) { 709 } else if (!strncmp(name, "dwarf", sizeof("dwarf"))) {
710 const unsigned long default_stack_dump_size = 8192; 710 const unsigned long default_stack_dump_size = 8192;
@@ -720,7 +720,7 @@ int record_parse_callchain(const char *arg, struct record_opts *opts)
720 ret = get_stack_size(tok, &size); 720 ret = get_stack_size(tok, &size);
721 opts->stack_dump_size = size; 721 opts->stack_dump_size = size;
722 } 722 }
723#endif /* HAVE_LIBUNWIND_SUPPORT */ 723#endif /* HAVE_DWARF_UNWIND_SUPPORT */
724 } else { 724 } else {
725 pr_err("callchain: Unknown --call-graph option " 725 pr_err("callchain: Unknown --call-graph option "
726 "value: %s\n", arg); 726 "value: %s\n", arg);
@@ -823,7 +823,7 @@ static struct record record = {
823 823
824#define CALLCHAIN_HELP "setup and enables call-graph (stack chain/backtrace) recording: " 824#define CALLCHAIN_HELP "setup and enables call-graph (stack chain/backtrace) recording: "
825 825
826#ifdef HAVE_LIBUNWIND_SUPPORT 826#ifdef HAVE_DWARF_UNWIND_SUPPORT
827const char record_callchain_help[] = CALLCHAIN_HELP "fp dwarf"; 827const char record_callchain_help[] = CALLCHAIN_HELP "fp dwarf";
828#else 828#else
829const char record_callchain_help[] = CALLCHAIN_HELP "fp"; 829const char record_callchain_help[] = CALLCHAIN_HELP "fp";
diff --git a/tools/perf/config/Makefile b/tools/perf/config/Makefile
index c48d44958172..1686583ff7fc 100644
--- a/tools/perf/config/Makefile
+++ b/tools/perf/config/Makefile
@@ -338,7 +338,7 @@ ifndef NO_LIBUNWIND
338 CFLAGS += -DNO_LIBUNWIND_DEBUG_FRAME 338 CFLAGS += -DNO_LIBUNWIND_DEBUG_FRAME
339 endif 339 endif
340 340
341 CFLAGS += -DHAVE_LIBUNWIND_SUPPORT 341 CFLAGS += -DHAVE_DWARF_UNWIND_SUPPORT -DHAVE_LIBUNWIND_SUPPORT
342 EXTLIBS += $(LIBUNWIND_LIBS) 342 EXTLIBS += $(LIBUNWIND_LIBS)
343 CFLAGS += $(LIBUNWIND_CFLAGS) 343 CFLAGS += $(LIBUNWIND_CFLAGS)
344 LDFLAGS += $(LIBUNWIND_LDFLAGS) 344 LDFLAGS += $(LIBUNWIND_LDFLAGS)
diff --git a/tools/perf/tests/builtin-test.c b/tools/perf/tests/builtin-test.c
index f5a6ffba8a47..b11bf8a08430 100644
--- a/tools/perf/tests/builtin-test.c
+++ b/tools/perf/tests/builtin-test.c
@@ -116,7 +116,7 @@ static struct test {
116 .func = test__parse_no_sample_id_all, 116 .func = test__parse_no_sample_id_all,
117 }, 117 },
118#if defined(__x86_64__) || defined(__i386__) 118#if defined(__x86_64__) || defined(__i386__)
119#ifdef HAVE_LIBUNWIND_SUPPORT 119#ifdef HAVE_DWARF_UNWIND_SUPPORT
120 { 120 {
121 .desc = "Test dwarf unwind", 121 .desc = "Test dwarf unwind",
122 .func = test__dwarf_unwind, 122 .func = test__dwarf_unwind,
diff --git a/tools/perf/tests/tests.h b/tools/perf/tests/tests.h
index 8979309876a7..a24795ca002d 100644
--- a/tools/perf/tests/tests.h
+++ b/tools/perf/tests/tests.h
@@ -43,7 +43,7 @@ int test__parse_no_sample_id_all(void);
43int test__dwarf_unwind(void); 43int test__dwarf_unwind(void);
44 44
45#if defined(__x86_64__) || defined(__i386__) 45#if defined(__x86_64__) || defined(__i386__)
46#ifdef HAVE_LIBUNWIND_SUPPORT 46#ifdef HAVE_DWARF_UNWIND_SUPPORT
47struct thread; 47struct thread;
48struct perf_sample; 48struct perf_sample;
49int test__arch_unwind_sample(struct perf_sample *sample, 49int test__arch_unwind_sample(struct perf_sample *sample,
diff --git a/tools/perf/util/unwind.h b/tools/perf/util/unwind.h
index 18f33b475c46..b031316f221a 100644
--- a/tools/perf/util/unwind.h
+++ b/tools/perf/util/unwind.h
@@ -13,12 +13,15 @@ struct unwind_entry {
13 13
14typedef int (*unwind_entry_cb_t)(struct unwind_entry *entry, void *arg); 14typedef int (*unwind_entry_cb_t)(struct unwind_entry *entry, void *arg);
15 15
16#ifdef HAVE_LIBUNWIND_SUPPORT 16#ifdef HAVE_DWARF_UNWIND_SUPPORT
17int unwind__get_entries(unwind_entry_cb_t cb, void *arg, 17int unwind__get_entries(unwind_entry_cb_t cb, void *arg,
18 struct machine *machine, 18 struct machine *machine,
19 struct thread *thread, 19 struct thread *thread,
20 struct perf_sample *data, int max_stack); 20 struct perf_sample *data, int max_stack);
21/* libunwind specific */
22#ifdef HAVE_LIBUNWIND_SUPPORT
21int libunwind__arch_reg_id(int regnum); 23int libunwind__arch_reg_id(int regnum);
24#endif
22#else 25#else
23static inline int 26static inline int
24unwind__get_entries(unwind_entry_cb_t cb __maybe_unused, 27unwind__get_entries(unwind_entry_cb_t cb __maybe_unused,
@@ -30,5 +33,5 @@ unwind__get_entries(unwind_entry_cb_t cb __maybe_unused,
30{ 33{
31 return 0; 34 return 0;
32} 35}
33#endif /* HAVE_LIBUNWIND_SUPPORT */ 36#endif /* HAVE_DWARF_UNWIND_SUPPORT */
34#endif /* __UNWIND_H */ 37#endif /* __UNWIND_H */