Lines Matching refs:he

13 				       struct hist_entry *he);
15 struct hist_entry *he);
17 struct hist_entry *he);
19 struct hist_entry *he);
246 static bool hists__decay_entry(struct hists *hists, struct hist_entry *he) in hists__decay_entry() argument
248 u64 prev_period = he->stat.period; in hists__decay_entry()
254 he_stat__decay(&he->stat); in hists__decay_entry()
256 he_stat__decay(he->stat_acc); in hists__decay_entry()
258 diff = prev_period - he->stat.period; in hists__decay_entry()
261 if (!he->filtered) in hists__decay_entry()
264 return he->stat.period == 0; in hists__decay_entry()
267 static void hists__delete_entry(struct hists *hists, struct hist_entry *he) in hists__delete_entry() argument
269 rb_erase(&he->rb_node, &hists->entries); in hists__delete_entry()
272 rb_erase(&he->rb_node_in, &hists->entries_collapsed); in hists__delete_entry()
275 if (!he->filtered) in hists__delete_entry()
278 hist_entry__delete(he); in hists__delete_entry()
318 struct hist_entry *he; in hist_entry__new() local
323 he = zalloc(sizeof(*he) + callchain_size); in hist_entry__new()
325 if (he != NULL) { in hist_entry__new()
326 *he = *template; in hist_entry__new()
329 he->stat_acc = malloc(sizeof(he->stat)); in hist_entry__new()
330 if (he->stat_acc == NULL) { in hist_entry__new()
331 free(he); in hist_entry__new()
334 memcpy(he->stat_acc, &he->stat, sizeof(he->stat)); in hist_entry__new()
336 memset(&he->stat, 0, sizeof(he->stat)); in hist_entry__new()
339 map__get(he->ms.map); in hist_entry__new()
341 if (he->branch_info) { in hist_entry__new()
347 he->branch_info = malloc(sizeof(*he->branch_info)); in hist_entry__new()
348 if (he->branch_info == NULL) { in hist_entry__new()
349 map__zput(he->ms.map); in hist_entry__new()
350 free(he->stat_acc); in hist_entry__new()
351 free(he); in hist_entry__new()
355 memcpy(he->branch_info, template->branch_info, in hist_entry__new()
356 sizeof(*he->branch_info)); in hist_entry__new()
358 map__get(he->branch_info->from.map); in hist_entry__new()
359 map__get(he->branch_info->to.map); in hist_entry__new()
362 if (he->mem_info) { in hist_entry__new()
363 map__get(he->mem_info->iaddr.map); in hist_entry__new()
364 map__get(he->mem_info->daddr.map); in hist_entry__new()
368 callchain_init(he->callchain); in hist_entry__new()
370 INIT_LIST_HEAD(&he->pairs.node); in hist_entry__new()
371 thread__get(he->thread); in hist_entry__new()
374 return he; in hist_entry__new()
391 struct hist_entry *he; in hists__findnew_entry() local
400 he = rb_entry(parent, struct hist_entry, rb_node_in); in hists__findnew_entry()
408 cmp = hist_entry__cmp(he, entry); in hists__findnew_entry()
412 he_stat__add_period(&he->stat, period, weight); in hists__findnew_entry()
414 he_stat__add_period(he->stat_acc, period, weight); in hists__findnew_entry()
428 if (he->ms.map != entry->ms.map) { in hists__findnew_entry()
429 map__put(he->ms.map); in hists__findnew_entry()
430 he->ms.map = map__get(entry->ms.map); in hists__findnew_entry()
441 he = hist_entry__new(entry, sample_self); in hists__findnew_entry()
442 if (!he) in hists__findnew_entry()
447 rb_link_node(&he->rb_node_in, parent, p); in hists__findnew_entry()
448 rb_insert_color(&he->rb_node_in, hists->entries_in); in hists__findnew_entry()
451 he_stat__add_cpumode_period(&he->stat, al->cpumode, period); in hists__findnew_entry()
453 he_stat__add_cpumode_period(he->stat_acc, al->cpumode, period); in hists__findnew_entry()
454 return he; in hists__findnew_entry()
527 struct hist_entry *he; in iter_add_single_mem_entry() local
543 he = __hists__add_entry(hists, al, iter->parent, NULL, mi, in iter_add_single_mem_entry()
545 if (!he) in iter_add_single_mem_entry()
548 iter->he = he; in iter_add_single_mem_entry()
558 struct hist_entry *he = iter->he; in iter_finish_mem_entry() local
561 if (he == NULL) in iter_finish_mem_entry()
564 hists__inc_nr_samples(hists, he->filtered); in iter_finish_mem_entry()
566 err = hist_entry__append_callchain(he, iter->sample); in iter_finish_mem_entry()
576 iter->he = NULL; in iter_finish_mem_entry()
602 iter->he = NULL; in iter_add_single_branch_entry()
631 struct hist_entry *he = NULL; in iter_add_next_branch_entry() local
644 he = __hists__add_entry(hists, al, iter->parent, &bi[i], NULL, in iter_add_next_branch_entry()
647 if (he == NULL) in iter_add_next_branch_entry()
650 hists__inc_nr_samples(hists, he->filtered); in iter_add_next_branch_entry()
653 iter->he = he; in iter_add_next_branch_entry()
663 iter->he = NULL; in iter_finish_branch_entry()
680 struct hist_entry *he; in iter_add_single_normal_entry() local
682 he = __hists__add_entry(evsel__hists(evsel), al, iter->parent, NULL, NULL, in iter_add_single_normal_entry()
685 if (he == NULL) in iter_add_single_normal_entry()
688 iter->he = he; in iter_add_single_normal_entry()
696 struct hist_entry *he = iter->he; in iter_finish_normal_entry() local
700 if (he == NULL) in iter_finish_normal_entry()
703 iter->he = NULL; in iter_finish_normal_entry()
705 hists__inc_nr_samples(evsel__hists(evsel), he->filtered); in iter_finish_normal_entry()
707 return hist_entry__append_callchain(he, sample); in iter_finish_normal_entry()
741 struct hist_entry *he; in iter_add_single_cumulative_entry() local
744 he = __hists__add_entry(hists, al, iter->parent, NULL, NULL, in iter_add_single_cumulative_entry()
747 if (he == NULL) in iter_add_single_cumulative_entry()
750 iter->he = he; in iter_add_single_cumulative_entry()
751 he_cache[iter->curr++] = he; in iter_add_single_cumulative_entry()
753 hist_entry__append_callchain(he, sample); in iter_add_single_cumulative_entry()
761 hists__inc_nr_samples(hists, he->filtered); in iter_add_single_cumulative_entry()
786 struct hist_entry *he; in iter_add_next_cumulative_entry() local
813 iter->he = NULL; in iter_add_next_cumulative_entry()
818 he = __hists__add_entry(evsel__hists(evsel), al, iter->parent, NULL, NULL, in iter_add_next_cumulative_entry()
821 if (he == NULL) in iter_add_next_cumulative_entry()
824 iter->he = he; in iter_add_next_cumulative_entry()
825 he_cache[iter->curr++] = he; in iter_add_next_cumulative_entry()
828 callchain_append(he->callchain, &cursor, sample->period); in iter_add_next_cumulative_entry()
837 iter->he = NULL; in iter_finish_cumulative_entry()
894 if (iter->he && iter->add_entry_cb) { in hist_entry_iter__add()
905 if (iter->he && iter->add_entry_cb) { in hist_entry_iter__add()
956 void hist_entry__delete(struct hist_entry *he) in hist_entry__delete() argument
958 thread__zput(he->thread); in hist_entry__delete()
959 map__zput(he->ms.map); in hist_entry__delete()
961 if (he->branch_info) { in hist_entry__delete()
962 map__zput(he->branch_info->from.map); in hist_entry__delete()
963 map__zput(he->branch_info->to.map); in hist_entry__delete()
964 zfree(&he->branch_info); in hist_entry__delete()
967 if (he->mem_info) { in hist_entry__delete()
968 map__zput(he->mem_info->iaddr.map); in hist_entry__delete()
969 map__zput(he->mem_info->daddr.map); in hist_entry__delete()
970 zfree(&he->mem_info); in hist_entry__delete()
973 zfree(&he->stat_acc); in hist_entry__delete()
974 free_srcline(he->srcline); in hist_entry__delete()
975 if (he->srcfile && he->srcfile[0]) in hist_entry__delete()
976 free(he->srcfile); in hist_entry__delete()
977 free_callchain(he->callchain); in hist_entry__delete()
978 free(he); in hist_entry__delete()
987 struct hist_entry *he) in hists__collapse_insert_entry() argument
998 cmp = hist_entry__collapse(iter, he); in hists__collapse_insert_entry()
1001 he_stat__add_stat(&iter->stat, &he->stat); in hists__collapse_insert_entry()
1003 he_stat__add_stat(iter->stat_acc, he->stat_acc); in hists__collapse_insert_entry()
1009 he->callchain); in hists__collapse_insert_entry()
1011 hist_entry__delete(he); in hists__collapse_insert_entry()
1022 rb_link_node(&he->rb_node_in, parent, p); in hists__collapse_insert_entry()
1023 rb_insert_color(&he->rb_node_in, root); in hists__collapse_insert_entry()
1042 static void hists__apply_filters(struct hists *hists, struct hist_entry *he) in hists__apply_filters() argument
1044 hists__filter_entry_by_dso(hists, he); in hists__apply_filters()
1045 hists__filter_entry_by_thread(hists, he); in hists__apply_filters()
1046 hists__filter_entry_by_symbol(hists, he); in hists__apply_filters()
1047 hists__filter_entry_by_socket(hists, he); in hists__apply_filters()
1132 struct hist_entry *he, in __hists__insert_output_entry() argument
1141 callchain_param.sort(&he->sorted_chain, he->callchain, in __hists__insert_output_entry()
1148 if (hist_entry__sort(he, iter) > 0) in __hists__insert_output_entry()
1154 rb_link_node(&he->rb_node, parent, p); in __hists__insert_output_entry()
1155 rb_insert_color(&he->rb_node, entries); in __hists__insert_output_entry()
1220 struct hist_entry *he) in hists__filter_entry_by_dso() argument
1223 (he->ms.map == NULL || he->ms.map->dso != hists->dso_filter)) { in hists__filter_entry_by_dso()
1224 he->filtered |= (1 << HIST_FILTER__DSO); in hists__filter_entry_by_dso()
1254 struct hist_entry *he) in hists__filter_entry_by_thread() argument
1257 he->thread != hists->thread_filter) { in hists__filter_entry_by_thread()
1258 he->filtered |= (1 << HIST_FILTER__THREAD); in hists__filter_entry_by_thread()
1285 struct hist_entry *he) in hists__filter_entry_by_symbol() argument
1288 (!he->ms.sym || strstr(he->ms.sym->name, in hists__filter_entry_by_symbol()
1290 he->filtered |= (1 << HIST_FILTER__SYMBOL); in hists__filter_entry_by_symbol()
1317 struct hist_entry *he) in hists__filter_entry_by_socket() argument
1320 (he->socket != hists->socket_filter)) { in hists__filter_entry_by_socket()
1321 he->filtered |= (1 << HIST_FILTER__SOCKET); in hists__filter_entry_by_socket()
1371 struct hist_entry *he; in hists__add_dummy_entry() local
1383 he = rb_entry(parent, struct hist_entry, rb_node_in); in hists__add_dummy_entry()
1385 cmp = hist_entry__collapse(he, pair); in hists__add_dummy_entry()
1396 he = hist_entry__new(pair, true); in hists__add_dummy_entry()
1397 if (he) { in hists__add_dummy_entry()
1398 memset(&he->stat, 0, sizeof(he->stat)); in hists__add_dummy_entry()
1399 he->hists = hists; in hists__add_dummy_entry()
1400 rb_link_node(&he->rb_node_in, parent, p); in hists__add_dummy_entry()
1401 rb_insert_color(&he->rb_node_in, root); in hists__add_dummy_entry()
1402 hists__inc_stats(hists, he); in hists__add_dummy_entry()
1403 he->dummy = true; in hists__add_dummy_entry()
1406 return he; in hists__add_dummy_entry()
1410 struct hist_entry *he) in hists__find_entry() argument
1421 int64_t cmp = hist_entry__collapse(iter, he); in hists__find_entry()