All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] About the trace framework
@ 2017-07-09  9:57 Wang Dong
  2017-07-10  5:24 ` Xie Changlong
  0 siblings, 1 reply; 9+ messages in thread
From: Wang Dong @ 2017-07-09  9:57 UTC (permalink / raw)
  To: qemu-devel; +Cc: stefanha

Hi,

I am new to QEMU. But I got some problem so that  I want to figure it out.

So I try to debug qemu to see what happened.

And I found trace framework. I think this will help me understand the point.

So I compiled qemu with option:

## *--enable-trace-backends=simple*

And did as the docs/tracing.txt tell. But when I execute the example 
command in it, nothing just happens.

*./scripts/simpletrace.py trace-events-all trace-xxxxxx(my trace file 
produced by qemu)
I am not sure what happened. Just ask this.
Any clue will be appreciated. Thanks in advance.
*

-- 
Best regards.

Wang Dong

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

* Re: [Qemu-devel] About the trace framework
  2017-07-09  9:57 [Qemu-devel] About the trace framework Wang Dong
@ 2017-07-10  5:24 ` Xie Changlong
  2017-07-10 12:40   ` Stefan Hajnoczi
  2017-07-11  1:33   ` Wang Dong
  0 siblings, 2 replies; 9+ messages in thread
From: Xie Changlong @ 2017-07-10  5:24 UTC (permalink / raw)
  To: Wang Dong, qemu-devel; +Cc: stefanha

在 7/9/2017 5:57 PM, Wang Dong 写道:
> Hi,
> 
> I am new to QEMU. But I got some problem so that  I want to figure it out.
> 
> So I try to debug qemu to see what happened.
> 
> And I found trace framework. I think this will help me understand the 
> point.
> 
> So I compiled qemu with option:
> 
> ## *--enable-trace-backends=simple*
> 
> And did as the docs/tracing.txt tell. But when I execute the example 
> command in it, nothing just happens.
> 
> *./scripts/simpletrace.py trace-events-all trace-xxxxxx(my trace file 
> produced by qemu)
> I am not sure what happened. Just ask this.
> Any clue will be appreciated. Thanks in advance.
> *
> 

Did you set *trace-event*? I've encountered this issue in the past :)
(qemu) help trace-event
trace-event name on|off -- changes status of a specific trace event
(qemu) info trace-events

-- 
Thanks
     -Xie

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

* Re: [Qemu-devel] About the trace framework
  2017-07-10  5:24 ` Xie Changlong
@ 2017-07-10 12:40   ` Stefan Hajnoczi
  2017-07-13  8:01     ` Wang Dong
  2017-07-11  1:33   ` Wang Dong
  1 sibling, 1 reply; 9+ messages in thread
From: Stefan Hajnoczi @ 2017-07-10 12:40 UTC (permalink / raw)
  To: Xie Changlong; +Cc: Wang Dong, qemu-devel

[-- Attachment #1: Type: text/plain, Size: 1457 bytes --]

On Mon, Jul 10, 2017 at 01:24:23PM +0800, Xie Changlong wrote:
> 在 7/9/2017 5:57 PM, Wang Dong 写道:
> > Hi,
> > 
> > I am new to QEMU. But I got some problem so that  I want to figure it out.
> > 
> > So I try to debug qemu to see what happened.
> > 
> > And I found trace framework. I think this will help me understand the
> > point.
> > 
> > So I compiled qemu with option:
> > 
> > ## *--enable-trace-backends=simple*
> > 
> > And did as the docs/tracing.txt tell. But when I execute the example
> > command in it, nothing just happens.
> > 
> > *./scripts/simpletrace.py trace-events-all trace-xxxxxx(my trace file
> > produced by qemu)
> > I am not sure what happened. Just ask this.
> > Any clue will be appreciated. Thanks in advance.
> > *
> > 
> 
> Did you set *trace-event*? I've encountered this issue in the past :)
> (qemu) help trace-event
> trace-event name on|off -- changes status of a specific trace event
> (qemu) info trace-events

Yes, you need to enable specific trace events that you are interested
in.  'trace-event' does that from the QEMU monitor at runtime.  If you'd
rather keep a file with a list of events to enable:

  $ echo bdrv_aio_readv   > /tmp/events
  $ echo bdrv_aio_writev >> /tmp/events
  $ qemu -trace events=/tmp/events ... # your normal QEMU invocation

It's hard to know what is missing without seeing your QEMU command-line
and monitor commands you used.

Stefan

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 455 bytes --]

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

