unwind.h 908 B

12345678910111213141516171819202122232425262728293031323334353637
  1. #ifndef __UNWIND_H
  2. #define __UNWIND_H
  3. #include <linux/types.h>
  4. #include "event.h"
  5. #include "symbol.h"
  6. struct unwind_entry {
  7. struct map *map;
  8. struct symbol *sym;
  9. u64 ip;
  10. };
  11. typedef int (*unwind_entry_cb_t)(struct unwind_entry *entry, void *arg);
  12. #ifdef HAVE_DWARF_UNWIND_SUPPORT
  13. int unwind__get_entries(unwind_entry_cb_t cb, void *arg,
  14. struct machine *machine,
  15. struct thread *thread,
  16. struct perf_sample *data, int max_stack);
  17. /* libunwind specific */
  18. #ifdef HAVE_LIBUNWIND_SUPPORT
  19. int libunwind__arch_reg_id(int regnum);
  20. #endif
  21. #else
  22. static inline int
  23. unwind__get_entries(unwind_entry_cb_t cb __maybe_unused,
  24. void *arg __maybe_unused,
  25. struct machine *machine __maybe_unused,
  26. struct thread *thread __maybe_unused,
  27. struct perf_sample *data __maybe_unused,
  28. int max_stack __maybe_unused)
  29. {
  30. return 0;
  31. }
  32. #endif /* HAVE_DWARF_UNWIND_SUPPORT */
  33. #endif /* __UNWIND_H */