aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/util/scripting-engines/trace-event-python.c
diff options
context:
space:
mode:
authorIan Rogers <[email protected]>2025-07-19 03:05:06 +0000
committerNamhyung Kim <[email protected]>2025-07-24 20:41:35 +0000
commitbd741d80dc65922c7d6e5fd855a934f5d2cf2309 (patch)
treee2c2e9d3a5e5cc107b6b6f098383ad9f68eff417 /tools/perf/util/scripting-engines/trace-event-python.c
parentperf stat: Don't size aggregation ids from user_requested_cpus (diff)
downloadkernel-bd741d80dc65922c7d6e5fd855a934f5d2cf2309.tar.gz
kernel-bd741d80dc65922c7d6e5fd855a934f5d2cf2309.zip
perf parse-events: Allow the cpu term to be a PMU or CPU range
On hybrid systems, events like msr/tsc/ will aggregate counts across all CPUs. Often metrics only want a value like msr/tsc/ for the cores on which the metric is being computed. Listing each CPU with terms cpu=0,cpu=1.. is laborious and would need to be encoded for all variations of a CPU model. Allow the cpumask from a PMU to be an argument to the cpu term. For example in the following the cpumask of the cstate_pkg PMU selects the CPUs to count msr/tsc/ counter upon: ``` $ cat /sys/bus/event_source/devices/cstate_pkg/cpumask 0 $ perf stat -A -e 'msr/tsc,cpu=cstate_pkg/' -a sleep 0.1 Performance counter stats for 'system wide': CPU0 252,621,253 msr/tsc,cpu=cstate_pkg/ 0.101184092 seconds time elapsed ``` As the cpu term is now also allowed to be a string, allow it to encode a range of CPUs (a list can't be supported as ',' is already a special token). The "event qualifiers" section of the `perf list` man page is updated to detail the additional behavior. The man page formatting is tidied up in this section, as it was incorrectly appearing within the "parameterized events" section. Reviewed-by: Thomas Falcon <[email protected]> Signed-off-by: Ian Rogers <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Namhyung Kim <[email protected]>
Diffstat (limited to 'tools/perf/util/scripting-engines/trace-event-python.c')
0 files changed, 0 insertions, 0 deletions