qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 0/2] Make simpletrace work on Windows


From: hkran
Subject: Re: [Qemu-devel] [PATCH 0/2] Make simpletrace work on Windows
Date: Fri, 23 Sep 2011 13:58:57 +0800
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.18) Gecko/20110617 Red Hat/3.1.11-2.el6_1 Thunderbird/3.1.11

On 09/20/2011 06:15 PM, Zhi Yong Wu wrote:
On Tue, Sep 20, 2011 at 5:57 PM, Stefan Hajnoczi
<address@hidden>  wrote:
On Tue, Sep 20, 2011 at 05:05:45PM +0800, hkran wrote:
On 09/09/2011 05:37 PM, Stefan Hajnoczi wrote:
The 'simple' trace backend uses pthreads and does not work on Windows.  These
patches switch from pthreads to glib so that the code builds on all platforms
supported by glib.

Only one thing I'm unhappy about: the simpletrace write-out thread used to
block all signals.  I have removed that code and don't expect glib to do it for
me.  I'm not sure if there is a problem if signal handlers are invoked in the
write-out thread instead of a QEMU thread.  Any thoughts?

Stefan Hajnoczi (2):
   trace: portable simple trace backend using glib
   trace: use binary file open mode in simpletrace

  trace/simple.c |   58 ++++++++++++++++++++++++++-----------------------------
  1 files changed, 27 insertions(+), 31 deletions(-)

Stefan,

I applied the patch and make&install it.

After a round of running of the qemu with the patch, a trace file is
here, but when I want to open it like this,
./simpletrace.py trace-events trace-29948    //trace-29948 is my tracefile
  an error occurs:

Traceback (most recent call last):
   File "./simpletrace.py", line 151, in<module>
     run(Formatter())
   File "./simpletrace.py", line 131, in run
     events = parse_events(open(sys.argv[1], 'r'))
IOError: [Errno 2] No such file or directory: 'trace-events'

Am I using it in a right way?
Looks like your current working directory is scripts/ so simpletrace.py
will be unable to find the trace-events file which is in the parent
directory.

Usually I stay in QEMU's root directory and just run:
$ qemu # ...generate the trace
$ scripts/simpletrace.py trace-events trace-$PID
I know how to define my own event and play with it now. Very helpful
for me to debug my functions. thanks.

Additionally, There is something about WIN32 in patch, How can I
compile a qemu running on windows? Could you give a reference?
Search for 'mingw' in qemu-doc.texi for instructions.

Stefan




It took much long time to setup a mingw environment on windows to build qemu with the patch. I enable the events bdrv_aio_readv and bdrv_aio_writev...... finally I got a trace, I paste a piece of that here:

bdrv_aio_readv 1172.216 bs=0x12b84a0 sector_num=0x538607 nb_sectors=0x40 opaque=0xe1a1d40 bdrv_aio_readv 1.676 bs=0x12b96e0 sector_num=0x538607 nb_sectors=0x40 opaque=0xe1a1d40 bdrv_aio_readv 811.555 bs=0x12b84a0 sector_num=0x538647 nb_sectors=0x37 opaque=0xe1a1d40 bdrv_aio_readv 2.515 bs=0x12b96e0 sector_num=0x538647 nb_sectors=0x37 opaque=0xe1a1d40 bdrv_aio_writev 3549944.197 bs=0x12b84a0 sector_num=0xf2b3f nb_sectors=0x48 opaque=0xe1a1d40 bdrv_aio_writev 4.190 bs=0x12b96e0 sector_num=0xf2b3f nb_sectors=0x48 opaque=0xe1a1d40 bdrv_aio_writev 35316.500 bs=0x12b84a0 sector_num=0x13f7b7 nb_sectors=0x60 opaque=0xe1a1d40 bdrv_aio_writev 3.911 bs=0x12b96e0 sector_num=0x13f7b7 nb_sectors=0x60 opaque=0xe1a1d40 bdrv_aio_writev 27754.924 bs=0x12b84a0 sector_num=0x9efdf nb_sectors=0x50 opaque=0xe1a1d40 bdrv_aio_writev 3.911 bs=0x12b96e0 sector_num=0x9efdf nb_sectors=0x50 opaque=0xe1a1d40 bdrv_aio_writev 30819.839 bs=0x12b84a0 sector_num=0xf36a7 nb_sectors=0x48 opaque=0xe1a1d40

It looks working fine when windows serving a host.

For another thing, if I use virtio driver in my case like this:

qemu-system-i386.exe -m 786 -drive file=/c/setup/iso/xp_shanghai.img,if=virtio -sdl -net nic,model=virtio -net user

the guest can startup but soon go to crash without any traces. My question:
Can not virtio drivers be applied in the case that windows serve as a host?
furthermore, are there other limitations when qemu is running on windows?




reply via email to

[Prev in Thread] Current Thread [Next in Thread]