linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Hardware performance events are not counted by  "perf"   in a 2.6.31.12 KVM guest
@ 2010-03-27  2:03 Naresh Rapolu
  2010-03-28 11:57 ` Joerg Roedel
  0 siblings, 1 reply; 2+ messages in thread
From: Naresh Rapolu @ 2010-03-27  2:03 UTC (permalink / raw)
  To: linux-kernel

Hello,

"perf"  tool does not count  hardware performance events ( cache misses 
etc) in a  KVM guest ( Ubuntu 9.10 karmic,  2.6.31-14-generic  kernel) 
on  Xeon 5530 quad-core.  The host  is  2.6.28  kernel , Ubuntu 8.04 
LTS, Hardy.

readfile.sh  reads in a  large file (1430 lines),  which should cause  
cache-misses.
root@multicore4-vm3:/usr/src/linux-2.6.31.12/tools/perf# ./perf stat -r 
5 -- bash readfile.sh

Performance counter stats for 'bash readfile.sh' (5 runs):

  11002.207467  task-clock-msecs         #      1.042 CPUs    ( +-  
10.834% )
          3480  context-switches                 #      0.000 M/sec   ( 
+-  19.017% )
          2238  CPU-migrations                 #      0.000 M/sec   ( 
+-  29.488% )
        482299  page-faults                      #      0.044 M/sec   ( 
+-   0.141% )
             0  cycles                                  #      0.000 
M/sec   ( +-     nan% )
             0  instructions                          #        nan 
IPC     ( +-     nan% )
             0  cache-references                 #      0.000 M/sec   ( 
+-     nan% )
             0  cache-misses                      #      0.000 M/sec   ( 
+-     nan% )

  10.560510393  seconds time elapsed   ( +-  11.401% )

Do I need to make some configuration changes to enable hardware events 
?  A similar question was posted recently here : 
http://lkml.org/lkml/2010/3/18/342   but no response !
Any help would be greatly appreciated.

Thanks,
Naresh Rapolu.

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

* Re: Hardware performance events are not counted by  "perf"   in a 2.6.31.12 KVM guest
  2010-03-27  2:03 Hardware performance events are not counted by "perf" in a 2.6.31.12 KVM guest Naresh Rapolu
@ 2010-03-28 11:57 ` Joerg Roedel
  0 siblings, 0 replies; 2+ messages in thread
From: Joerg Roedel @ 2010-03-28 11:57 UTC (permalink / raw)
  To: Naresh Rapolu; +Cc: linux-kernel

On Fri, Mar 26, 2010 at 10:03:10PM -0400, Naresh Rapolu wrote:
> "perf"  tool does not count  hardware performance events ( cache misses  
> etc) in a  KVM guest ( Ubuntu 9.10 karmic,  2.6.31-14-generic  kernel)  
> on  Xeon 5530 quad-core.  The host  is  2.6.28  kernel , Ubuntu 8.04  
> LTS, Hardy.

The KVM guest has no access to the hardware counters of the cpu. KVM
ignores these accesses from guests. Making this work needs proper
virtualization of the PMU which is not implemented yet.

Regards,

	Joerg


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

end of thread, other threads:[~2010-03-28 11:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-03-27  2:03 Hardware performance events are not counted by "perf" in a 2.6.31.12 KVM guest Naresh Rapolu
2010-03-28 11:57 ` Joerg Roedel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).