Commit | Line | Data |
---|---|---|
71ad0f5e JO |
1 | #ifndef __UNWIND_H |
2 | #define __UNWIND_H | |
3 | ||
d944c4ee | 4 | #include <linux/types.h> |
71ad0f5e JO |
5 | #include "event.h" |
6 | #include "symbol.h" | |
66f066d8 | 7 | #include "thread.h" |
71ad0f5e JO |
8 | |
9 | struct unwind_entry { | |
10 | struct map *map; | |
11 | struct symbol *sym; | |
12 | u64 ip; | |
13 | }; | |
14 | ||
15 | typedef int (*unwind_entry_cb_t)(struct unwind_entry *entry, void *arg); | |
16 | ||
9ff125d1 | 17 | #ifdef HAVE_DWARF_UNWIND_SUPPORT |
71ad0f5e | 18 | int unwind__get_entries(unwind_entry_cb_t cb, void *arg, |
71ad0f5e | 19 | struct thread *thread, |
37676af1 | 20 | struct perf_sample *data, int max_stack); |
9ff125d1 JO |
21 | /* libunwind specific */ |
22 | #ifdef HAVE_LIBUNWIND_SUPPORT | |
ea3da69d | 23 | int libunwind__arch_reg_id(int regnum); |
66f066d8 | 24 | int unwind__prepare_access(struct thread *thread); |
380b5143 | 25 | void unwind__flush_access(struct thread *thread); |
66f066d8 NK |
26 | void unwind__finish_access(struct thread *thread); |
27 | #else | |
28 | static inline int unwind__prepare_access(struct thread *thread __maybe_unused) | |
29 | { | |
30 | return 0; | |
31 | } | |
32 | ||
380b5143 | 33 | static inline void unwind__flush_access(struct thread *thread __maybe_unused) {} |
66f066d8 | 34 | static inline void unwind__finish_access(struct thread *thread __maybe_unused) {} |
9ff125d1 | 35 | #endif |
71ad0f5e JO |
36 | #else |
37 | static inline int | |
1d037ca1 IT |
38 | unwind__get_entries(unwind_entry_cb_t cb __maybe_unused, |
39 | void *arg __maybe_unused, | |
1d037ca1 | 40 | struct thread *thread __maybe_unused, |
37676af1 ACM |
41 | struct perf_sample *data __maybe_unused, |
42 | int max_stack __maybe_unused) | |
71ad0f5e JO |
43 | { |
44 | return 0; | |
45 | } | |
66f066d8 NK |
46 | |
47 | static inline int unwind__prepare_access(struct thread *thread __maybe_unused) | |
48 | { | |
49 | return 0; | |
50 | } | |
51 | ||
380b5143 | 52 | static inline void unwind__flush_access(struct thread *thread __maybe_unused) {} |
66f066d8 | 53 | static inline void unwind__finish_access(struct thread *thread __maybe_unused) {} |
9ff125d1 | 54 | #endif /* HAVE_DWARF_UNWIND_SUPPORT */ |
71ad0f5e | 55 | #endif /* __UNWIND_H */ |