From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Ahern Subject: Re: [PATCH v2 00/11] KVM in-guest performance monitoring Date: Wed, 15 Jun 2011 10:08:30 -0600 Message-ID: <4DF8D8FE.2080808@cisco.com> References: <1307972106-2468-1-git-send-email-avi@redhat.com> <4DF66B1A.6060606@cisco.com> <4DF71DA3.2080300@redhat.com> <4DF7972F.3040103@cisco.com> <4DF79941.9050705@siemens.com> <4DF79B6F.10102@cisco.com> <4DF79EFE.1050201@cisco.com> <4DF7A436.8090308@cisco.com> <4DF873FD.6040903@redhat.com> <4DF8A82F.5090900@cisco.com> <4DF8B1F8.6030502@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Marcelo Tosatti , kvm@vger.kernel.org, Ingo Molnar , Peter Zijlstra , Arnaldo Carvalho de Melo To: Avi Kivity Return-path: Received: from sj-iport-2.cisco.com ([171.71.176.71]:15668 "EHLO sj-iport-2.cisco.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753704Ab1FOQIb (ORCPT ); Wed, 15 Jun 2011 12:08:31 -0400 In-Reply-To: <4DF8B1F8.6030502@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On 06/15/2011 07:22 AM, Avi Kivity wrote: > On 06/15/2011 03:40 PM, David Ahern wrote: >> On 06/15/2011 02:57 AM, Avi Kivity wrote: >> > Okay. If you do anything interesting with it, please let us know. I >> > only tested the watchdog, 'perf top', and 'perf stat'. >> > >> >> For the following I was using the userspace command from latest >> perf-core branch. >> >> cycles H/W event is not working for me, so perf-top did not do much >> other than start. > > Strange, IIRC it did for me. I'll re-test. > >> perf-stat -ddd shows a whole lot of 0's - which is interesting. It means >> time enabled and time running are non-0, yet the counter value is 0. >> cycles and instructions events also show as not counted > > Most of those counters aren't supported by the emulated PMU. If the counter is unsupported perf-stat should show either or (I submitted a patch for the latter which is in perf-core branch). If you add -v to perf-stat you see the counters are enabled and the time running is getting incremented. ie., something is probably not implemented correctly. > What does > dmesg say about Perf? [ 0.050995] Performance Events: Nehalem events, core PMU driver. [ 0.051466] ... version: 1 [ 0.052998] ... bit width: 40 [ 0.053999] ... generic registers: 2 [ 0.054998] ... value mask: 000000ffffffffff [ 0.055998] ... max period: 000000007fffffff [ 0.057997] ... fixed-purpose events: 0 [ 0.058998] ... event mask: 0000000000000003 > >> Also, the numbers for branches and branch-misses just seem wrong >> compared to the same command run in the host as well as running >> perf-stat in the host on the vcpu thread running openssl (with the vcpu >> pinned to a pcpu). > > Could be due to the fact that the counter is running in host mode. Will You mean when perf is run in the guest? > be fixed once the exclude_host/exclude_guest patch makes it in (and > gains Intel support). > How does exclude_{host,_guest} help if the guest-side counters are low -- by orders of magnitude? David