xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Doug Goldstein <cardoe@cardoe.com>, xen-devel@lists.xen.org
Cc: Kevin Tian <kevin.tian@intel.com>, Keir Fraser <keir@xen.org>,
	Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>,
	Jan Beulich <jbeulich@suse.com>,
	Aravind Gopalakrishnan <Aravind.Gopalakrishnan@amd.com>,
	Jun Nakajima <jun.nakajima@intel.com>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>
Subject: Re: [PATCH 1/2] xenoprof: fix up ability to disable it
Date: Mon, 8 Feb 2016 16:25:04 +0000	[thread overview]
Message-ID: <56B8C160.5030905@citrix.com> (raw)
In-Reply-To: <1454947487-8588-1-git-send-email-cardoe@cardoe.com>

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 <xen/config.h>
> +#include <xen/kconfig.h>
>  #include <xen/xenoprof.h>
>  #include <xen/hvm/save.h>
>  #include <xen/sched.h>
> @@ -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

      parent reply	other threads:[~2016-02-08 16:25 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-08 16:04 [PATCH 1/2] xenoprof: fix up ability to disable it Doug Goldstein
2016-02-08 16:04 ` [PATCH 2/2] build: convert xenoprof to Kconfig Doug Goldstein
2016-02-08 16:14   ` Andrew Cooper
2016-02-08 16:24 ` [PATCH 1/2] xenoprof: fix up ability to disable it Boris Ostrovsky
2016-02-09  3:01   ` Doug Goldstein
2016-02-09  4:05   ` Doug Goldstein
2016-02-09 13:34     ` Boris Ostrovsky
2016-02-08 16:25 ` Andrew Cooper [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=56B8C160.5030905@citrix.com \
    --to=andrew.cooper3@citrix.com \
    --cc=Aravind.Gopalakrishnan@amd.com \
    --cc=boris.ostrovsky@oracle.com \
    --cc=cardoe@cardoe.com \
    --cc=jbeulich@suse.com \
    --cc=jun.nakajima@intel.com \
    --cc=keir@xen.org \
    --cc=kevin.tian@intel.com \
    --cc=suravee.suthikulpanit@amd.com \
    --cc=xen-devel@lists.xen.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).