From mboxrd@z Thu Jan 1 00:00:00 1970 From: Gleb Natapov Subject: Re: Performance counters in kvm? Date: Thu, 14 Nov 2013 09:16:17 +0200 Message-ID: <20131114071616.GK2008@redhat.com> References: <5283AE31.1000303@cs.rutgers.edu> <20131113175409.GA2088@redhat.com> <5284420E.8070403@cs.rutgers.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: kvm@vger.kernel.org To: "Binh Q. Pham" Return-path: Received: from mx1.redhat.com ([209.132.183.28]:52336 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751179Ab3KNHQk (ORCPT ); Thu, 14 Nov 2013 02:16:40 -0500 Content-Disposition: inline In-Reply-To: <5284420E.8070403@cs.rutgers.edu> Sender: kvm-owner@vger.kernel.org List-ID: On Wed, Nov 13, 2013 at 10:22:54PM -0500, Binh Q. Pham wrote: > 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. > Which QEMU version are you using, what is the output of "cat /proc/cpuinfo" in the guest and attach guest's dmesg too. > 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. -- Gleb.