0001
0002
0003
0004
0005
0006
0007 #ifndef __PERF_CALL_PATH_H
0008 #define __PERF_CALL_PATH_H
0009
0010 #include <sys/types.h>
0011
0012 #include <linux/types.h>
0013 #include <linux/rbtree.h>
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028 struct call_path {
0029 struct call_path *parent;
0030 struct symbol *sym;
0031 u64 ip;
0032 u64 db_id;
0033 bool in_kernel;
0034 struct rb_node rb_node;
0035 struct rb_root children;
0036 };
0037
0038 #define CALL_PATH_BLOCK_SHIFT 8
0039 #define CALL_PATH_BLOCK_SIZE (1 << CALL_PATH_BLOCK_SHIFT)
0040 #define CALL_PATH_BLOCK_MASK (CALL_PATH_BLOCK_SIZE - 1)
0041
0042 struct call_path_block {
0043 struct call_path cp[CALL_PATH_BLOCK_SIZE];
0044 struct list_head node;
0045 };
0046
0047
0048
0049
0050
0051
0052
0053
0054 struct call_path_root {
0055 struct call_path call_path;
0056 struct list_head blocks;
0057 size_t next;
0058 size_t sz;
0059 };
0060
0061 struct call_path_root *call_path_root__new(void);
0062 void call_path_root__free(struct call_path_root *cpr);
0063
0064 struct call_path *call_path__findnew(struct call_path_root *cpr,
0065 struct call_path *parent,
0066 struct symbol *sym, u64 ip, u64 ks);
0067
0068 #endif