* Re: [Qemu-devel] About the trace framework
  2017-07-10  5:24 ` Xie Changlong
  2017-07-10 12:40   ` Stefan Hajnoczi
@ 2017-07-11  1:33   ` Wang Dong
  2017-07-11  9:39     ` Xie Changlong
  1 sibling, 1 reply; 9+ messages in thread
From: Wang Dong @ 2017-07-11  1:33 UTC (permalink / raw)
  To: Xie Changlong, qemu-devel; +Cc: stefanha



On 07/10/2017 01:24 PM, Xie Changlong wrote:
> 在 7/9/2017 5:57 PM, Wang Dong 写道:
>> Hi,
>>
>> I am new to QEMU. But I got some problem so that  I want to figure it 
>> out.
>>
>> So I try to debug qemu to see what happened.
>>
>> And I found trace framework. I think this will help me understand the 
>> point.
>>
>> So I compiled qemu with option:
>>
>> ## *--enable-trace-backends=simple*
>>
>> And did as the docs/tracing.txt tell. But when I execute the example 
>> command in it, nothing just happens.
>>
>> *./scripts/simpletrace.py trace-events-all trace-xxxxxx(my trace file 
>> produced by qemu)
>> I am not sure what happened. Just ask this.
>> Any clue will be appreciated. Thanks in advance.
>> *
>>
>
> Did you set *trace-event*? I've encountered this issue in the past :)
> (qemu) help trace-event
> trace-event name on|off -- changes status of a specific trace event
> (qemu) info trace-events
yes, I set it. I just did as the docs told. If this does not work or 
misses something, it should be corrected I think.

Have you also tried out the examples in docs? how did you do that? I 
think I misses some. Could you tell more about
it? Thanks.

-- 
Best regards. Wang Dong

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

* Re: [Qemu-devel] About the trace framework
  2017-07-11  1:33   ` Wang Dong
@ 2017-07-11  9:39     ` Xie Changlong
  2017-07-14  2:16       ` Wang Dong
  0 siblings, 1 reply; 9+ messages in thread
From: Xie Changlong @ 2017-07-11  9:39 UTC (permalink / raw)
  To: Wang Dong, qemu-devel; +Cc: stefanha

在 7/11/2017 9:33 AM, Wang Dong 写道:
> 
> 
> On 07/10/2017 01:24 PM, Xie Changlong wrote:
>> 在 7/9/2017 5:57 PM, Wang Dong 写道:
>>> Hi,
>>>
>>> I am new to QEMU. But I got some problem so that  I want to figure it 
>>> out.
>>>
>>> So I try to debug qemu to see what happened.
>>>
>>> And I found trace framework. I think this will help me understand the 
>>> point.
>>>
>>> So I compiled qemu with option:
>>>
>>> ## *--enable-trace-backends=simple*
>>>
>>> And did as the docs/tracing.txt tell. But when I execute the example 
>>> command in it, nothing just happens.
>>>
>>> *./scripts/simpletrace.py trace-events-all trace-xxxxxx(my trace file 
>>> produced by qemu)
>>> I am not sure what happened. Just ask this.
>>> Any clue will be appreciated. Thanks in advance.
>>> *
>>>
>>
>> Did you set *trace-event*? I've encountered this issue in the past :)
>> (qemu) help trace-event
>> trace-event name on|off -- changes status of a specific trace event
>> (qemu) info trace-events
> yes, I set it. I just did as the docs told. If this does not work or 
> misses something, it should be corrected I think.
> 
> Have you also tried out the examples in docs? how did you do that? I 

Yes, just follow the docs. No something special.

> think I misses some. Could you tell more about
> it? Thanks.

You should confirm the *trace-event*s you set are really triggered by 
qemu. Use gdb breakpoint to verify it is a good choice.

> 

-- 
Thanks
     -Xie

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

* Re: [Qemu-devel] About the trace framework
  2017-07-10 12:40   ` Stefan Hajnoczi
