kvm_pio
During some test with "perf stat", we found event "kvm_pio" is heavy. So we decide to see who is the criminal.
Record Events
First step is use perf record to record events.
perf record -e 'kvm:kvm_pio' -a sleep 30This will general perf.data file.
Dump raw data
After this, we need to take a look into the raw data.
perf script > pio_statNow pio_stat contains the raw data. Here is a glance of the raw data.
qemu-system-x86 10042 [000] 313831.754508: kvm:kvm_pio: pio_read at 0x3fd size 1 count 1 val 0x60
qemu-system-x86 10042 [000] 313831.754515: kvm:kvm_pio: pio_read at 0x3fd size 1 count 1 val 0x60Use awk to analysis
Execute this:
awk -f pio_calculate.awk pio_stat | sort -nk 2 -rThe pio_calculate.awk looks like:
Then you will get this output:
This shows most pio operation happens at port 0x3fd.
Find the criminal
Then we can use file /proc/ioport to find the port 0x3fd belongs to who.
Go and find it!
Last updated
Was this helpful?