From: "Zhang, Yanmin" <yanmin_zhang@linux.intel.com>
To: Jes Sorensen <Jes.Sorensen@redhat.com>
Cc: LKML <linux-kernel@vger.kernel.org>,
kvm@vger.kernel.org, Avi Kivity <avi@redhat.com>,
Ingo Molnar <mingo@elte.hu>,
Fr??d??ric Weisbecker <fweisbec@gmail.com>,
Arnaldo Carvalho de Melo <acme@redhat.com>,
Cyrill Gorcunov <gorcunov@gmail.com>,
Lin Ming <ming.m.lin@intel.com>,
Sheng Yang <sheng@linux.intel.com>,
Marcelo Tosatti <mtosatti@redhat.com>,
oerg Roedel <joro@8bytes.org>, Gleb Natapov <gleb@redhat.com>,
Zachary Amsden <zamsden@redhat.com>,
zhiteng.huang@intel.com, tim.c.chen@intel.com,
Peter Zijlstra <a.p.zijlstra@chello.nl>
Subject: Re: [PATCH V2 4/5] ara virt interface of perf to support kvm guest os statistics collection in guest os
Date: Tue, 22 Jun 2010 17:10:26 +0800 [thread overview]
Message-ID: <1277197826.2096.713.camel@ymzhang.sh.intel.com> (raw)
In-Reply-To: <4C20734A.3000008@redhat.com>
On Tue, 2010-06-22 at 10:24 +0200, Jes Sorensen wrote:
> On 06/21/10 11:31, Zhang, Yanmin wrote:
> > @@ -583,10 +584,20 @@ static void x86_pmu_disable_all(void)
> > }
> > }
> >
> > +#ifdef CONFIG_KVM_PERF
> > +static int kvm_hw_perf_enable(void);
> > +static int kvm_hw_perf_disable(void);
> > +#endif
>
> Please put these prototypes into a header ... and create dummy stubs for
> them when CONFIG_KVM_PERF is not set.
Ok. I just didn't want to touch too much generic codes of perf.
>
> > void hw_perf_disable(void)
> > {
> > struct cpu_hw_events *cpuc = &__get_cpu_var(cpu_hw_events);
> >
> > +#ifdef CONFIG_KVM_PERF
> > + if (!kvm_hw_perf_disable())
> > + return;
> > +#endif
>
> If you stub them out we can avoid all the ugly #ifdefs
Ok.
>
> > @@ -810,6 +821,11 @@ void hw_perf_enable(void)
> > struct hw_perf_event *hwc;
> > int i, added = cpuc->n_added;
> >
> > +#ifdef CONFIG_KVM_PERF
> > + if (!kvm_hw_perf_enable())
> > + return;
> > +#endif
>
> and here....
Ok.
>
> > @@ -1317,6 +1334,11 @@ void __init init_hw_perf_events(void)
> >
> > pr_info("Performance Events: ");
> >
> > +#ifdef CONFIG_KVM_PERF
> > + if (!kvm_init_hw_perf_events())
> > + return;
> > +#endif
>
> and again here :)
Ok. Peter is working out a couple of patches to support multiple PMU. His patches
change pmu difition and we might move some into the callbacks. That will become
much clearer.
Yanmin
prev parent reply other threads:[~2010-06-22 9:10 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-06-21 9:31 Zhang, Yanmin
2010-06-22 8:24 ` Jes Sorensen
2010-06-22 9:10 ` Zhang, Yanmin [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=1277197826.2096.713.camel@ymzhang.sh.intel.com \
--to=yanmin_zhang@linux.intel.com \
--cc=Jes.Sorensen@redhat.com \
--cc=a.p.zijlstra@chello.nl \
--cc=acme@redhat.com \
--cc=avi@redhat.com \
--cc=fweisbec@gmail.com \
--cc=gleb@redhat.com \
--cc=gorcunov@gmail.com \
--cc=joro@8bytes.org \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=ming.m.lin@intel.com \
--cc=mingo@elte.hu \
--cc=mtosatti@redhat.com \
--cc=sheng@linux.intel.com \
--cc=tim.c.chen@intel.com \
--cc=zamsden@redhat.com \
--cc=zhiteng.huang@intel.com \
/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
all inboxes | Powered by JetHome®