callchain.h 711 B

123456789101112131415161718192021222324252627282930313233
  1. #ifndef __PERF_CALLCHAIN_H
  2. #define __PERF_CALLCHAIN_H
  3. #include "../perf.h"
  4. #include "list.h"
  5. #include "rbtree.h"
  6. struct callchain_node {
  7. struct callchain_node *parent;
  8. struct list_head brothers;
  9. struct list_head children;
  10. struct list_head val;
  11. struct rb_node rb_node;
  12. int val_nr;
  13. int hit;
  14. };
  15. struct callchain_list {
  16. unsigned long ip;
  17. struct list_head list;
  18. };
  19. static inline void callchain_init(struct callchain_node *node)
  20. {
  21. INIT_LIST_HEAD(&node->brothers);
  22. INIT_LIST_HEAD(&node->children);
  23. INIT_LIST_HEAD(&node->val);
  24. }
  25. void append_chain(struct callchain_node *root, struct ip_callchain *chain);
  26. void sort_chain_to_rbtree(struct rb_root *rb_root, struct callchain_node *node);
  27. #endif