blob: b031316f221a7de76c1930d8289ba03300748672 [file] [log] [blame]
Jiri Olsa71ad0f52012-08-07 15:20:46 +02001#ifndef __UNWIND_H
2#define __UNWIND_H
3
4#include "types.h"
5#include "event.h"
6#include "symbol.h"
7
8struct unwind_entry {
9 struct map *map;
10 struct symbol *sym;
11 u64 ip;
12};
13
14typedef int (*unwind_entry_cb_t)(struct unwind_entry *entry, void *arg);
15
Jiri Olsa9ff125d2014-01-07 13:47:28 +010016#ifdef HAVE_DWARF_UNWIND_SUPPORT
Jiri Olsa71ad0f52012-08-07 15:20:46 +020017int unwind__get_entries(unwind_entry_cb_t cb, void *arg,
18 struct machine *machine,
19 struct thread *thread,
Arnaldo Carvalho de Melo37676af2013-11-13 17:40:36 -030020 struct perf_sample *data, int max_stack);
Jiri Olsa9ff125d2014-01-07 13:47:28 +010021/* libunwind specific */
22#ifdef HAVE_LIBUNWIND_SUPPORT
Jiri Olsaea3da692014-01-07 13:47:27 +010023int libunwind__arch_reg_id(int regnum);
Jiri Olsa9ff125d2014-01-07 13:47:28 +010024#endif
Jiri Olsa71ad0f52012-08-07 15:20:46 +020025#else
26static inline int
Irina Tirdea1d037ca2012-09-11 01:15:03 +030027unwind__get_entries(unwind_entry_cb_t cb __maybe_unused,
28 void *arg __maybe_unused,
29 struct machine *machine __maybe_unused,
30 struct thread *thread __maybe_unused,
Arnaldo Carvalho de Melo37676af2013-11-13 17:40:36 -030031 struct perf_sample *data __maybe_unused,
32 int max_stack __maybe_unused)
Jiri Olsa71ad0f52012-08-07 15:20:46 +020033{
34 return 0;
35}
Jiri Olsa9ff125d2014-01-07 13:47:28 +010036#endif /* HAVE_DWARF_UNWIND_SUPPORT */
Jiri Olsa71ad0f52012-08-07 15:20:46 +020037#endif /* __UNWIND_H */