tools: perf: Expose sample ID / stream ID to python scripts
authorBen Gainey <ben.gainey@arm.com>
Tue, 23 Jan 2024 10:31:37 +0000 (10:31 +0000)
committerNamhyung Kim <namhyung@kernel.org>
Sat, 3 Feb 2024 02:05:40 +0000 (18:05 -0800)
commitacfd65c89403f3f6478d4451d76377dd8b88bf02
tree68dd6eac1671f3c2c4b78e6c6f1fbc5f83597c7f
parentffd856537b95dd65facb4e0c78ca1cb92c2048ff
tools: perf: Expose sample ID / stream ID to python scripts

perf script exposes the evsel_name to python scripts as part of the data
passed to the sample or tracepoint handler function, and it passes the id and
stream_id to the throttled/unthrottled handler functions. This makes matching
throttle events and samples difficult.

To make this possible, this change exposes the sample id and stream_id values
to the script.

Signed-off-by: Ben Gainey <ben.gainey@arm.com>
Reviewed-by: Adrian Hunter <adrian.hunter@intel.com>
Cc: will@kernel.org
Cc: linux-arm-kernel@lists.infradead.org
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Link: https://lore.kernel.org/r/20240123103137.1890779-2-ben.gainey@arm.com
tools/perf/Documentation/perf-script-python.txt
tools/perf/util/scripting-engines/trace-event-python.c