kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Roedel, Joerg" <Joerg.Roedel@amd.com>
To: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Paul Mackerras <paulus@samba.org>, Ingo Molnar <mingo@elte.hu>,
	Arnaldo Carvalho de Melo <acme@ghostprotocols.net>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"kvm@vger.kernel.org" <kvm@vger.kernel.org>
Subject: Re: [PATCH 3/3] perf, tools: Add support for guest/host-only profiling
Date: Tue, 10 May 2011 17:46:52 +0200	[thread overview]
Message-ID: <20110510154652.GF30996@amd.com> (raw)
In-Reply-To: <1305041114.2914.105.camel@laptop>

On Tue, May 10, 2011 at 11:25:14AM -0400, Peter Zijlstra wrote:
> On Tue, 2011-05-10 at 17:08 +0200, Roedel, Joerg wrote:
> > On Tue, May 10, 2011 at 10:50:08AM -0400, Peter Zijlstra wrote:
> > > On Tue, 2011-05-10 at 16:35 +0200, Joerg Roedel wrote:
> > > > @@ -740,6 +740,12 @@ parse_event_modifier(const char **strp, struct perf_event_attr *attr)
> > > >                         if (!exclude)
> > > >                                 exclude = eu = ek = eh = 1;
> > > >                         eh = 0;
> > > > +               } else if (*str == 'G') {
> > > > +                       eg   = 0;
> > > > +                       ehst = 1;
> > > > +               } else if (*str == 'H') {
> > > > +                       eg   = 1;
> > > > +                       ehst = 0; 
> > > 
> > > This doesn't match the existing exclude logic, also eH and eG come to
> > > mind.
> > 
> > OK, eH and eG seems like a better choice. Regarding the logic I
> > explictly decided to do it this way. The reason is that guest/host
> > counting is orthogonal to user/kernel/hv counting. You can decide to
> > only count guest-kernel for example. And if a user just specifies
> > -e cycles:G this would automatically exlucde user and kernel counting.
> > This didn't make sense to me so I decided to keep the logic seperate for
> > guest/host exclusions.
> 
> OK, so the changelog lacked that bit of information ;-)

Okay, so I add this information to the changelog.

> How about you do something like:
> 
> 
> 
> +               } else if (*str == 'G') {
> +			if (!excl_GH)
> +				excl_GH = eH = eG = 1;
> +                       eG   = 0;
> +               } else if (*str == 'H') {
> +			if (!excl_GH)
> +				excl_GH = eH = eG = 1;
> +                       eH   = 0;
> 
> Which mirrors the existing logic but keeps it orthogonal?

Right, it would better fit to the u/k/hv logic. It is not strictly
needed because there are only two excludes here but it makes the code
look more consistent. I'll change it.

> Hmm,. does this nicely integrate with exclude_hv? that seems to want to
> be grouped with G/H.

I intended to re-use the exlude_hv bit originally, but then I looked
into how this bit is used. On PPC it looks like this bit is set when
Linux itself runs as a guest to exclude the hypervisor code being
profiled. The meaning here is different (beacause Linux itself is the
hypervisor) and I wanted to avoid different semantics for this bit
across architectures. So I introduces seperate bits.
The exclude_hv bit can be used when we have some kind of perf-ctr
support for KVM guests.

Regards,

	Joerg

  reply	other threads:[~2011-05-10 15:46 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-10 14:35 [RFC][PATCH 0/3] perf support for amd guest/host-only bits Joerg Roedel
2011-05-10 14:35 ` [PATCH 1/3] perf, core: Introduce attrs to count in either host or guest mode Joerg Roedel
2011-05-10 14:45   ` Peter Zijlstra
2011-05-10 14:59     ` Roedel, Joerg
2011-05-10 15:18       ` Peter Zijlstra
2011-05-10 15:38         ` Roedel, Joerg
2011-05-10 16:07           ` Peter Zijlstra
2011-05-10 16:25             ` Roedel, Joerg
2011-05-11 11:44   ` Avi Kivity
2011-05-11 11:45     ` Avi Kivity
2011-05-11 13:49       ` Peter Zijlstra
2011-05-11 13:52         ` Avi Kivity
2011-05-11 14:02           ` Ingo Molnar
2011-05-10 14:35 ` [PATCH 2/3] perf, x86: Use GO/HO bits in perf-ctr Joerg Roedel
2011-05-10 14:48   ` Peter Zijlstra
2011-05-10 15:04     ` Roedel, Joerg
2011-05-11 12:58       ` Avi Kivity
2011-05-12  9:21         ` Joerg Roedel
2011-05-10 14:35 ` [PATCH 3/3] perf, tools: Add support for guest/host-only profiling Joerg Roedel
2011-05-10 14:50   ` Peter Zijlstra
2011-05-10 15:08     ` Roedel, Joerg
2011-05-10 15:25       ` Peter Zijlstra
2011-05-10 15:46         ` Roedel, Joerg [this message]
2011-05-10 16:09           ` Peter Zijlstra
2011-05-10 15:21 ` [RFC][PATCH 0/3] perf support for amd guest/host-only bits Ingo Molnar
2011-05-10 15:50   ` Roedel, Joerg
2011-05-10 20:41     ` Ingo Molnar
2011-05-11  8:57       ` Joerg Roedel

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=20110510154652.GF30996@amd.com \
    --to=joerg.roedel@amd.com \
    --cc=a.p.zijlstra@chello.nl \
    --cc=acme@ghostprotocols.net \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=paulus@samba.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).