1
2
3
4
5
6
7 #ifndef __PERF_CALL_PATH_H
8 #define __PERF_CALL_PATH_H
9
10 #include <sys/types.h>
11
12 #include <linux/types.h>
13 #include <linux/rbtree.h>
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28 struct call_path {
29 struct call_path *parent;
30 struct symbol *sym;
31 u64 ip;
32 u64 db_id;
33 bool in_kernel;
34 struct rb_node rb_node;
35 struct rb_root children;
36 };
37
38 #define CALL_PATH_BLOCK_SHIFT 8
39 #define CALL_PATH_BLOCK_SIZE (1 << CALL_PATH_BLOCK_SHIFT)
40 #define CALL_PATH_BLOCK_MASK (CALL_PATH_BLOCK_SIZE - 1)
41
42 struct call_path_block {
43 struct call_path cp[CALL_PATH_BLOCK_SIZE];
44 struct list_head node;
45 };
46
47
48
49
50
51
52
53
54 struct call_path_root {
55 struct call_path call_path;
56 struct list_head blocks;
57 size_t next;
58 size_t sz;
59 };
60
61 struct call_path_root *call_path_root__new(void);
62 void call_path_root__free(struct call_path_root *cpr);
63
64 struct call_path *call_path__findnew(struct call_path_root *cpr,
65 struct call_path *parent,
66 struct symbol *sym, u64 ip, u64 ks);
67
68 #endif