Skip to content

perf script python: Provide sample dict to all handlers

Arun Kalyanasundaram lkml 2 versions In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest5 patches 1 replyIn review
  2. v15 patches 4 repliesSuperseded

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5perf script python: Allocate memory only if handler existstools/perf/util/scripting-engines/trace-event-python.c+22 -160 replies
2/5perf script python: Refactor creation of perf sample dicttools/perf/util/scripting-engines/trace-event-python.c+53 -410 replies
3/5perf script python: Add sample_read to dicttools/perf/util/scripting-engines/trace-event-python.c+51 -00 replies
4/5perf script python: Add perf_sample dict to tracepoint handlerstools/perf/util/scripting-engines/trace-event-python.c+40 -10 replies
5/5perf script python: Generate hooks with additional argumenttools/perf/util/scripting-engines/trace-event-python.c+18 -40 replies

Reviews trailers per patch

None of the 5 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchJiri Olsa
SeriesA-b
1/5
2/5
3/5
4/5
5/5

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH v2 0/5] perf script python: Provide sample dict to all handlers

v2: - Add sample_read struct to the dict (in 3/5).
- Increase reference count of callchain in process tracepoint to avoid unnecessary garbage collection (in 4/5).

The process_event python hook receives a dict with most perf_sample entries.

Other handlers (e.g. trace_unhandled, python_process_tracepoint) predate the introduction of this dict and do not receive it. This patch series adds the dict to all handlers, aiming to unify the information passed to them.

This change adds an additional argument to the affected handlers. To keep backwards compatibility (and avoid unnecessary work), do not pass the aforementioned dict if the number of arguments signals that handler version predates this change.

In addition, provide time_enabled, time_running and counter value in the perf_sample dict.

Initial Discussion: https://lkml.org/lkml/2017/7/1/108

Arun Kalyanasundaram (5):
perf script python: Allocate memory only if handler exists perf script python: Refactor creation of perf sample dict perf script python: Add sample_read to dict
perf script python: Add perf_sample dict to tracepoint handlers perf script python: Generate hooks with additional argument

 .../util/scripting-engines/trace-event-python.c    | 246 +++++++++++++++------
 1 file changed, 184 insertions(+), 62 deletions(-)
Signature · 1 line
2.14.0.rc0.284.gd933b75aa4-goog