Showing posts with label tracing. Show all posts
Showing posts with label tracing. Show all posts

Wednesday, July 11, 2012

HowTo - Using Perf KVM to trace KVM

1. From guest OS: (Android-x86 for example)

$ cat /proc/kallsyms > /sdcard/guest.kallsyms
$ cat /proc/modules > /sdcard/guest.modules

2. Pull out the two files above via adb.

3. On the host OS:

3.1 Record

# perf kvm --host --guest --guestkallsyms=guest.kallsyms --guestmodules=guest.modules record -a

(The record will be saved to perf.data.kvm file under current directory.)

3.2 Report

# perf kvm --host --guest --guestkallsyms=guest.kallsyms --guestmodules=guest.modules report -i perf.data.kvm



Ref:

Monday, July 9, 2012

HowTo - Using KVM default tracing tool


1. Install trace-cmd 

The source can be found in the kvm source file home directory. 

2. Suppose you are interested in i/o events, type in:

$ sudo trace-cmd record -e '*io*' virsh 

You can start your virtual machine in virsh. 

3. Use kernelshark to read the record.

$ kernelshark