perf script python: Add perf_sample dict to tracepoint handlers
authorArun Kalyanasundaram <arunkaly@google.com>
Fri, 21 Jul 2017 22:04:21 +0000 (15:04 -0700)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Wed, 26 Jul 2017 01:43:20 +0000 (22:43 -0300)
commitf38d281663b011d1d8a1b0119bb8357706d134a8
tree5a33f1bf722a5a1b4bd33faed9c2cbcf66d9d59f
parent74ec14f3893c3065053b91cec850cffa2d565e0a
perf script python: Add perf_sample dict to tracepoint handlers

The process_event python hook receives a dict with all perf_sample
entries, but the tracepoint specific and trace_unhandled hooks predate
the introduction of this dict, and do not receive it.

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

Signed-off-by: Arun Kalyanasundaram <arunkaly@google.com>
Acked-by: Jiri Olsa <jolsa@kernel.org>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Daniel Borkmann <daniel@iogearbox.net>
Cc: David Carrillo-Cisneros <davidcc@google.com>
Cc: David S. Miller <davem@davemloft.net>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Seongjae Park <sj38.park@gmail.com>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/r/20170721220422.63962-5-arunkaly@google.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/util/scripting-engines/trace-event-python.c