summaryrefslogtreecommitdiff
path: root/tools/perf/util/python.c
diff options
context:
space:
mode:
authorIan Rogers <irogers@google.com>2025-07-10 16:51:19 -0700
committerNamhyung Kim <namhyung@kernel.org>2025-07-11 12:36:40 -0700
commitfaebee18d720d9e209946ece3e468c06cf13f5ec (patch)
tree63c1843370345040bc7996ec7346ce3125374d3a /tools/perf/util/python.c
parentcb336b6aaeb44be281df9a03684ddeadd3afab60 (diff)
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>
Diffstat (limited to 'tools/perf/util/python.c')
-rw-r--r--tools/perf/util/python.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/tools/perf/util/python.c b/tools/perf/util/python.c
index 82666bcd2eda..b5ee9f7a4662 100644
--- a/tools/perf/util/python.c
+++ b/tools/perf/util/python.c
@@ -18,6 +18,7 @@
#include "strbuf.h"
#include "thread_map.h"
#include "trace-event.h"
+#include "metricgroup.h"
#include "mmap.h"
#include "util/sample.h"
#include <internal/lib.h>
@@ -1544,6 +1545,9 @@ static PyObject *pyrf_evlist__from_evlist(struct evlist *evlist)
evlist__add(&pevlist->evlist, &pevsel->evsel);
}
+ metricgroup__copy_metric_events(&pevlist->evlist, /*cgrp=*/NULL,
+ &pevlist->evlist.metric_events,
+ &evlist->metric_events);
return (PyObject *)pevlist;
}