Skip to contentSkip to conversation

qemu-2.2 using trace event

Qemu-devel 浩樊啊 2 participants 4 messages Oct 28, 2015 – Nov 13, 2015 2 messages not in the archive

lore
Share & tools
lore

浩樊啊

author
#0 lore raw

Hi,here is my problem
1 ./configure --enable-trace-backends=simple
make
make install
echo virtio_notity > /tmp/events
echo virtio_queue_notify >> /tmp/events
2 I use a xml file run a virtual machine
3 qemu-system_x86_64 -trace events=/tmp/events
4 ./scripts/simpletrace.py trace-events trace-*

But do not get trace.log. and when i check trace-* using 'vim' i find the file is almost empty.
I tried many times, including reinstall qemu,but still don't work.
when i use qemu -trace -m 2048 ........... commandline create virtual machine ,the vm become very slow and still no trace.log. I am a green hand, help!!!!!

#1 lore raw
Quoted 8 lines · 浩樊啊

Hi,here is my problem
1 ./configure --enable-trace-backends=simple
make
make install
echo virtio_notity > /tmp/events
echo virtio_queue_notify >> /tmp/events
2 I use a xml file run a virtual machine
3 qemu-system_x86_64 -trace events=/tmp/events

Here is my command-line:

  qemu-system-x86_64 -enable-kvm -m 1024 \
                     -drive if=virtio,file=test.img,format=raw \
		     -trace events=/tmp/events

Can you post your full command-line?

Quoted 1 line

4 ./scripts/simpletrace.py trace-events trace-*

After shutting down QEMU I ran:

  $ scripts/simpletrace.py trace-events trace-16347
  ...
  virtio_notify 89.954 pid=16347 vdev=0x5628b0b5db30 vq=0x5628b1f8f650
  virtio_queue_notify 77.129 pid=16347 vdev=0x5628b0b5db30 n=0x0 vq=0x5628b1f8f650
  virtio_notify 171.445 pid=16347 vdev=0x5628b0b5db30 vq=0x5628b1f8f650
  virtio_queue_notify 65.987 pid=16347 vdev=0x5628b0b5db30 n=0x0 vq=0x5628b1f8f650
  virtio_notify 168.007 pid=16347 vdev=0x5628b0b5db30 vq=0x5628b1f8f650
  ...
Quoted 2 lines

But do not get trace.log. and when i check trace-* using 'vim' i find the file is almost empty. I tried many times, including reinstall qemu,but still don't work.

The file is called trace-$QEMU_PID, not trace.log.

A message that is not in the archive (sent off-list or not yet received): [email protected]

#3 lore raw

On Tue, Nov 3, 2015 at 9:13 AM, 浩樊啊 <[email protected]> wrote:

Please keep [email protected] on CC so the discussion stays on the mailing list where others can participate.

Quoted 3 lines

you mean that qemu-system-x86_64 ..... is a command to start a vm?
can I just start a vm by a xml file and then use qemu-system_x86_64 -trace events=/tmp/events trace the vm?

No, each QEMU process is a separate VM. Launching a new QEMU does not attach to an existing QEMU process.

If you want to "attach" to a running QEMU process, you can use the SystemTap tracing backend. Make sure that your QEMU binary was built with ./configure --enable-trace-backend=dtrace (that is the case in Fedora and Red Hat-based distributions). Take a look at the /usr/share/systemtap/tapset/qemu-system-x86_64.stp tapset and SystemTap documentation here:
https://sourceware.org/systemtap/wiki/AddingUserSpaceProbingToApps
https://sourceware.org/systemtap/SystemTap_Beginners_Guide/

Stefan

A message that is not in the archive (sent off-list or not yet received): [email protected]

#5 lore raw
Quoted 2 lines · 浩樊啊

Hi, I can use trace-event now , but i still don't know what the second list stands for? is it a execution time of a function?

If you are using the "simple" trace backend then the second column contains the time delta (in microseconds) since the previous trace event.

For example:
a 0 ...
b 1000 ...

Event 'b' occurred 1 millisecond after 'a'.