linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Andrew Murray <andrew.murray@arm.com>
Cc: Mark Rutland <mark.rutland@arm.com>,
	Will Deacon <will.deacon@arm.com>,
	Paul Mackerras <paulus@samba.org>,
	Shawn Guo <shawnguo@kernel.org>,
	boris.ostrovsky@oracle.com, x86@kernel.org,
	Russell King <linux@armlinux.org.uk>,
	Ingo Molnar <mingo@redhat.com>, Matt Turner <mattst88@gmail.com>,
	suzuki.poulose@arm.com, Sascha Hauer <s.hauer@pengutronix.de>,
	Arnaldo Carvalho de Melo <acme@kernel.org>,
	Ivan Kokshaysky <ink@jurassic.park.msu.ru>,
	Thomas Gleixner <tglx@linutronix.de>,
	linux-arm-kernel@lists.infradead.org,
	Richard Henderson <rth@twiddle.net>,
	jgross@suse.com, robin.murphy@arm.com,
	linux-kernel@vger.kernel.org, linux-alpha@vger.kernel.org,
	Borislav Petkov <bp@alien8.de>,
	linuxppc-dev@lists.ozlabs.org
Subject: Re: [PATCH v4 10/13] x86: perf/core: use PERF_PMU_CAP_NO_EXCLUDE for exclude incapable PMUs
Date: Tue, 8 Jan 2019 11:48:41 +0100	[thread overview]
Message-ID: <20190108104841.GD6808@hirez.programming.kicks-ass.net> (raw)
In-Reply-To: <1546878450-20341-11-git-send-email-andrew.murray@arm.com>

On Mon, Jan 07, 2019 at 04:27:27PM +0000, Andrew Murray wrote:
> For drivers that do not support context exclusion let's advertise the
> PERF_PMU_CAP_NOEXCLUDE capability. This ensures that perf will
> prevent us from handling events where any exclusion flags are set.
> Let's also remove the now unnecessary check for exclusion flags.
> 
> Signed-off-by: Andrew Murray <andrew.murray@arm.com>
> ---
>  arch/x86/events/amd/ibs.c          | 13 +------------
>  arch/x86/events/amd/power.c        | 10 ++--------
>  arch/x86/events/intel/cstate.c     | 12 +++---------
>  arch/x86/events/intel/rapl.c       |  9 ++-------
>  arch/x86/events/intel/uncore_snb.c |  9 ++-------
>  arch/x86/events/msr.c              | 10 ++--------
>  6 files changed, 12 insertions(+), 51 deletions(-)

You (correctly) don't add CAP_NO_EXCLUDE to the main x86 pmu code, but
then you also don't check if it handles all the various exclude options
correctly/consistently.

Now; I must admit that that is a bit of a maze, but I think we can at
least add exclude_idle and exclude_hv fails in there, nothing uses those
afaict.

On the various exclude options; they are as follows (IIUC):

  - exclude_guest: we're a HV/host-kernel and we don't want the counter
                   to run when we run a guest context.

  - exclude_host: we're a HV/host-kernel and we don't want the counter
                  to run when we run in host context.

  - exclude_hv: we're a guest and don't want the counter to run in HV
                context.

Now, KVM always implies exclude_hv afaict (for guests), I'm not sure
what, if anything Xen does on x86 (IIRC Brendan Gregg once said perf
works on Xen) -- nor quite sure who to ask, Boris, Jeurgen?


  reply	other threads:[~2019-01-08 10:51 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-07 16:27 [PATCH v4 00/13] perf/core: Generalise event exclusion checking Andrew Murray
2019-01-07 16:27 ` [PATCH v4 01/13] perf/doc: update design.txt for exclude_{host|guest} flags Andrew Murray
2019-01-07 16:27 ` [PATCH v4 02/13] perf/core: add function to test for event exclusion flags Andrew Murray
2019-01-07 16:27 ` [PATCH v4 03/13] perf/core: add PERF_PMU_CAP_NO_EXCLUDE for exclusion incapable PMUs Andrew Murray
2019-01-07 16:27 ` [PATCH v4 04/13] alpha: perf/core: use PERF_PMU_CAP_NO_EXCLUDE Andrew Murray
2019-01-07 16:27 ` [PATCH v4 05/13] arm: perf: conditionally " Andrew Murray
2019-01-08 10:28   ` Peter Zijlstra
2019-01-08 13:07     ` Andrew Murray
2019-01-08 13:10       ` Peter Zijlstra
2019-01-08 13:13         ` Andrew Murray
2019-01-08 14:43           ` Peter Zijlstra
2019-01-07 16:27 ` [PATCH v4 06/13] arm: perf/core: use PERF_PMU_CAP_NO_EXCLUDE for exclude incapable PMUs Andrew Murray
2019-01-07 16:27 ` [PATCH v4 07/13] drivers/perf: " Andrew Murray
2019-01-07 16:27 ` [PATCH v4 08/13] " Andrew Murray
2019-01-07 16:27 ` [PATCH v4 09/13] powerpc: " Andrew Murray
2019-01-07 16:27 ` [PATCH v4 10/13] x86: " Andrew Murray
2019-01-08 10:48   ` Peter Zijlstra [this message]
2019-01-08 13:12     ` Andrew Murray
2019-01-08 16:36     ` Boris Ostrovsky
2019-01-08 18:49       ` Peter Zijlstra
2019-01-10 13:15     ` Michael Ellerman
2019-01-07 16:27 ` [PATCH v4 11/13] " Andrew Murray
2019-01-08 10:49   ` Peter Zijlstra
2019-01-08 13:08     ` Andrew Murray
2019-01-07 16:27 ` [PATCH v4 12/13] perf/core: remove unused perf_flags Andrew Murray
2019-01-07 16:27 ` [PATCH v4 13/13] drivers/perf: use PERF_PMU_CAP_NO_EXCLUDE for Cavium TX2 PMU Andrew Murray
2019-01-10 11:10   ` Will Deacon

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=20190108104841.GD6808@hirez.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=acme@kernel.org \
    --cc=andrew.murray@arm.com \
    --cc=boris.ostrovsky@oracle.com \
    --cc=bp@alien8.de \
    --cc=ink@jurassic.park.msu.ru \
    --cc=jgross@suse.com \
    --cc=linux-alpha@vger.kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=mark.rutland@arm.com \
    --cc=mattst88@gmail.com \
    --cc=mingo@redhat.com \
    --cc=paulus@samba.org \
    --cc=robin.murphy@arm.com \
    --cc=rth@twiddle.net \
    --cc=s.hauer@pengutronix.de \
    --cc=shawnguo@kernel.org \
    --cc=suzuki.poulose@arm.com \
    --cc=tglx@linutronix.de \
    --cc=will.deacon@arm.com \
    --cc=x86@kernel.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).