Lines Matching refs:pair
279 static double compute_delta(struct hist_entry *he, struct hist_entry *pair) in compute_delta() argument
282 double new_percent = period_percent(pair, pair->stat.period); in compute_delta()
284 pair->diff.period_ratio_delta = new_percent - old_percent; in compute_delta()
285 pair->diff.computed = true; in compute_delta()
286 return pair->diff.period_ratio_delta; in compute_delta()
289 static double compute_ratio(struct hist_entry *he, struct hist_entry *pair) in compute_ratio() argument
292 double new_period = pair->stat.period; in compute_ratio()
294 pair->diff.computed = true; in compute_ratio()
295 pair->diff.period_ratio = new_period / old_period; in compute_ratio()
296 return pair->diff.period_ratio; in compute_ratio()
299 static s64 compute_wdiff(struct hist_entry *he, struct hist_entry *pair) in compute_wdiff() argument
302 u64 new_period = pair->stat.period; in compute_wdiff()
304 pair->diff.computed = true; in compute_wdiff()
305 pair->diff.wdiff = new_period * compute_wdiff_w2 - in compute_wdiff()
308 return pair->diff.wdiff; in compute_wdiff()
311 static int formula_delta(struct hist_entry *he, struct hist_entry *pair, in formula_delta() argument
315 u64 pair_total = pair->hists->stats.total_period; in formula_delta()
319 pair_total = pair->hists->stats.total_non_filtered_period; in formula_delta()
324 pair->stat.period, pair_total, in formula_delta()
328 static int formula_ratio(struct hist_entry *he, struct hist_entry *pair, in formula_ratio() argument
332 double new_period = pair->stat.period; in formula_ratio()
337 static int formula_wdiff(struct hist_entry *he, struct hist_entry *pair, in formula_wdiff() argument
341 u64 new_period = pair->stat.period; in formula_wdiff()
348 static int formula_fprintf(struct hist_entry *he, struct hist_entry *pair, in formula_fprintf() argument
354 return formula_delta(he, pair, buf, size); in formula_fprintf()
356 return formula_ratio(he, pair, buf, size); in formula_fprintf()
358 return formula_wdiff(he, pair, buf, size); in formula_fprintf()
509 struct hist_entry *pair; in get_pair_data() local
511 list_for_each_entry(pair, &he->pairs.head, pairs.node) in get_pair_data()
512 if (pair->hists == d->hists) in get_pair_data()
513 return pair; in get_pair_data()
621 struct hist_entry *pair) in compute_cycles_diff() argument
623 pair->diff.computed = true; in compute_cycles_diff()
624 if (pair->block_info->num && he->block_info->num) { in compute_cycles_diff()
625 pair->diff.cycles = in compute_cycles_diff()
626 pair->block_info->cycles_aggr / pair->block_info->num_aggr - in compute_cycles_diff()
632 init_stats(&pair->diff.stats); in compute_cycles_diff()
633 init_spark_values(pair->diff.svals, NUM_SPARKS); in compute_cycles_diff()
635 for (int i = 0; i < pair->block_info->num; i++) { in compute_cycles_diff()
641 val = llabs(pair->block_info->cycles_spark[i] - in compute_cycles_diff()
644 update_spark_value(pair->diff.svals, NUM_SPARKS, in compute_cycles_diff()
645 &pair->diff.stats, val); in compute_cycles_diff()
646 update_stats(&pair->diff.stats, val); in compute_cycles_diff()
660 struct hist_entry *pair = get_block_pair(he, hists_pair); in block_hists_match() local
664 if (pair) { in block_hists_match()
665 hist_entry__add_pair(pair, he); in block_hists_match()
666 compute_cycles_diff(he, pair); in block_hists_match()
684 struct hist_entry *he, *pair; in hists__precompute() local
698 pair = get_pair_data(he, d); in hists__precompute()
699 if (!pair) in hists__precompute()
705 compute_delta(he, pair); in hists__precompute()
708 compute_ratio(he, pair); in hists__precompute()
711 compute_wdiff(he, pair); in hists__precompute()
714 pair_bh = container_of(pair, struct block_hist, in hists__precompute()
717 block_info__process_sym(pair, pair_bh, NULL, 0, 0); in hists__precompute()
1338 static int cycles_printf(struct hist_entry *he, struct hist_entry *pair, in cycles_printf() argument
1342 struct block_hist *bh_pair = container_of(pair, struct block_hist, he); in cycles_printf()
1388 struct hist_entry *pair = get_pair_fmt(he, dfmt); in __hpp__color_compare() local
1393 if (!pair) { in __hpp__color_compare()
1407 if (pair->diff.computed) in __hpp__color_compare()
1408 diff = pair->diff.period_ratio_delta; in __hpp__color_compare()
1410 diff = compute_delta(he, pair); in __hpp__color_compare()
1418 if (pair->diff.computed) in __hpp__color_compare()
1419 diff = pair->diff.period_ratio; in __hpp__color_compare()
1421 diff = compute_ratio(he, pair); in __hpp__color_compare()
1429 if (pair->diff.computed) in __hpp__color_compare()
1430 wdiff = pair->diff.wdiff; in __hpp__color_compare()
1432 wdiff = compute_wdiff(he, pair); in __hpp__color_compare()
1439 return cycles_printf(he, pair, hpp, dfmt->header_width); in __hpp__color_compare()
1507 struct hist_entry *pair = get_pair_fmt(he, dfmt); in hpp__color_cycles_hist() local
1515 if (!pair) { in hpp__color_cycles_hist()
1522 bh_pair = container_of(pair, struct block_hist, he); in hpp__color_cycles_hist()
1573 hpp__entry_pair(struct hist_entry *he, struct hist_entry *pair, in hpp__entry_pair() argument
1583 if (pair->diff.computed) in hpp__entry_pair()
1584 diff = pair->diff.period_ratio_delta; in hpp__entry_pair()
1586 diff = compute_delta(he, pair); in hpp__entry_pair()
1598 if (pair->diff.computed) in hpp__entry_pair()
1599 ratio = pair->diff.period_ratio; in hpp__entry_pair()
1601 ratio = compute_ratio(he, pair); in hpp__entry_pair()
1614 if (pair->diff.computed) in hpp__entry_pair()
1615 wdiff = pair->diff.wdiff; in hpp__entry_pair()
1617 wdiff = compute_wdiff(he, pair); in hpp__entry_pair()
1624 formula_fprintf(he, pair, buf, size); in hpp__entry_pair()
1628 scnprintf(buf, size, "%" PRIu64, pair->stat.period); in hpp__entry_pair()
1640 struct hist_entry *pair = get_pair_fmt(he, dfmt); in __hpp__entry_global() local
1647 if (pair) in __hpp__entry_global()
1648 hpp__entry_pair(he, pair, idx, buf, size); in __hpp__entry_global()