summaryrefslogtreecommitdiffstats
path: root/tools/perf/scripts/python/parallel-perf.py
diff options
context:
space:
mode:
authorIan Rogers <irogers@google.com>2025-11-11 13:21:54 -0800
committerNamhyung Kim <namhyung@kernel.org>2025-11-11 16:48:35 -0800
commit3622990efaab066897a2c570b6e90f4b9f30b200 (patch)
treecfa9a01b6269bec9d5a7cc7b6cc0363c5e1651f3 /tools/perf/scripts/python/parallel-perf.py
parent2dfc0cab3da4a2054468489cc140b2bd539ce626 (diff)
downloadlinux-3622990efaab066897a2c570b6e90f4b9f30b200.tar.gz
linux-3622990efaab066897a2c570b6e90f4b9f30b200.zip
perf script: Change metric format to use json metrics
The metric format option isn't properly supported. This change improves that by making the sample events update the counts of an evsel, where the shadow metric code expects to read the values. To support printing metrics, metrics need to be found. This is done on the first attempt to print a metric. Every metric is parsed and then the evsels in the metric's evlist compared to those in perf script using the perf_event_attr type and config. If the metric matches then it is added for printing. As an event in the perf script's evlist may have >1 metric id, or different leader for aggregation, the first metric matched will be displayed in those cases. An example use is: ``` $ perf record -a -e '{instructions,cpu-cycles}:S' -a -- sleep 1 $ perf script -F period,metric ... 867817 metric: 0.30 insn per cycle 125394 metric: 0.04 insn per cycle 313516 metric: 0.11 insn per cycle metric: 1.00 insn per cycle ``` Signed-off-by: Ian Rogers <irogers@google.com> Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Diffstat (limited to 'tools/perf/scripts/python/parallel-perf.py')
0 files changed, 0 insertions, 0 deletions