srcline.h 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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. char *get_srcline_split(struct dso *dso, u64 addr, unsigned *line);
  17. /* insert the srcline into the DSO, which will take ownership */
  18. void srcline__tree_insert(struct rb_root_cached *tree, u64 addr, char *srcline);
  19. /* find previously inserted srcline */
  20. char *srcline__tree_find(struct rb_root_cached *tree, u64 addr);
  21. /* delete all srclines within the tree */
  22. void srcline__tree_delete(struct rb_root_cached *tree);
  23. #define SRCLINE_UNKNOWN ((char *) "??:0")
  24. struct inline_list {
  25. struct symbol *symbol;
  26. char *srcline;
  27. struct list_head list;
  28. };
  29. struct inline_node {
  30. u64 addr;
  31. struct list_head val;
  32. struct rb_node rb_node;
  33. };
  34. /* parse inlined frames for the given address */
  35. struct inline_node *dso__parse_addr_inlines(struct dso *dso, u64 addr,
  36. struct symbol *sym);
  37. /* free resources associated to the inline node list */
  38. void inline_node__delete(struct inline_node *node);
  39. /* insert the inline node list into the DSO, which will take ownership */
  40. void inlines__tree_insert(struct rb_root_cached *tree,
  41. struct inline_node *inlines);
  42. /* find previously inserted inline node list */
  43. struct inline_node *inlines__tree_find(struct rb_root_cached *tree, u64 addr);
  44. /* delete all nodes within the tree of inline_node s */
  45. void inlines__tree_delete(struct rb_root_cached *tree);
  46. #endif /* PERF_SRCLINE_H */