Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

perf stat: Move metric list from config to evlist

The rblist of metric_event that then have a list of associated
metric_expr is moved out of the stat_config and into the evlist. This
is done as part of refactoring things for python, having the state
split in two places complicates that implementation. The evlist is
doing the harder work of enabling and disabling events, the metrics
are needed to compute a value and it doesn't seem unreasonable to hang
them from the evlist.

Signed-off-by: Ian Rogers <irogers@google.com>
Link: https://lore.kernel.org/r/20250710235126.1086011-7-irogers@google.com
Signed-off-by: Namhyung Kim <namhyung@kernel.org>

authored by

Ian Rogers and committed by
Namhyung Kim
faebee18 cb336b6a

+75 -108
+1 -2
tools/perf/builtin-script.c
··· 2136 2136 perf_stat__print_shadow_stats(&stat_config, ev2, 2137 2137 evsel_script(ev2)->val, 2138 2138 sample->cpu, 2139 - &ctx, 2140 - NULL); 2139 + &ctx); 2141 2140 } 2142 2141 evsel_script(leader)->gnum = 0; 2143 2142 }
+12 -13
tools/perf/builtin-stat.c
··· 1863 1863 stat_config.metric_no_threshold, 1864 1864 stat_config.user_requested_cpu_list, 1865 1865 stat_config.system_wide, 1866 - stat_config.hardware_aware_grouping, 1867 - &stat_config.metric_events); 1866 + stat_config.hardware_aware_grouping); 1868 1867 goto out; 1869 1868 } 1870 1869 ··· 1900 1901 stat_config.metric_no_threshold, 1901 1902 stat_config.user_requested_cpu_list, 1902 1903 stat_config.system_wide, 1903 - stat_config.hardware_aware_grouping, 1904 - &stat_config.metric_events); 1904 + stat_config.hardware_aware_grouping); 1905 1905 goto out; 1906 1906 } 1907 1907 ··· 1937 1939 /*metric_no_threshold=*/true, 1938 1940 stat_config.user_requested_cpu_list, 1939 1941 stat_config.system_wide, 1940 - stat_config.hardware_aware_grouping, 1941 - &stat_config.metric_events) < 0) { 1942 + stat_config.hardware_aware_grouping) < 0) { 1942 1943 ret = -1; 1943 1944 goto out; 1944 1945 } ··· 1986 1989 /*metric_no_threshold=*/true, 1987 1990 stat_config.user_requested_cpu_list, 1988 1991 stat_config.system_wide, 1989 - stat_config.hardware_aware_grouping, 1990 - &stat_config.metric_events) < 0) { 1992 + stat_config.hardware_aware_grouping) < 0) { 1991 1993 ret = -1; 1992 1994 goto out; 1993 1995 } ··· 1995 1999 evsel->default_metricgroup = true; 1996 2000 1997 2001 evlist__splice_list_tail(evlist, &metric_evlist->core.entries); 2002 + metricgroup__copy_metric_events(evlist, /*cgrp=*/NULL, 2003 + &evlist->metric_events, 2004 + &metric_evlist->metric_events); 1998 2005 evlist__delete(metric_evlist); 1999 2006 } 2000 2007 } ··· 2052 2053 } 2053 2054 parse_events_error__exit(&err); 2054 2055 evlist__splice_list_tail(evsel_list, &evlist->core.entries); 2056 + metricgroup__copy_metric_events(evsel_list, /*cgrp=*/NULL, 2057 + &evsel_list->metric_events, 2058 + &evlist->metric_events); 2055 2059 evlist__delete(evlist); 2056 2060 return ret; 2057 2061 } ··· 2741 2739 stat_config.metric_no_threshold, 2742 2740 stat_config.user_requested_cpu_list, 2743 2741 stat_config.system_wide, 2744 - stat_config.hardware_aware_grouping, 2745 - &stat_config.metric_events); 2742 + stat_config.hardware_aware_grouping); 2746 2743 2747 2744 zfree(&metrics); 2748 2745 if (ret) { ··· 2761 2760 goto out; 2762 2761 } 2763 2762 2764 - if (evlist__expand_cgroup(evsel_list, stat_config.cgroup_list, 2765 - &stat_config.metric_events, true) < 0) { 2763 + if (evlist__expand_cgroup(evsel_list, stat_config.cgroup_list, true) < 0) { 2766 2764 parse_options_usage(stat_usage, stat_options, 2767 2765 "for-each-cgroup", 0); 2768 2766 goto out; ··· 2936 2936 2937 2937 evlist__delete(evsel_list); 2938 2938 2939 - metricgroup__rblist_exit(&stat_config.metric_events); 2940 2939 evlist__close_control(stat_config.ctl_fd, stat_config.ctl_fd_ack, &stat_config.ctl_fd_close); 2941 2940 2942 2941 return status;
+7 -17
tools/perf/tests/expand-cgroup.c
··· 13 13 #include <stdlib.h> 14 14 #include <string.h> 15 15 16 - static int test_expand_events(struct evlist *evlist, 17 - struct rblist *metric_events) 16 + static int test_expand_events(struct evlist *evlist) 18 17 { 19 18 int i, ret = TEST_FAIL; 20 19 int nr_events; ··· 46 47 was_group_event = evsel__is_group_event(evlist__first(evlist)); 47 48 nr_members = evlist__first(evlist)->core.nr_members; 48 49 49 - ret = evlist__expand_cgroup(evlist, cgrp_str, metric_events, false); 50 + ret = evlist__expand_cgroup(evlist, cgrp_str, false); 50 51 if (ret < 0) { 51 52 pr_debug("failed to expand events for cgroups\n"); 52 53 goto out; ··· 99 100 static int expand_default_events(void) 100 101 { 101 102 int ret; 102 - struct rblist metric_events; 103 103 struct evlist *evlist = evlist__new_default(); 104 104 105 105 TEST_ASSERT_VAL("failed to get evlist", evlist); 106 106 107 - rblist__init(&metric_events); 108 - ret = test_expand_events(evlist, &metric_events); 107 + ret = test_expand_events(evlist); 109 108 evlist__delete(evlist); 110 109 return ret; 111 110 } ··· 112 115 { 113 116 int ret; 114 117 struct evlist *evlist; 115 - struct rblist metric_events; 116 118 struct parse_events_error err; 117 119 const char event_str[] = "{cycles,instructions}"; 118 120 ··· 128 132 goto out; 129 133 } 130 134 131 - rblist__init(&metric_events); 132 - ret = test_expand_events(evlist, &metric_events); 135 + ret = test_expand_events(evlist); 133 136 out: 134 137 parse_events_error__exit(&err); 135 138 evlist__delete(evlist); ··· 139 144 { 140 145 int ret; 141 146 struct evlist *evlist; 142 - struct rblist metric_events; 143 147 const char event_str[] = "CYCLES"; 144 148 struct option opt = { 145 149 .value = &evlist, ··· 160 166 goto out; 161 167 } 162 168 163 - rblist__init(&metric_events); 164 - ret = test_expand_events(evlist, &metric_events); 169 + ret = test_expand_events(evlist); 165 170 out: 166 171 evlist__delete(evlist); 167 172 return ret; ··· 170 177 { 171 178 int ret; 172 179 struct evlist *evlist; 173 - struct rblist metric_events; 174 180 const char metric_str[] = "CPI"; 175 181 const struct pmu_metrics_table *pme_test; 176 182 177 183 evlist = evlist__new(); 178 184 TEST_ASSERT_VAL("failed to get evlist", evlist); 179 185 180 - rblist__init(&metric_events); 181 186 pme_test = find_core_metrics_table("testarch", "testcpu"); 182 - ret = metricgroup__parse_groups_test(evlist, pme_test, metric_str, &metric_events); 187 + ret = metricgroup__parse_groups_test(evlist, pme_test, metric_str); 183 188 if (ret < 0) { 184 189 pr_debug("failed to parse '%s' metric\n", metric_str); 185 190 goto out; 186 191 } 187 192 188 - ret = test_expand_events(evlist, &metric_events); 193 + ret = test_expand_events(evlist); 189 194 190 195 out: 191 - metricgroup__rblist_exit(&metric_events); 192 196 evlist__delete(evlist); 193 197 return ret; 194 198 }
+5 -11
tools/perf/tests/parse-metric.c
··· 45 45 } 46 46 } 47 47 48 - static double compute_single(struct rblist *metric_events, struct evlist *evlist, 49 - const char *name) 48 + static double compute_single(struct evlist *evlist, const char *name) 50 49 { 51 50 struct metric_expr *mexp; 52 51 struct metric_event *me; 53 52 struct evsel *evsel; 54 53 55 54 evlist__for_each_entry(evlist, evsel) { 56 - me = metricgroup__lookup(metric_events, evsel, false); 55 + me = metricgroup__lookup(&evlist->metric_events, evsel, false); 57 56 if (me != NULL) { 58 57 list_for_each_entry (mexp, &me->head, nd) { 59 58 if (strcmp(mexp->metric_name, name)) ··· 68 69 const char *name1, double *ratio1, 69 70 const char *name2, double *ratio2) 70 71 { 71 - struct rblist metric_events = { 72 - .nr_entries = 0, 73 - }; 74 72 const struct pmu_metrics_table *pme_test; 75 73 struct perf_cpu_map *cpus; 76 74 struct evlist *evlist; ··· 91 95 92 96 /* Parse the metric into metric_events list. */ 93 97 pme_test = find_core_metrics_table("testarch", "testcpu"); 94 - err = metricgroup__parse_groups_test(evlist, pme_test, name, 95 - &metric_events); 98 + err = metricgroup__parse_groups_test(evlist, pme_test, name); 96 99 if (err) 97 100 goto out; 98 101 ··· 104 109 105 110 /* And execute the metric */ 106 111 if (name1 && ratio1) 107 - *ratio1 = compute_single(&metric_events, evlist, name1); 112 + *ratio1 = compute_single(evlist, name1); 108 113 if (name2 && ratio2) 109 - *ratio2 = compute_single(&metric_events, evlist, name2); 114 + *ratio2 = compute_single(evlist, name2); 110 115 111 116 out: 112 117 /* ... cleanup. */ 113 - metricgroup__rblist_exit(&metric_events); 114 118 evlist__free_stats(evlist); 115 119 perf_cpu_map__put(cpus); 116 120 evlist__delete(evlist);
+2 -6
tools/perf/tests/pmu-events.c
··· 868 868 struct evlist *evlist; 869 869 struct perf_cpu_map *cpus; 870 870 struct evsel *evsel; 871 - struct rblist metric_events = { 872 - .nr_entries = 0, 873 - }; 874 871 int err = 0; 875 872 876 873 if (!pm->metric_expr) ··· 892 895 893 896 perf_evlist__set_maps(&evlist->core, cpus, NULL); 894 897 895 - err = metricgroup__parse_groups_test(evlist, table, pm->metric_name, &metric_events); 898 + err = metricgroup__parse_groups_test(evlist, table, pm->metric_name); 896 899 if (err) { 897 900 if (!strcmp(pm->metric_name, "M1") || !strcmp(pm->metric_name, "M2") || 898 901 !strcmp(pm->metric_name, "M3")) { ··· 919 922 k++; 920 923 } 921 924 evlist__for_each_entry(evlist, evsel) { 922 - struct metric_event *me = metricgroup__lookup(&metric_events, evsel, false); 925 + struct metric_event *me = metricgroup__lookup(&evlist->metric_events, evsel, false); 923 926 924 927 if (me != NULL) { 925 928 struct metric_expr *mexp; ··· 941 944 pr_debug("Broken metric %s\n", pm->metric_name); 942 945 943 946 /* ... cleanup. */ 944 - metricgroup__rblist_exit(&metric_events); 945 947 evlist__free_stats(evlist); 946 948 perf_cpu_map__put(cpus); 947 949 evlist__delete(evlist);
+8 -15
tools/perf/util/cgroup.c
··· 413 413 return !!strpbrk(str, "{}[]()|*+?^$"); 414 414 } 415 415 416 - int evlist__expand_cgroup(struct evlist *evlist, const char *str, 417 - struct rblist *metric_events, bool open_cgroup) 416 + int evlist__expand_cgroup(struct evlist *evlist, const char *str, bool open_cgroup) 418 417 { 419 418 struct evlist *orig_list, *tmp_list; 420 419 struct evsel *pos, *evsel, *leader; ··· 439 440 evlist__splice_list_tail(orig_list, &evlist->core.entries); 440 441 evlist->core.nr_entries = 0; 441 442 442 - if (metric_events) { 443 - orig_metric_events = *metric_events; 444 - rblist__init(metric_events); 445 - } else { 446 - rblist__init(&orig_metric_events); 447 - } 443 + orig_metric_events = evlist->metric_events; 444 + metricgroup__rblist_init(&evlist->metric_events); 448 445 449 446 if (has_pattern_string(str)) 450 447 prefix_len = match_cgroups(str); ··· 485 490 cgroup__put(cgrp); 486 491 nr_cgroups++; 487 492 488 - if (metric_events) { 489 - if (metricgroup__copy_metric_events(tmp_list, cgrp, 490 - metric_events, 491 - &orig_metric_events) < 0) 492 - goto out_err; 493 - } 493 + if (metricgroup__copy_metric_events(tmp_list, cgrp, 494 + &evlist->metric_events, 495 + &orig_metric_events) < 0) 496 + goto out_err; 494 497 495 498 evlist__splice_list_tail(evlist, &tmp_list->core.entries); 496 499 tmp_list->core.nr_entries = 0; ··· 505 512 out_err: 506 513 evlist__delete(orig_list); 507 514 evlist__delete(tmp_list); 508 - rblist__exit(&orig_metric_events); 515 + metricgroup__rblist_exit(&orig_metric_events); 509 516 release_cgroup_list(); 510 517 511 518 return ret;
+1 -2
tools/perf/util/cgroup.h
··· 28 28 29 29 struct cgroup *cgroup__new(const char *name, bool do_open); 30 30 struct cgroup *evlist__findnew_cgroup(struct evlist *evlist, const char *name); 31 - int evlist__expand_cgroup(struct evlist *evlist, const char *cgroups, 32 - struct rblist *metric_events, bool open_cgroup); 31 + int evlist__expand_cgroup(struct evlist *evlist, const char *cgroups, bool open_cgroup); 33 32 34 33 void evlist__set_default_cgroup(struct evlist *evlist, struct cgroup *cgroup); 35 34
+3
tools/perf/util/evlist.c
··· 35 35 #include "util/util.h" 36 36 #include "util/env.h" 37 37 #include "util/intel-tpebs.h" 38 + #include "util/metricgroup.h" 38 39 #include "util/strbuf.h" 39 40 #include <signal.h> 40 41 #include <unistd.h> ··· 84 83 evlist->ctl_fd.ack = -1; 85 84 evlist->ctl_fd.pos = -1; 86 85 evlist->nr_br_cntr = -1; 86 + metricgroup__rblist_init(&evlist->metric_events); 87 87 } 88 88 89 89 struct evlist *evlist__new(void) ··· 175 173 176 174 void evlist__exit(struct evlist *evlist) 177 175 { 176 + metricgroup__rblist_exit(&evlist->metric_events); 178 177 event_enable_timer__exit(&evlist->eet); 179 178 zfree(&evlist->mmap); 180 179 zfree(&evlist->overwrite_mmap);
+6
tools/perf/util/evlist.h
··· 12 12 #include <perf/evlist.h> 13 13 #include "events_stats.h" 14 14 #include "evsel.h" 15 + #include "rblist.h" 15 16 #include <pthread.h> 16 17 #include <signal.h> 17 18 #include <unistd.h> ··· 87 86 int pos; /* index at evlist core object to check signals */ 88 87 } ctl_fd; 89 88 struct event_enable_timer *eet; 89 + /** 90 + * @metric_events: A list of struct metric_event which each have a list 91 + * of struct metric_expr. 92 + */ 93 + struct rblist metric_events; 90 94 }; 91 95 92 96 struct evsel_str_handler {
+8 -12
tools/perf/util/metricgroup.c
··· 103 103 free(me); 104 104 } 105 105 106 - static void metricgroup__rblist_init(struct rblist *metric_events) 106 + void metricgroup__rblist_init(struct rblist *metric_events) 107 107 { 108 108 rblist__init(metric_events); 109 109 metric_events->node_cmp = metric_event_cmp; ··· 1323 1323 const char *user_requested_cpu_list, 1324 1324 bool system_wide, 1325 1325 bool fake_pmu, 1326 - struct rblist *metric_events_list, 1327 1326 const struct pmu_metrics_table *table) 1328 1327 { 1329 1328 struct evlist *combined_evlist = NULL; ··· 1332 1333 bool is_default = !strcmp(str, "Default"); 1333 1334 int ret; 1334 1335 1335 - if (metric_events_list->nr_entries == 0) 1336 - metricgroup__rblist_init(metric_events_list); 1337 1336 ret = metricgroup__add_metric_list(pmu, str, metric_no_group, metric_no_threshold, 1338 1337 user_requested_cpu_list, 1339 1338 system_wide, &metric_list, table); ··· 1422 1425 goto out; 1423 1426 } 1424 1427 1425 - me = metricgroup__lookup(metric_events_list, metric_events[0], true); 1428 + me = metricgroup__lookup(&perf_evlist->metric_events, metric_events[0], 1429 + /*create=*/true); 1426 1430 1427 1431 expr = malloc(sizeof(struct metric_expr)); 1428 1432 if (!expr) { ··· 1483 1485 bool metric_no_threshold, 1484 1486 const char *user_requested_cpu_list, 1485 1487 bool system_wide, 1486 - bool hardware_aware_grouping, 1487 - struct rblist *metric_events) 1488 + bool hardware_aware_grouping) 1488 1489 { 1489 1490 const struct pmu_metrics_table *table = pmu_metrics_table__find(); 1490 1491 ··· 1494 1497 1495 1498 return parse_groups(perf_evlist, pmu, str, metric_no_group, metric_no_merge, 1496 1499 metric_no_threshold, user_requested_cpu_list, system_wide, 1497 - /*fake_pmu=*/false, metric_events, table); 1500 + /*fake_pmu=*/false, table); 1498 1501 } 1499 1502 1500 1503 int metricgroup__parse_groups_test(struct evlist *evlist, 1501 1504 const struct pmu_metrics_table *table, 1502 - const char *str, 1503 - struct rblist *metric_events) 1505 + const char *str) 1504 1506 { 1505 1507 return parse_groups(evlist, "all", str, 1506 1508 /*metric_no_group=*/false, ··· 1507 1511 /*metric_no_threshold=*/false, 1508 1512 /*user_requested_cpu_list=*/NULL, 1509 1513 /*system_wide=*/false, 1510 - /*fake_pmu=*/true, metric_events, table); 1514 + /*fake_pmu=*/true, table); 1511 1515 } 1512 1516 1513 1517 struct metricgroup__has_metric_data { ··· 1592 1596 evsel = evlist__find_evsel(evlist, old_me->evsel->core.idx); 1593 1597 if (!evsel) 1594 1598 return -EINVAL; 1595 - new_me = metricgroup__lookup(new_metric_events, evsel, true); 1599 + new_me = metricgroup__lookup(new_metric_events, evsel, /*create=*/true); 1596 1600 if (!new_me) 1597 1601 return -ENOMEM; 1598 1602
+3 -4
tools/perf/util/metricgroup.h
··· 77 77 bool metric_no_threshold, 78 78 const char *user_requested_cpu_list, 79 79 bool system_wide, 80 - bool hardware_aware_grouping, 81 - struct rblist *metric_events); 80 + bool hardware_aware_grouping); 82 81 int metricgroup__parse_groups_test(struct evlist *evlist, 83 82 const struct pmu_metrics_table *table, 84 - const char *str, 85 - struct rblist *metric_events); 83 + const char *str); 86 84 87 85 int metricgroup__for_each_metric(const struct pmu_metrics_table *table, pmu_metric_iter_fn fn, 88 86 void *data); 89 87 bool metricgroup__has_metric_or_groups(const char *pmu, const char *metric_or_groups); 90 88 unsigned int metricgroups__topdown_max_level(void); 91 89 int arch_get_runtimeparam(const struct pmu_metric *pm); 90 + void metricgroup__rblist_init(struct rblist *metric_events); 92 91 void metricgroup__rblist_exit(struct rblist *metric_events); 93 92 94 93 int metricgroup__copy_metric_events(struct evlist *evlist, struct cgroup *cgrp,
+4
tools/perf/util/python.c
··· 18 18 #include "strbuf.h" 19 19 #include "thread_map.h" 20 20 #include "trace-event.h" 21 + #include "metricgroup.h" 21 22 #include "mmap.h" 22 23 #include "util/sample.h" 23 24 #include <internal/lib.h> ··· 1545 1544 1546 1545 evlist__add(&pevlist->evlist, &pevsel->evsel); 1547 1546 } 1547 + metricgroup__copy_metric_events(&pevlist->evlist, /*cgrp=*/NULL, 1548 + &pevlist->evlist.metric_events, 1549 + &evlist->metric_events); 1548 1550 return (PyObject *)pevlist; 1549 1551 } 1550 1552
+6 -10
tools/perf/util/stat-display.c
··· 899 899 print_noise(config, os, counter, noise, /*before_metric=*/true); 900 900 print_running(config, os, run, ena, /*before_metric=*/true); 901 901 from = perf_stat__print_shadow_stats_metricgroup(config, counter, aggr_idx, 902 - &num, from, &out, 903 - &config->metric_events); 902 + &num, from, &out); 904 903 } while (from != NULL); 905 - } else 906 - perf_stat__print_shadow_stats(config, counter, uval, aggr_idx, 907 - &out, &config->metric_events); 904 + } else { 905 + perf_stat__print_shadow_stats(config, counter, uval, aggr_idx, &out); 906 + } 908 907 } else { 909 908 pm(config, os, METRIC_THRESHOLD_UNKNOWN, /*format=*/NULL, /*unit=*/NULL, /*val=*/0); 910 909 } ··· 1015 1016 ena = aggr->counts.ena; 1016 1017 run = aggr->counts.run; 1017 1018 1018 - if (perf_stat__skip_metric_event(counter, &config->metric_events, ena, run)) 1019 + if (perf_stat__skip_metric_event(counter, ena, run)) 1019 1020 return; 1020 1021 1021 1022 if (val == 0 && should_skip_zero_counter(config, counter, &id)) ··· 1274 1275 1275 1276 os.evsel = counter; 1276 1277 1277 - perf_stat__print_shadow_stats(config, counter, 0, 1278 - 0, 1279 - &out, 1280 - &config->metric_events); 1278 + perf_stat__print_shadow_stats(config, counter, 0, 0, &out); 1281 1279 } 1282 1280 1283 1281 if (!config->json_output)
+6 -7
tools/perf/util/stat-shadow.c
··· 15 15 #include <linux/zalloc.h> 16 16 #include "iostat.h" 17 17 #include "util/hashmap.h" 18 + #include "rblist.h" 18 19 #include "tool_pmu.h" 19 20 20 21 struct stats walltime_nsecs_stats; ··· 636 635 int aggr_idx, 637 636 int *num, 638 637 void *from, 639 - struct perf_stat_output_ctx *out, 640 - struct rblist *metric_events) 638 + struct perf_stat_output_ctx *out) 641 639 { 642 640 struct metric_event *me; 643 641 struct metric_expr *mexp = from; 644 642 void *ctxp = out->ctx; 645 643 bool header_printed = false; 646 644 const char *name = NULL; 645 + struct rblist *metric_events = &evsel->evlist->metric_events; 647 646 648 647 me = metricgroup__lookup(metric_events, evsel, false); 649 648 if (me == NULL) ··· 684 683 void perf_stat__print_shadow_stats(struct perf_stat_config *config, 685 684 struct evsel *evsel, 686 685 double avg, int aggr_idx, 687 - struct perf_stat_output_ctx *out, 688 - struct rblist *metric_events) 686 + struct perf_stat_output_ctx *out) 689 687 { 690 688 typedef void (*stat_print_function_t)(struct perf_stat_config *config, 691 689 const struct evsel *evsel, ··· 735 735 } 736 736 737 737 perf_stat__print_shadow_stats_metricgroup(config, evsel, aggr_idx, 738 - &num, NULL, out, metric_events); 738 + &num, NULL, out); 739 739 740 740 if (num == 0) { 741 741 print_metric(config, ctxp, METRIC_THRESHOLD_UNKNOWN, ··· 748 748 * if it's not running or not the metric event. 749 749 */ 750 750 bool perf_stat__skip_metric_event(struct evsel *evsel, 751 - struct rblist *metric_events, 752 751 u64 ena, u64 run) 753 752 { 754 753 if (!evsel->default_metricgroup) ··· 756 757 if (!ena || !run) 757 758 return true; 758 759 759 - return !metricgroup__lookup(metric_events, evsel, false); 760 + return !metricgroup__lookup(&evsel->evlist->metric_events, evsel, false); 760 761 }
+3 -9
tools/perf/util/stat.h
··· 7 7 #include <sys/types.h> 8 8 #include <sys/resource.h> 9 9 #include "cpumap.h" 10 - #include "rblist.h" 11 10 #include "counts.h" 12 11 13 12 struct perf_cpu_map; ··· 107 108 aggr_get_id_t aggr_get_id; 108 109 struct cpu_aggr_map *cpus_aggr_map; 109 110 u64 *walltime_run; 110 - struct rblist metric_events; 111 111 int ctl_fd; 112 112 int ctl_fd_ack; 113 113 bool ctl_fd_close; ··· 185 187 void perf_stat__print_shadow_stats(struct perf_stat_config *config, 186 188 struct evsel *evsel, 187 189 double avg, int aggr_idx, 188 - struct perf_stat_output_ctx *out, 189 - struct rblist *metric_events); 190 - bool perf_stat__skip_metric_event(struct evsel *evsel, 191 - struct rblist *metric_events, 192 - u64 ena, u64 run); 190 + struct perf_stat_output_ctx *out); 191 + bool perf_stat__skip_metric_event(struct evsel *evsel, u64 ena, u64 run); 193 192 void *perf_stat__print_shadow_stats_metricgroup(struct perf_stat_config *config, 194 193 struct evsel *evsel, 195 194 int aggr_idx, 196 195 int *num, 197 196 void *from, 198 - struct perf_stat_output_ctx *out, 199 - struct rblist *metric_events); 197 + struct perf_stat_output_ctx *out); 200 198 201 199 int evlist__alloc_stats(struct perf_stat_config *config, 202 200 struct evlist *evlist, bool alloc_raw);