@ 2017-07-13  8:01     ` Wang Dong
  2017-07-14 13:25       ` Stefan Hajnoczi
  0 siblings, 1 reply; 9+ messages in thread
From: Wang Dong @ 2017-07-13  8:01 UTC (permalink / raw)
  To: Stefan Hajnoczi, Xie Changlong; +Cc: qemu-devel



On 07/10/2017 08:40 PM, Stefan Hajnoczi wrote:
> On Mon, Jul 10, 2017 at 01:24:23PM +0800, Xie Changlong wrote:
>> 在 7/9/2017 5:57 PM, Wang Dong 写道:
>>> Hi,
>>>
>>> I am new to QEMU. But I got some problem so that  I want to figure it out.
>>>
>>> So I try to debug qemu to see what happened.
>>>
>>> And I found trace framework. I think this will help me understand the
>>> point.
>>>
>>> So I compiled qemu with option:
>>>
>>> ## *--enable-trace-backends=simple*
>>>
>>> And did as the docs/tracing.txt tell. But when I execute the example
>>> command in it, nothing just happens.
>>>
>>> *./scripts/simpletrace.py trace-events-all trace-xxxxxx(my trace file
>>> produced by qemu)
>>> I am not sure what happened. Just ask this.
>>> Any clue will be appreciated. Thanks in advance.
>>> *
>>>
>> Did you set *trace-event*? I've encountered this issue in the past :)
>> (qemu) help trace-event
>> trace-event name on|off -- changes status of a specific trace event
>> (qemu) info trace-events
> Yes, you need to enable specific trace events that you are interested
> in.  'trace-event' does that from the QEMU monitor at runtime.  If you'd
> rather keep a file with a list of events to enable:
>
>    $ echo bdrv_aio_readv   > /tmp/events
>    $ echo bdrv_aio_writev >> /tmp/events
>    $ qemu -trace events=/tmp/events ... # your normal QEMU invocation
>
> It's hard to know what is missing without seeing your QEMU command-line
> and monitor commands you used.
>
> Stefan

I thought the example in doc was enabled by default.

Thanks for your reply. Below is my command:
When to compile:

./configure --enable-debug --enable-trace-backends=simple

$ echo bdrv_aio_readv   > /tmp/events
$ echo bdrv_aio_writev >> /tmp/events


qemu [...]

-chardev socket,id=mon1,host=localhost,port=7777,server,nowait \
-mon chardev=mon1,mode=control,pretty=on \
-trace events=/tmp/events


Did I miss something?

-- 
Best regards. Wang Dong

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

* Re: [Qemu-devel] About the trace framework
  2017-07-11  9:39     ` Xie Changlong
@ 2017-07-14  2:16       ` Wang Dong
  0 siblings, 0 replies; 9+ messages in thread
From: Wang Dong @ 2017-07-14  2:16 UTC (permalink / raw)
  To: Xie Changlong, qemu-devel; +Cc: stefanha



On 07/11/2017 05:39 PM, Xie Changlong wrote:
> 在 7/11/2017 9:33 AM, Wang Dong 写道:
>>
>>
>> On 07/10/2017 01:24 PM, Xie Changlong wrote:
>>> 在 7/9/2017 5:57 PM, Wang Dong 写道:
>>>> Hi,
>>>>
>>>> I am new to QEMU. But I got some problem so that  I want to figure 
>>>> it out.
>>>>
>>>> So I try to debug qemu to see what happened.
>>>>
>>>> And I found trace framework. I think this will help me understand 
>>>> the point.
>>>>
>>>> So I compiled qemu with option:
>>>>
>>>> ## *--enable-trace-backends=simple*
>>>>
>>>> And did as the docs/tracing.txt tell. But when I execute the 
>>>> example command in it, nothing just happens.
>>>>
>>>> *./scripts/simpletrace.py trace-events-all trace-xxxxxx(my trace 
>>>> file produced by qemu)
>>>> I am not sure what happened. Just ask this.
>>>> Any clue will be appreciated. Thanks in advance.
>>>> *
>>>>
>>>
>>> Did you set *trace-event*? I've encountered this issue in the past :)
>>> (qemu) help trace-event
>>> trace-event name on|off -- changes status of a specific trace event
>>> (qemu) info trace-events
>> yes, I set it. I just did as the docs told. If this does not work or 
>> misses something, it should be corrected I think.
>>
>> Have you also tried out the examples in docs? how did you do that? I 
>
> Yes, just follow the docs. No something special.
>
>> think I misses some. Could you tell more about
>> it? Thanks.
>
> You should confirm the *trace-event*s you set are really triggered by 
> qemu. Use gdb breakpoint to verify it is a good choice.
>
>>
OK, I will try that. Thanks for your advice.

