Skip to content

perf python: Add support to access tracepoint fields

Jiri Olsa lkml 3 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest3 patches 5 repliesIn review
  2. v23 patches 11 repliesSuperseded
  3. v110 patches 10 repliesSuperseded

Changes in v3 from the cover letter

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

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3perf script python: Fix string vs byte array resolvingtools/perf/util/scripting-engines/trace-event-python.c+33 -61 reply
2/3perf tools: Make is_printable_array globaltools/perf/util/python.c tools/perf/util/scripting-engines/trace-event-python.c tools/perf/util/util.c +1 more+17 -281 reply
3/3perf tests: Add is_printable_array testtools/perf/tests/Build tools/perf/tests/builtin-test.c tools/perf/tests/is_printable_array.c +1 more+42 -03 replies

Reviews trailers per patch

None of the 3 patches has a Reviewed-by or Acked-by.

PatchJiri Pirko
1/3T-b
2/3T-b
3/3

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

Read the v3 thread

Cover letter [PATCHv3 0/3] perf python: Add support to access tracepoint fields

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