Lines Matching full: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()
523 struct hist_entry *pair; in get_pair_data() local
525 list_for_each_entry(pair, &he->pairs.head, pairs.node) in get_pair_data()
526 if (pair->hists == d->hists) in get_pair_data()
527 return pair; in get_pair_data()
635 struct hist_entry *pair) in compute_cycles_diff() argument
637 pair->diff.computed = true; in compute_cycles_diff()
638 if (pair->block_info->num && he->block_info->num) { in compute_cycles_diff()
639 pair->diff.cycles = in compute_cycles_diff()
640 pair->block_info->cycles_aggr / pair->block_info->num_aggr - in compute_cycles_diff()
646 init_stats(&pair->diff.stats); in compute_cycles_diff()
647 init_spark_values(pair->diff.svals, NUM_SPARKS); in compute_cycles_diff()
649 for (int i = 0; i < pair->block_info->num; i++) { in compute_cycles_diff()
655 val = llabs(pair->block_info->cycles_spark[i] - in compute_cycles_diff()
658 update_spark_value(pair->diff.svals, NUM_SPARKS, in compute_cycles_diff()
659 &pair->diff.stats, val); in compute_cycles_diff()
660 update_stats(&pair->diff.stats, val); in compute_cycles_diff()
674 struct hist_entry *pair = get_block_pair(he, hists_pair); in block_hists_match() local
678 if (pair) { in block_hists_match()
679 hist_entry__add_pair(pair, he); in block_hists_match()
680 compute_cycles_diff(he, pair); in block_hists_match()
698 struct hist_entry *he, *pair; in hists__precompute() local
712 pair = get_pair_data(he, d); in hists__precompute()
713 if (!pair) in hists__precompute()
719 compute_delta(he, pair); in hists__precompute()
722 compute_ratio(he, pair); in hists__precompute()
725 compute_wdiff(he, pair); in hists__precompute()
728 pair_bh = container_of(pair, struct block_hist, in hists__precompute()
731 block_info__process_sym(pair, pair_bh, NULL, 0); in hists__precompute()
1352 static int cycles_printf(struct hist_entry *he, struct hist_entry *pair, in cycles_printf() argument
1356 struct block_hist *bh_pair = container_of(pair, struct block_hist, he); in cycles_printf()
1402 struct hist_entry *pair = get_pair_fmt(he, dfmt); in __hpp__color_compare() local
1407 if (!pair) { in __hpp__color_compare()
1421 if (pair->diff.computed) in __hpp__color_compare()
1422 diff = pair->diff.period_ratio_delta; in __hpp__color_compare()
1424 diff = compute_delta(he, pair); in __hpp__color_compare()
1432 if (pair->diff.computed) in __hpp__color_compare()
1433 diff = pair->diff.period_ratio; in __hpp__color_compare()
1435 diff = compute_ratio(he, pair); in __hpp__color_compare()
1443 if (pair->diff.computed) in __hpp__color_compare()
1444 wdiff = pair->diff.wdiff; in __hpp__color_compare()
1446 wdiff = compute_wdiff(he, pair); in __hpp__color_compare()
1453 return cycles_printf(he, pair, hpp, dfmt->header_width); in __hpp__color_compare()
1521 struct hist_entry *pair = get_pair_fmt(he, dfmt); in hpp__color_cycles_hist() local
1529 if (!pair) { in hpp__color_cycles_hist()
1536 bh_pair = container_of(pair, struct block_hist, he); in hpp__color_cycles_hist()
1587 hpp__entry_pair(struct hist_entry *he, struct hist_entry *pair, in hpp__entry_pair() argument
1597 if (pair->diff.computed) in hpp__entry_pair()
1598 diff = pair->diff.period_ratio_delta; in hpp__entry_pair()
1600 diff = compute_delta(he, pair); in hpp__entry_pair()
1612 if (pair->diff.computed) in hpp__entry_pair()
1613 ratio = pair->diff.period_ratio; in hpp__entry_pair()
1615 ratio = compute_ratio(he, pair); in hpp__entry_pair()
1628 if (pair->diff.computed) in hpp__entry_pair()
1629 wdiff = pair->diff.wdiff; in hpp__entry_pair()
1631 wdiff = compute_wdiff(he, pair); in hpp__entry_pair()
1638 formula_fprintf(he, pair, buf, size); in hpp__entry_pair()
1642 scnprintf(buf, size, "%" PRIu64, pair->stat.period); in hpp__entry_pair()
1654 struct hist_entry *pair = get_pair_fmt(he, dfmt); in __hpp__entry_global() local
1661 if (pair) in __hpp__entry_global()
1662 hpp__entry_pair(he, pair, idx, buf, size); in __hpp__entry_global()