public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: David Ahern <dsahern@gmail.com>
To: rostedt@goodmis.org, acme@ghostprotocols.net,
	linux-kernel@vger.kernel.org, weisbec@gmail.com
Cc: namhyung.kim@lge.com, mingo@kernel.org, peterz@infradead.org,
	David Ahern <dsahern@gmail.com>
Subject: [RFC PATCH 2/2] perf: add support for trace-cmd plugins
Date: Thu, 14 Jun 2012 11:35:33 -0600	[thread overview]
Message-ID: <1339695333-64591-3-git-send-email-dsahern@gmail.com> (raw)
In-Reply-To: <1339695333-64591-1-git-send-email-dsahern@gmail.com>

Improves pretty printing of events when using perf-script. e.g.,
perf record -p 8731 -e kvm:* -fo /tmp/perf.data -- sleep 1

Currently when dumping kvm events you ugliness like this:
$ perf script -i /tmp/perf.data
Warning: bad op token {
Warning: failed to read event print fmt for kvm_emulate_insn
...
        qemu-kvm  8734 [006] 826443.468554: kvm_emulate_insn:
<...>-8734  [006]     0.000000000: kvm_emulate_insn:
[FAILED TO PARSE] rip=18446744071579001937 csbase=0 len=6
insn=<89><B7> flags=9 failed=0

Ignoring the duplication of data the event is not readable.
With this patch and using the kvm plugin for trace-cmd you get:

        qemu-kvm  8734 [006] 826443.468554: kvm_emulate_insn:
0:ffffffff81026451: mov %esi, 0xff5fb000(%rdi)

which is a bit more readable.

Signed-off-by: David Ahern <dsahern@gmail.com>
---
 tools/perf/util/trace-event-parse.c |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/tools/perf/util/trace-event-parse.c b/tools/perf/util/trace-event-parse.c
index df2fddb..7b149c5 100644
--- a/tools/perf/util/trace-event-parse.c
+++ b/tools/perf/util/trace-event-parse.c
@@ -27,6 +27,7 @@
 #include "../perf.h"
 #include "util.h"
 #include "trace-event.h"
+#include "tracecmd-plugins.h"
 
 int header_page_size_size;
 int header_page_ts_size;
@@ -36,6 +37,7 @@ struct pevent *perf_pevent;
 static struct pevent *pevent;
 
 bool latency_format;
+struct plugin_list *list;
 
 int read_trace_init(int file_bigendian, int host_bigendian)
 {
@@ -45,6 +47,8 @@ int read_trace_init(int file_bigendian, int host_bigendian)
 	perf_pevent = pevent_alloc();
 	pevent = perf_pevent;
 
+	list = tracecmd_load_plugins(pevent);
+
 	pevent_set_flag(pevent, PEVENT_NSEC_OUTPUT);
 	pevent_set_file_bigendian(pevent, file_bigendian);
 	pevent_set_host_bigendian(pevent, host_bigendian);
-- 
1.7.10.1


  parent reply	other threads:[~2012-06-14 17:35 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-14 17:35 [RFC PATCH 0/2] libtraceevent/perf: Add support for trace-cmd plugins David Ahern
2012-06-14 17:35 ` [RFC PATCH 1/2] libtraceevent: Add support for tracecmd plugins David Ahern
2012-06-14 17:35 ` David Ahern [this message]
2012-06-18  8:35 ` [RFC PATCH 0/2] libtraceevent/perf: Add support for trace-cmd plugins Namhyung Kim
2012-06-18 14:21   ` Steven Rostedt
2012-06-18 14:35     ` David Ahern
2012-06-18 14:38   ` David Ahern
2012-06-19  0:45     ` Namhyung Kim
2012-06-19  1:03       ` Steven Rostedt
2012-06-19  1:11         ` Namhyung Kim
2012-06-19  1:26           ` Steven Rostedt
2012-06-19  1:40             ` Namhyung Kim
2012-06-19  2:16               ` Steven Rostedt
2012-06-19  5:41                 ` Namhyung Kim
2012-06-19 11:54                   ` Steven Rostedt
2012-06-19 14:39                     ` Namhyung Kim
2012-06-19 14:44                       ` Steven Rostedt
2012-06-19  1:14       ` David Ahern

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=1339695333-64591-3-git-send-email-dsahern@gmail.com \
    --to=dsahern@gmail.com \
    --cc=acme@ghostprotocols.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=namhyung.kim@lge.com \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    --cc=weisbec@gmail.com \
    /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