All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC 00/24] perf tools: Add traceevent plugins support
@ 2013-09-01 10:48 Jiri Olsa
  2013-09-01 10:48 ` [PATCH 01/24] perf tools: Fix 'make install prefix=...' build rule Jiri Olsa
                   ` (24 more replies)
  0 siblings, 25 replies; 31+ messages in thread
From: Jiri Olsa @ 2013-09-01 10:48 UTC (permalink / raw)
  To: linux-kernel
  Cc: Jiri Olsa, Corey Ashford, Frederic Weisbecker, Ingo Molnar,
	Namhyung Kim, Paul Mackerras, Peter Zijlstra,
	Arnaldo Carvalho de Melo, Steven Rostedt, David Ahern

hi,
backporting traceevent plugin support from trace-cmd.

Having plugins allow traceevent to properly parse
'print fmt' line of tracepoint format and display
proper/additional data in perf script command, like:

- displaying call_site details in kmem:* tracepoints:
  $ sudo perf record -e kmem:kmalloc ls

  before:
  ls 31708 [003] 15123.850504: kmem:kmalloc: call_site=ffffffff812030eb ptr=0xffff8801cbb91840 bytes_req=40 bytes_alloc=64 gfp_
  ls 31708 [003] 15123.850506: kmem:kmalloc: call_site=ffffffff811be761 ptr=0xffff8801cbbddd20 bytes_req=32 bytes_alloc=32 gfp_
  ls 31708 [003] 15123.850507: kmem:kmalloc: call_site=ffffffff811be6ab ptr=0xffff880163bf1800 bytes_req=112 bytes_alloc=128 gf
  ls 31708 [003] 15123.850535: kmem:kmalloc: call_site=ffffffff811bed5e ptr=0xffff88017d41b000 bytes_req=4096 bytes_alloc=4096 
  ls 31708 [003] 15123.850691: kmem:kmalloc: call_site=ffffffff81128333 ptr=0xffff88020eedc000 bytes_req=4104 bytes_alloc=8192 
  ls 31708 [003] 15123.850838: kmem:kmalloc: call_site=ffffffff8121c28e ptr=0xffff8801cb981940 bytes_req=48 bytes_alloc=64 gfp_
  ls 31708 [003] 15123.850848: kmem:kmalloc: call_site=ffffffff8121c418 ptr=0xffff8801cb916bc0 bytes_req=50 bytes_alloc=64 gfp_
  ls 31708 [003] 15123.850850: kmem:kmalloc: call_site=ffffffff8121c418 ptr=0xffff8801cb916b40 bytes_req=51 bytes_alloc=64 gfp_

  now:
  $ sudo perf script
  ...
  ls 30512 [001] 14717.425867: kmem:kmalloc: (perf_event_mmap+0xf3) call_site=ffffffff81128333 ptr=0xffff880211cea000 bytes_req
  ls 30512 [001] 14717.425981: kmem:kmalloc: (proc_reg_open+0x4b) call_site=ffffffff812030eb ptr=0xffff88017de85a40 bytes_req=4
  ls 30512 [001] 14717.425982: kmem:kmalloc: (single_open+0x41) call_site=ffffffff811be761 ptr=0xffff8801958e1e00 bytes_req=32 
  ls 30512 [001] 14717.425982: kmem:kmalloc: (seq_open+0xfb) call_site=ffffffff811be6ab ptr=0xffff880211d88f00 bytes_req=112 by
  ls 30512 [001] 14717.425989: kmem:kmalloc: (seq_read+0x2ee) call_site=ffffffff811bed5e ptr=0xffff88017be8c000 bytes_req=4096 
  ls 30512 [001] 14717.426034: kmem:kmalloc: (perf_event_mmap+0xf3) call_site=ffffffff81128333 ptr=0xffff880211cea000 bytes_req
  ls 30512 [001] 14717.426079: kmem:kmalloc: (ext4_readdir+0x6fe) call_site=ffffffff8121c28e ptr=0xffff88017de85f00 bytes_req=4
  ls 30512 [001] 14717.426081: kmem:kmalloc: (ext4_htree_store_dirent+0x38) call_site=ffffffff8121c418 ptr=0xffff88017de85080 b
  ...

