All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] how could I analysis the trace log?
@ 2012-02-12  4:32 Wei Yang
  2012-02-13  3:24 ` Wei Yang
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Wei Yang @ 2012-02-12  4:32 UTC (permalink / raw)
  To: qemu-devel

All

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?
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?

-- 
Richard Yang
Help You, Help Me

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

* Re: [Qemu-devel] how could I analysis the trace log?
  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 ` 陳韋任
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 6+ messages in thread
From: Wei Yang @ 2012-02-13  3:24 UTC (permalink / raw)
  To: qemu-devel

Hi, this kind of trace is not popular?

2012/2/12 Wei Yang <weiyang.kernel@gmail.com>:
> All
>
> 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?
> 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?
>
> --
> Richard Yang
> Help You, Help Me



-- 
Richard Yang
Help You, Help Me

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

* Re: [Qemu-devel] how could I analysis the trace log?
  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
  3 siblings, 0 replies; 6+ messages in thread
From: 陳韋任 @ 2012-02-13  3:25 UTC (permalink / raw)
  To: Wei Yang; +Cc: qemu-devel

> 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?

  http://repo.or.cz/w/qemu/stefanha.git/blob_plain/refs/heads/tracing:/docs/tracing.txt

  Reading "Trace events" might be help.

Regards,
chenwj

-- 
Wei-Ren Chen (陳韋任)
Computer Systems Lab, Institute of Information Science,
Academia Sinica, Taiwan (R.O.C.)
Tel:886-2-2788-3799 #1667
Homepage: http://people.cs.nctu.edu.tw/~chenwj

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

* Re: [Qemu-devel] how could I analysis the trace log?
  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
  3 siblings, 0 replies; 6+ messages in thread
From: Stefan Hajnoczi @ 2012-02-13 11:22 UTC (permalink / raw)
  To: Wei Yang; +Cc: qemu-devel

On Sun, Feb 12, 2012 at 4:32 AM, Wei Yang <weiyang.kernel@gmail.com> wrote:
> 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?

Yes, that's fine.  The output fields are trace event name, delta time
since last event (in microseconds), and arguments printed as hex
numbers.

> 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?

simpletrace.py does not format events in a special way.  It simply
prints them all out as hex numbers.

If you want special formatting you should write a custom trace
analysis script.  It's pretty easy to do and you can find an example
here:

http://blog.vmsplice.net/2011/03/how-to-write-trace-analysis-scripts-for.html

If you looked at the simpletrace.py source code you may have noticed
that it is actually a Python module.  It provides an API so you can
process the trace events that you are interested in.

Stefan

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

* Re: [Qemu-devel] how could I analysis the trace log?
  2012-02-12  4:32 [Qemu-devel] how could I analysis the trace log? Wei Yang
                   ` (2 preceding siblings ...)
  2012-02-13 11:22 ` Stefan Hajnoczi
@ 2012-02-13 15:12 ` Andreas Färber
  2012-02-13 16:31   ` Stefan Hajnoczi
  3 siblings, 1 reply; 6+ messages in thread
From: Andreas Färber @ 2012-02-13 15:12 UTC (permalink / raw)
  To: Wei Yang; +Cc: Stefan Hajnoczi, qemu-devel

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

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

* Re: [Qemu-devel] how could I analysis the trace log?
  2012-02-13 15:12 ` Andreas Färber
@ 2012-02-13 16:31   ` Stefan Hajnoczi
  0 siblings, 0 replies; 6+ messages in thread
From: Stefan Hajnoczi @ 2012-02-13 16:31 UTC (permalink / raw)
  To: Andreas Färber; +Cc: Wei Yang, qemu-devel

On Mon, Feb 13, 2012 at 3:12 PM, Andreas Färber <afaerber@suse.de> wrote:
> 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.

Right:

$ scripts/simpletrace.py trace-events trace-12345

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

end of thread, other threads:[~2012-02-13 16:31 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
2012-02-13 16:31   ` Stefan Hajnoczi

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.