linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jiri Olsa <jolsa@kernel.org>
To: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: lkml <linux-kernel@vger.kernel.org>,
	David Ahern <dsahern@gmail.com>, Ingo Molnar <mingo@kernel.org>,
	Namhyung Kim <namhyung@kernel.org>,
	Peter Zijlstra <a.p.zijlstra@chello.nl>,
	"Steven Rostedt (Red Hat)" <rostedt@goodmis.org>,
	Jiri Pirko <jiri@mellanox.com>
Subject: [PATCHv3 0/3] perf python: Add support to access tracepoint fields
Date: Sat, 16 Jul 2016 18:11:17 +0200	[thread overview]
Message-ID: <1468685480-18951-1-git-send-email-jolsa@kernel.org> (raw)

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

             reply	other threads:[~2016-07-16 16:11 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-16 16:11 Jiri Olsa [this message]
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
2016-07-19  6:54   ` [tip:perf/core] " tip-bot for Jiri Olsa
2016-07-16 16:11 ` [PATCH 2/3] perf tools: Make is_printable_array global Jiri Olsa
2016-07-18 11:44   ` Jiri Pirko
2016-07-19  6:54   ` [tip:perf/core] " tip-bot for Jiri Olsa
2016-07-16 16:11 ` [PATCH 3/3] perf tests: Add is_printable_array test Jiri Olsa
2016-07-18 11:46   ` Jiri Pirko
2016-07-18 12:14     ` Jiri Olsa
2016-07-18 22:49       ` Arnaldo Carvalho de Melo
2016-07-19  6:55   ` [tip:perf/core] " tip-bot for Jiri Olsa

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1468685480-18951-1-git-send-email-jolsa@kernel.org \
    --to=jolsa@kernel.org \
    --cc=a.p.zijlstra@chello.nl \
    --cc=acme@kernel.org \
    --cc=dsahern@gmail.com \
    --cc=jiri@mellanox.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=namhyung@kernel.org \
    --cc=rostedt@goodmis.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).