public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* Questing regarding KVM Guest PMU
@ 2012-03-18 10:18 shashank rachamalla
  2012-03-18 10:30 ` Gleb Natapov
  0 siblings, 1 reply; 31+ messages in thread
From: shashank rachamalla @ 2012-03-18 10:18 UTC (permalink / raw)
  To: kvm

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

^ permalink raw reply	[flat|nested] 31+ messages in thread

end of thread, other threads:[~2012-04-10  3:18 UTC | newest]

Thread overview: 31+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-18 10:18 Questing regarding KVM Guest PMU shashank rachamalla
2012-03-18 10:30 ` Gleb Natapov
2012-03-18 12:57   ` shashank rachamalla
2012-03-18 14:50     ` Avi Kivity
2012-03-18 14:50     ` Gleb Natapov
2012-03-18 16:17       ` shashank rachamalla
2012-03-18 16:51         ` Gleb Natapov
2012-03-19  6:50           ` shashank rachamalla
2012-03-19  7:07             ` Gleb Natapov
2012-04-03 13:50               ` shashank rachamalla
2012-04-03 16:58                 ` Gleb Natapov
2012-04-03 18:43                   ` shashank rachamalla
2012-04-03 18:54                     ` shashank rachamalla
2012-04-04  7:04                       ` Gleb Natapov
2012-04-04 10:19                         ` shashank rachamalla
2012-04-04 10:29                           ` Gleb Natapov
2012-04-05  2:37                             ` shashank rachamalla
2012-04-05 12:27                             ` Avi Kivity
2012-04-05 12:37                               ` Gleb Natapov
2012-04-05 12:48                                 ` Avi Kivity
2012-04-05 13:26                                   ` Gleb Natapov
2012-04-05 13:28                                     ` Avi Kivity
2012-04-05 13:48                                       ` Gleb Natapov
2012-04-05 13:57                                         ` Gleb Natapov
2012-04-05 14:38                                           ` Avi Kivity
2012-04-05 14:41                                             ` Gleb Natapov
2012-04-06  5:13                                               ` shashank rachamalla
2012-04-06  6:50                                                 ` Gleb Natapov
2012-04-08 15:27                                                   ` Gleb Natapov
2012-04-09  9:26                                                     ` Gleb Natapov
2012-04-10  3:18                                                       ` shashank rachamalla

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox