Lines Matching refs:node

413 __sort_chain_flat(struct rb_root *rb_root, struct callchain_node *node,
419 n = rb_first(&node->rb_root_in);
427 if (node->hit && node->hit >= min_hit)
428 rb_insert_callchain(rb_root, node, CHAIN_FLAT);
440 __sort_chain_flat(rb_root, &root->node, min_hit);
443 static void __sort_chain_graph_abs(struct callchain_node *node,
449 node->rb_root = RB_ROOT;
450 n = rb_first(&node->rb_root_in);
458 rb_insert_callchain(&node->rb_root, child,
467 __sort_chain_graph_abs(&chain_root->node, min_hit);
468 rb_root->rb_node = chain_root->node.rb_root.rb_node;
471 static void __sort_chain_graph_rel(struct callchain_node *node,
478 node->rb_root = RB_ROOT;
479 min_hit = ceil(node->children_hit * min_percent);
481 n = rb_first(&node->rb_root_in);
488 rb_insert_callchain(&node->rb_root, child,
497 __sort_chain_graph_rel(&chain_root->node, param->min_percent / 100.0);
498 rb_root->rb_node = chain_root->node.rb_root.rb_node;
563 * Fill the node with callchain values
566 fill_node(struct callchain_node *node, struct callchain_cursor *cursor)
570 node->val_nr = cursor->nr - cursor->pos;
571 if (!node->val_nr)
572 pr_warning("Warning: empty node in callchain tree\n");
621 list_add_tail(&call->list, &node->val);
710 static enum match_result match_chain(struct callchain_cursor_node *node,
717 match = match_chain_strings(cnode->srcline, node->srcline);
723 if (node->ms.sym && cnode->ms.sym) {
730 if (cnode->ms.sym->inlined || node->ms.sym->inlined) {
732 node->ms.sym->name);
737 node->ms.map, node->ms.sym->start);
745 match = match_chain_dso_addresses(cnode->ms.map, cnode->ip, node->ms.map, node->ip);
749 if (match == MATCH_EQ && node->branch) {
752 if (node->branch_from) {
758 if (node->branch_flags.predicted)
761 if (node->branch_flags.abort)
765 &node->branch_flags,
766 node->branch_from,
767 node->ip);
773 cnode->cycles_count += node->branch_flags.cycles;
774 cnode->iter_count += node->nr_loop_iter;
775 cnode->iter_cycles += node->iter_cycles;
825 struct callchain_cursor_node *node;
833 node = callchain_cursor_current(cursor);
847 if (match_chain(node, cnode) == MATCH_LT)
872 struct callchain_cursor_node *node;
876 node = callchain_cursor_current(cursor);
877 if (!node)
899 /* nothing in children, add to the current node */
925 * Lookup in the current node
931 struct callchain_cursor_node *node;
933 node = callchain_cursor_current(cursor);
934 if (!node)
937 cmp = match_chain(node, cnode);
954 /* we match only a part of the node. Split it and add the new chain */
970 /* We match the node and still have a part remaining */
986 if (append_chain_children(&root->node, cursor, period) < 0)
1042 return merge_chain_branch(cursor, &dst->node, &src->node);
1051 struct callchain_cursor_node *node = *cursor->last;
1053 if (!node) {
1054 node = calloc(1, sizeof(*node));
1055 if (!node)
1058 *cursor->last = node;
1061 node->ip = ip;
1062 map__zput(node->ms.map);
1063 node->ms = *ms;
1064 map__get(node->ms.map);
1065 node->branch = branch;
1066 node->nr_loop_iter = nr_loop_iter;
1067 node->iter_cycles = iter_cycles;
1068 node->srcline = srcline;
1071 memcpy(&node->branch_flags, flags,
1074 node->branch_from = branch_from;
1077 cursor->last = &node->next;
1106 int fill_callchain_info(struct addr_location *al, struct callchain_cursor_node *node,
1109 al->maps = node->ms.maps;
1110 al->map = node->ms.map;
1111 al->sym = node->ms.sym;
1112 al->srcline = node->srcline;
1113 al->addr = node->ip;
1176 char *callchain_node__scnprintf_value(struct callchain_node *node,
1180 u64 period = callchain_cumul_hits(node);
1181 unsigned count = callchain_cumul_counts(node);
1184 period = node->hit;
1185 count = node->count;
1205 int callchain_node__fprintf_value(struct callchain_node *node,
1209 u64 period = callchain_cumul_hits(node);
1210 unsigned count = callchain_cumul_counts(node);
1213 period = node->hit;
1214 count = node->count;
1231 static void callchain_counts_value(struct callchain_node *node,
1237 list_for_each_entry(clist, &node->val, list) {
1252 static int callchain_node_branch_counts_cumul(struct callchain_node *node,
1261 n = rb_first(&node->rb_root_in);
1295 return callchain_node_branch_counts_cumul(&root->node,
1454 static void free_callchain_node(struct callchain_node *node)
1460 list_for_each_entry_safe(list, tmp, &node->parent_val, list) {
1466 list_for_each_entry_safe(list, tmp, &node->val, list) {
1472 n = rb_first(&node->rb_root_in);
1476 rb_erase(&child->rb_node_in, &node->rb_root_in);
1488 free_callchain_node(&root->node);
1491 static u64 decay_callchain_node(struct callchain_node *node)
1497 n = rb_first(&node->rb_root_in);
1505 node->hit = (node->hit * 7) / 8;
1506 node->children_hit = child_hits;
1508 return node->hit;
1516 decay_callchain_node(&root->node);
1519 int callchain_node__make_parent_list(struct callchain_node *node)
1521 struct callchain_node *parent = node->parent;
1539 list_move_tail(&chain->list, &node->parent_val);
1541 if (!list_empty(&node->parent_val)) {
1542 chain = list_first_entry(&node->parent_val, struct callchain_list, list);
1543 chain->has_children = rb_prev(&node->rb_node) || rb_next(&node->rb_node);
1545 chain = list_first_entry(&node->val, struct callchain_list, list);
1568 struct callchain_cursor_node *node;
1570 node = callchain_cursor_current(src);
1571 if (node == NULL)
1574 rc = callchain_cursor_append(dst, node->ip, &node->ms,
1575 node->branch, &node->branch_flags,
1576 node->nr_loop_iter,
1577 node->iter_cycles,
1578 node->branch_from, node->srcline);
1594 struct callchain_cursor_node *node;
1599 for (node = cursor->first; node != NULL; node = node->next)
1600 map__zput(node->ms.map);
1675 struct callchain_node *node;
1679 node = rb_entry(rb_node, struct callchain_node, rb_node);
1680 chain_hits += node->hit;