Lines Matching refs:he

13 				       struct hist_entry *he);
15 struct hist_entry *he);
17 struct hist_entry *he);
226 static bool hists__decay_entry(struct hists *hists, struct hist_entry *he) in hists__decay_entry() argument
228 u64 prev_period = he->stat.period; in hists__decay_entry()
234 he_stat__decay(&he->stat); in hists__decay_entry()
236 he_stat__decay(he->stat_acc); in hists__decay_entry()
238 diff = prev_period - he->stat.period; in hists__decay_entry()
241 if (!he->filtered) in hists__decay_entry()
244 return he->stat.period == 0; in hists__decay_entry()
247 static void hists__delete_entry(struct hists *hists, struct hist_entry *he) in hists__delete_entry() argument
249 rb_erase(&he->rb_node, &hists->entries); in hists__delete_entry()
252 rb_erase(&he->rb_node_in, &hists->entries_collapsed); in hists__delete_entry()
255 if (!he->filtered) in hists__delete_entry()
258 hist_entry__delete(he); in hists__delete_entry()
298 struct hist_entry *he; in hist_entry__new() local
303 he = zalloc(sizeof(*he) + callchain_size); in hist_entry__new()
305 if (he != NULL) { in hist_entry__new()
306 *he = *template; in hist_entry__new()
309 he->stat_acc = malloc(sizeof(he->stat)); in hist_entry__new()
310 if (he->stat_acc == NULL) { in hist_entry__new()
311 free(he); in hist_entry__new()
314 memcpy(he->stat_acc, &he->stat, sizeof(he->stat)); in hist_entry__new()
316 memset(&he->stat, 0, sizeof(he->stat)); in hist_entry__new()
319 if (he->ms.map) in hist_entry__new()
320 he->ms.map->referenced = true; in hist_entry__new()
322 if (he->branch_info) { in hist_entry__new()
328 he->branch_info = malloc(sizeof(*he->branch_info)); in hist_entry__new()
329 if (he->branch_info == NULL) { in hist_entry__new()
330 free(he->stat_acc); in hist_entry__new()
331 free(he); in hist_entry__new()
335 memcpy(he->branch_info, template->branch_info, in hist_entry__new()
336 sizeof(*he->branch_info)); in hist_entry__new()
338 if (he->branch_info->from.map) in hist_entry__new()
339 he->branch_info->from.map->referenced = true; in hist_entry__new()
340 if (he->branch_info->to.map) in hist_entry__new()
341 he->branch_info->to.map->referenced = true; in hist_entry__new()
344 if (he->mem_info) { in hist_entry__new()
345 if (he->mem_info->iaddr.map) in hist_entry__new()
346 he->mem_info->iaddr.map->referenced = true; in hist_entry__new()
347 if (he->mem_info->daddr.map) in hist_entry__new()
348 he->mem_info->daddr.map->referenced = true; in hist_entry__new()
352 callchain_init(he->callchain); in hist_entry__new()
354 INIT_LIST_HEAD(&he->pairs.node); in hist_entry__new()
355 thread__get(he->thread); in hist_entry__new()
358 return he; in hist_entry__new()
375 struct hist_entry *he; in add_hist_entry() local
384 he = rb_entry(parent, struct hist_entry, rb_node_in); in add_hist_entry()
392 cmp = hist_entry__cmp(he, entry); in add_hist_entry()
396 he_stat__add_period(&he->stat, period, weight); in add_hist_entry()
398 he_stat__add_period(he->stat_acc, period, weight); in add_hist_entry()
412 if (he->ms.map != entry->ms.map) { in add_hist_entry()
413 he->ms.map = entry->ms.map; in add_hist_entry()
414 if (he->ms.map) in add_hist_entry()
415 he->ms.map->referenced = true; in add_hist_entry()
426 he = hist_entry__new(entry, sample_self); in add_hist_entry()
427 if (!he) in add_hist_entry()
432 rb_link_node(&he->rb_node_in, parent, p); in add_hist_entry()
433 rb_insert_color(&he->rb_node_in, hists->entries_in); in add_hist_entry()
436 he_stat__add_cpumode_period(&he->stat, al->cpumode, period); in add_hist_entry()
438 he_stat__add_cpumode_period(he->stat_acc, al->cpumode, period); in add_hist_entry()
439 return he; in add_hist_entry()
511 struct hist_entry *he; in iter_add_single_mem_entry() local
527 he = __hists__add_entry(hists, al, iter->parent, NULL, mi, in iter_add_single_mem_entry()
529 if (!he) in iter_add_single_mem_entry()
532 iter->he = he; in iter_add_single_mem_entry()
542 struct hist_entry *he = iter->he; in iter_finish_mem_entry() local
545 if (he == NULL) in iter_finish_mem_entry()
548 hists__inc_nr_samples(hists, he->filtered); in iter_finish_mem_entry()
550 err = hist_entry__append_callchain(he, iter->sample); in iter_finish_mem_entry()
560 iter->he = NULL; in iter_finish_mem_entry()
586 iter->he = NULL; in iter_add_single_branch_entry()
615 struct hist_entry *he = NULL; in iter_add_next_branch_entry() local
628 he = __hists__add_entry(hists, al, iter->parent, &bi[i], NULL, in iter_add_next_branch_entry()
630 if (he == NULL) in iter_add_next_branch_entry()
633 hists__inc_nr_samples(hists, he->filtered); in iter_add_next_branch_entry()
636 iter->he = he; in iter_add_next_branch_entry()
646 iter->he = NULL; in iter_finish_branch_entry()
663 struct hist_entry *he; in iter_add_single_normal_entry() local
665 he = __hists__add_entry(evsel__hists(evsel), al, iter->parent, NULL, NULL, in iter_add_single_normal_entry()
668 if (he == NULL) in iter_add_single_normal_entry()
671 iter->he = he; in iter_add_single_normal_entry()
679 struct hist_entry *he = iter->he; in iter_finish_normal_entry() local
683 if (he == NULL) in iter_finish_normal_entry()
686 iter->he = NULL; in iter_finish_normal_entry()
688 hists__inc_nr_samples(evsel__hists(evsel), he->filtered); in iter_finish_normal_entry()
690 return hist_entry__append_callchain(he, sample); in iter_finish_normal_entry()
724 struct hist_entry *he; in iter_add_single_cumulative_entry() local
727 he = __hists__add_entry(hists, al, iter->parent, NULL, NULL, in iter_add_single_cumulative_entry()
730 if (he == NULL) in iter_add_single_cumulative_entry()
733 iter->he = he; in iter_add_single_cumulative_entry()
734 he_cache[iter->curr++] = he; in iter_add_single_cumulative_entry()
736 hist_entry__append_callchain(he, sample); in iter_add_single_cumulative_entry()
744 hists__inc_nr_samples(hists, he->filtered); in iter_add_single_cumulative_entry()
769 struct hist_entry *he; in iter_add_next_cumulative_entry() local
795 iter->he = NULL; in iter_add_next_cumulative_entry()
800 he = __hists__add_entry(evsel__hists(evsel), al, iter->parent, NULL, NULL, in iter_add_next_cumulative_entry()
803 if (he == NULL) in iter_add_next_cumulative_entry()
806 iter->he = he; in iter_add_next_cumulative_entry()
807 he_cache[iter->curr++] = he; in iter_add_next_cumulative_entry()
810 callchain_append(he->callchain, &cursor, sample->period); in iter_add_next_cumulative_entry()
819 iter->he = NULL; in iter_finish_cumulative_entry()
878 if (iter->he && iter->add_entry_cb) { in hist_entry_iter__add()
889 if (iter->he && iter->add_entry_cb) { in hist_entry_iter__add()
940 void hist_entry__delete(struct hist_entry *he) in hist_entry__delete() argument
942 thread__zput(he->thread); in hist_entry__delete()
943 zfree(&he->branch_info); in hist_entry__delete()
944 zfree(&he->mem_info); in hist_entry__delete()
945 zfree(&he->stat_acc); in hist_entry__delete()
946 free_srcline(he->srcline); in hist_entry__delete()
947 free_callchain(he->callchain); in hist_entry__delete()
948 free(he); in hist_entry__delete()
957 struct hist_entry *he) in hists__collapse_insert_entry() argument
968 cmp = hist_entry__collapse(iter, he); in hists__collapse_insert_entry()
971 he_stat__add_stat(&iter->stat, &he->stat); in hists__collapse_insert_entry()
973 he_stat__add_stat(iter->stat_acc, he->stat_acc); in hists__collapse_insert_entry()
979 he->callchain); in hists__collapse_insert_entry()
981 hist_entry__delete(he); in hists__collapse_insert_entry()
992 rb_link_node(&he->rb_node_in, parent, p); in hists__collapse_insert_entry()
993 rb_insert_color(&he->rb_node_in, root); in hists__collapse_insert_entry()
1012 static void hists__apply_filters(struct hists *hists, struct hist_entry *he) in hists__apply_filters() argument
1014 hists__filter_entry_by_dso(hists, he); in hists__apply_filters()
1015 hists__filter_entry_by_thread(hists, he); in hists__apply_filters()
1016 hists__filter_entry_by_symbol(hists, he); in hists__apply_filters()
1101 struct hist_entry *he, in __hists__insert_output_entry() argument
1109 callchain_param.sort(&he->sorted_chain, he->callchain, in __hists__insert_output_entry()
1116 if (hist_entry__sort(he, iter) > 0) in __hists__insert_output_entry()
1122 rb_link_node(&he->rb_node, parent, p); in __hists__insert_output_entry()
1123 rb_insert_color(&he->rb_node, entries); in __hists__insert_output_entry()
1181 struct hist_entry *he) in hists__filter_entry_by_dso() argument
1184 (he->ms.map == NULL || he->ms.map->dso != hists->dso_filter)) { in hists__filter_entry_by_dso()
1185 he->filtered |= (1 << HIST_FILTER__DSO); in hists__filter_entry_by_dso()
1215 struct hist_entry *he) in hists__filter_entry_by_thread() argument
1218 he->thread != hists->thread_filter) { in hists__filter_entry_by_thread()
1219 he->filtered |= (1 << HIST_FILTER__THREAD); in hists__filter_entry_by_thread()
1246 struct hist_entry *he) in hists__filter_entry_by_symbol() argument
1249 (!he->ms.sym || strstr(he->ms.sym->name, in hists__filter_entry_by_symbol()
1251 he->filtered |= (1 << HIST_FILTER__SYMBOL); in hists__filter_entry_by_symbol()
1301 struct hist_entry *he; in hists__add_dummy_entry() local
1313 he = rb_entry(parent, struct hist_entry, rb_node_in); in hists__add_dummy_entry()
1315 cmp = hist_entry__collapse(he, pair); in hists__add_dummy_entry()
1326 he = hist_entry__new(pair, true); in hists__add_dummy_entry()
1327 if (he) { in hists__add_dummy_entry()
1328 memset(&he->stat, 0, sizeof(he->stat)); in hists__add_dummy_entry()
1329 he->hists = hists; in hists__add_dummy_entry()
1330 rb_link_node(&he->rb_node_in, parent, p); in hists__add_dummy_entry()
1331 rb_insert_color(&he->rb_node_in, root); in hists__add_dummy_entry()
1332 hists__inc_stats(hists, he); in hists__add_dummy_entry()
1333 he->dummy = true; in hists__add_dummy_entry()
1336 return he; in hists__add_dummy_entry()
1340 struct hist_entry *he) in hists__find_entry() argument
1351 int64_t cmp = hist_entry__collapse(iter, he); in hists__find_entry()