Lines Matching refs:he
262 static double period_percent(struct hist_entry *he, u64 period) in period_percent() argument
264 u64 total = hists__total_period(he->hists); in period_percent()
269 static double compute_delta(struct hist_entry *he, struct hist_entry *pair) in compute_delta() argument
271 double old_percent = period_percent(he, he->stat.period); in compute_delta()
279 static double compute_ratio(struct hist_entry *he, struct hist_entry *pair) in compute_ratio() argument
281 double old_period = he->stat.period ?: 1; in compute_ratio()
289 static s64 compute_wdiff(struct hist_entry *he, struct hist_entry *pair) in compute_wdiff() argument
291 u64 old_period = he->stat.period; in compute_wdiff()
301 static int formula_delta(struct hist_entry *he, struct hist_entry *pair, in formula_delta() argument
304 u64 he_total = he->hists->stats.total_period; in formula_delta()
308 he_total = he->hists->stats.total_non_filtered_period; in formula_delta()
315 he->stat.period, he_total); in formula_delta()
318 static int formula_ratio(struct hist_entry *he, struct hist_entry *pair, in formula_ratio() argument
321 double old_period = he->stat.period; in formula_ratio()
327 static int formula_wdiff(struct hist_entry *he, struct hist_entry *pair, in formula_wdiff() argument
330 u64 old_period = he->stat.period; in formula_wdiff()
338 static int formula_fprintf(struct hist_entry *he, struct hist_entry *pair, in formula_fprintf() argument
344 return formula_delta(he, pair, buf, size); in formula_fprintf()
346 return formula_ratio(he, pair, buf, size); in formula_fprintf()
348 return formula_wdiff(he, pair, buf, size); in formula_fprintf()
364 return &bh->he; in block_hist_zalloc()
367 static void block_hist_free(void *he) in block_hist_free() argument
371 bh = container_of(he, struct block_hist, he); in block_hist_free()
490 get_pair_data(struct hist_entry *he, struct data__file *d) in get_pair_data() argument
492 if (hist_entry__has_pairs(he)) { in get_pair_data()
495 list_for_each_entry(pair, &he->pairs.head, pairs.node) in get_pair_data()
504 get_pair_fmt(struct hist_entry *he, struct diff_hpp_fmt *dfmt) in get_pair_fmt() argument
508 return get_pair_data(he, d); in get_pair_fmt()
523 struct hist_entry *he = rb_entry(next, struct hist_entry, rb_node_in); in hists__baseline_only() local
525 next = rb_next(&he->rb_node_in); in hists__baseline_only()
526 if (!hist_entry__next_pair(he)) { in hists__baseline_only()
527 rb_erase_cached(&he->rb_node_in, root); in hists__baseline_only()
528 hist_entry__delete(he); in hists__baseline_only()
615 static int process_block_per_sym(struct hist_entry *he) in process_block_per_sym() argument
621 if (!he->ms.map || !he->ms.sym) in process_block_per_sym()
624 notes = symbol__annotation(he->ms.sym); in process_block_per_sym()
628 bh = container_of(he, struct block_hist, he); in process_block_per_sym()
632 for (unsigned int i = 0; i < symbol__size(he->ms.sym); i++) { in process_block_per_sym()
641 init_block_info(bi, he->ms.sym, &ch[i], i); in process_block_per_sym()
671 static struct hist_entry *get_block_pair(struct hist_entry *he, in get_block_pair() argument
684 cmp = block_pair_cmp(he_pair, he); in get_block_pair()
692 static void compute_cycles_diff(struct hist_entry *he, in compute_cycles_diff() argument
696 if (pair->block_info->num && he->block_info->num) { in compute_cycles_diff()
699 he->block_info->cycles_aggr / he->block_info->num_aggr; in compute_cycles_diff()
710 struct hist_entry *he = rb_entry(next, struct hist_entry, in block_hists_match() local
712 struct hist_entry *pair = get_block_pair(he, hists_pair); in block_hists_match()
714 next = rb_next(&he->rb_node_in); in block_hists_match()
717 hist_entry__add_pair(pair, he); in block_hists_match()
718 compute_cycles_diff(he, pair); in block_hists_match()
723 static int filter_cb(struct hist_entry *he, void *arg __maybe_unused) in filter_cb() argument
726 he->filtered = true; in filter_cb()
743 struct hist_entry *he, *pair; in hists__precompute() local
747 he = rb_entry(next, struct hist_entry, rb_node_in); in hists__precompute()
748 next = rb_next(&he->rb_node_in); in hists__precompute()
751 process_block_per_sym(he); in hists__precompute()
754 pair = get_pair_data(he, d); in hists__precompute()
761 compute_delta(he, pair); in hists__precompute()
764 compute_ratio(he, pair); in hists__precompute()
767 compute_wdiff(he, pair); in hists__precompute()
771 bh = container_of(he, struct block_hist, he); in hists__precompute()
773 he); in hists__precompute()
1293 static double baseline_percent(struct hist_entry *he) in baseline_percent() argument
1295 u64 total = hists__total_period(he->hists); in baseline_percent()
1297 return 100.0 * he->stat.period / total; in baseline_percent()
1301 struct perf_hpp *hpp, struct hist_entry *he) in hpp__color_baseline() argument
1305 double percent = baseline_percent(he); in hpp__color_baseline()
1308 if (!he->dummy) { in hpp__color_baseline()
1317 static int hpp__entry_baseline(struct hist_entry *he, char *buf, size_t size) in hpp__entry_baseline() argument
1319 double percent = baseline_percent(he); in hpp__entry_baseline()
1323 if (!he->dummy) in hpp__entry_baseline()
1329 static int cycles_printf(struct hist_entry *he, struct hist_entry *pair, in cycles_printf() argument
1332 struct block_hist *bh = container_of(he, struct block_hist, he); in cycles_printf()
1333 struct block_hist *bh_pair = container_of(pair, struct block_hist, he); in cycles_printf()
1352 start_line = map__srcline(he->ms.map, bi->sym->start + bi->start, in cycles_printf()
1353 he->ms.sym); in cycles_printf()
1355 end_line = map__srcline(he->ms.map, bi->sym->start + bi->end, in cycles_printf()
1356 he->ms.sym); in cycles_printf()
1373 struct perf_hpp *hpp, struct hist_entry *he, in __hpp__color_compare() argument
1378 struct hist_entry *pair = get_pair_fmt(he, dfmt); in __hpp__color_compare()
1387 bh = container_of(he, struct block_hist, he); in __hpp__color_compare()
1400 diff = compute_delta(he, pair); in __hpp__color_compare()
1406 if (he->dummy) in __hpp__color_compare()
1411 diff = compute_ratio(he, pair); in __hpp__color_compare()
1417 if (he->dummy) in __hpp__color_compare()
1422 wdiff = compute_wdiff(he, pair); in __hpp__color_compare()
1429 return cycles_printf(he, pair, hpp, dfmt->header_width); in __hpp__color_compare()
1442 struct perf_hpp *hpp, struct hist_entry *he) in hpp__color_delta() argument
1444 return __hpp__color_compare(fmt, hpp, he, COMPUTE_DELTA); in hpp__color_delta()
1448 struct perf_hpp *hpp, struct hist_entry *he) in hpp__color_ratio() argument
1450 return __hpp__color_compare(fmt, hpp, he, COMPUTE_RATIO); in hpp__color_ratio()
1454 struct perf_hpp *hpp, struct hist_entry *he) in hpp__color_wdiff() argument
1456 return __hpp__color_compare(fmt, hpp, he, COMPUTE_WEIGHTED_DIFF); in hpp__color_wdiff()
1460 struct perf_hpp *hpp, struct hist_entry *he) in hpp__color_cycles() argument
1462 return __hpp__color_compare(fmt, hpp, he, COMPUTE_CYCLES); in hpp__color_cycles()
1466 hpp__entry_unpair(struct hist_entry *he, int idx, char *buf, size_t size) in hpp__entry_unpair() argument
1470 scnprintf(buf, size, "%" PRIu64, he->stat.period); in hpp__entry_unpair()
1479 hpp__entry_pair(struct hist_entry *he, struct hist_entry *pair, in hpp__entry_pair() argument
1492 diff = compute_delta(he, pair); in hpp__entry_pair()
1499 if (he->dummy) { in hpp__entry_pair()
1507 ratio = compute_ratio(he, pair); in hpp__entry_pair()
1515 if (he->dummy) { in hpp__entry_pair()
1523 wdiff = compute_wdiff(he, pair); in hpp__entry_pair()
1530 formula_fprintf(he, pair, buf, size); in hpp__entry_pair()
1543 __hpp__entry_global(struct hist_entry *he, struct diff_hpp_fmt *dfmt, in __hpp__entry_global() argument
1546 struct hist_entry *pair = get_pair_fmt(he, dfmt); in __hpp__entry_global()
1551 hpp__entry_baseline(he, buf, size); in __hpp__entry_global()
1554 hpp__entry_pair(he, pair, idx, buf, size); in __hpp__entry_global()
1556 hpp__entry_unpair(he, idx, buf, size); in __hpp__entry_global()
1561 struct hist_entry *he) in hpp__entry_global() argument
1567 __hpp__entry_global(he, dfmt, buf, MAX_COL_WIDTH); in hpp__entry_global()