Lines Matching full:cursor
573 fill_node(struct callchain_node *node, struct callchain_cursor *cursor) in fill_node() argument
577 node->val_nr = cursor->nr - cursor->pos; in fill_node()
581 cursor_node = callchain_cursor_current(cursor); in fill_node()
640 callchain_cursor_advance(cursor); in fill_node()
641 cursor_node = callchain_cursor_current(cursor); in fill_node()
648 struct callchain_cursor *cursor, in add_child() argument
657 if (fill_node(new, cursor) < 0) { in add_child()
816 struct callchain_cursor *cursor, in split_add_child() argument
848 if (idx_total < cursor->nr) { in split_add_child()
859 node = callchain_cursor_current(cursor); in split_add_child()
860 new = add_child(parent, cursor, period); in split_add_child()
889 struct callchain_cursor *cursor,
894 struct callchain_cursor *cursor, in append_chain_children() argument
902 node = callchain_cursor_current(cursor); in append_chain_children()
914 ret = append_chain(rnode, cursor, period); in append_chain_children()
926 rnode = add_child(root, cursor, period); in append_chain_children()
941 struct callchain_cursor *cursor, in append_chain() argument
945 u64 start = cursor->pos; in append_chain()
959 node = callchain_cursor_current(cursor); in append_chain()
969 callchain_cursor_advance(cursor); in append_chain()
978 matches = cursor->pos - start; in append_chain()
982 if (split_add_child(root, cursor, cnode, start, matches, in append_chain()
990 if (matches == root->val_nr && cursor->pos == cursor->nr) { in append_chain()
997 if (append_chain_children(root, cursor, period) < 0) in append_chain()
1004 struct callchain_cursor *cursor, in callchain_append() argument
1007 if (cursor == NULL) in callchain_append()
1010 if (!cursor->nr) in callchain_append()
1013 callchain_cursor_commit(cursor); in callchain_append()
1015 if (append_chain_children(&root->node, cursor, period) < 0) in callchain_append()
1018 if (cursor->nr > root->max_depth) in callchain_append()
1019 root->max_depth = cursor->nr; in callchain_append()
1025 merge_chain_branch(struct callchain_cursor *cursor, in merge_chain_branch() argument
1028 struct callchain_cursor_node **old_last = cursor->last; in merge_chain_branch()
1032 int old_pos = cursor->nr; in merge_chain_branch()
1040 callchain_cursor_append(cursor, list->ip, &ms, false, NULL, 0, 0, 0, list->srcline); in merge_chain_branch()
1049 callchain_cursor_commit(cursor); in merge_chain_branch()
1050 if (append_chain_children(dst, cursor, src->hit) < 0) in merge_chain_branch()
1060 err = merge_chain_branch(cursor, dst, child); in merge_chain_branch()
1067 cursor->nr = old_pos; in merge_chain_branch()
1068 cursor->last = old_last; in merge_chain_branch()
1073 int callchain_merge(struct callchain_cursor *cursor, in callchain_merge() argument
1076 return merge_chain_branch(cursor, &dst->node, &src->node); in callchain_merge()
1079 int callchain_cursor_append(struct callchain_cursor *cursor, in callchain_cursor_append() argument
1085 struct callchain_cursor_node *node = *cursor->last; in callchain_cursor_append()
1092 *cursor->last = node; in callchain_cursor_append()
1110 cursor->nr++; in callchain_cursor_append()
1112 cursor->last = &node->next; in callchain_cursor_append()
1118 struct callchain_cursor *cursor, struct symbol **parent, in sample__resolve_callchain() argument
1127 return thread__resolve_callchain(al->thread, cursor, evsel, sample, in sample__resolve_callchain()
1597 struct callchain_cursor *cursor = vcursor; in callchain_cursor__delete() local
1600 callchain_cursor_reset(cursor); in callchain_cursor__delete()
1601 for (node = cursor->first; node != NULL; node = next) { in callchain_cursor__delete()
1605 free(cursor); in callchain_cursor__delete()
1611 pr_err("callchain cursor creation failed"); in init_callchain_cursor_key()
1619 struct callchain_cursor *cursor; in get_tls_callchain_cursor() local
1622 cursor = pthread_getspecific(callchain_cursor); in get_tls_callchain_cursor()
1623 if (!cursor) { in get_tls_callchain_cursor()
1624 cursor = zalloc(sizeof(*cursor)); in get_tls_callchain_cursor()
1625 if (!cursor) in get_tls_callchain_cursor()
1627 pthread_setspecific(callchain_cursor, cursor); in get_tls_callchain_cursor()
1629 return cursor; in get_tls_callchain_cursor()
1662 * Initialize a cursor before adding entries inside, but keep
1665 void callchain_cursor_reset(struct callchain_cursor *cursor) in callchain_cursor_reset() argument
1669 cursor->nr = 0; in callchain_cursor_reset()
1670 cursor->last = &cursor->first; in callchain_cursor_reset()
1672 for (node = cursor->first; node != NULL; node = node->next) in callchain_cursor_reset()
1805 struct callchain_cursor *cursor = get_tls_callchain_cursor(); in sample__for_each_callchain_node() local
1808 if (!cursor) in sample__for_each_callchain_node()
1812 ret = __thread__resolve_callchain(thread, cursor, evsel, sample, in sample__for_each_callchain_node()
1819 callchain_cursor_commit(cursor); in sample__for_each_callchain_node()
1822 struct callchain_cursor_node *node = callchain_cursor_current(cursor); in sample__for_each_callchain_node()
1831 callchain_cursor_advance(cursor); in sample__for_each_callchain_node()