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: In str(evsel) use the evsel__pmu_name helper

The evsel__pmu_name helper will internally use evsel__find_pmu that
handles legacy events, extended types, etc. in determining a PMU and
will provide a better value than just trying to access the PMU's name
directly as the PMU may not have been computed.

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

authored by

Ian Rogers and committed by
Namhyung Kim
7d5b635d 5c255832

+1 -4
+1 -4
tools/perf/util/python.c
··· 925 925 struct pyrf_evsel *pevsel = (void *)self; 926 926 struct evsel *evsel = &pevsel->evsel; 927 927 928 - if (!evsel->pmu) 929 - return PyUnicode_FromFormat("evsel(%s)", evsel__name(evsel)); 930 - 931 - return PyUnicode_FromFormat("evsel(%s/%s/)", evsel->pmu->name, evsel__name(evsel)); 928 + return PyUnicode_FromFormat("evsel(%s/%s/)", evsel__pmu_name(evsel), evsel__name(evsel)); 932 929 } 933 930 934 931 static PyMethodDef pyrf_evsel__methods[] = {