- displaying details for timer_expire_entry and hrtimer_start tracepoints:

  $ sudo perf record -e timer:* ls

  before:
  ls 31727 [001] 15171.487282: timer:hrtimer_cancel: hrtimer=0xffff88021e24e4c0
  ls 31727 [001] 15171.487284: timer:hrtimer_expire_entry: [FAILED TO PARSE] hrtimer=0xffff88021e24e4c0 now=15167505000662 func
  ls 31727 [001] 15171.487290: timer:hrtimer_expire_exit: hrtimer=0xffff88021e24e4c0
  ls 31727 [001] 15171.487290: timer:hrtimer_start: [FAILED TO PARSE] hrtimer=0xffff88021e24e4c0 function=0xffffffff810b6460 ex

  now:
  $ sudo perf script
  ..
  ls 30557 [001] 14855.443889: timer:hrtimer_cancel: hrtimer=0xffff88021e24e4c0
  ls 30557 [001] 14855.443891: timer:hrtimer_expire_entry: hrtimer=0xffff88021e24e4c0 now=14851544000735 function=tick_sched_timer/0x0
  ls 30557 [001] 14855.443897: timer:hrtimer_expire_exit: hrtimer=0xffff88021e24e4c0
  ls 30557 [001] 14855.443897: timer:hrtimer_start: hrtimer=0xffff88021e24e4c0 function=tick_sched_timer expires=14851545000000 softexpires=14851545000000
  ls 30557 [001] 14855.443899: timer:timer_cancel: timer=0xffff88021e250b68
  ls 30557 [001] 14855.443900: timer:timer_expire_entry: timer=0xffff88021e250b68 function=delayed_work_timer_fn now=4309518840
  ls 30557 [001] 14855.443903: timer:timer_expire_exit: timer=0xffff88021e250b68
  ls 30557 [001] 14855.444888: timer:hrtimer_cancel: hrtimer=0xffff88021e24e4c0
  ls 30557 [001] 14855.444889: timer:hrtimer_expire_entry: hrtimer=0xffff88021e24e4c0 now=14851545000598 function=tick_sched_timer/0x0
  ...


All plugins present in trace-cmd are backported plus
added new scsi and xen. The 'xen' plugin still cannot
handle all the 'print fmt' functions, since I dont follow
xen code ;-) Also xen tracepoints use 'sizeof' in the
format string and it's not clear yet how to handle that.

Plugins get installed to following locations:
  '$(HOME)/.traceevent/plugins'
   - if no prefix is provided
  '$(perfexecdir)/traceevent/plugins'
   - if prefix is provided

thanks for comments,
jirka


Signed-off-by: Jiri Olsa <jolsa@redhat.com>
Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: David Ahern <dsahern@gmail.com>
---
Jiri Olsa (24):
      perf tools: Fix 'make install prefix=...' build rule
      perf tools: Remove unused trace-event-* code
      perf tools: Unify page_size usage
      tools list traceevent: Add plugin support
      tools list traceevent: Add options support
      tools list traceevent: Add plugin build support
      tools list traceevent: Add traceevent_host_bigendian function
      tools list traceevent: Add pevent_print_func_field function
      tools list traceevent: Add jbd2 plugin
      tools list traceevent: Add blk plugin
      tools list traceevent: Add hrtimer plugin
      tools list traceevent: Add kmem plugin
      tools list traceevent: Add kvm plugin
      tools list traceevent: Add mac80211 plugin
      tools list traceevent: Add sched_switch plugin
      tools list traceevent: Add function plugin
      tools list traceevent: Update kvm plugin with is_writable_pte helper
      tools list traceevent: Add xen plugin
      tools list traceevent: Add scsi plugin
      tools list traceevent: Change pevent_parse_event to return event format
      perf tools: Add traceevents Makefile install rule
      perf tools: Add trace-event object
      perf tools: Add traceevent object to interface traceevent lib
      perf tools: Overload pr_stat traceevent print function

 tools/lib/traceevent/Makefile              |  57 +++++++++--
 tools/lib/traceevent/event-option.c        | 278 +++++++++++++++++++++++++++++++++++++++++++++++++++
 tools/lib/traceevent/event-parse.c         |  70 +++++++++----
 tools/lib/traceevent/event-parse.h         |  29 +++++-
 tools/lib/traceevent/event-plugin.c        | 202 +++++++++++++++++++++++++++++++++++++
 tools/lib/traceevent/plugin_blk.c          | 389 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 tools/lib/traceevent/plugin_function.c     | 182 +++++++++++++++++++++++++++++++++
 tools/lib/traceevent/plugin_hrtimer.c      |  94 ++++++++++++++++++
 tools/lib/traceevent/plugin_jbd2.c         |  68 +++++++++++++
 tools/lib/traceevent/plugin_kmem.c         |  76 ++++++++++++++
 tools/lib/traceevent/plugin_kvm.c          | 480 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 tools/lib/traceevent/plugin_mac80211.c     | 204 +++++++++++++++++++++++++++++++++++++
 tools/lib/traceevent/plugin_sched_switch.c | 147 +++++++++++++++++++++++++++
 tools/lib/traceevent/plugin_scsi.c         | 431 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 tools/lib/traceevent/plugin_xen.c          | 132 ++++++++++++++++++++++++
 tools/perf/Makefile                        |  13 ++-
 tools/perf/builtin-record.c                |   5 +-
 tools/perf/builtin-script.c                |   2 +-
 tools/perf/builtin-trace.c                 |   5 +-
 tools/perf/config/Makefile                 |   4 +-
 tools/perf/perf.c                          |   1 +
 tools/perf/util/debug.c                    |  16 +++
 tools/perf/util/debug.h                    |   2 +
 tools/perf/util/evsel.c                    |  44 +-------
 tools/perf/util/header.c                   |   8 +-
 tools/perf/util/python-ext-sources         |   1 +
 tools/perf/util/python.c                   |   1 +
 tools/perf/util/session.c                  |   2 +-
 tools/perf/util/session.h                  |   3 +-
 tools/perf/util/trace-event-parse.c        |  53 +---------
 tools/perf/util/trace-event-read.c         |  20 ++--
 tools/perf/util/trace-event.c              | 121 ++++++++++++++++++++++
 tools/perf/util/trace-event.h              |  22 ++--
 33 files changed, 3002 insertions(+), 160 deletions(-)
 create mode 100644 tools/lib/traceevent/event-option.c
 create mode 100644 tools/lib/traceevent/event-plugin.c
 create mode 100644 tools/lib/traceevent/plugin_blk.c
 create mode 100644 tools/lib/traceevent/plugin_function.c
 create mode 100644 tools/lib/traceevent/plugin_hrtimer.c
 create mode 100644 tools/lib/traceevent/plugin_jbd2.c
 create mode 100644 tools/lib/traceevent/plugin_kmem.c
 create mode 100644 tools/lib/traceevent/plugin_kvm.c
 create mode 100644 tools/lib/traceevent/plugin_mac80211.c
 create mode 100644 tools/lib/traceevent/plugin_sched_switch.c
 create mode 100644 tools/lib/traceevent/plugin_scsi.c
 create mode 100644 tools/lib/traceevent/plugin_xen.c
 create mode 100644 tools/perf/util/trace-event.c

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

