From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Binh Q. Pham" Subject: Re: Performance counters in kvm? Date: Wed, 13 Nov 2013 22:22:54 -0500 Message-ID: <5284420E.8070403@cs.rutgers.edu> References: <5283AE31.1000303@cs.rutgers.edu> <20131113175409.GA2088@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: kvm@vger.kernel.org To: Gleb Natapov Return-path: Received: from dragon.rutgers.edu ([128.6.4.3]:59433 "EHLO dragon.rutgers.edu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750951Ab3KNDWz (ORCPT ); Wed, 13 Nov 2013 22:22:55 -0500 In-Reply-To: <20131113175409.GA2088@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: Hi Gleb, Thanks for the suggestion, but I just tried to specify the cpu type to QEMU: -cpu host and I got the same output. Binh On 11/13/2013 12:54 PM, Gleb Natapov wrote: > On Wed, Nov 13, 2013 at 11:52:01AM -0500, Binh Q. Pham wrote: >> Hi all, >> >> I just started using kvm and want to use linux 'perf' tool inside >> the virtual machine to get some information about the hardware >> performance counters. I noticed in kvm source, there is pmu.c and >> pmu-stubs.c, so I assume they provide support for PMU. However, when >> I ran 'perf stat' in the VM, all hardware events are not supported. >> Sample screen shot: >> >> perf stat /bin/ls >> Performance counter stats for '/bin/ls': >> cycles >> stalled-cycles-frontend >> .... >> >> Could someone clarify for me if I can use 'perf' in VM with the >> current kvm state? >> > You need to specify host cpu type to QEMU: -cpu host. > > -- > Gleb.