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

Configure Feed

Select the types of activity you want to include in your feed.

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 <howardchu95@gmail.com>
Signed-off-by: Ian Rogers <irogers@google.com>
Reviewed-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Link: https://lore.kernel.org/r/20250228222308.626803-8-irogers@google.com
Signed-off-by: Namhyung Kim <namhyung@kernel.org>

authored by

Ian Rogers and committed by
Namhyung Kim
07fc2316 6c62403b

+2
+2
tools/perf/util/python.c
··· 1312 1312 evsel__init(&pevsel->evsel, &evsel->core.attr, evsel->core.idx); 1313 1313 1314 1314 evsel__clone(&pevsel->evsel, evsel); 1315 + if (evsel__is_group_leader(evsel)) 1316 + evsel__set_leader(&pevsel->evsel, &pevsel->evsel); 1315 1317 return (PyObject *)pevsel; 1316 1318 } 1317 1319