srcline.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. #ifndef PERF_SRCLINE_H
  3. #define PERF_SRCLINE_H
  4. #include <linux/list.h>
  5. #include <linux/rbtree.h>
  6. #include <linux/types.h>
  7. struct dso;
  8. struct symbol;
  9. extern bool srcline_full_filename;
  10. char *get_srcline(struct dso *dso, u64 addr, struct symbol *sym,
  11. bool show_sym, bool show_addr, u64 ip);
  12. char *__get_srcline(struct dso *dso, u64 addr, struct symbol *sym,
  13. bool show_sym, bool show_addr, bool unwind_inlines,
  14. u64 ip);
  15. void free_srcline(char *srcline);
  16. /* insert the srcline into the DSO, which will take ownership */
  17. void srcline__tree_insert(struct rb_root *tree, u64 addr, char *srcline);
  18. /* find previously inserted srcline */
  19. char *srcline__tree_find(struct rb_root *tree, u64 addr);
  20. /* delete all srclines within the tree */
  21. void srcline__tree_delete(struct rb_root *tree);
  22. #define SRCLINE_UNKNOWN ((char *) "??:0")
  23. struct inline_list {
  24. struct symbol *symbol;
  25. char *srcline;
  26. struct list_head list;
  27. };
  28. struct inline_node {
  29. u64 addr;
  30. struct list_head val;
  31. struct rb_node rb_node;
  32. };
  33. /* parse inlined frames for the given address */
  34. struct inline_node *dso__parse_addr_inlines(struct dso *dso, u64 addr,
  35. struct symbol *sym);
  36. /* free resources associated to the inline node list */
  37. void inline_node__delete(struct inline_node *node);
  38. /* insert the inline node list into the DSO, which will take ownership */
  39. void inlines__tree_insert(struct rb_root *tree, struct inline_node *inlines);
  40. /* find previously inserted inline node list */
  41. struct inline_node *inlines__tree_find(struct rb_root *tree, u64 addr);
  42. /* delete all nodes within the tree of inline_node s */
  43. void inlines__tree_delete(struct rb_root *tree);
  44. #endif /* PERF_SRCLINE_H */