From mboxrd@z Thu Jan 1 00:00:00 1970 From: Naresh Rapolu Subject: Hardware performance events are not counted by "perf" in a 2.6.31.12 KVM guest Date: Fri, 26 Mar 2010 21:58:08 -0400 Message-ID: <4BAD6630.80608@purdue.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit To: kvm@vger.kernel.org Return-path: Received: from mailhub130.itcs.purdue.edu ([128.210.5.130]:40763 "EHLO mailhub130.itcs.purdue.edu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752198Ab0C0CSG (ORCPT ); Fri, 26 Mar 2010 22:18:06 -0400 Received: from [128.211.167.84] (pal-167-084.itap.purdue.edu [128.211.167.84]) (authenticated bits=0) by mailhub130.itcs.purdue.edu (8.14.2/8.14.2/mta1-auth.smtp.purdue.edu) with ESMTP id o2R1w9hC024378 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Fri, 26 Mar 2010 21:58:10 -0400 Sender: kvm-owner@vger.kernel.org List-ID: 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.