The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH 0/1] tools: perf: Expose sample ID / stream ID to python scripts
@ 2024-01-23 10:31 Ben Gainey
  2024-01-23 10:31 ` [PATCH 1/1] " Ben Gainey
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Ben Gainey @ 2024-01-23 10:31 UTC (permalink / raw)
  To: linux-perf-users, linux-kernel, linux-arm-kernel
  Cc: peterz, mingo, acme, mark.rutland, alexander.shishkin, jolsa,
	namhyung, irogers, adrian.hunter, will, Ben Gainey

This patch modifies the perf python scripting engine so that the ID and
STREAM_ID are exposed as part of the sample so that they may be
correlated to the corresponding throttle/unthrottle event (for example).

NB: For scripts where perf_db_export_mode = True, this may be a breaking
change depending on how the script is constructed. Each field is passed
to `sample_table` as an argument so any script that is written as:

    def sample_table(db_id, evsel_id, machine_id, ..., cyc_cnt, flags)

will now fail due to the changed number of arguments with:

    TypeError: sample_table() takes 25 positional arguments but 27 were given

Scripts that use:

    def sample_table(*args)

or some variation thereof will not be affected.

When `perf_db_export_mode = False`, the script should be unaffected as
all the arguments are inserted into a dictionary.

The export-to-xxx.py scripts use the (..., *x) form so are not affected.


Ben Gainey (1):
  tools: perf: Expose sample ID / stream ID to python scripts

 tools/perf/Documentation/perf-script-python.txt        | 4 ++--
 tools/perf/util/scripting-engines/trace-event-python.c | 8 +++++++-
 2 files changed, 9 insertions(+), 3 deletions(-)

-- 
2.43.0


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2024-02-06  0:19 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-23 10:31 [PATCH 0/1] tools: perf: Expose sample ID / stream ID to python scripts Ben Gainey
2024-01-23 10:31 ` [PATCH 1/1] " Ben Gainey
2024-01-23 11:04   ` Adrian Hunter
2024-01-23 11:24     ` Ben Gainey
2024-02-02 17:05   ` Adrian Hunter
2024-01-23 11:32 ` [PATCH 0/1] " Adrian Hunter
2024-02-03  1:54 ` Namhyung Kim
2024-02-06  0:19 ` Namhyung Kim

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox