Skip to content

RFC perf tools: Add perf data CTF conversion

Jiri Olsa lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest5 patches 1 replyIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5perf tools: Add feature check for libbabeltracetools/perf/Makefile.perf tools/perf/config/Makefile tools/perf/config/feature-checks/Makefile +2 more+48 -50 replies
2/5perf tools: Add new perf data commandtools/perf/Documentation/perf-data.txt tools/perf/Makefile.perf tools/perf/builtin-data.c +3 more+117 -00 replies
3/5perf tools data: Add perf data to CTF convertion supporttools/perf/Documentation/perf-data.txt tools/perf/Documentation/perf.txt tools/perf/Makefile.perf +6 more+675 -40 replies
4/5perf tools data: Add a 'perf' prefix to the generic fieldstools/perf/util/data-bt.c+22 -200 replies
5/5perf tools data: Add tracepoint events fields CTF convertion supporttools/perf/util/data-bt.c+246 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [RFC 0/5] perf tools: Add perf data CTF conversion

hi,
this is initial post of the CTF converter for perf. Basically adding 'perf data convert' command to allow conversion of perf data file into CTF [1] data.

To convert perf data file run:

  $ perf data convert --to-ctf=./ctf-data/
  [ perf data convert: Converted 'perf.data' into CTF data './ctf-data/' ]
  [ perf data convert: Converted and wrote 11.268 MB (100230 samples) ]

To display converted CTF data run [2]:

  $ babeltrace ./ctf-data/
  [03:19:13.962125533] (+?.?????????) cycles: { }, { ip = 0xFFFFFFFF8105443A, tid = 20714, pid = 20714, period = 1 }
  [03:19:13.962130001] (+0.000004468) cycles: { }, { ip = 0xFFFFFFFF8105443A, tid = 20714, pid = 20714, period = 1 }
  [03:19:13.962131936] (+0.000001935) cycles: { }, { ip = 0xFFFFFFFF8105443A, tid = 20714, pid = 20714, period = 8 }
  [03:19:13.962133732] (+0.000001796) cycles: { }, { ip = 0xFFFFFFFF8105443A, tid = 20714, pid = 20714, period = 114 }
  [03:19:13.962135557] (+0.000001825) cycles: { }, { ip = 0xFFFFFFFF8105443A, tid = 20714, pid = 20714, period = 2087 }
  [03:19:13.962137627] (+0.000002070) cycles: { }, { ip = 0xFFFFFFFF81361938, tid = 20714, pid = 20714, period = 37582 }
  [03:19:13.962161091] (+0.000023464) cycles: { }, { ip = 0xFFFFFFFF8124218F, tid = 20714, pid = 20714, period = 600246 }
  [03:19:13.962517569] (+0.000356478) cycles: { }, { ip = 0xFFFFFFFF811A75DB, tid = 20714, pid = 20714, period = 1325731 }
  [03:19:13.969518008] (+0.007000439) cycles: { }, { ip = 0x34080917B2, tid = 20714, pid = 20714, period = 1144298 }

It has still some limitations (noted in patches), but it has reached the point of the useful perf feature. More features and supports are about to come and it'll be better to continue publicly.

Also reachable in here:
git://git.kernel.org/pub/scm/linux/kernel/git/jolsa/perf.git
perf/core_ctf_convert

thanks for comments,
jirka

[1] Common Trace Format - http://www.efficios.com/ctf
[2] babeltrace - http://www.efficios.com/babeltrace

Cc Arnaldo Carvalho de Melo <[email protected]>
Cc David Ahern <[email protected]>
Cc Dominique Toupin <[email protected]>
Cc Frederic Weisbecker <[email protected]>
Cc Jeremie Galarneau <[email protected]>
Cc Jiri Olsa <[email protected]>
Cc Mathieu Desnoyers <[email protected]>
Cc Namhyung Kim <[email protected]>
Cc Paul Mackerras <[email protected]>
Cc Peter Zijlstra <[email protected]>
Cc Sebastian Andrzej Siewior <[email protected]>
Cc Tom Zanussi <[email protected]>

---
Jiri Olsa (3):
perf tools: Add feature check for libbabeltrace perf tools: Add new perf data command
perf tools data: Add perf data to CTF convertion support

Sebastian Andrzej Siewior (2):
perf tools data: Add a 'perf' prefix to the generic fields perf tools data: Add tracepoint events fields CTF convertion support

 tools/perf/Documentation/perf-data.txt                |  40 ++++
 tools/perf/Documentation/perf.txt                     |   7 +-
 tools/perf/Makefile.perf                              |   8 +
 tools/perf/builtin-data.c                             | 112 ++++++++++
 tools/perf/builtin.h                                  |   1 +
 tools/perf/command-list.txt                           |   1 +
 tools/perf/config/Makefile                            |  28 ++-
 tools/perf/config/feature-checks/Makefile             |  10 +-
 tools/perf/config/feature-checks/test-all.c           |   5 +
 tools/perf/config/feature-checks/test-libbabeltrace.c |   8 +
 tools/perf/perf.c                                     |   1 +
 tools/perf/util/data-bt.c                             | 859 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 tools/perf/util/data-bt.h                             |   8 +
 tools/perf/util/debug.c                               |   4 +-
 tools/perf/util/debug.h                               |   1 +
 15 files changed, 1086 insertions(+), 7 deletions(-)
 create mode 100644 tools/perf/Documentation/perf-data.txt
 create mode 100644 tools/perf/builtin-data.c
 create mode 100644 tools/perf/config/feature-checks/test-libbabeltrace.c
 create mode 100644 tools/perf/util/data-bt.c
 create mode 100644 tools/perf/util/data-bt.h