summaryrefslogtreecommitdiff
path: root/tools/perf/python
diff options
context:
space:
mode:
authorIan Rogers <irogers@google.com>2025-10-05 21:24:09 +0300
committerNamhyung Kim <namhyung@kernel.org>2025-10-15 17:59:10 +0300
commit84bae3af20d0b6c5d23b4f7558c2eaa7d59c9157 (patch)
treeb0ff69f86cbfdf71ba642fedfa7e28716e7f256a /tools/perf/python
parent4bb55de4ff03db3e8b204c9c804cef3cad29a271 (diff)
downloadlinux-84bae3af20d0b6c5d23b4f7558c2eaa7d59c9157.tar.xz
perf pmu: Don't eagerly parse event terms
When an event/alias is created for a PMU the terms are eagerly parsed using parse_events_terms. For a command like perf stat or perf record, the particular event/alias will be found, the terms parsed, the terms cloned for use in the event parsing, and then the terms used to configure the perf_event_attr. Events/aliases may be eagerly loaded, such as from sysfs or in perf list, in which case the aliases terms will be little or never used. To avoid redundant work, to avoid cloning, and to reduce memory overhead, hold the terms for an event as a string until they need handling as a term list. This may introduce duplicate parsing if an event is repeated in a list, but this situation is expected to be uncommon. Measuring the number of instructions before and after with a sysfs event and perf stat, there is a minor reduction in the number of instructions executed by 0.3%. Tested-by: Thomas Richter <tmricht@linux.ibm.com> Signed-off-by: Ian Rogers <irogers@google.com> Tested-by: James Clark <james.clark@linaro.org> Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Diffstat (limited to 'tools/perf/python')
0 files changed, 0 insertions, 0 deletions