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);
521 struct hist_entry *pair;
523 list_for_each_entry(pair, &he->pairs.head, pairs.node)
524 if (pair->hists == d->hists)
525 return pair;
633 struct hist_entry *pair)
635 pair->diff.computed = true;
636 if (pair->block_info->num && he->block_info->num) {
637 pair->diff.cycles =
638 pair->block_info->cycles_aggr / pair->block_info->num_aggr -
644 init_stats(&pair->diff.stats);
645 init_spark_values(pair->diff.svals, NUM_SPARKS);
647 for (int i = 0; i < pair->block_info->num; i++) {
653 val = llabs(pair->block_info->cycles_spark[i] -
656 update_spark_value(pair->diff.svals, NUM_SPARKS,
657 &pair->diff.stats, val);
658 update_stats(&pair->diff.stats, val);
672 struct hist_entry *pair = get_block_pair(he, hists_pair);
676 if (pair) {
677 hist_entry__add_pair(pair, he);
678 compute_cycles_diff(he, pair);
696 struct hist_entry *he, *pair;
710 pair = get_pair_data(he, d);
711 if (!pair)
717 compute_delta(he, pair);
720 compute_ratio(he, pair);
723 compute_wdiff(he, pair);
726 pair_bh = container_of(pair, struct block_hist,
729 block_info__process_sym(pair, pair_bh, NULL, 0);
1349 static int cycles_printf(struct hist_entry *he, struct hist_entry *pair,
1353 struct block_hist *bh_pair = container_of(pair, struct block_hist, he);
1399 struct hist_entry *pair = get_pair_fmt(he, dfmt);
1404 if (!pair) {
1418 if (pair->diff.computed)
1419 diff = pair->diff.period_ratio_delta;
1421 diff = compute_delta(he, pair);
1429 if (pair->diff.computed)
1430 diff = pair->diff.period_ratio;
1432 diff = compute_ratio(he, pair);
1440 if (pair->diff.computed)
1441 wdiff = pair->diff.wdiff;
1443 wdiff = compute_wdiff(he, pair);
1450 return cycles_printf(he, pair, hpp, dfmt->header_width);
1518 struct hist_entry *pair = get_pair_fmt(he, dfmt);
1526 if (!pair) {
1533 bh_pair = container_of(pair, struct block_hist, he);
1584 hpp__entry_pair(struct hist_entry *he, struct hist_entry *pair,
1594 if (pair->diff.computed)
1595 diff = pair->diff.period_ratio_delta;
1597 diff = compute_delta(he, pair);
1609 if (pair->diff.computed)
1610 ratio = pair->diff.period_ratio;
1612 ratio = compute_ratio(he, pair);
1625 if (pair->diff.computed)
1626 wdiff = pair->diff.wdiff;
1628 wdiff = compute_wdiff(he, pair);
1635 formula_fprintf(he, pair, buf, size);
1639 scnprintf(buf, size, "%" PRIu64, pair->stat.period);
1651 struct hist_entry *pair = get_pair_fmt(he, dfmt);
1658 if (pair)
1659 hpp__entry_pair(he, pair, idx, buf, size);