public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/5] perf script python: Provide sample dict to all handlers
@ 2017-07-21 22:04 Arun Kalyanasundaram
  2017-07-21 22:04 ` [PATCH v2 1/5] perf script python: Allocate memory only if handler exists Arun Kalyanasundaram
                   ` (5 more replies)
  0 siblings, 6 replies; 12+ messages in thread
From: Arun Kalyanasundaram @ 2017-07-21 22:04 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo, linux-kernel
  Cc: Peter Zijlstra, Ingo Molnar, Alexander Shishkin,
	Arun Kalyanasundaram, Jiri Olsa, Daniel Borkmann,
	David S . Miller, SeongJae Park, davidcc, Stephane Eranian

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(-)

-- 
2.14.0.rc0.284.gd933b75aa4-goog

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

end of thread, other threads:[~2017-07-26 17:30 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-07-21 22:04 [PATCH v2 0/5] perf script python: Provide sample dict to all handlers Arun Kalyanasundaram
2017-07-21 22:04 ` [PATCH v2 1/5] perf script python: Allocate memory only if handler exists Arun Kalyanasundaram
2017-07-26 17:24   ` [tip:perf/core] " tip-bot for Arun Kalyanasundaram
2017-07-21 22:04 ` [PATCH v2 2/5] perf script python: Refactor creation of perf sample dict Arun Kalyanasundaram
2017-07-26 17:24   ` [tip:perf/core] " tip-bot for Arun Kalyanasundaram
2017-07-21 22:04 ` [PATCH v2 3/5] perf script python: Add sample_read to dict Arun Kalyanasundaram
2017-07-26 17:25   ` [tip:perf/core] " tip-bot for Arun Kalyanasundaram
2017-07-21 22:04 ` [PATCH v2 4/5] perf script python: Add perf_sample dict to tracepoint handlers Arun Kalyanasundaram
2017-07-26 17:25   ` [tip:perf/core] " tip-bot for Arun Kalyanasundaram
2017-07-21 22:04 ` [PATCH v2 5/5] perf script python: Generate hooks with additional argument Arun Kalyanasundaram
2017-07-26 17:25   ` [tip:perf/core] " tip-bot for Arun Kalyanasundaram
2017-07-24 13:28 ` [PATCH v2 0/5] perf script python: Provide sample dict to all handlers Jiri Olsa

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