KVM: MMU: shadow support for 1gb pages
[linux/fpc-iii.git] / tools / perf / util / callchain.h
bloba926ae4f5a16c5c5519c0a30cf19cf93a75157d9
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 CHAIN_NONE,
11 CHAIN_FLAT,
12 CHAIN_GRAPH_ABS,
13 CHAIN_GRAPH_REL
16 struct callchain_node {
17 struct callchain_node *parent;
18 struct list_head brothers;
19 struct list_head children;
20 struct list_head val;
21 struct rb_node rb_node; /* to sort nodes in an rbtree */
22 struct rb_root rb_root; /* sorted tree of children */
23 unsigned int val_nr;
24 u64 hit;
25 u64 children_hit;
28 struct callchain_param;
30 typedef void (*sort_chain_func_t)(struct rb_root *, struct callchain_node *,
31 u64, struct callchain_param *);
33 struct callchain_param {
34 enum chain_mode mode;
35 double min_percent;
36 sort_chain_func_t sort;
39 struct callchain_list {
40 u64 ip;
41 struct symbol *sym;
42 struct list_head list;
45 static inline void callchain_init(struct callchain_node *node)
47 INIT_LIST_HEAD(&node->brothers);
48 INIT_LIST_HEAD(&node->children);
49 INIT_LIST_HEAD(&node->val);
52 static inline u64 cumul_hits(struct callchain_node *node)
54 return node->hit + node->children_hit;
57 int register_callchain_param(struct callchain_param *param);
58 void append_chain(struct callchain_node *root, struct ip_callchain *chain,
59 struct symbol **syms);
60 #endif