Lines Matching +full:differential +full:- +full:pair

1 // SPDX-License-Identifier: GPL-2.0
3 * builtin-diff.c
23 #include "util/time-utils.h"
27 #include "util/block-info.h"
33 #include <subcmd/parse-options.h>
118 [COMPUTE_DELTA_ABS] = "delta-abs",
186 int ret = -EINVAL; in setup_compute_opt_wdiff()
224 return -EINVAL; in setup_compute_opt()
233 int *cp = (int *) opt->value; in setup_compute()
246 unsigned len = option++ - str; in setup_compute()
255 return -EINVAL; in setup_compute()
270 return -EINVAL; in setup_compute()
275 u64 total = hists__total_period(he->hists); in period_percent()
280 static double compute_delta(struct hist_entry *he, struct hist_entry *pair) in compute_delta() argument
282 double old_percent = period_percent(he, he->stat.period); in compute_delta()
283 double new_percent = period_percent(pair, pair->stat.period); in compute_delta()
285 pair->diff.period_ratio_delta = new_percent - old_percent; in compute_delta()
286 pair->diff.computed = true; in compute_delta()
287 return pair->diff.period_ratio_delta; in compute_delta()
290 static double compute_ratio(struct hist_entry *he, struct hist_entry *pair) in compute_ratio() argument
292 double old_period = he->stat.period ?: 1; in compute_ratio()
293 double new_period = pair->stat.period; in compute_ratio()
295 pair->diff.computed = true; in compute_ratio()
296 pair->diff.period_ratio = new_period / old_period; in compute_ratio()
297 return pair->diff.period_ratio; in compute_ratio()
300 static s64 compute_wdiff(struct hist_entry *he, struct hist_entry *pair) in compute_wdiff() argument
302 u64 old_period = he->stat.period; in compute_wdiff()
303 u64 new_period = pair->stat.period; in compute_wdiff()
305 pair->diff.computed = true; in compute_wdiff()
306 pair->diff.wdiff = new_period * compute_wdiff_w2 - in compute_wdiff()
309 return pair->diff.wdiff; in compute_wdiff()
312 static int formula_delta(struct hist_entry *he, struct hist_entry *pair, in formula_delta() argument
315 u64 he_total = he->hists->stats.total_period; in formula_delta()
316 u64 pair_total = pair->hists->stats.total_period; in formula_delta()
319 he_total = he->hists->stats.total_non_filtered_period; in formula_delta()
320 pair_total = pair->hists->stats.total_non_filtered_period; in formula_delta()
323 "(%" PRIu64 " * 100 / %" PRIu64 ") - " in formula_delta()
325 pair->stat.period, pair_total, in formula_delta()
326 he->stat.period, he_total); in formula_delta()
329 static int formula_ratio(struct hist_entry *he, struct hist_entry *pair, in formula_ratio() argument
332 double old_period = he->stat.period; in formula_ratio()
333 double new_period = pair->stat.period; in formula_ratio()
338 static int formula_wdiff(struct hist_entry *he, struct hist_entry *pair, in formula_wdiff() argument
341 u64 old_period = he->stat.period; in formula_wdiff()
342 u64 new_period = pair->stat.period; in formula_wdiff()
345 "(%" PRIu64 " * " "%" PRId64 ") - (%" PRIu64 " * " "%" PRId64 ")", in formula_wdiff()
349 static int formula_fprintf(struct hist_entry *he, struct hist_entry *pair, in formula_fprintf() argument
355 return formula_delta(he, pair, buf, size); in formula_fprintf()
357 return formula_ratio(he, pair, buf, size); in formula_fprintf()
359 return formula_wdiff(he, pair, buf, size); in formula_fprintf()
364 return -1; in formula_fprintf()
375 return &bh->he; in block_hist_zalloc()
383 hists__delete_entries(&bh->block_hists); in block_hist_free()
406 int ret = -1; in diff__process_sample_event()
408 if (perf_time__ranges_skip_sample(pdiff->ptime_range, pdiff->range_num, in diff__process_sample_event()
409 sample->time)) { in diff__process_sample_event()
416 event->header.type); in diff__process_sample_event()
417 ret = -1; in diff__process_sample_event()
421 if (cpu_list && !test_bit(sample->cpu, cpu_bitmap)) { in diff__process_sample_event()
435 hist__account_cycles(sample->branch_stack, &al, sample, in diff__process_sample_event()
462 hists->stats.total_period += sample->period; in diff__process_sample_event()
464 hists->stats.total_non_filtered_period += sample->period; in diff__process_sample_event()
478 if ((evsel->core.attr.type == e->core.attr.type) && in evsel_match()
479 (evsel->core.attr.config == e->core.attr.config)) in evsel_match()
500 void *ptr = dfmt - dfmt->idx; in fmt_to_data_file()
510 struct hist_entry *pair; in get_pair_data() local
512 list_for_each_entry(pair, &he->pairs.head, pairs.node) in get_pair_data()
513 if (pair->hists == d->hists) in get_pair_data()
514 return pair; in get_pair_data()
523 struct data__file *d = fmt_to_data_file(&dfmt->fmt); in get_pair_fmt()
534 root = &hists->entries_collapsed; in hists__baseline_only()
536 root = hists->entries_in; in hists__baseline_only()
542 next = rb_next(&he->rb_node_in); in hists__baseline_only()
544 rb_erase_cached(&he->rb_node_in, root); in hists__baseline_only()
560 l = llabs(left->diff.cycles); in block_cycles_diff_cmp()
561 r = llabs(right->diff.cycles); in block_cycles_diff_cmp()
562 return r - l; in block_cycles_diff_cmp()
573 __hists__init(&bh->block_hists, &bh->block_list); in init_block_hist()
574 perf_hpp_list__init(&bh->block_list); in init_block_hist()
576 INIT_LIST_HEAD(&bh->block_fmt.list); in init_block_hist()
577 INIT_LIST_HEAD(&bh->block_fmt.sort_list); in init_block_hist()
578 bh->block_fmt.cmp = block_info__cmp; in init_block_hist()
579 bh->block_fmt.sort = block_sort; in init_block_hist()
580 perf_hpp_list__register_sort_field(&bh->block_list, in init_block_hist()
581 &bh->block_fmt); in init_block_hist()
582 bh->valid = true; in init_block_hist()
588 struct rb_root_cached *root = hists_pair->entries_in; in get_block_pair()
596 next = rb_next(&he_pair->rb_node_in); in get_block_pair()
615 int n = stats->n; in update_spark_value()
622 struct hist_entry *pair) in compute_cycles_diff() argument
624 pair->diff.computed = true; in compute_cycles_diff()
625 if (pair->block_info->num && he->block_info->num) { in compute_cycles_diff()
626 pair->diff.cycles = in compute_cycles_diff()
627 pair->block_info->cycles_aggr / pair->block_info->num_aggr - in compute_cycles_diff()
628 he->block_info->cycles_aggr / he->block_info->num_aggr; in compute_cycles_diff()
633 init_stats(&pair->diff.stats); in compute_cycles_diff()
634 init_spark_values(pair->diff.svals, NUM_SPARKS); in compute_cycles_diff()
636 for (int i = 0; i < pair->block_info->num; i++) { in compute_cycles_diff()
639 if (i >= he->block_info->num || i >= NUM_SPARKS) in compute_cycles_diff()
642 val = llabs(pair->block_info->cycles_spark[i] - in compute_cycles_diff()
643 he->block_info->cycles_spark[i]); in compute_cycles_diff()
645 update_spark_value(pair->diff.svals, NUM_SPARKS, in compute_cycles_diff()
646 &pair->diff.stats, val); in compute_cycles_diff()
647 update_stats(&pair->diff.stats, val); in compute_cycles_diff()
655 struct rb_root_cached *root = hists_base->entries_in; in block_hists_match()
661 struct hist_entry *pair = get_block_pair(he, hists_pair); in block_hists_match() local
663 next = rb_next(&he->rb_node_in); in block_hists_match()
665 if (pair) { in block_hists_match()
666 hist_entry__add_pair(pair, he); in block_hists_match()
667 compute_cycles_diff(he, pair); in block_hists_match()
678 root = &hists->entries_collapsed; in hists__precompute()
680 root = hists->entries_in; in hists__precompute()
685 struct hist_entry *he, *pair; in hists__precompute() local
690 next = rb_next(&he->rb_node_in); in hists__precompute()
699 pair = get_pair_data(he, d); in hists__precompute()
700 if (!pair) in hists__precompute()
706 compute_delta(he, pair); in hists__precompute()
709 compute_ratio(he, pair); in hists__precompute()
712 compute_wdiff(he, pair); in hists__precompute()
715 pair_bh = container_of(pair, struct block_hist, in hists__precompute()
718 block_info__process_sym(pair, pair_bh, NULL, 0, 0); in hists__precompute()
722 if (bh->valid && pair_bh->valid) { in hists__precompute()
723 block_hists_match(&bh->block_hists, in hists__precompute()
724 &pair_bh->block_hists); in hists__precompute()
725 hists__output_resort(&pair_bh->block_hists, in hists__precompute()
739 return -1; in cmp_doubles()
753 double l = left->diff.period_ratio_delta; in __hist_entry__cmp_compute()
754 double r = right->diff.period_ratio_delta; in __hist_entry__cmp_compute()
760 double l = fabs(left->diff.period_ratio_delta); in __hist_entry__cmp_compute()
761 double r = fabs(right->diff.period_ratio_delta); in __hist_entry__cmp_compute()
767 double l = left->diff.period_ratio; in __hist_entry__cmp_compute()
768 double r = right->diff.period_ratio; in __hist_entry__cmp_compute()
774 s64 l = left->diff.wdiff; in __hist_entry__cmp_compute()
775 s64 r = right->diff.wdiff; in __hist_entry__cmp_compute()
777 return r - l; in __hist_entry__cmp_compute()
798 return pairs_left ? -1 : 1; in hist_entry__cmp_compute()
807 return p_left ? -1 : 1; in hist_entry__cmp_compute()
829 return p_left ? -1 : 1; in hist_entry__cmp_compute_idx()
837 if (left->dummy && right->dummy) in hist_entry__cmp_compute_idx()
840 if (left->dummy || right->dummy) in hist_entry__cmp_compute_idx()
841 return left->dummy ? 1 : -1; in hist_entry__cmp_compute_idx()
859 if (left->stat.period == right->stat.period) in hist_entry__cmp_baseline()
861 return left->stat.period > right->stat.period ? 1 : -1; in hist_entry__cmp_baseline()
870 return hist_entry__cmp_compute(right, left, COMPUTE_DELTA, d->idx); in hist_entry__cmp_delta()
879 return hist_entry__cmp_compute(right, left, COMPUTE_DELTA_ABS, d->idx); in hist_entry__cmp_delta_abs()
888 return hist_entry__cmp_compute(right, left, COMPUTE_RATIO, d->idx); in hist_entry__cmp_ratio()
897 return hist_entry__cmp_compute(right, left, COMPUTE_WEIGHTED_DIFF, d->idx); in hist_entry__cmp_wdiff()
956 d->idx, d->data.path, in data__fprintf()
957 !d->idx ? "(Baseline)" : ""); in data__fprintf()
964 struct evlist *evlist_base = data__files[0].session->evlist; in data_process()
974 struct evlist *evlist = d->session->evlist; in data_process()
983 d->hists = hists; in data_process()
1012 struct evlist *evlist_base = data_base->session->evlist; in process_base_stream()
1013 struct evlist *evlist_pair = data_pair->session->evlist; in process_base_stream()
1022 es_base = evsel_streams__entry(data_base->evlist_streams, in process_base_stream()
1025 return -1; in process_base_stream()
1027 es_pair = evsel_streams__entry(data_pair->evlist_streams, in process_base_stream()
1030 return -1; in process_base_stream()
1054 if (d->evlist_streams) in data__free()
1055 evlist_streams__delete(d->evlist_streams); in data__free()
1058 struct diff_hpp_fmt *fmt = &d->fmt[col]; in data__free()
1060 zfree(&fmt->header); in data__free()
1071 return -ENOMEM; in abstime_str_dup()
1091 return -EINVAL; in parse_absolute_time()
1098 return -EINVAL; in parse_absolute_time()
1102 ret = perf_time__parse_for_ranges(*pstr, d->session, in parse_absolute_time()
1121 ret = perf_time__parse_for_ranges(pdiff.time_str, d->session, in parse_percent_time()
1148 d->session = perf_session__new(&d->data, &pdiff.tool); in check_file_brstack()
1149 if (IS_ERR(d->session)) { in check_file_brstack()
1150 pr_err("Failed to open %s\n", d->data.path); in check_file_brstack()
1151 return PTR_ERR(d->session); in check_file_brstack()
1154 has_br_stack = perf_header__has_feat(&d->session->header, in check_file_brstack()
1156 perf_session__delete(d->session); in check_file_brstack()
1177 ret = -EINVAL; in __cmd_diff()
1180 d->session = perf_session__new(&d->data, &pdiff.tool); in __cmd_diff()
1181 if (IS_ERR(d->session)) { in __cmd_diff()
1182 ret = PTR_ERR(d->session); in __cmd_diff()
1183 pr_err("Failed to open %s\n", d->data.path); in __cmd_diff()
1194 ret = perf_session__cpu_bitmap(d->session, cpu_list, in __cmd_diff()
1200 ret = perf_session__process_events(d->session); in __cmd_diff()
1202 pr_err("Failed to process %s\n", d->data.path); in __cmd_diff()
1206 evlist__collapse_resort(d->session->evlist); in __cmd_diff()
1212 d->evlist_streams = evlist__create_streams( in __cmd_diff()
1213 d->session->evlist, 5); in __cmd_diff()
1214 if (!d->evlist_streams) { in __cmd_diff()
1215 ret = -ENOMEM; in __cmd_diff()
1228 if (!IS_ERR(d->session)) in __cmd_diff()
1229 perf_session__delete(d->session); in __cmd_diff()
1253 OPT_BOOLEAN('b', "baseline-only", &show_baseline_only,
1256 "delta,delta-abs,ratio,wdiff:w1,w2 (default delta-abs),cycles",
1257 "Entries differential computation selection",
1263 OPT_BOOLEAN(0, "cycles-hist", &cycles_hist,
1265 "- WARNING: use only with -c cycles."),
1266 OPT_BOOLEAN('D', "dump-raw-trace", &dump_trace,
1272 "load module symbols - WARNING: use only with -k and LIVE kernel"),
1282 OPT_STRING_NOEMPTY('t', "field-separator", &symbol_conf.field_sep, "separator",
1305 u64 total = hists__total_period(he->hists); in baseline_percent()
1307 return 100.0 * he->stat.period / total; in baseline_percent()
1318 if (!he->dummy) { in hpp__color_baseline()
1319 scnprintf(pfmt, 20, "%%%d.2f%%%%", dfmt->header_width - 1); in hpp__color_baseline()
1320 return percent_color_snprintf(hpp->buf, hpp->size, in hpp__color_baseline()
1323 return scnprintf(hpp->buf, hpp->size, "%*s", in hpp__color_baseline()
1324 dfmt->header_width, pfmt); in hpp__color_baseline()
1333 if (!he->dummy) in hpp__entry_baseline()
1339 static int cycles_printf(struct hist_entry *he, struct hist_entry *pair, in cycles_printf() argument
1343 struct block_hist *bh_pair = container_of(pair, struct block_hist, he); in cycles_printf()
1349 block_he = hists__get_entry(&bh_pair->block_hists, bh->block_idx); in cycles_printf()
1351 hpp->skip = true; in cycles_printf()
1360 bi = block_he->block_info; in cycles_printf()
1362 start_line = map__srcline(he->ms.map, bi->sym->start + bi->start, in cycles_printf()
1363 he->ms.sym); in cycles_printf()
1365 end_line = map__srcline(he->ms.map, bi->sym->start + bi->end, in cycles_printf()
1366 he->ms.sym); in cycles_printf()
1370 scnprintf(buf, sizeof(buf), "[%s -> %s] %4ld", in cycles_printf()
1371 start_line, end_line, block_he->diff.cycles); in cycles_printf()
1373 scnprintf(buf, sizeof(buf), "[%7lx -> %7lx] %4ld", in cycles_printf()
1374 bi->start, bi->end, block_he->diff.cycles); in cycles_printf()
1380 return scnprintf(hpp->buf, hpp->size, "%*s", width, buf); in cycles_printf()
1389 struct hist_entry *pair = get_pair_fmt(he, dfmt); in __hpp__color_compare() local
1394 if (!pair) { in __hpp__color_compare()
1399 if (bh->block_idx) in __hpp__color_compare()
1400 hpp->skip = true; in __hpp__color_compare()
1408 if (pair->diff.computed) in __hpp__color_compare()
1409 diff = pair->diff.period_ratio_delta; in __hpp__color_compare()
1411 diff = compute_delta(he, pair); in __hpp__color_compare()
1413 scnprintf(pfmt, 20, "%%%+d.2f%%%%", dfmt->header_width - 1); in __hpp__color_compare()
1414 return percent_color_snprintf(hpp->buf, hpp->size, in __hpp__color_compare()
1417 if (he->dummy) in __hpp__color_compare()
1419 if (pair->diff.computed) in __hpp__color_compare()
1420 diff = pair->diff.period_ratio; in __hpp__color_compare()
1422 diff = compute_ratio(he, pair); in __hpp__color_compare()
1424 scnprintf(pfmt, 20, "%%%d.6f", dfmt->header_width); in __hpp__color_compare()
1425 return value_color_snprintf(hpp->buf, hpp->size, in __hpp__color_compare()
1428 if (he->dummy) in __hpp__color_compare()
1430 if (pair->diff.computed) in __hpp__color_compare()
1431 wdiff = pair->diff.wdiff; in __hpp__color_compare()
1433 wdiff = compute_wdiff(he, pair); in __hpp__color_compare()
1435 scnprintf(pfmt, 20, "%%14ld", dfmt->header_width); in __hpp__color_compare()
1436 return color_snprintf(hpp->buf, hpp->size, in __hpp__color_compare()
1440 return cycles_printf(he, pair, hpp, dfmt->header_width); in __hpp__color_compare()
1445 return scnprintf(hpp->buf, hpp->size, "%*s", in __hpp__color_compare()
1446 dfmt->header_width, "N/A"); in __hpp__color_compare()
1448 return scnprintf(hpp->buf, hpp->size, "%*s", in __hpp__color_compare()
1449 dfmt->header_width, pfmt); in __hpp__color_compare()
1499 printed += scnprintf(bf + printed, size - printed, " "); in print_cycles_spark()
1508 struct hist_entry *pair = get_pair_fmt(he, dfmt); in hpp__color_cycles_hist() local
1516 if (!pair) { in hpp__color_cycles_hist()
1517 if (bh->block_idx) in hpp__color_cycles_hist()
1518 hpp->skip = true; in hpp__color_cycles_hist()
1523 bh_pair = container_of(pair, struct block_hist, he); in hpp__color_cycles_hist()
1525 block_he = hists__get_entry(&bh_pair->block_hists, bh->block_idx); in hpp__color_cycles_hist()
1527 hpp->skip = true; in hpp__color_cycles_hist()
1531 ret = print_cycles_spark(spark, sizeof(spark), block_he->diff.svals, in hpp__color_cycles_hist()
1532 block_he->diff.stats.n); in hpp__color_cycles_hist()
1534 r = rel_stddev_stats(stddev_stats(&block_he->diff.stats), in hpp__color_cycles_hist()
1535 avg_stats(&block_he->diff.stats)); in hpp__color_cycles_hist()
1542 pad = NUM_SPARKS - ((ret - 1) / 3); in hpp__color_cycles_hist()
1544 ret = scnprintf(hpp->buf, hpp->size, "%*s", in hpp__color_cycles_hist()
1545 dfmt->header_width, buf); in hpp__color_cycles_hist()
1548 ret += scnprintf(hpp->buf + ret, hpp->size - ret, in hpp__color_cycles_hist()
1549 "%-*s", pad, " "); in hpp__color_cycles_hist()
1556 return scnprintf(hpp->buf, hpp->size, "%*s", in hpp__color_cycles_hist()
1557 dfmt->header_width, " "); in hpp__color_cycles_hist()
1565 scnprintf(buf, size, "%" PRIu64, he->stat.period); in hpp__entry_unpair()
1574 hpp__entry_pair(struct hist_entry *he, struct hist_entry *pair, in hpp__entry_pair() argument
1584 if (pair->diff.computed) in hpp__entry_pair()
1585 diff = pair->diff.period_ratio_delta; in hpp__entry_pair()
1587 diff = compute_delta(he, pair); in hpp__entry_pair()
1594 if (he->dummy) { in hpp__entry_pair()
1599 if (pair->diff.computed) in hpp__entry_pair()
1600 ratio = pair->diff.period_ratio; in hpp__entry_pair()
1602 ratio = compute_ratio(he, pair); in hpp__entry_pair()
1610 if (he->dummy) { in hpp__entry_pair()
1615 if (pair->diff.computed) in hpp__entry_pair()
1616 wdiff = pair->diff.wdiff; in hpp__entry_pair()
1618 wdiff = compute_wdiff(he, pair); in hpp__entry_pair()
1625 formula_fprintf(he, pair, buf, size); in hpp__entry_pair()
1629 scnprintf(buf, size, "%" PRIu64, pair->stat.period); in hpp__entry_pair()
1641 struct hist_entry *pair = get_pair_fmt(he, dfmt); in __hpp__entry_global() local
1642 int idx = dfmt->idx; in __hpp__entry_global()
1648 if (pair) in __hpp__entry_global()
1649 hpp__entry_pair(he, pair, idx, buf, size); in __hpp__entry_global()
1665 return scnprintf(hpp->buf, hpp->size, "%s", buf); in hpp__entry_global()
1667 return scnprintf(hpp->buf, hpp->size, "%*s", in hpp__entry_global()
1668 dfmt->header_width, buf); in hpp__entry_global()
1679 BUG_ON(!dfmt->header); in hpp__header()
1680 return scnprintf(hpp->buf, hpp->size, dfmt->header); in hpp__header()
1690 BUG_ON(dfmt->header_width <= 0); in hpp__width()
1691 return dfmt->header_width; in hpp__width()
1702 BUG_ON(dfmt->idx >= PERF_HPP_DIFF__MAX_INDEX); in init_header()
1703 header = columns[dfmt->idx].name; in init_header()
1704 width = columns[dfmt->idx].width; in init_header()
1710 scnprintf(buf, MAX_HEADER_NAME, "%s/%d", header, d->idx); in init_header()
1713 dfmt->header_width = width; in init_header()
1715 if (dfmt->header_width < width) in init_header()
1716 dfmt->header_width = width; in init_header()
1719 dfmt->header_width, NAME); in init_header()
1721 dfmt->header = strdup(buf_indent); in init_header()
1728 struct diff_hpp_fmt *dfmt = &d->fmt[idx]; in data__hpp_register()
1729 struct perf_hpp_fmt *fmt = &dfmt->fmt; in data__hpp_register()
1731 dfmt->idx = idx; in data__hpp_register()
1733 fmt->header = hpp__header; in data__hpp_register()
1734 fmt->width = hpp__width; in data__hpp_register()
1735 fmt->entry = hpp__entry_global; in data__hpp_register()
1736 fmt->cmp = hist_entry__cmp_nop; in data__hpp_register()
1737 fmt->collapse = hist_entry__cmp_nop; in data__hpp_register()
1742 fmt->color = hpp__color_baseline; in data__hpp_register()
1743 fmt->sort = hist_entry__cmp_baseline; in data__hpp_register()
1746 fmt->color = hpp__color_delta; in data__hpp_register()
1747 fmt->sort = hist_entry__cmp_delta; in data__hpp_register()
1750 fmt->color = hpp__color_ratio; in data__hpp_register()
1751 fmt->sort = hist_entry__cmp_ratio; in data__hpp_register()
1754 fmt->color = hpp__color_wdiff; in data__hpp_register()
1755 fmt->sort = hist_entry__cmp_wdiff; in data__hpp_register()
1758 fmt->color = hpp__color_delta; in data__hpp_register()
1759 fmt->sort = hist_entry__cmp_delta_abs; in data__hpp_register()
1762 fmt->color = hpp__color_cycles; in data__hpp_register()
1763 fmt->sort = hist_entry__cmp_nop; in data__hpp_register()
1766 fmt->color = hpp__color_cycles_hist; in data__hpp_register()
1767 fmt->sort = hist_entry__cmp_nop; in data__hpp_register()
1770 fmt->sort = hist_entry__cmp_nop; in data__hpp_register()
1825 * Note that this column (data) can be compared twice - one in ui_init()
1834 return -1; in ui_init()
1837 fmt->cmp = hist_entry__cmp_nop; in ui_init()
1838 fmt->collapse = hist_entry__cmp_nop; in ui_init()
1842 fmt->sort = hist_entry__cmp_delta_idx; in ui_init()
1845 fmt->sort = hist_entry__cmp_ratio_idx; in ui_init()
1848 fmt->sort = hist_entry__cmp_wdiff_idx; in ui_init()
1851 fmt->sort = hist_entry__cmp_delta_abs_idx; in ui_init()
1855 * Should set since 'fmt->sort' is called without in ui_init()
1858 fmt->sort = hist_entry__cmp_nop; in ui_init()
1894 return -EINVAL; in data_init()
1899 return -ENOMEM; in data_init()
1902 struct perf_data *data = &d->data; in data_init()
1904 data->path = use_default ? defaults[i] : argv[i]; in data_init()
1905 data->mode = PERF_DATA_MODE_READ; in data_init()
1906 data->force = force; in data_init()
1908 d->idx = i; in data_init()
1920 return -1; in diff__config()
1927 } else if (!strcmp(value, "delta-abs")) { in diff__config()
1935 return -1; in diff__config()
1977 return -1; in cmd_diff()
1980 return -1; in cmd_diff()
1983 return -1; in cmd_diff()
1987 return -1; in cmd_diff()
2001 return -1; in cmd_diff()