Lines Matching refs:he
55 struct hist_entry *he = in hist_browser__get_folding() local
58 if (he->leaf && he->unfolded) in hist_browser__get_folding()
59 unfolded_rows += he->nr_rows; in hist_browser__get_folding()
146 static char hist_entry__folded(const struct hist_entry *he) in hist_entry__folded() argument
148 return he->has_children ? tree__folded_sign(he->unfolded) : ' '; in hist_entry__folded()
257 static int hierarchy_count_rows(struct hist_browser *hb, struct hist_entry *he, in hierarchy_count_rows() argument
264 if (he->leaf) in hierarchy_count_rows()
265 return callchain__count_rows(&he->sorted_chain); in hierarchy_count_rows()
267 if (he->has_no_entry) in hierarchy_count_rows()
270 node = rb_first(&he->hroot_out); in hierarchy_count_rows()
289 static bool hist_entry__toggle_fold(struct hist_entry *he) in hist_entry__toggle_fold() argument
291 if (!he) in hist_entry__toggle_fold()
294 if (!he->has_children) in hist_entry__toggle_fold()
297 he->unfolded = !he->unfolded; in hist_entry__toggle_fold()
366 static void hist_entry__init_have_children(struct hist_entry *he) in hist_entry__init_have_children() argument
368 if (he->init_have_children) in hist_entry__init_have_children()
371 if (he->leaf) { in hist_entry__init_have_children()
372 he->has_children = !RB_EMPTY_ROOT(&he->sorted_chain); in hist_entry__init_have_children()
373 callchain__init_have_children(&he->sorted_chain); in hist_entry__init_have_children()
375 he->has_children = !RB_EMPTY_ROOT(&he->hroot_out); in hist_entry__init_have_children()
378 he->init_have_children = true; in hist_entry__init_have_children()
383 struct hist_entry *he = browser->he_selection; in hist_browser__toggle_fold() local
388 if (!he || !ms) in hist_browser__toggle_fold()
391 if (ms == &he->ms) in hist_browser__toggle_fold()
392 has_children = hist_entry__toggle_fold(he); in hist_browser__toggle_fold()
399 hist_entry__init_have_children(he); in hist_browser__toggle_fold()
400 browser->b.nr_entries -= he->nr_rows; in hist_browser__toggle_fold()
402 if (he->leaf) in hist_browser__toggle_fold()
403 browser->nr_callchain_rows -= he->nr_rows; in hist_browser__toggle_fold()
405 browser->nr_hierarchy_entries -= he->nr_rows; in hist_browser__toggle_fold()
408 child_rows = hierarchy_count_rows(browser, he, true); in hist_browser__toggle_fold()
410 if (he->unfolded) { in hist_browser__toggle_fold()
411 if (he->leaf) in hist_browser__toggle_fold()
412 he->nr_rows = callchain__count_rows( in hist_browser__toggle_fold()
413 &he->sorted_chain); in hist_browser__toggle_fold()
415 he->nr_rows = hierarchy_count_rows(browser, he, false); in hist_browser__toggle_fold()
419 browser->b.nr_entries += child_rows - he->nr_rows; in hist_browser__toggle_fold()
421 if (!he->leaf && he->nr_rows == 0) { in hist_browser__toggle_fold()
422 he->has_no_entry = true; in hist_browser__toggle_fold()
423 he->nr_rows = 1; in hist_browser__toggle_fold()
427 browser->b.nr_entries -= child_rows - he->nr_rows; in hist_browser__toggle_fold()
429 if (he->has_no_entry) in hist_browser__toggle_fold()
430 he->has_no_entry = false; in hist_browser__toggle_fold()
432 he->nr_rows = 0; in hist_browser__toggle_fold()
435 browser->b.nr_entries += he->nr_rows; in hist_browser__toggle_fold()
437 if (he->leaf) in hist_browser__toggle_fold()
438 browser->nr_callchain_rows += he->nr_rows; in hist_browser__toggle_fold()
440 browser->nr_hierarchy_entries += he->nr_rows; in hist_browser__toggle_fold()
503 static int hierarchy_set_folding(struct hist_browser *hb, struct hist_entry *he, in hierarchy_set_folding() argument
511 for (nd = rb_first(&he->hroot_out); nd; nd = rb_next(nd)) { in hierarchy_set_folding()
521 static void __hist_entry__set_folding(struct hist_entry *he, in __hist_entry__set_folding() argument
524 hist_entry__init_have_children(he); in __hist_entry__set_folding()
525 he->unfolded = unfold ? he->has_children : false; in __hist_entry__set_folding()
527 if (he->has_children) { in __hist_entry__set_folding()
530 if (he->leaf) in __hist_entry__set_folding()
531 n = callchain__set_folding(&he->sorted_chain, unfold); in __hist_entry__set_folding()
533 n = hierarchy_set_folding(hb, he, unfold); in __hist_entry__set_folding()
535 he->nr_rows = unfold ? n : 0; in __hist_entry__set_folding()
537 he->nr_rows = 0; in __hist_entry__set_folding()
540 static void hist_entry__set_folding(struct hist_entry *he, in hist_entry__set_folding() argument
545 percent = hist_entry__get_percent_limit(he); in hist_entry__set_folding()
546 if (he->filtered || percent < browser->min_pcnt) in hist_entry__set_folding()
549 __hist_entry__set_folding(he, browser, unfold); in hist_entry__set_folding()
551 if (!he->depth || unfold) in hist_entry__set_folding()
553 if (he->leaf) in hist_entry__set_folding()
554 browser->nr_callchain_rows += he->nr_rows; in hist_entry__set_folding()
555 else if (unfold && !hist_entry__has_hierarchy_children(he, browser->min_pcnt)) { in hist_entry__set_folding()
557 he->has_no_entry = true; in hist_entry__set_folding()
558 he->nr_rows = 1; in hist_entry__set_folding()
560 he->has_no_entry = false; in hist_entry__set_folding()
567 struct hist_entry *he; in __hist_browser__set_folding() local
571 he = rb_entry(nd, struct hist_entry, rb_node); in __hist_browser__set_folding()
576 hist_entry__set_folding(he, browser, unfold); in __hist_browser__set_folding()
1162 static u64 __hpp_get_##_field(struct hist_entry *he) \
1164 return he->stat._field; \
1170 struct hist_entry *he) \
1172 return hpp__fmt(fmt, hpp, he, __hpp_get_##_field, " %*.2f%%", \
1177 static u64 __hpp_get_acc_##_field(struct hist_entry *he) \
1179 return he->stat_acc->_field; \
1185 struct hist_entry *he) \
1196 return hpp__fmt(fmt, hpp, he, __hpp_get_acc_##_field, \
1964 struct hist_entry *he, FILE *fp, in hist_browser__fprintf_callchain() argument
1971 hist_browser__show_callchain(browser, he, level, 0, in hist_browser__fprintf_callchain()
1978 struct hist_entry *he, FILE *fp) in hist_browser__fprintf_entry() argument
1991 if (hist_entry__has_callchains(he) && symbol_conf.use_callchain) { in hist_browser__fprintf_entry()
1992 folded_sign = hist_entry__folded(he); in hist_browser__fprintf_entry()
1997 if (perf_hpp__should_skip(fmt, he->hists)) in hist_browser__fprintf_entry()
2006 ret = fmt->entry(fmt, &hpp, he); in hist_browser__fprintf_entry()
2007 ret = hist_entry__snprintf_alignment(he, &hpp, fmt, ret); in hist_browser__fprintf_entry()
2013 printed += hist_browser__fprintf_callchain(browser, he, fp, 1); in hist_browser__fprintf_entry()
2020 struct hist_entry *he, in hist_browser__fprintf_hierarchy_entry() argument
2034 int hierarchy_indent = (he->hists->nr_hpp_node - 2) * HIERARCHY_INDENT; in hist_browser__fprintf_hierarchy_entry()
2038 folded_sign = hist_entry__folded(he); in hist_browser__fprintf_hierarchy_entry()
2042 fmt_node = list_first_entry(&he->hists->hpp_formats, in hist_browser__fprintf_hierarchy_entry()
2051 ret = fmt->entry(fmt, &hpp, he); in hist_browser__fprintf_hierarchy_entry()
2058 perf_hpp_list__for_each_format(he->hpp_list, fmt) { in hist_browser__fprintf_hierarchy_entry()
2062 ret = fmt->entry(fmt, &hpp, he); in hist_browser__fprintf_hierarchy_entry()
2068 if (he->leaf && folded_sign == '-') { in hist_browser__fprintf_hierarchy_entry()
2069 printed += hist_browser__fprintf_callchain(browser, he, fp, in hist_browser__fprintf_hierarchy_entry()
2070 he->depth + 1); in hist_browser__fprintf_hierarchy_entry()
2339 struct hist_entry *he; in do_annotate() local
2353 he = hist_browser__selected_entry(browser); in do_annotate()
2358 if ((err == 'q' || err == CTRL('c')) && he->branch_info) in do_annotate()
2660 struct hist_entry *he; in hist_browser__update_percent_limit() local
2668 he = rb_entry(nd, struct hist_entry, rb_node); in hist_browser__update_percent_limit()
2670 if (he->has_no_entry) { in hist_browser__update_percent_limit()
2671 he->has_no_entry = false; in hist_browser__update_percent_limit()
2672 he->nr_rows = 0; in hist_browser__update_percent_limit()
2675 if (!he->leaf || !hist_entry__has_callchains(he) || !symbol_conf.use_callchain) in hist_browser__update_percent_limit()
2679 total = he->stat.period; in hist_browser__update_percent_limit()
2682 total = he->stat_acc->period; in hist_browser__update_percent_limit()
2687 callchain_param.sort(&he->sorted_chain, he->callchain, in hist_browser__update_percent_limit()
2694 he->init_have_children = false; in hist_browser__update_percent_limit()
2695 hist_entry__set_folding(he, hb, false); in hist_browser__update_percent_limit()