-- 
Best regards. Wang Dong

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

* Re: [Qemu-devel] About the trace framework
  2017-07-13  8:01     ` Wang Dong
@ 2017-07-14 13:25       ` Stefan Hajnoczi
  2017-07-27  1:03         ` Wang Dong
  0 siblings, 1 reply; 9+ messages in thread
From: Stefan Hajnoczi @ 2017-07-14 13:25 UTC (permalink / raw)
  To: Wang Dong; +Cc: Xie Changlong, qemu-devel

[-- Attachment #1: Type: text/plain, Size: 2490 bytes --]

On Thu, Jul 13, 2017 at 04:01:09PM +0800, Wang Dong wrote:
> On 07/10/2017 08:40 PM, Stefan Hajnoczi wrote:
> > On Mon, Jul 10, 2017 at 01:24:23PM +0800, Xie Changlong wrote:
> > > 在 7/9/2017 5:57 PM, Wang Dong 写道:
> > > > Hi,
> > > > 
> > > > I am new to QEMU. But I got some problem so that  I want to figure it out.
> > > > 
> > > > So I try to debug qemu to see what happened.
> > > > 
> > > > And I found trace framework. I think this will help me understand the
> > > > point.
> > > > 
> > > > So I compiled qemu with option:
> > > > 
> > > > ## *--enable-trace-backends=simple*
> > > > 
> > > > And did as the docs/tracing.txt tell. But when I execute the example
> > > > command in it, nothing just happens.
> > > > 
> > > > *./scripts/simpletrace.py trace-events-all trace-xxxxxx(my trace file
> > > > produced by qemu)
> > > > I am not sure what happened. Just ask this.
> > > > Any clue will be appreciated. Thanks in advance.
> > > > *
> > > > 
> > > Did you set *trace-event*? I've encountered this issue in the past :)
> > > (qemu) help trace-event
> > > trace-event name on|off -- changes status of a specific trace event
> > > (qemu) info trace-events
> > Yes, you need to enable specific trace events that you are interested
> > in.  'trace-event' does that from the QEMU monitor at runtime.  If you'd
> > rather keep a file with a list of events to enable:
> > 
> >    $ echo bdrv_aio_readv   > /tmp/events
> >    $ echo bdrv_aio_writev >> /tmp/events
> >    $ qemu -trace events=/tmp/events ... # your normal QEMU invocation
> > 
> > It's hard to know what is missing without seeing your QEMU command-line
> > and monitor commands you used.
> > 
> > Stefan
> 
> I thought the example in doc was enabled by default.
> 
> Thanks for your reply. Below is my command:
> When to compile:
> 
> ./configure --enable-debug --enable-trace-backends=simple
> 
> $ echo bdrv_aio_readv   > /tmp/events
> $ echo bdrv_aio_writev >> /tmp/events
> 
> 
> qemu [...]
> 
> -chardev socket,id=mon1,host=localhost,port=7777,server,nowait \
> -mon chardev=mon1,mode=control,pretty=on \
> -trace events=/tmp/events
> 
> 
> Did I miss something?

Recent QEMU versions do not have bdrv_aio_readv/bdrv_aio_writev trace
events, so you may not get any output.

Which events do you actually want to trace?

I will update the example in docs/devel/tracing.txt with trace events
that are more likely to be triggered.

Stefan

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 455 bytes --]

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

* Re: [Qemu-devel] About the trace framework
  2017-07-14 13:25       ` Stefan Hajnoczi
