Skip to contentSkip to conversation

About the trace framework

Qemu-devel Wang Dong 3 participants 9 messages Jul 9, 2017 – Jul 27, 2017

lore
Share & tools
lore

Wang Dong

author
#0 lore raw

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.
*

Signature · 3 lines
Best regards.

Wang Dong
#1 lore raw
Quoted 10 lines · 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:

Quoted 9 lines

## *--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

Signature · 2 lines
Thanks
    -Xie
#2 lore raw
Quoted 24 lines · Xie Changlong
Quoted 13 lines · 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*

Quoted 9 lines

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.
*

Quoted 4 lines

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

author
#3 lore raw
Quoted 32 lines · Stefan Hajnoczi
Quoted 23 lines · Xie Changlong
Quoted 13 lines · 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*

Quoted 9 lines

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.
*

Quoted 4 lines

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:

Quoted 8 lines
   $ 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?

Signature · 1 line
Best regards. Wang Dong
#4 lore raw
Quoted 60 lines · Wang Dong
Quoted 32 lines · Stefan Hajnoczi
Quoted 23 lines · Xie Changlong
Quoted 13 lines · 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*

Quoted 9 lines

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.
*

Quoted 4 lines

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:

Quoted 8 lines
   $ 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 [...]

(quoted diff) +0 -3
-chardev socket,id=mon1,host=localhost,port=7777,server,nowait \
-mon chardev=mon1,mode=control,pretty=on \
-trace events=/tmp/events
Quoted 1 line

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

author
#5 lore raw
Quoted 64 lines · Stefan Hajnoczi
Quoted 59 lines · Wang Dong
Quoted 32 lines · Stefan Hajnoczi
Quoted 23 lines · Xie Changlong
Quoted 13 lines · 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*

Quoted 9 lines

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.
*

Quoted 4 lines

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:

Quoted 8 lines
    $ 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 [...]

(quoted diff) +0 -3
-chardev socket,id=mon1,host=localhost,port=7777,server,nowait \
-mon chardev=mon1,mode=control,pretty=on \
-trace events=/tmp/events
Quoted 1 line

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.

Quoted 6 lines

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.

Signature · 1 line
Best regards. Wang Dong
author
#6 lore raw
In reply to Xie Changlong
Quoted 21 lines · Xie Changlong
Quoted 10 lines · 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:

Quoted 9 lines

## *--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.
*

Quoted 4 lines

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.

Signature · 1 line
Best regards. Wang Dong
#7 lore raw
Quoted 24 lines · Wang Dong
Quoted 21 lines · Xie Changlong
Quoted 19 lines · 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.
*

Quoted 7 lines
Quoted 4 lines

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.

Quoted 2 lines

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.

Quoted 1 line
Signature · 2 lines
Thanks
    -Xie
author
#8 lore raw
Quoted 31 lines · Xie Changlong
Quoted 30 lines · Wang Dong
Quoted 21 lines · Xie Changlong
Quoted 10 lines · 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:

Quoted 9 lines

## *--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.
*

Quoted 4 lines

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.

Quoted 10 lines
Quoted 1 line

Have you also tried out the examples in docs? how did you do that? I

Yes, just follow the docs. No something special.

Quoted 2 lines

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.

Quoted 1 line

OK, I will try that. Thanks for your advice.

Signature · 1 line
Best regards. Wang Dong