linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCHv6 0/7] perf tools: Add perf data CTF conversion
@ 2015-04-18 15:50 Jiri Olsa
  2015-04-18 15:50 ` [PATCH 1/7] perf data: Show error message when conversion failed Jiri Olsa
                   ` (7 more replies)
  0 siblings, 8 replies; 29+ messages in thread
From: Jiri Olsa @ 2015-04-18 15:50 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: David Ahern, Frederic Weisbecker, He Kuang, Ingo Molnar,
	Jeremie Galarneau, Namhyung Kim, Paul Mackerras, Peter Zijlstra,
	Sebastian Andrzej Siewior, Tom Zanussi, Wang Nan, lkml

hi,
this is follow up on original RFC patchset:
  http://marc.info/?t=140732735600004&r=1&w=2

Basically we are adding 'perf data convert' command to
allow conversion of perf data file into CTF [1] data.

v6 changes:
  - first bunch of patches got accepted, adding the
    rest plus additional fixes
  - rebased to latest acme's perf/core
  - removed acked/reviewed tags from patch 2, due to small
    change - changed ctf_writer__flush_streams to return
    error value
  - it all works with recent tracecompass and libbabeltrace git tree
  - after recent changes in build system, it needs to be compiled with:
      $ make LIBBABELTRACE=1 LIBBABELTRACE_DIR=/opt/libbabeltrace/
    this will change once new version libabeltrace is released
    and adopted by common distros

v5 changes:
  - added struct field_format::alias instead of priv void*
  - rebased to latest acme's perf/core

v4 changes:
  - sorted out babeltrace new code regressions
  - rebased to latest acme's perf/core
  - includes fixes from Wang Nan, patches 9/10/11
  - patch 1/11 changelog updated with babeltrace
    compilation instructions [Arnaldo]

v3 changes:
  - rebased to latest acme's perf/core

v2 changes:
  - addressed comments from Namhyung
  - rebased to latest acme's perf/core

Changes from RFC:
  - able to generate CTF data, that are possible to be displayed under
    tracecompas GUI [3], please check several screenshots in here [4]
  - storing CTF data streams per cpu
  - several cleanups

