annotate.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. #ifndef __PERF_ANNOTATE_H
  2. #define __PERF_ANNOTATE_H
  3. #include <stdbool.h>
  4. #include "types.h"
  5. #include "symbol.h"
  6. #include <linux/list.h>
  7. #include <linux/rbtree.h>
  8. struct objdump_line {
  9. struct list_head node;
  10. s64 offset;
  11. char *line;
  12. };
  13. void objdump_line__free(struct objdump_line *self);
  14. struct objdump_line *objdump__get_next_ip_line(struct list_head *head,
  15. struct objdump_line *pos);
  16. struct sym_hist {
  17. u64 sum;
  18. u64 addr[0];
  19. };
  20. struct source_line {
  21. struct rb_node node;
  22. double percent;
  23. char *path;
  24. };
  25. struct annotation {
  26. struct sym_hist *histogram;
  27. struct source_line *src_line;
  28. };
  29. struct sannotation {
  30. struct annotation annotation;
  31. struct symbol symbol;
  32. };
  33. static inline struct annotation *symbol__annotation(struct symbol *sym)
  34. {
  35. struct sannotation *a = container_of(sym, struct sannotation, symbol);
  36. return &a->annotation;
  37. }
  38. int symbol__inc_addr_samples(struct symbol *sym, struct map *map, u64 addr);
  39. int symbol__annotate(struct symbol *sym, struct map *map,
  40. struct list_head *head, size_t privsize);
  41. int symbol__tty_annotate(struct symbol *sym, struct map *map,
  42. bool print_lines, bool full_paths);
  43. #ifdef NO_NEWT_SUPPORT
  44. static inline int symbol__tui_annotate(symbol *sym __used,
  45. struct map *map __used)
  46. {
  47. return 0;
  48. }
  49. #else
  50. int symbol__tui_annotate(struct symbol *sym, struct map *map);
  51. #endif
  52. #endif /* __PERF_ANNOTATE_H */