From: Will Deacon <will.deacon@arm.com>
To: Suzuki K Poulose <suzuki.poulose@arm.com>
Cc: linux-arm-kernel@lists.infradead.org, mark.rutland@arm.com,
Ganapatrao.Kulkarni@cavium.com, stable@vger.kernel.org
Subject: Re: [PATCH 1/6] arm64: perf: Reject stand-alone CHAIN events for PMUv3
Date: Thu, 11 Oct 2018 10:04:11 +0100 [thread overview]
Message-ID: <20181011090410.GA20836@arm.com> (raw)
In-Reply-To: <3fdfb5d5-b667-e797-3605-7557cc810f90@arm.com>
On Wed, Oct 10, 2018 at 06:30:13PM +0100, Suzuki K Poulose wrote:
> On 10/10/18 17:31, Will Deacon wrote:
> >It doesn't make sense for a perf event to be configured as a CHAIN event
> >in isolation, so extend the arm_pmu structure with a ->filter_match()
> >function to allow the backend PMU implementation to reject CHAIN events
> >early.
> >
> >Cc: <stable@vger.kernel.org>
> >Signed-off-by: Will Deacon <will.deacon@arm.com>
>
>
>
> >---
> > arch/arm64/kernel/perf_event.c | 7 +++++++
> > drivers/perf/arm_pmu.c | 8 +++++++-
> > include/linux/perf/arm_pmu.h | 1 +
> > 3 files changed, 15 insertions(+), 1 deletion(-)
> >
> >diff --git a/arch/arm64/kernel/perf_event.c b/arch/arm64/kernel/perf_event.c
> >index 8e38d5267f22..e213f8e867f6 100644
> >--- a/arch/arm64/kernel/perf_event.c
> >+++ b/arch/arm64/kernel/perf_event.c
> >@@ -966,6 +966,12 @@ static int armv8pmu_set_event_filter(struct hw_perf_event *event,
> > return 0;
> > }
> >+static int armv8pmu_filter_match(struct perf_event *event)
> >+{
> >+ unsigned long evtype = event->hw.config_base & ARMV8_PMU_EVTYPE_EVENT;
> >+ return evtype != ARMV8_PMUV3_PERFCTR_CHAIN;
> >+}
> >+
>
> The patch looks correct. I guess we could handle it via the existing
> map_event(), avoiding another arch specific callback.
I initially implemented it using ->map_event(), but that has weird
interactions with groups where other events in the group following the
CHAIN event will not count, but previous events will. This means that the
perf behaviour depends on the order in which you specify the events, which
is really confusing!
> Either way,
>
> Reviewed-by: Suzuki K Poulose <suzuki.poulose@arm.com>
Thanks.
Will
prev parent reply other threads:[~2018-10-11 16:30 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1539189115-16221-1-git-send-email-will.deacon@arm.com>
2018-10-10 16:31 ` [PATCH 1/6] arm64: perf: Reject stand-alone CHAIN events for PMUv3 Will Deacon
2018-10-10 17:30 ` Suzuki K Poulose
2018-10-11 9:04 ` Will Deacon [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=20181011090410.GA20836@arm.com \
--to=will.deacon@arm.com \
--cc=Ganapatrao.Kulkarni@cavium.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=mark.rutland@arm.com \
--cc=stable@vger.kernel.org \
--cc=suzuki.poulose@arm.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;
as well as URLs for NNTP newsgroup(s).