From mboxrd@z Thu Jan 1 00:00:00 1970 From: Joerg Roedel Subject: Re: KVM PMU virtualization Date: Fri, 26 Feb 2010 09:51:06 +0100 Message-ID: <20100226085105.GC4246@8bytes.org> References: <4B86917C.4070102@redhat.com> <20100225173423.GB4246@8bytes.org> <1267152917.1726.82.camel@localhost> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Jes Sorensen , KVM General , Peter Zijlstra , Avi Kivity , Zachary Amsden , Gleb Natapov , Ingo Molnar , ming.m.lin@intel.com To: "Zhang, Yanmin" Return-path: Received: from 8bytes.org ([88.198.83.132]:39582 "EHLO 8bytes.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935550Ab0BZIvJ (ORCPT ); Fri, 26 Feb 2010 03:51:09 -0500 Content-Disposition: inline In-Reply-To: <1267152917.1726.82.camel@localhost> Sender: kvm-owner@vger.kernel.org List-ID: On Fri, Feb 26, 2010 at 10:55:17AM +0800, Zhang, Yanmin wrote: > On Thu, 2010-02-25 at 18:34 +0100, Joerg Roedel wrote: > > On Thu, Feb 25, 2010 at 04:04:28PM +0100, Jes Sorensen wrote: > > > > > 1) Add support to perf to allow it to monitor a KVM guest from the > > > host. > > > > This shouldn't be a big problem. The PMU of AMD Fam10 processors can be > > configured to count only when in guest mode. Perf needs to be aware of > > that and fetch the rip from a different place when monitoring a guest. > The idea is we want to measure both host and guest at the same time, and > compare all the hot functions fairly. So you want to measure while the guest vcpu is running and the vmexit path of that vcpu (including qemu userspace part) together? The challenge here is to find out if a performance event originated in guest mode or in host mode. But we can check for that in the nmi-protected part of the vmexit path. Joerg