perf_counter tools: Set the minimum percent for callchains to be displayed
[linux-2.6/x86.git] / tools / perf / util / callchain.h
blobf3e4776e743005a4700add99ca9a666826fd2970
1 #ifndef __PERF_CALLCHAIN_H
2 #define __PERF_CALLCHAIN_H
4 #include "../perf.h"
5 #include <linux/list.h>
6 #include <linux/rbtree.h>
7 #include "symbol.h"
9 enum chain_mode {
10 FLAT,
11 GRAPH
14 struct callchain_node {
15 struct callchain_node *parent;
16 struct list_head brothers;
17 struct list_head children;
18 struct list_head val;
19 struct rb_node rb_node; /* to sort nodes in an rbtree */
20 struct rb_root rb_root; /* sorted tree of children */
21 unsigned int val_nr;
22 u64 hit;
23 u64 cumul_hit; /* hit + hits of children */
26 struct callchain_list {
27 u64 ip;
28 struct symbol *sym;
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,
42 u64 min_hit);
43 void sort_chain_graph(struct rb_root *rb_root, struct callchain_node *node,
44 u64 min_hit);
45 #endif