Examples:
- Catch default perf data (cycles event):
  $ perf record ls
  [ perf record: Woken up 1 times to write data ]
  [ perf record: Captured and wrote 0.012 MB perf.data (~546 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 }

- To get some nice output in tracecompas GUI [3], please capture sched:*
  and syscall tracepoints like:
  # perf record -e 'sched:*,raw_syscalls:*' -a
  ^C[ perf record: Woken up 0 times to write data ]
  [ perf record: Captured and wrote 412.347 MB perf.data (~18015721 samples) ]

- To convert perf data file run:
  # perf data convert --to-ctf=./ctf 
  [ perf data convert: Converted 'perf.data' into CTF data './ctf' ]
  [ perf data convert: Converted and wrote 408.421 MB (3964792 samples) ]

- To display converted CTF data run [2]:
  # babeltrace ./ctf-data/
  [23:32:20.165354855] (+0.000000507) sched:sched_wakeup: { cpu_id = 0 }, { perf_ip = 0xFFFFFFFF810BCA72, perf_tid = 0, perf_pid = 0, perf_id = 462554, perf_period = 1, common_type = 265, ...
  [23:32:20.165359078] (+0.000001181) sched:sched_switch: { cpu_id = 0 }, { perf_ip = 0xFFFFFFFF8172A110, perf_tid = 0, perf_pid = 0, perf_id = 462562, perf_period = 1, common_type = 263, ...
  [23:32:20.165364686] (+0.000000328) sched:sched_stat_runtime: { cpu_id = 0 }, { perf_ip = 0xFFFFFFFF810C8AE5, perf_tid = 5326, perf_pid = 5326, perf_id = 462610, perf_period = 11380, ...
  [23:32:20.165366067] (+0.000001205) sched:sched_switch: { cpu_id = 0 }, { perf_ip = 0xFFFFFFFF8172A110, perf_tid = 5326, perf_pid = 5326, perf_id = 462562, perf_period = 1, common_type  ...
  [23:32:20.165723312] (+0.000001479) sched:sched_stat_runtime: { cpu_id = 2 }, { perf_ip = 0xFFFFFFFF810C8AE5, perf_tid = 11821, perf_pid = 11821, perf_id = 462612, perf_period = 1000265, ...
  [23:32:20.065282391] (+?.?????????) raw_syscalls:sys_enter: { cpu_id = 1 }, { perf_ip = 0xFFFFFFFF810230AF, perf_tid = 26155, perf_pid = 26155, perf_id = 462635, perf_period = 1, ...
  [23:32:20.065286422] (+0.000004031) raw_syscalls:sys_exit: { cpu_id = 1 }, { perf_ip = 0xFFFFFFFF810231D8, perf_tid = 26155, perf_pid = 26155, perf_id = 462639, perf_period = 1, ...

- Or run tracecompass and open the CTF data ;-)

Changes are also reachable in here:
  git://git.kernel.org/pub/scm/linux/kernel/git/jolsa/perf.git
  perf/ctf

thanks,
jirka

[1] Common Trace Format - http://www.efficios.com/ctf
[2] babeltrace - http://www.efficios.com/babeltrace
[3] Trace compass - http://projects.eclipse.org/projects/tools.tracecompass
[4] screenshots - http://people.redhat.com/~jolsa/tracecompass-perf/


---
He Kuang (1):
      perf data: Show error message when conversion failed

Jiri Olsa (3):
      perf data: Enable stream flush within processing
      perf data: Add support for setting ordered_events queue size
      tools lib traceevent: Add alias field to struct format_field

Sebastian Andrzej Siewior (1):
      perf data: Switch to multiple cpu stream files

Wang Nan (2):
      perf data: Fix duplicate field names and avoid reserved keywords
      perf data: Fix signess of value

 tools/lib/traceevent/event-parse.c |   6 +-
 tools/lib/traceevent/event-parse.h |   1 +
 tools/perf/util/data-convert-bt.c  | 410 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++----------
 3 files changed, 373 insertions(+), 44 deletions(-)

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

end of thread, other threads:[~2015-05-06  2:58 UTC | newest]

Thread overview: 29+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-04-18 15:50 [PATCHv6 0/7] perf tools: Add perf data CTF conversion Jiri Olsa
2015-04-18 15:50 ` [PATCH 1/7] perf data: Show error message when conversion failed Jiri Olsa
2015-05-06  2:55   ` [tip:perf/core] " tip-bot for He Kuang
2015-04-18 15:50 ` [PATCH 2/7] perf data: Switch to multiple cpu stream files Jiri Olsa
2015-04-20 19:58   ` Arnaldo Carvalho de Melo
2015-04-20 20:01     ` Arnaldo Carvalho de Melo
2015-04-20 20:19     ` Jiri Olsa
2015-04-20 20:41       ` Arnaldo Carvalho de Melo
2015-04-20 20:49         ` Arnaldo Carvalho de Melo
2015-05-06  2:57   ` [tip:perf/core] " tip-bot for Sebastian Andrzej Siewior
2015-04-18 15:50 ` [PATCH 3/7] perf data: Enable stream flush within processing Jiri Olsa
2015-05-06  2:57   ` [tip:perf/core] " tip-bot for Jiri Olsa
2015-04-18 15:50 ` [PATCH 4/7] perf data: Add support for setting ordered_events queue size Jiri Olsa
2015-05-06  2:57   ` [tip:perf/core] " tip-bot for Jiri Olsa
2015-04-18 15:50 ` [PATCH 5/7] tools lib traceevent: Add alias field to struct format_field Jiri Olsa
2015-04-20 14:24   ` Steven Rostedt
2015-05-06  2:55   ` [tip:perf/core] " tip-bot for Jiri Olsa
2015-04-18 15:50 ` [PATCH 6/7] perf data: Fix duplicate field names and avoid reserved keywords Jiri Olsa
2015-04-18 18:56   ` Jérémie Galarneau
2015-04-18 20:45     ` Jiri Olsa
2015-04-20 14:02       ` Arnaldo Carvalho de Melo
2015-05-06  2:57   ` [tip:perf/core] " tip-bot for Wang Nan
2015-04-18 15:50 ` [PATCH 7/7] perf data: Fix signess of value Jiri Olsa
2015-04-20 21:23   ` Arnaldo Carvalho de Melo
2015-04-20 21:52     ` Jiri Olsa
2015-04-21  2:41     ` Wang Nan
2015-04-21 14:25       ` Arnaldo Carvalho de Melo
2015-05-06  2:58   ` [tip:perf/core] perf data: Fix signedness " tip-bot for Wang Nan
2015-04-20 20:05 ` [PATCHv6 0/7] perf tools: Add perf data CTF conversion Arnaldo Carvalho de Melo

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).