Tuesday, July 10, 2012

HowTo - Using Simple Tracing in Qemu-KVM


You need to build your own version of Qemu-KVM. Download the qemu-kvm source file.

git clone git://git.kernel.org/pub/scm/virt/kvm/qemu-kvm.git

1. Build qemu-kvm with the 'simple' trace backend: 


$ ./configure --enable-trace-backend=simple && 
   make 

2. Create a file with the events you want to trace: 

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

3. Run the virtual machine to produce a trace file: 

$ kvm -trace events=/tmp/events ... # your normal QEMU invocation 

4. Pretty-print the binary trace file at: 

 ~/qemu-kvm/scripts/simpletrace.py trace-events trace-*


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

No comments:

Post a Comment