• Home
  • Raw
  • Download

Lines Matching refs:he

20 				       struct hist_entry *he);
22 struct hist_entry *he);
24 struct hist_entry *he);
26 struct hist_entry *he);
272 static void hists__delete_entry(struct hists *hists, struct hist_entry *he);
274 static bool hists__decay_entry(struct hists *hists, struct hist_entry *he) in hists__decay_entry() argument
276 u64 prev_period = he->stat.period; in hists__decay_entry()
282 he_stat__decay(&he->stat); in hists__decay_entry()
284 he_stat__decay(he->stat_acc); in hists__decay_entry()
285 decay_callchain(he->callchain); in hists__decay_entry()
287 diff = prev_period - he->stat.period; in hists__decay_entry()
289 if (!he->depth) { in hists__decay_entry()
291 if (!he->filtered) in hists__decay_entry()
295 if (!he->leaf) { in hists__decay_entry()
297 struct rb_node *node = rb_first(&he->hroot_out); in hists__decay_entry()
307 return he->stat.period == 0; in hists__decay_entry()
310 static void hists__delete_entry(struct hists *hists, struct hist_entry *he) in hists__delete_entry() argument
315 if (he->parent_he) { in hists__delete_entry()
316 root_in = &he->parent_he->hroot_in; in hists__delete_entry()
317 root_out = &he->parent_he->hroot_out; in hists__delete_entry()
326 rb_erase(&he->rb_node_in, root_in); in hists__delete_entry()
327 rb_erase(&he->rb_node, root_out); in hists__delete_entry()
330 if (!he->filtered) in hists__delete_entry()
333 hist_entry__delete(he); in hists__delete_entry()
369 static int hist_entry__init(struct hist_entry *he, in hist_entry__init() argument
373 *he = *template; in hist_entry__init()
376 he->stat_acc = malloc(sizeof(he->stat)); in hist_entry__init()
377 if (he->stat_acc == NULL) in hist_entry__init()
379 memcpy(he->stat_acc, &he->stat, sizeof(he->stat)); in hist_entry__init()
381 memset(&he->stat, 0, sizeof(he->stat)); in hist_entry__init()
384 map__get(he->ms.map); in hist_entry__init()
386 if (he->branch_info) { in hist_entry__init()
392 he->branch_info = malloc(sizeof(*he->branch_info)); in hist_entry__init()
393 if (he->branch_info == NULL) { in hist_entry__init()
394 map__zput(he->ms.map); in hist_entry__init()
395 free(he->stat_acc); in hist_entry__init()
399 memcpy(he->branch_info, template->branch_info, in hist_entry__init()
400 sizeof(*he->branch_info)); in hist_entry__init()
402 map__get(he->branch_info->from.map); in hist_entry__init()
403 map__get(he->branch_info->to.map); in hist_entry__init()
406 if (he->mem_info) { in hist_entry__init()
407 map__get(he->mem_info->iaddr.map); in hist_entry__init()
408 map__get(he->mem_info->daddr.map); in hist_entry__init()
412 callchain_init(he->callchain); in hist_entry__init()
414 if (he->raw_data) { in hist_entry__init()
415 he->raw_data = memdup(he->raw_data, he->raw_size); in hist_entry__init()
417 if (he->raw_data == NULL) { in hist_entry__init()
418 map__put(he->ms.map); in hist_entry__init()
419 if (he->branch_info) { in hist_entry__init()
420 map__put(he->branch_info->from.map); in hist_entry__init()
421 map__put(he->branch_info->to.map); in hist_entry__init()
422 free(he->branch_info); in hist_entry__init()
424 if (he->mem_info) { in hist_entry__init()
425 map__put(he->mem_info->iaddr.map); in hist_entry__init()
426 map__put(he->mem_info->daddr.map); in hist_entry__init()
428 free(he->stat_acc); in hist_entry__init()
432 INIT_LIST_HEAD(&he->pairs.node); in hist_entry__init()
433 thread__get(he->thread); in hist_entry__init()
434 he->hroot_in = RB_ROOT; in hist_entry__init()
435 he->hroot_out = RB_ROOT; in hist_entry__init()
438 he->leaf = true; in hist_entry__init()
463 struct hist_entry *he; in hist_entry__new() local
472 he = ops->new(callchain_size); in hist_entry__new()
473 if (he) { in hist_entry__new()
474 err = hist_entry__init(he, template, sample_self); in hist_entry__new()
476 ops->free(he); in hist_entry__new()
477 he = NULL; in hist_entry__new()
481 return he; in hist_entry__new()
491 static void hist_entry__add_callchain_period(struct hist_entry *he, u64 period) in hist_entry__add_callchain_period() argument
496 he->hists->callchain_period += period; in hist_entry__add_callchain_period()
497 if (!he->filtered) in hist_entry__add_callchain_period()
498 he->hists->callchain_non_filtered_period += period; in hist_entry__add_callchain_period()
508 struct hist_entry *he; in hists__findnew_entry() local
517 he = rb_entry(parent, struct hist_entry, rb_node_in); in hists__findnew_entry()
525 cmp = hist_entry__cmp(he, entry); in hists__findnew_entry()
529 he_stat__add_period(&he->stat, period, weight); in hists__findnew_entry()
530 hist_entry__add_callchain_period(he, period); in hists__findnew_entry()
533 he_stat__add_period(he->stat_acc, period, weight); in hists__findnew_entry()
547 if (he->ms.map != entry->ms.map) { in hists__findnew_entry()
548 map__put(he->ms.map); in hists__findnew_entry()
549 he->ms.map = map__get(entry->ms.map); in hists__findnew_entry()
560 he = hist_entry__new(entry, sample_self); in hists__findnew_entry()
561 if (!he) in hists__findnew_entry()
565 hist_entry__add_callchain_period(he, period); in hists__findnew_entry()
568 rb_link_node(&he->rb_node_in, parent, p); in hists__findnew_entry()
569 rb_insert_color(&he->rb_node_in, hists->entries_in); in hists__findnew_entry()
572 he_stat__add_cpumode_period(&he->stat, al->cpumode, period); in hists__findnew_entry()
574 he_stat__add_cpumode_period(he->stat_acc, al->cpumode, period); in hists__findnew_entry()
575 return he; in hists__findnew_entry()
684 struct hist_entry *he; in iter_add_single_mem_entry() local
702 he = hists__add_entry(hists, al, iter->parent, NULL, mi, in iter_add_single_mem_entry()
704 if (!he) in iter_add_single_mem_entry()
707 iter->he = he; in iter_add_single_mem_entry()
717 struct hist_entry *he = iter->he; in iter_finish_mem_entry() local
720 if (he == NULL) in iter_finish_mem_entry()
723 hists__inc_nr_samples(hists, he->filtered); in iter_finish_mem_entry()
725 err = hist_entry__append_callchain(he, iter->sample); in iter_finish_mem_entry()
735 iter->he = NULL; in iter_finish_mem_entry()
788 struct hist_entry *he = NULL; in iter_add_next_branch_entry() local
804 he = hists__add_entry(hists, al, iter->parent, &bi[i], NULL, in iter_add_next_branch_entry()
806 if (he == NULL) in iter_add_next_branch_entry()
809 hists__inc_nr_samples(hists, he->filtered); in iter_add_next_branch_entry()
812 iter->he = he; in iter_add_next_branch_entry()
822 iter->he = NULL; in iter_finish_branch_entry()
839 struct hist_entry *he; in iter_add_single_normal_entry() local
841 he = hists__add_entry(evsel__hists(evsel), al, iter->parent, NULL, NULL, in iter_add_single_normal_entry()
843 if (he == NULL) in iter_add_single_normal_entry()
846 iter->he = he; in iter_add_single_normal_entry()
854 struct hist_entry *he = iter->he; in iter_finish_normal_entry() local
858 if (he == NULL) in iter_finish_normal_entry()
861 iter->he = NULL; in iter_finish_normal_entry()
863 hists__inc_nr_samples(evsel__hists(evsel), he->filtered); in iter_finish_normal_entry()
865 return hist_entry__append_callchain(he, sample); in iter_finish_normal_entry()
899 struct hist_entry *he; in iter_add_single_cumulative_entry() local
902 he = hists__add_entry(hists, al, iter->parent, NULL, NULL, in iter_add_single_cumulative_entry()
904 if (he == NULL) in iter_add_single_cumulative_entry()
907 iter->he = he; in iter_add_single_cumulative_entry()
908 he_cache[iter->curr++] = he; in iter_add_single_cumulative_entry()
910 hist_entry__append_callchain(he, sample); in iter_add_single_cumulative_entry()
918 hists__inc_nr_samples(hists, he->filtered); in iter_add_single_cumulative_entry()
943 struct hist_entry *he; in iter_add_next_cumulative_entry() local
972 iter->he = NULL; in iter_add_next_cumulative_entry()
977 he = hists__add_entry(evsel__hists(evsel), al, iter->parent, NULL, NULL, in iter_add_next_cumulative_entry()
979 if (he == NULL) in iter_add_next_cumulative_entry()
982 iter->he = he; in iter_add_next_cumulative_entry()
983 he_cache[iter->curr++] = he; in iter_add_next_cumulative_entry()
986 callchain_append(he->callchain, &cursor, sample->period); in iter_add_next_cumulative_entry()
995 iter->he = NULL; in iter_finish_cumulative_entry()
1056 if (iter->he && iter->add_entry_cb) { in hist_entry_iter__add()
1067 if (iter->he && iter->add_entry_cb) { in hist_entry_iter__add()
1124 void hist_entry__delete(struct hist_entry *he) in hist_entry__delete() argument
1126 struct hist_entry_ops *ops = he->ops; in hist_entry__delete()
1128 thread__zput(he->thread); in hist_entry__delete()
1129 map__zput(he->ms.map); in hist_entry__delete()
1131 if (he->branch_info) { in hist_entry__delete()
1132 map__zput(he->branch_info->from.map); in hist_entry__delete()
1133 map__zput(he->branch_info->to.map); in hist_entry__delete()
1134 free_srcline(he->branch_info->srcline_from); in hist_entry__delete()
1135 free_srcline(he->branch_info->srcline_to); in hist_entry__delete()
1136 zfree(&he->branch_info); in hist_entry__delete()
1139 if (he->mem_info) { in hist_entry__delete()
1140 map__zput(he->mem_info->iaddr.map); in hist_entry__delete()
1141 map__zput(he->mem_info->daddr.map); in hist_entry__delete()
1142 zfree(&he->mem_info); in hist_entry__delete()
1145 if (he->inline_node) { in hist_entry__delete()
1146 inline_node__delete(he->inline_node); in hist_entry__delete()
1147 he->inline_node = NULL; in hist_entry__delete()
1150 zfree(&he->stat_acc); in hist_entry__delete()
1151 free_srcline(he->srcline); in hist_entry__delete()
1152 if (he->srcfile && he->srcfile[0]) in hist_entry__delete()
1153 free(he->srcfile); in hist_entry__delete()
1154 free_callchain(he->callchain); in hist_entry__delete()
1155 free(he->trace_output); in hist_entry__delete()
1156 free(he->raw_data); in hist_entry__delete()
1157 ops->free(he); in hist_entry__delete()
1167 int hist_entry__snprintf_alignment(struct hist_entry *he, struct perf_hpp *hpp, in hist_entry__snprintf_alignment() argument
1170 if (!list_is_last(&fmt->list, &he->hists->hpp_list->fields)) { in hist_entry__snprintf_alignment()
1171 const int width = fmt->width(fmt, hpp, he->hists); in hist_entry__snprintf_alignment()
1185 static void hists__apply_filters(struct hists *hists, struct hist_entry *he);
1186 static void hists__remove_entry_filter(struct hists *hists, struct hist_entry *he,
1196 static void hist_entry__check_and_remove_filter(struct hist_entry *he, in hist_entry__check_and_remove_filter() argument
1202 struct hist_entry *parent = he->parent_he; in hist_entry__check_and_remove_filter()
1229 perf_hpp_list__for_each_format(he->hpp_list, fmt) { in hist_entry__check_and_remove_filter()
1243 if (!(he->filtered & (1 << type))) { in hist_entry__check_and_remove_filter()
1260 he->filtered |= (1 << type); in hist_entry__check_and_remove_filter()
1262 he->filtered |= (parent->filtered & (1 << type)); in hist_entry__check_and_remove_filter()
1266 static void hist_entry__apply_hierarchy_filters(struct hist_entry *he) in hist_entry__apply_hierarchy_filters() argument
1268 hist_entry__check_and_remove_filter(he, HIST_FILTER__THREAD, in hist_entry__apply_hierarchy_filters()
1271 hist_entry__check_and_remove_filter(he, HIST_FILTER__DSO, in hist_entry__apply_hierarchy_filters()
1274 hist_entry__check_and_remove_filter(he, HIST_FILTER__SYMBOL, in hist_entry__apply_hierarchy_filters()
1277 hists__apply_filters(he->hists, he); in hist_entry__apply_hierarchy_filters()
1282 struct hist_entry *he, in hierarchy_insert_entry() argument
1298 cmp = fmt->collapse(fmt, iter, he); in hierarchy_insert_entry()
1304 he_stat__add_stat(&iter->stat, &he->stat); in hierarchy_insert_entry()
1314 new = hist_entry__new(he, true); in hierarchy_insert_entry()
1329 he->trace_output = NULL; in hierarchy_insert_entry()
1334 he->srcline = NULL; in hierarchy_insert_entry()
1339 he->srcfile = NULL; in hierarchy_insert_entry()
1351 struct hist_entry *he) in hists__hierarchy_insert_entry() argument
1365 new_he = hierarchy_insert_entry(hists, root, he, parent, &node->hpp); in hists__hierarchy_insert_entry()
1383 he->callchain) < 0) in hists__hierarchy_insert_entry()
1389 hist_entry__delete(he); in hists__hierarchy_insert_entry()
1397 struct hist_entry *he) in hists__collapse_insert_entry() argument
1405 return hists__hierarchy_insert_entry(hists, root, he); in hists__collapse_insert_entry()
1411 cmp = hist_entry__collapse(iter, he); in hists__collapse_insert_entry()
1416 he_stat__add_stat(&iter->stat, &he->stat); in hists__collapse_insert_entry()
1418 he_stat__add_stat(iter->stat_acc, he->stat_acc); in hists__collapse_insert_entry()
1424 he->callchain) < 0) in hists__collapse_insert_entry()
1427 hist_entry__delete(he); in hists__collapse_insert_entry()
1438 rb_link_node(&he->rb_node_in, parent, p); in hists__collapse_insert_entry()
1439 rb_insert_color(&he->rb_node_in, root); in hists__collapse_insert_entry()
1458 static void hists__apply_filters(struct hists *hists, struct hist_entry *he) in hists__apply_filters() argument
1460 hists__filter_entry_by_dso(hists, he); in hists__apply_filters()
1461 hists__filter_entry_by_thread(hists, he); in hists__apply_filters()
1462 hists__filter_entry_by_symbol(hists, he); in hists__apply_filters()
1463 hists__filter_entry_by_socket(hists, he); in hists__apply_filters()
1557 struct hist_entry *he; in hierarchy_recalc_total_periods() local
1570 he = rb_entry(node, struct hist_entry, rb_node); in hierarchy_recalc_total_periods()
1573 hists->stats.total_period += he->stat.period; in hierarchy_recalc_total_periods()
1574 if (!he->filtered) in hierarchy_recalc_total_periods()
1575 hists->stats.total_non_filtered_period += he->stat.period; in hierarchy_recalc_total_periods()
1580 struct hist_entry *he) in hierarchy_insert_output_entry() argument
1591 if (hist_entry__sort(he, iter) > 0) in hierarchy_insert_output_entry()
1597 rb_link_node(&he->rb_node, parent, p); in hierarchy_insert_output_entry()
1598 rb_insert_color(&he->rb_node, root); in hierarchy_insert_output_entry()
1601 perf_hpp_list__for_each_sort_list(he->hpp_list, fmt) { in hierarchy_insert_output_entry()
1603 fmt->sort(fmt, he, NULL); in hierarchy_insert_output_entry()
1615 struct hist_entry *he; in hists__hierarchy_output_resort() local
1621 he = rb_entry(node, struct hist_entry, rb_node_in); in hists__hierarchy_output_resort()
1624 hierarchy_insert_output_entry(root_out, he); in hists__hierarchy_output_resort()
1630 if (!he->filtered) { in hists__hierarchy_output_resort()
1632 hists__calc_col_len(hists, he); in hists__hierarchy_output_resort()
1635 if (!he->leaf) { in hists__hierarchy_output_resort()
1637 &he->hroot_in, in hists__hierarchy_output_resort()
1638 &he->hroot_out, in hists__hierarchy_output_resort()
1648 u64 total = he->stat.period; in hists__hierarchy_output_resort()
1651 total = he->stat_acc->period; in hists__hierarchy_output_resort()
1656 callchain_param.sort(&he->sorted_chain, he->callchain, in hists__hierarchy_output_resort()
1662 struct hist_entry *he, in __hists__insert_output_entry() argument
1673 u64 total = he->stat.period; in __hists__insert_output_entry()
1676 total = he->stat_acc->period; in __hists__insert_output_entry()
1680 callchain_param.sort(&he->sorted_chain, he->callchain, in __hists__insert_output_entry()
1688 if (hist_entry__sort(he, iter) > 0) in __hists__insert_output_entry()
1694 rb_link_node(&he->rb_node, parent, p); in __hists__insert_output_entry()
1695 rb_insert_color(&he->rb_node, entries); in __hists__insert_output_entry()
1699 perf_hpp__defined_dynamic_entry(fmt, he->hists)) in __hists__insert_output_entry()
1700 fmt->sort(fmt, he, NULL); /* update column width */ in __hists__insert_output_entry()
1783 static bool can_goto_child(struct hist_entry *he, enum hierarchy_move_dir hmd) in can_goto_child() argument
1785 if (he->leaf || hmd == HMD_FORCE_SIBLING) in can_goto_child()
1788 if (he->unfolded || hmd == HMD_FORCE_CHILD) in can_goto_child()
1796 struct hist_entry *he = rb_entry(node, struct hist_entry, rb_node); in rb_hierarchy_last() local
1798 while (can_goto_child(he, HMD_NORMAL)) { in rb_hierarchy_last()
1799 node = rb_last(&he->hroot_out); in rb_hierarchy_last()
1800 he = rb_entry(node, struct hist_entry, rb_node); in rb_hierarchy_last()
1807 struct hist_entry *he = rb_entry(node, struct hist_entry, rb_node); in __rb_hierarchy_next() local
1809 if (can_goto_child(he, hmd)) in __rb_hierarchy_next()
1810 node = rb_first(&he->hroot_out); in __rb_hierarchy_next()
1815 he = he->parent_he; in __rb_hierarchy_next()
1816 if (he == NULL) in __rb_hierarchy_next()
1819 node = rb_next(&he->rb_node); in __rb_hierarchy_next()
1826 struct hist_entry *he = rb_entry(node, struct hist_entry, rb_node); in rb_hierarchy_prev() local
1832 he = he->parent_he; in rb_hierarchy_prev()
1833 if (he == NULL) in rb_hierarchy_prev()
1836 return &he->rb_node; in rb_hierarchy_prev()
1839 bool hist_entry__has_hierarchy_children(struct hist_entry *he, float limit) in hist_entry__has_hierarchy_children() argument
1845 if (he->leaf) in hist_entry__has_hierarchy_children()
1848 node = rb_first(&he->hroot_out); in hist_entry__has_hierarchy_children()
1907 struct hist_entry *he) in hists__filter_entry_by_dso() argument
1910 (he->ms.map == NULL || he->ms.map->dso != hists->dso_filter)) { in hists__filter_entry_by_dso()
1911 he->filtered |= (1 << HIST_FILTER__DSO); in hists__filter_entry_by_dso()
1919 struct hist_entry *he) in hists__filter_entry_by_thread() argument
1922 he->thread != hists->thread_filter) { in hists__filter_entry_by_thread()
1923 he->filtered |= (1 << HIST_FILTER__THREAD); in hists__filter_entry_by_thread()
1931 struct hist_entry *he) in hists__filter_entry_by_symbol() argument
1934 (!he->ms.sym || strstr(he->ms.sym->name, in hists__filter_entry_by_symbol()
1936 he->filtered |= (1 << HIST_FILTER__SYMBOL); in hists__filter_entry_by_symbol()
1944 struct hist_entry *he) in hists__filter_entry_by_socket() argument
1947 (he->socket != hists->socket_filter)) { in hists__filter_entry_by_socket()
1948 he->filtered |= (1 << HIST_FILTER__SOCKET); in hists__filter_entry_by_socket()
1955 typedef bool (*filter_fn_t)(struct hists *hists, struct hist_entry *he);
1976 static void resort_filtered_entry(struct rb_root *root, struct hist_entry *he) in resort_filtered_entry() argument
1988 if (hist_entry__sort(he, iter) > 0) in resort_filtered_entry()
1994 rb_link_node(&he->rb_node, parent, p); in resort_filtered_entry()
1995 rb_insert_color(&he->rb_node, root); in resort_filtered_entry()
1997 if (he->leaf || he->filtered) in resort_filtered_entry()
2000 nd = rb_first(&he->hroot_out); in resort_filtered_entry()
2005 rb_erase(&h->rb_node, &he->hroot_out); in resort_filtered_entry()
2010 he->hroot_out = new_root; in resort_filtered_entry()
2144 struct hist_entry *he; in hists__add_dummy_entry() local
2156 he = rb_entry(parent, struct hist_entry, rb_node_in); in hists__add_dummy_entry()
2158 cmp = hist_entry__collapse(he, pair); in hists__add_dummy_entry()
2169 he = hist_entry__new(pair, true); in hists__add_dummy_entry()
2170 if (he) { in hists__add_dummy_entry()
2171 memset(&he->stat, 0, sizeof(he->stat)); in hists__add_dummy_entry()
2172 he->hists = hists; in hists__add_dummy_entry()
2174 memset(he->stat_acc, 0, sizeof(he->stat)); in hists__add_dummy_entry()
2175 rb_link_node(&he->rb_node_in, parent, p); in hists__add_dummy_entry()
2176 rb_insert_color(&he->rb_node_in, root); in hists__add_dummy_entry()
2177 hists__inc_stats(hists, he); in hists__add_dummy_entry()
2178 he->dummy = true; in hists__add_dummy_entry()
2181 return he; in hists__add_dummy_entry()
2190 struct hist_entry *he; in add_dummy_hierarchy_entry() local
2198 he = rb_entry(parent, struct hist_entry, rb_node_in); in add_dummy_hierarchy_entry()
2200 perf_hpp_list__for_each_sort_list(he->hpp_list, fmt) { in add_dummy_hierarchy_entry()
2201 cmp = fmt->collapse(fmt, he, pair); in add_dummy_hierarchy_entry()
2214 he = hist_entry__new(pair, true); in add_dummy_hierarchy_entry()
2215 if (he) { in add_dummy_hierarchy_entry()
2216 rb_link_node(&he->rb_node_in, parent, p); in add_dummy_hierarchy_entry()
2217 rb_insert_color(&he->rb_node_in, root); in add_dummy_hierarchy_entry()
2219 he->dummy = true; in add_dummy_hierarchy_entry()
2220 he->hists = hists; in add_dummy_hierarchy_entry()
2221 memset(&he->stat, 0, sizeof(he->stat)); in add_dummy_hierarchy_entry()
2222 hists__inc_stats(hists, he); in add_dummy_hierarchy_entry()
2225 return he; in add_dummy_hierarchy_entry()
2229 struct hist_entry *he) in hists__find_entry() argument
2240 int64_t cmp = hist_entry__collapse(iter, he); in hists__find_entry()
2254 struct hist_entry *he) in hists__find_hierarchy_entry() argument
2264 perf_hpp_list__for_each_sort_list(he->hpp_list, fmt) { in hists__find_hierarchy_entry()
2265 cmp = fmt->collapse(fmt, iter, he); in hists__find_hierarchy_entry()
2502 struct hist_entry *he; in hists__delete_remaining_entries() local
2508 he = rb_entry(node, struct hist_entry, rb_node_in); in hists__delete_remaining_entries()
2509 hist_entry__delete(he); in hists__delete_remaining_entries()