обработка данных трассировки с помощью скрипта Python (Process trace data with a Python script)
STARTER SCRIPTS
You can quickly get started writing a script for a particular set
of trace data by generating a skeleton script using perf script
-g python in the same directory as an existing perf.data trace
file. That will generate a starter script containing a handler
for each of the event types in the trace file; it simply prints
every available field for each event in the trace file.
You can also look at the existing scripts in
~/libexec/perf-core/scripts/python for typical examples showing
how to do basic things like aggregate event data, print results,
etc. Also, the check-perf-script.py script, while not interesting
for its results, attempts to exercise all of the main scripting
features.