@ 2017-07-27  1:03         ` Wang Dong
  0 siblings, 0 replies; 9+ messages in thread
From: Wang Dong @ 2017-07-27  1:03 UTC (permalink / raw)
  To: Stefan Hajnoczi; +Cc: Xie Changlong, qemu-devel



On 07/14/2017 09:25 PM, Stefan Hajnoczi wrote:
> On Thu, Jul 13, 2017 at 04:01:09PM +0800, Wang Dong wrote:
>> On 07/10/2017 08:40 PM, Stefan Hajnoczi wrote:
>>> On Mon, Jul 10, 2017 at 01:24:23PM +0800, Xie Changlong wrote:
>>>> 在 7/9/2017 5:57 PM, Wang Dong 写道:
>>>>> Hi,
>>>>>
>>>>> I am new to QEMU. But I got some problem so that  I want to figure it out.
>>>>>
>>>>> So I try to debug qemu to see what happened.
>>>>>
>>>>> And I found trace framework. I think this will help me understand the
>>>>> point.
>>>>>
>>>>> So I compiled qemu with option:
>>>>>
>>>>> ## *--enable-trace-backends=simple*
>>>>>
>>>>> And did as the docs/tracing.txt tell. But when I execute the example
>>>>> command in it, nothing just happens.
>>>>>
>>>>> *./scripts/simpletrace.py trace-events-all trace-xxxxxx(my trace file
>>>>> produced by qemu)
>>>>> I am not sure what happened. Just ask this.
>>>>> Any clue will be appreciated. Thanks in advance.
>>>>> *
>>>>>
>>>> Did you set *trace-event*? I've encountered this issue in the past :)
>>>> (qemu) help trace-event
>>>> trace-event name on|off -- changes status of a specific trace event
>>>> (qemu) info trace-events
>>> Yes, you need to enable specific trace events that you are interested
>>> in.  'trace-event' does that from the QEMU monitor at runtime.  If you'd
>>> rather keep a file with a list of events to enable:
>>>
>>>     $ echo bdrv_aio_readv   > /tmp/events
>>>     $ echo bdrv_aio_writev >> /tmp/events
>>>     $ qemu -trace events=/tmp/events ... # your normal QEMU invocation
>>>
>>> It's hard to know what is missing without seeing your QEMU command-line
>>> and monitor commands you used.
>>>
>>> Stefan
>> I thought the example in doc was enabled by default.
>>
>> Thanks for your reply. Below is my command:
>> When to compile:
>>
>> ./configure --enable-debug --enable-trace-backends=simple
>>
>> $ echo bdrv_aio_readv   > /tmp/events
>> $ echo bdrv_aio_writev >> /tmp/events
>>
>>
>> qemu [...]
>>
>> -chardev socket,id=mon1,host=localhost,port=7777,server,nowait \
>> -mon chardev=mon1,mode=control,pretty=on \
>> -trace events=/tmp/events
>>
>>
>> Did I miss something?
> Recent QEMU versions do not have bdrv_aio_readv/bdrv_aio_writev trace
> events, so you may not get any output.
>
> Which events do you actually want to trace?
>
> I will update the example in docs/devel/tracing.txt with trace events
> that are more likely to be triggered.
>
> Stefan
Hi Stefan,
     Thanks for the reply and your patch.
     I just want to learn qemu with debugging.
     I think it will be easier for me to learn the detail with this 
trace framework.

     So I just tried it. I will try it again with your updated.


-- 
Best regards. Wang Dong

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

end of thread, other threads:[~2017-07-27  1:05 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-07-09  9:57 [Qemu-devel] About the trace framework Wang Dong
2017-07-10  5:24 ` Xie Changlong
2017-07-10 12:40   ` Stefan Hajnoczi
2017-07-13  8:01     ` Wang Dong
2017-07-14 13:25       ` Stefan Hajnoczi
2017-07-27  1:03         ` Wang Dong
2017-07-11  1:33   ` Wang Dong
2017-07-11  9:39     ` Xie Changlong
2017-07-14  2:16       ` Wang Dong

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.