linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCHv2 0/3] perf python: Add support to access tracepoint fields
@ 2016-07-15  7:29 Jiri Olsa
  2016-07-15  7:29 ` [PATCH 1/3] perf script python: Fix string vs byte array resolving Jiri Olsa
                   ` (2 more replies)
  0 siblings, 3 replies; 18+ messages in thread
From: Jiri Olsa @ 2016-07-15  7:29 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: Steven Rostedt (Red Hat),
	Jiri Pirko, Songshan Gong, lkml, David Ahern, Ingo Molnar,
	Namhyung Kim, Peter Zijlstra

hi,
adding support to access tracepoint fields in python scripts.

v2 changes:
  - most of the patches is already pulled in,
    this is just leftover
  - fixed is_printable_array [Steven]
  - making is_printable_array global
  - attached unrelated fix 3/3

With this patchset it's possible to access tracepoint fields
in event python object like:

  print "time %u prev_comm=%s prev_pid=%d prev_prio=%d prev_state=0x%x ==> next_comm=%s next_pid=%d next_prio=%d" % (
         event.sample_time,
         event.prev_comm,
         event.prev_pid,
         event.prev_prio,
         event.prev_state,
         event.next_comm,
         event.next_pid,
         event.next_prio)

Also available in:
  git://git.kernel.org/pub/scm/linux/kernel/git/jolsa/perf.git
  perf/fixes

thanks,
jirka


Cc: Steven Rostedt (Red Hat) <rostedt@goodmis.org>
Cc: Jiri Pirko <jiri@mellanox.com>
Cc: Songshan Gong <gongss@linux.vnet.ibm.com>
---
Jiri Olsa (3):
      perf script python: Fix string vs byte array resolving
      perf tools: Make is_printable_array global
      tools lib api fs: Use base 0 in filename__read_ull

 tools/lib/api/fs/fs.c                                  |  7 ++++++-
 tools/perf/util/python.c                               | 12 ------------
 tools/perf/util/scripting-engines/trace-event-python.c | 25 ++++++++++++++++++-------
 tools/perf/util/util.c                                 | 14 ++++++++++++++
 tools/perf/util/util.h                                 |  1 +
 5 files changed, 39 insertions(+), 20 deletions(-)

^ permalink raw reply	[flat|nested] 18+ messages in thread
* [PATCHv3 0/3] perf python: Add support to access tracepoint fields
@ 2016-07-16 16:11 Jiri Olsa
  2016-07-16 16:11 ` [PATCH 1/3] perf script python: Fix string vs byte array resolving Jiri Olsa
  0 siblings, 1 reply; 18+ messages in thread
From: Jiri Olsa @ 2016-07-16 16:11 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: lkml, David Ahern, Ingo Molnar, Namhyung Kim, Peter Zijlstra,
	Steven Rostedt (Red Hat),
	Jiri Pirko

hi,
adding support to access tracepoint fields in python scripts.

v3 changes:
  - once again fixed is_printable_array [Steven]
  - patch 3/3 already merged
  - added new patch 3/3 with automated test for is_printable_array

v2 changes:
  - most of the patches is already pulled in,
    this is just leftover
  - fixed is_printable_array [Steven]
  - making is_printable_array global
  - attached unrelated fix 3/3

With this patchset it's possible to access tracepoint fields
in event python object like:

  print "time %u prev_comm=%s prev_pid=%d prev_prio=%d prev_state=0x%x ==> next_comm=%s next_pid=%d next_prio=%d" % (
         event.sample_time,
         event.prev_comm,
         event.prev_pid,
         event.prev_prio,
         event.prev_state,
         event.next_comm,
         event.next_pid,
         event.next_prio)

Also available in:
  git://git.kernel.org/pub/scm/linux/kernel/git/jolsa/perf.git
  perf/fixes

thanks,
jirka

---
Jiri Olsa (3):
      perf script python: Fix string vs byte array resolving
      perf tools: Make is_printable_array global
      perf tests: Add is_printable_array test

 tools/perf/tests/Build                                 |  1 +
 tools/perf/tests/builtin-test.c                        |  4 ++++
 tools/perf/tests/is_printable_array.c                  | 36 ++++++++++++++++++++++++++++++++++++
 tools/perf/tests/tests.h                               |  1 +
 tools/perf/util/python.c                               | 12 ------------
 tools/perf/util/scripting-engines/trace-event-python.c | 25 ++++++++++++++++++-------
 tools/perf/util/util.c                                 | 16 ++++++++++++++++
 tools/perf/util/util.h                                 |  1 +
 8 files changed, 77 insertions(+), 19 deletions(-)
 create mode 100644 tools/perf/tests/is_printable_array.c

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

end of thread, other threads:[~2016-07-18 12:17 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-07-15  7:29 [PATCHv2 0/3] perf python: Add support to access tracepoint fields Jiri Olsa
2016-07-15  7:29 ` [PATCH 1/3] perf script python: Fix string vs byte array resolving Jiri Olsa
2016-07-15  7:32   ` Jiri Olsa
2016-07-15 15:30   ` Steven Rostedt
2016-07-15 15:51   ` Jiri Pirko
2016-07-15 16:02     ` Steven Rostedt
2016-07-15 16:13       ` Jiri Olsa
2016-07-15 16:37         ` Arnaldo Carvalho de Melo
2016-07-15 16:38           ` Arnaldo Carvalho de Melo
2016-07-15 17:16         ` Steven Rostedt
2016-07-15 17:18   ` Steven Rostedt
2016-07-16 15:58     ` Jiri Olsa
2016-07-15  7:29 ` [PATCH 2/3] perf tools: Make is_printable_array global Jiri Olsa
2016-07-15 15:31   ` Steven Rostedt
2016-07-15  7:29 ` [PATCH 3/3] tools lib api fs: Use base 0 in filename__read_ull Jiri Olsa
2016-07-16 20:45   ` [tip:perf/core] " tip-bot for Jiri Olsa
2016-07-16 16:11 [PATCHv3 0/3] perf python: Add support to access tracepoint fields Jiri Olsa
2016-07-16 16:11 ` [PATCH 1/3] perf script python: Fix string vs byte array resolving Jiri Olsa
2016-07-18 11:44   ` Jiri Pirko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).