linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Boris Ostrovsky <boris.ostrovsky@oracle.com>
To: Peter Zijlstra <peterz@infradead.org>,
	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>,
	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:36:33 -0500	[thread overview]
Message-ID: <7300f0af-b532-5546-a6f4-fec69cb91a0f@oracle.com> (raw)
In-Reply-To: <20190108104841.GD6808@hirez.programming.kicks-ass.net>

On 1/8/19 5:48 AM, Peter Zijlstra wrote:
> 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?

perf does work inside guests.

VPMU is managed by the Xen and it presents to the guest only samples
that are associated with the guest. So from that perspective exclude_hv
doesn't seem to be needed.

There is a VPMU mode that allows profiling whole system (host and
guests) from dom0, and this where exclude_hv might be useful. But this
mode, ahem, needs some work.


-boris

  parent reply	other threads:[~2019-01-08 16:58 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
2019-01-08 13:12     ` Andrew Murray
2019-01-08 16:36     ` Boris Ostrovsky [this message]
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=7300f0af-b532-5546-a6f4-fec69cb91a0f@oracle.com \
    --to=boris.ostrovsky@oracle.com \
    --cc=acme@kernel.org \
    --cc=andrew.murray@arm.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=peterz@infradead.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).