From: Steven Rostedt <rostedt@goodmis.org>
To: Avi Kivity <avi@redhat.com>
Cc: linux-kernel <linux-kernel@vger.kernel.org>,
KVM list <kvm@vger.kernel.org>
Subject: Re: kernelshark plugins and ftrace array fields
Date: Thu, 02 Sep 2010 14:16:38 -0400 [thread overview]
Message-ID: <1283451398.2356.360.camel@gandalf.stny.rr.com> (raw)
In-Reply-To: <4C7FB603.60609@redhat.com>
On Thu, 2010-09-02 at 17:34 +0300, Avi Kivity wrote:
> On 09/02/2010 05:25 PM, Steven Rostedt wrote:
> > On Thu, 2010-09-02 at 15:19 +0300, Avi Kivity wrote:
> >> I'd like to add enhance kvm_emulate_insn display in kernelshark to
> >> show the disassembly of the instruction being emulated. However,
> >> pevent_get_field_val() doesn't support arrays (the instruction is
> >> provided in a 15-byte array).
> >>
> >> Can you add support for arrays in the kernelshark API? With that, it
> >> looks like adding disassembly output to the kvm plugin should be quite
> >> simple.
> >>
> > Sure, I could add a pevent_get_field_array() or something. Could you
> > tell me the event and give me an example of what you want to do.
>
> plugin_kvm.c:
>
> kvm_emulate_insn_handler()
> {
> fetch insn array and len field
> feed into disassembler
> trace_seq_printf() the disassembled instruction
> }
>
OK, with no modification of what I have already, I just created this
handler:
static int
kvm_emulate_insn_handler(struct trace_seq *s, struct record *record,
struct event_format *event, void *context)
{
struct format_field *field;
unsigned char *data = record->data;
int i;
field = pevent_find_field(event, "insn");
if (!field) {
trace_seq_puts(s, "Can't find inst field");
return 0;
}
trace_seq_puts(s, "insn: ");
for (i = 0; i < field->size; i++) {
trace_seq_printf(s, "%s%02x",
i ? "," : "",
data[field->offset + i]);
}
return 0;
}
I think this is what you would want, right?
-- Steve
next prev parent reply other threads:[~2010-09-02 18:16 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-09-02 12:19 Avi Kivity
2010-09-02 14:25 ` Steven Rostedt
2010-09-02 14:34 ` Avi Kivity
2010-09-02 15:52 ` Steven Rostedt
2010-09-02 16:06 ` Avi Kivity
2010-09-02 17:55 ` Steven Rostedt
2010-09-02 18:16 ` Steven Rostedt [this message]
2010-09-02 18:38 ` Steven Rostedt
2010-09-02 19:24 ` Steven Rostedt
2010-09-05 7:08 ` Avi Kivity
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=1283451398.2356.360.camel@gandalf.stny.rr.com \
--to=rostedt@goodmis.org \
--cc=avi@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/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
all inboxes | Powered by JetHome®