From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Cooper Subject: Re: [PATCH 1/2] xenoprof: fix up ability to disable it Date: Mon, 8 Feb 2016 16:25:04 +0000 Message-ID: <56B8C160.5030905@citrix.com> References: <1454947487-8588-1-git-send-email-cardoe@cardoe.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1454947487-8588-1-git-send-email-cardoe@cardoe.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Doug Goldstein , xen-devel@lists.xen.org Cc: Kevin Tian , Keir Fraser , Suravee Suthikulpanit , Jan Beulich , Aravind Gopalakrishnan , Jun Nakajima , Boris Ostrovsky List-Id: xen-devel@lists.xenproject.org On 08/02/16 16:04, Doug Goldstein wrote: > diff --git a/xen/arch/x86/cpu/vpmu_amd.c b/xen/arch/x86/cpu/vpmu_amd.c > index 990e6f3..c7b5bd5 100644 > --- a/xen/arch/x86/cpu/vpmu_amd.c > +++ b/xen/arch/x86/cpu/vpmu_amd.c > @@ -22,6 +22,7 @@ > */ > > #include > +#include > #include > #include > #include > @@ -378,7 +379,8 @@ static int amd_vpmu_do_wrmsr(unsigned int msr, uint64_t msr_content, > if ( (type == MSR_TYPE_CTRL) && > is_pmu_enabled(msr_content) && !vpmu_is_set(vpmu, VPMU_RUNNING) ) > { > - if ( !acquire_pmu_ownership(PMU_OWNER_HVM) ) > + if ( IS_ENABLED(CONFIG_XENOPROF) && > + !acquire_pmu_ownership(PMU_OWNER_HVM) ) > return 0; > vpmu_set(vpmu, VPMU_RUNNING); > Instead of modifying each caller into the oprofile code like this, I wonder whether it would be neater to produce an empty set of static inlines in xenoprof.h when !CONFIG_XENOPROF, similar to CONFIG_SHADOW_PAGING in xen/include/asm-x86/shadow.h ~Andrew