blob: cb6bc503a792413dd701fec8dafbf60d9e921ed6 [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
Namhyung Kim95485b12012-09-28 18:32:00 +090016#ifdef LIBUNWIND_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,
20 u64 sample_uregs,
21 struct perf_sample *data);
22int unwind__arch_reg_id(int regnum);
23#else
24static inline int
Irina Tirdea1d037ca2012-09-11 01:15:03 +030025unwind__get_entries(unwind_entry_cb_t cb __maybe_unused,
26 void *arg __maybe_unused,
27 struct machine *machine __maybe_unused,
28 struct thread *thread __maybe_unused,
29 u64 sample_uregs __maybe_unused,
30 struct perf_sample *data __maybe_unused)
Jiri Olsa71ad0f52012-08-07 15:20:46 +020031{
32 return 0;
33}
Namhyung Kim95485b12012-09-28 18:32:00 +090034#endif /* LIBUNWIND_SUPPORT */
Jiri Olsa71ad0f52012-08-07 15:20:46 +020035#endif /* __UNWIND_H */