Questing regarding KVM Guest PMU

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

 



Hi

I have setup kernel 3.3 ( which has save and restore support for PMU
registers in KVM ). Also, I have started a guest machine by specifying
"--cpu host" in qemu-kvm and verified that the "arch_perfmon" cpu flag
is visible inside the guest. However, I could not succeed in counting
the number of cpu cycles for a cpu intensive program using oprofile
inside guest.

The following is a simple script used to run oprofile

#############################################
/usr/bin/opcontrol --reset
/usr/bin/opcontrol --event="default"
/usr/bin/opcontrol --setup --no-vmlinux --separate=library
/usr/bin/opcontrol --start
#This is a cpu intensive program
./a.out
/usr/bin/opcontrol --shutdown
opreport --global-percent --long-filenames --threshold 20
##############################################

Output on host

CPU: Core 2, speed 2201 MHz (estimated)
Counted CPU_CLK_UNHALTED events (Clock cycles when not halted) with a
unit mask of 0x00 (Unhalted core cycles) count 100000
CPU_CLK_UNHALT...|
 samples|      %|
------------------
   21125 43.2597 /home/shashank/workspace/seminar/code/oprofile/a.out

Output on guest

CPU: Core 2, speed 2200.19 MHz (estimated)
Counted CPU_CLK_UNHALTED events (Clock cycles when not halted) with a
unit mask of 0x00 (Unhalted core cycles) count 100000
CPU_CLK_UNHALT...|
 samples|      %|
------------------
       1 100.000 /no-vmlinux


Note that only 1 sample got collected on guest. I see the same
behavior for other workloads on guest. Also, I executed CPUID
instruction on both guest and host to check the PMU leaf details
(0x0A) and found them to be the same.  Please let me know if I am
missing anything here.  I am yet to profile the same workload on
host/guest using perf.

Regards,
Shashank
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux