From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Zhang, Yanmin" Subject: Re: KVM PMU virtualization Date: Thu, 04 Mar 2010 09:00:50 +0800 Message-ID: <1267664450.1726.199.camel@localhost> References: <4B86917C.4070102@redhat.com> <20100225173423.GB4246@8bytes.org> <1267152917.1726.82.camel@localhost> <20100226085105.GC4246@8bytes.org> <20100226091732.GI15885@elte.hu> <1267513746.1726.104.camel@localhost> <20100302093629.GB8591@elte.hu> <1267587152.1726.171.camel@localhost> <1267608432.1726.182.camel@localhost> <1267611323.25158.86.camel@laptop> Mime-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit Cc: Ingo Molnar , Joerg Roedel , Jes Sorensen , KVM General , Avi Kivity , Zachary Amsden , Gleb Natapov , ming.m.lin@intel.com To: Peter Zijlstra Return-path: Received: from mga06.intel.com ([134.134.136.21]:61431 "EHLO orsmga101.jf.intel.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751101Ab0CDA63 (ORCPT ); Wed, 3 Mar 2010 19:58:29 -0500 In-Reply-To: <1267611323.25158.86.camel@laptop> Sender: kvm-owner@vger.kernel.org List-ID: On Wed, 2010-03-03 at 11:15 +0100, Peter Zijlstra wrote: > On Wed, 2010-03-03 at 17:27 +0800, Zhang, Yanmin wrote: > > -#ifndef perf_misc_flags > > -#define perf_misc_flags(regs) (user_mode(regs) ? PERF_RECORD_MISC_USER : \ > > - PERF_RECORD_MISC_KERNEL) > > -#define perf_instruction_pointer(regs) instruction_pointer(regs) > > -#endif > > Ah, that #ifndef is for powerpc, which I think you just broke. Thanks for the reminder. I deleted powerpc codes when building cscope lib. It seems perf_save_virt_ip/perf_reset_virt_ip interfaces are ugly. I plan to change them to a callback function struct and kvm registers its version to perf. Such like: struct perf_guest_info_callbacks { int (*is_in_guest)(); u64 (*get_guest_ip)(); int (*copy_guest_stack)(); int (*reset_in_guest)(); ... }; int perf_register_guest_info_callbacks(struct perf_guest_info_callbacks *); int perf_unregister_guest_info_callbacks(struct perf_guest_info_callbacks *); It's more scalable and neater.