Lines Matching defs:new

529  * Create a child for a parent. If inherit_children, then the new child
530 * will become the new parent of it's parent children
535 struct callchain_node *new;
537 new = zalloc(sizeof(*new));
538 if (!new) {
542 new->parent = parent;
543 INIT_LIST_HEAD(&new->val);
544 INIT_LIST_HEAD(&new->parent_val);
550 new->rb_root_in = parent->rb_root_in;
553 n = rb_first(&new->rb_root_in);
556 child->parent = new;
561 rb_link_node(&new->rb_node_in, NULL, &parent->rb_root_in.rb_node);
562 rb_insert_color(&new->rb_node_in, &parent->rb_root_in);
565 return new;
642 struct callchain_node *new;
644 new = create_child(parent, false);
645 if (new == NULL)
648 if (fill_node(new, cursor) < 0) {
651 list_for_each_entry_safe(call, tmp, &new->val, list) {
657 free(new);
661 new->children_hit = 0;
662 new->hit = period;
663 new->children_count = 0;
664 new->count = 1;
665 return new;
793 * Split the parent in two parts (a new child is created) and
795 * Then create another child to host the given callchain of new branch
803 struct callchain_node *new;
808 new = create_child(parent, true);
809 if (new == NULL)
812 /* split the callchain and move a part to the new child */
815 new->val.next = &to_split->list;
816 new->val.prev = old_tail;
817 to_split->list.prev = &new->val;
818 old_tail->next = &new->val;
821 new->hit = parent->hit;
822 new->children_hit = parent->children_hit;
823 parent->children_hit = callchain_cumul_hits(new);
824 new->val_nr = parent->val_nr - idx_local;
826 new->count = parent->count;
827 new->children_count = parent->children_count;
828 parent->children_count = callchain_cumul_counts(new);
830 /* create a new child for the new branch if any */
843 new = add_child(parent, cursor, period);
844 if (new == NULL)
849 * to new (first) child above.
861 rb_link_node(&new->rb_node_in, p, pp);
862 rb_insert_color(&new->rb_node_in, &parent->rb_root_in);
963 /* we match only a part of the node. Split it and add the new chain */
1539 struct callchain_list *chain, *new;
1544 new = malloc(sizeof(*new));
1545 if (new == NULL)
1547 *new = *chain;
1548 new->has_children = false;
1549 new->ms.map = map__get(new->ms.map);
1550 list_add_tail(&new->list, &head);
1555 list_for_each_entry_safe_reverse(chain, new, &head, list)
1568 list_for_each_entry_safe(chain, new, &head, list) {