end of thread, other threads:[~2013-09-16  3:40 UTC | newest]

Thread overview: 31+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-01 10:48 [RFC 00/24] perf tools: Add traceevent plugins support Jiri Olsa
2013-09-01 10:48 ` [PATCH 01/24] perf tools: Fix 'make install prefix=...' build rule Jiri Olsa
2013-09-04  8:35   ` Namhyung Kim
2013-09-01 10:48 ` [PATCH 02/24] perf tools: Remove unused trace-event-* code Jiri Olsa
2013-09-04  8:36   ` Namhyung Kim
2013-09-01 10:48 ` [PATCH 03/24] perf tools: Unify page_size usage Jiri Olsa
2013-09-04  8:37   ` Namhyung Kim
2013-09-01 10:48 ` [PATCH 04/24] tools list traceevent: Add plugin support Jiri Olsa
2013-09-16  3:37   ` David Ahern
2013-09-01 10:48 ` [PATCH 05/24] tools list traceevent: Add options support Jiri Olsa
2013-09-16  3:40   ` David Ahern
2013-09-01 10:48 ` [PATCH 06/24] tools list traceevent: Add plugin build support Jiri Olsa
2013-09-01 10:48 ` [PATCH 07/24] tools list traceevent: Add traceevent_host_bigendian function Jiri Olsa
2013-09-01 10:48 ` [PATCH 08/24] tools list traceevent: Add pevent_print_func_field function Jiri Olsa
2013-09-01 10:48 ` [PATCH 09/24] tools list traceevent: Add jbd2 plugin Jiri Olsa
2013-09-01 10:48 ` [PATCH 10/24] tools list traceevent: Add blk plugin Jiri Olsa
2013-09-01 10:48 ` [PATCH 11/24] tools list traceevent: Add hrtimer plugin Jiri Olsa
2013-09-01 10:48 ` [PATCH 12/24] tools list traceevent: Add kmem plugin Jiri Olsa
2013-09-01 10:48 ` [PATCH 13/24] tools list traceevent: Add kvm plugin Jiri Olsa
2013-09-01 10:48 ` [PATCH 14/24] tools list traceevent: Add mac80211 plugin Jiri Olsa
2013-09-01 10:48 ` [PATCH 15/24] tools list traceevent: Add sched_switch plugin Jiri Olsa
2013-09-01 10:48 ` [PATCH 16/24] tools list traceevent: Add function plugin Jiri Olsa
2013-09-01 10:48 ` [PATCH 17/24] tools list traceevent: Update kvm plugin with is_writable_pte helper Jiri Olsa
2013-09-01 10:48 ` [PATCH 18/24] tools list traceevent: Add xen plugin Jiri Olsa
2013-09-01 10:48 ` [PATCH 19/24] tools list traceevent: Add scsi plugin Jiri Olsa
2013-09-01 10:48 ` [PATCH 20/24] tools list traceevent: Change pevent_parse_event to return event format Jiri Olsa
2013-09-01 10:48 ` [PATCH 21/24] perf tools: Add traceevents Makefile install rule Jiri Olsa
2013-09-01 10:48 ` [PATCH 22/24] perf tools: Add trace-event object Jiri Olsa
2013-09-01 10:48 ` [PATCH 23/24] perf tools: Add traceevent object to interface traceevent lib Jiri Olsa
2013-09-01 10:48 ` [PATCH 24/24] perf tools: Overload pr_stat traceevent print function Jiri Olsa
2013-09-02  8:39 ` [RFC 00/24] perf tools: Add traceevent plugins support Jiri Olsa

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.