All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Andreas Färber" <afaerber@suse.de>
To: Wei Yang <weiyang.kernel@gmail.com>
Cc: Stefan Hajnoczi <stefanha@gmail.com>, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] how could I analysis the trace log?
Date: Mon, 13 Feb 2012 16:12:13 +0100	[thread overview]
Message-ID: <4F39284D.70307@suse.de> (raw)
In-Reply-To: <CADLM8XOHsgMMvDGMQfnVW_A6K84iQ9vf65fmR0tD4u7FtcvmDA@mail.gmail.com>

Hi,

Am 12.02.2012 05:32, schrieb Wei Yang:
> I enable the trace function with --enable-trace-backend=simple and I
> create the event file like this
> g_realloc
> g_malloc
> 
> Then I start the qemu with following command.
> ./i386-softmmu/qemu-system-i386 -enable-kvm -drive
> file=../../kvm/ubuntu.img -boot dc -m 512 -usb
>  -monitor stdio -trace events=qemu_trace_events,file=qemu_trace.log
> 
> After some run time, I run the script like:
> ./scripts/simpletrace.py qemu_trace_events_parse qemu_trace.log
> 
> The qemu_trace_events_parse is :
> g_realloc(addr)
> g_malloc(addr)
> 
> The output looks like:
> g_malloc 1.831 addr=0xb945d1f0
> g_malloc 2.498 addr=0xb945d1f0
> g_realloc 4.715 addr=0x10
> g_realloc 1.520 addr=0xc
> g_realloc 1.505 addr=0xc
> 
> The steps I used is correct?

Not quite. IIRC you need to pass in path/to/qemu/trace-events with the
full list of events you were using at the time of tracing (trace file
uses index of event). That file also contains a format string from which
you can infer what the arguments mean.

> I just guess the format of input events file of the simpletrace.py.

> For so many available events, how could I specify the format of all
> those events?

Not knowing Python too well myself, I just wrote a small analysis script
from scratch for my specific task, based on the simpletrace source code.

Andreas

-- 
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg

  parent reply	other threads:[~2012-02-13 15:12 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-12  4:32 [Qemu-devel] how could I analysis the trace log? Wei Yang
2012-02-13  3:24 ` Wei Yang
2012-02-13  3:25 ` 陳韋任
2012-02-13 11:22 ` Stefan Hajnoczi
2012-02-13 15:12 ` Andreas Färber [this message]
2012-02-13 16:31   ` Stefan Hajnoczi

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=4F39284D.70307@suse.de \
    --to=afaerber@suse.de \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@gmail.com \
    --cc=weiyang.kernel@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 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.