Lines Matching +full:ip +full:- +full:blocks
2 * call-path.h: Manipulate a tree data structure containing function call paths
20 #include "call-path.h"
23 struct symbol *sym, u64 ip, bool in_kernel) in call_path__init() argument
25 cp->parent = parent; in call_path__init()
26 cp->sym = sym; in call_path__init()
27 cp->ip = sym ? 0 : ip; in call_path__init()
28 cp->db_id = 0; in call_path__init()
29 cp->in_kernel = in_kernel; in call_path__init()
30 RB_CLEAR_NODE(&cp->rb_node); in call_path__init()
31 cp->children = RB_ROOT; in call_path__init()
41 call_path__init(&cpr->call_path, NULL, NULL, 0, false); in call_path_root__new()
42 INIT_LIST_HEAD(&cpr->blocks); in call_path_root__new()
50 list_for_each_entry_safe(pos, n, &cpr->blocks, node) { in call_path_root__free()
51 list_del(&pos->node); in call_path_root__free()
59 struct symbol *sym, u64 ip, in call_path__new() argument
66 if (cpr->next < cpr->sz) { in call_path__new()
67 cpb = list_last_entry(&cpr->blocks, struct call_path_block, in call_path__new()
73 list_add_tail(&cpb->node, &cpr->blocks); in call_path__new()
74 cpr->sz += CALL_PATH_BLOCK_SIZE; in call_path__new()
77 n = cpr->next++ & CALL_PATH_BLOCK_MASK; in call_path__new()
78 cp = &cpb->cp[n]; in call_path__new()
80 call_path__init(cp, parent, sym, ip, in_kernel); in call_path__new()
87 struct symbol *sym, u64 ip, u64 ks) in call_path__findnew() argument
92 bool in_kernel = ip >= ks; in call_path__findnew()
95 ip = 0; in call_path__findnew()
98 return call_path__new(cpr, parent, sym, ip, in_kernel); in call_path__findnew()
100 p = &parent->children.rb_node; in call_path__findnew()
105 if (cp->sym == sym && cp->ip == ip) in call_path__findnew()
108 if (sym < cp->sym || (sym == cp->sym && ip < cp->ip)) in call_path__findnew()
109 p = &(*p)->rb_left; in call_path__findnew()
111 p = &(*p)->rb_right; in call_path__findnew()
114 cp = call_path__new(cpr, parent, sym, ip, in_kernel); in call_path__findnew()
118 rb_link_node(&cp->rb_node, node_parent, p); in call_path__findnew()
119 rb_insert_color(&cp->rb_node, &parent->children); in call_path__findnew()