aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/util/python.c
diff options
context:
space:
mode:
authorIan Rogers <[email protected]>2025-02-28 22:23:04 +0000
committerNamhyung Kim <[email protected]>2025-03-12 01:55:37 +0000
commit07fc231617378bd74b54661615a3e4772b514ed1 (patch)
tree2c050ff2ff170d01652882dfa094f6f09a1da9b1 /tools/perf/util/python.c
parentperf python: Add optional cpus and threads arguments to parse_events (diff)
downloadkernel-07fc231617378bd74b54661615a3e4772b514ed1.tar.gz
kernel-07fc231617378bd74b54661615a3e4772b514ed1.zip
perf python: Update ungrouped evsel leader in clone
evsels are cloned in the python code as they form part of the Python object pyrf_evsel. The cloning doesn't update the evsel's leader, do this for the case of an evsel being ungrouped. Reviewed-by: Howard Chu <[email protected]> Signed-off-by: Ian Rogers <[email protected]> Reviewed-by: Arnaldo Carvalho de Melo <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Namhyung Kim <[email protected]>
Diffstat (limited to 'tools/perf/util/python.c')
-rw-r--r--tools/perf/util/python.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/tools/perf/util/python.c b/tools/perf/util/python.c
index 4a3015e7dc83..e244cc74f16d 100644
--- a/tools/perf/util/python.c
+++ b/tools/perf/util/python.c
@@ -1312,6 +1312,8 @@ static PyObject *pyrf_evsel__from_evsel(struct evsel *evsel)
evsel__init(&pevsel->evsel, &evsel->core.attr, evsel->core.idx);
evsel__clone(&pevsel->evsel, evsel);
+ if (evsel__is_group_leader(evsel))
+ evsel__set_leader(&pevsel->evsel, &pevsel->evsel);
return (PyObject *)pevsel;
}