Lines Matching refs:pair

279 static double compute_delta(struct hist_entry *he, struct hist_entry *pair)
282 double new_percent = period_percent(pair, pair->stat.period);
284 pair->diff.period_ratio_delta = new_percent - old_percent;
285 pair->diff.computed = true;
286 return pair->diff.period_ratio_delta;
289 static double compute_ratio(struct hist_entry *he, struct hist_entry *pair)
292 double new_period = pair->stat.period;
294 pair->diff.computed = true;
295 pair->diff.period_ratio = new_period / old_period;
296 return pair->diff.period_ratio;
299 static s64 compute_wdiff(struct hist_entry *he, struct hist_entry *pair)
302 u64 new_period = pair->stat.period;
304 pair->diff.computed = true;
305 pair->diff.wdiff = new_period * compute_wdiff_w2 -
308 return pair->diff.wdiff;
311 static int formula_delta(struct hist_entry *he, struct hist_entry *pair,
315 u64 pair_total = pair->hists->stats.total_period;
319 pair_total = pair->hists->stats.total_non_filtered_period;
324 pair->stat.period, pair_total,
328 static int formula_ratio(struct hist_entry *he, struct hist_entry *pair,
332 double new_period = pair->stat.period;
337 static int formula_wdiff(struct hist_entry *he, struct hist_entry *pair,
341 u64 new_period = pair->stat.period;
348 static int formula_fprintf(struct hist_entry *he, struct hist_entry *pair,
354 return formula_delta(he, pair, buf, size);
356 return formula_ratio(he, pair, buf, size);
358 return formula_wdiff(he, pair, buf, size);
523 struct hist_entry *pair;
525 list_for_each_entry(pair, &he->pairs.head, pairs.node)
526 if (pair->hists == d->hists)
527 return pair;
635 struct hist_entry *pair)
637 pair->diff.computed = true;
638 if (pair->block_info->num && he->block_info->num) {
639 pair->diff.cycles =
640 pair->block_info->cycles_aggr / pair->block_info->num_aggr -
646 init_stats(&pair->diff.stats);
647 init_spark_values(pair->diff.svals, NUM_SPARKS);
649 for (int i = 0; i < pair->block_info->num; i++) {
655 val = llabs(pair->block_info->cycles_spark[i] -
658 update_spark_value(pair->diff.svals, NUM_SPARKS,
659 &pair->diff.stats, val);
660 update_stats(&pair->diff.stats, val);
674 struct hist_entry *pair = get_block_pair(he, hists_pair);
678 if (pair) {
679 hist_entry__add_pair(pair, he);
680 compute_cycles_diff(he, pair);
698 struct hist_entry *he, *pair;
712 pair = get_pair_data(he, d);
713 if (!pair)
719 compute_delta(he, pair);
722 compute_ratio(he, pair);
725 compute_wdiff(he, pair);
728 pair_bh = container_of(pair, struct block_hist,
731 block_info__process_sym(pair, pair_bh, NULL, 0);
1352 static int cycles_printf(struct hist_entry *he, struct hist_entry *pair,
1356 struct block_hist *bh_pair = container_of(pair, struct block_hist, he);
1402 struct hist_entry *pair = get_pair_fmt(he, dfmt);
1407 if (!pair) {
1421 if (pair->diff.computed)
1422 diff = pair->diff.period_ratio_delta;
1424 diff = compute_delta(he, pair);
1432 if (pair->diff.computed)
1433 diff = pair->diff.period_ratio;
1435 diff = compute_ratio(he, pair);
1443 if (pair->diff.computed)
1444 wdiff = pair->diff.wdiff;
1446 wdiff = compute_wdiff(he, pair);
1453 return cycles_printf(he, pair, hpp, dfmt->header_width);
1521 struct hist_entry *pair = get_pair_fmt(he, dfmt);
1529 if (!pair) {
1536 bh_pair = container_of(pair, struct block_hist, he);
1587 hpp__entry_pair(struct hist_entry *he, struct hist_entry *pair,
1597 if (pair->diff.computed)
1598 diff = pair->diff.period_ratio_delta;
1600 diff = compute_delta(he, pair);
1612 if (pair->diff.computed)
1613 ratio = pair->diff.period_ratio;
1615 ratio = compute_ratio(he, pair);
1628 if (pair->diff.computed)
1629 wdiff = pair->diff.wdiff;
1631 wdiff = compute_wdiff(he, pair);
1638 formula_fprintf(he, pair, buf, size);
1642 scnprintf(buf, size, "%" PRIu64, pair->stat.period);
1654 struct hist_entry *pair = get_pair_fmt(he, dfmt);
1661 if (pair)
1662 hpp__entry_pair(he, pair, idx, buf, size);