1 #ifndef __PERF_CALLCHAIN_H
2 #define __PERF_CALLCHAIN_H
5 #include <linux/list.h>
6 #include <linux/rbtree.h>
14 struct callchain_node
{
15 struct callchain_node
*parent
;
16 struct list_head brothers
;
17 struct list_head children
;
19 struct rb_node rb_node
; /* to sort nodes in an rbtree */
20 struct rb_root rb_root
; /* sorted tree of children */
23 u64 cumul_hit
; /* hit + hits of children */
26 struct callchain_list
{
29 struct list_head list
;
32 static inline void callchain_init(struct callchain_node
*node
)
34 INIT_LIST_HEAD(&node
->brothers
);
35 INIT_LIST_HEAD(&node
->children
);
36 INIT_LIST_HEAD(&node
->val
);
39 void append_chain(struct callchain_node
*root
, struct ip_callchain
*chain
,
40 struct symbol
**syms
);
41 void sort_chain_flat(struct rb_root
*rb_root
, struct callchain_node
*node
,
43 void sort_chain_graph(struct rb_root
*rb_root
, struct callchain_node
*node
,