linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: will.deacon@arm.com (Will Deacon)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v5 6/7] drivers/perf: Add support for ARMv8.2 Statistical Profiling Extension
Date: Mon, 2 Oct 2017 15:14:05 +0100	[thread overview]
Message-ID: <20171002141405.GC12847@arm.com> (raw)
In-Reply-To: <20170929171940.2aa33d00463b1e9c987aea15@arm.com>

Hi Kim,

On Fri, Sep 29, 2017 at 05:19:40PM -0500, Kim Phillips wrote:
> On Thu, 28 Sep 2017 15:09:50 +0100
> Will Deacon <will.deacon@arm.com> wrote:
> 
> > +/* Perf callbacks */
> > +static int arm_spe_pmu_event_init(struct perf_event *event)
> > +{
> > +	u64 reg;
> > +	struct perf_event_attr *attr = &event->attr;
> > +	struct arm_spe_pmu *spe_pmu = to_spe_pmu(event->pmu);
> > +
> > +	/* This is, of course, deeply driver-specific */
> > +	if (attr->type != event->pmu->type)
> > +		return -ENOENT;
> > +
> > +	if (event->cpu >= 0 &&
> > +	    !cpumask_test_cpu(event->cpu, &spe_pmu->supported_cpus))
> > +		return -ENOENT;
> 
> So -ENOENT will make tools/perf/util/evsel.c tell the user "The %s event is not
> supported." whereas returning -ENODEV will say "No such device - did
> you specify an out-of-range profile CPU?" which may or may not be more
> appropriate for this check.

I agree that the message isn't great, but I'm returning ENOENT here to
be consistent with the CPU PMU behaviour (which necessarily has to return
ENOENT so that we can support ABI event types over there -- see
perf_init_event).

> > +	if (arm_spe_event_to_pmsevfr(event) & SYS_PMSEVFR_EL1_RES0)
> > +		return -EOPNOTSUPP;
> > +	if (attr->exclude_idle)
> > +		return -EOPNOTSUPP;
> 
> "PMU Hardware doesn't support sampling/overflow-interrupts." will be
> printed if the user didn't specify a sample period.  Otherwise, a
> string with "/bin/dmesg may provide additional information." will be
> printed.
> 
> I was hoping for a response from acme by now for this:
> 
> https://www.spinics.net/lists/linux-perf-users/msg04066.html
> 
> Alas, nothing.  Looking at the #ifdef x86 in evsel.c, I'm guessing
> it'll be ok, although I'm still not sure how PMU-specific we can get in
> evsel.c, nor whether it's ok to communicate lists of h/w supported
> sample periods through /sys/bus/event_source/devices/...
> 
> acme?  OK to refactor evsel messaging for Arm, including parsing for
> which PMUs are being used, so customize the message?

Arnaldo's probably got enough on his plate maintaining perf tool, so my
advice would be to post a patch as an RFC and use that as a concrete basis
for discussion. It often works out better starting with code, even if none
of it ends up getting merged (and you can include bits of your email above
in the cover letter).

Will

  reply	other threads:[~2017-10-02 14:14 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-28 14:09 [PATCH v5 0/7] Add support for the ARMv8.2 Statistical Profiling Extension Will Deacon
2017-09-28 14:09 ` [PATCH v5 1/7] genirq: export irq_get_percpu_devid_partition to modules Will Deacon
2017-09-28 14:09 ` [PATCH v5 2/7] perf/core: Export AUX buffer helpers " Will Deacon
2017-09-28 14:09 ` [PATCH v5 3/7] perf/core: Add PERF_AUX_FLAG_COLLISION to report colliding samples Will Deacon
2017-09-28 14:09 ` [PATCH v5 4/7] arm64: sysreg: Move SPE registers and PSB into common header files Will Deacon
2017-10-02  9:53   ` Marc Zyngier
2017-10-02  9:55   ` Mark Rutland
2017-09-28 14:09 ` [PATCH v5 5/7] arm64: head: Init PMSCR_EL2.{PA, PCT} when entered at EL2 without VHE Will Deacon
2017-10-02 10:03   ` Mark Rutland
2017-09-28 14:09 ` [PATCH v5 6/7] drivers/perf: Add support for ARMv8.2 Statistical Profiling Extension Will Deacon
2017-09-29 22:19   ` Kim Phillips
2017-10-02 14:14     ` Will Deacon [this message]
2017-10-02 16:49       ` Arnaldo Carvalho de Melo
2017-10-02 23:35         ` Kim Phillips
2017-10-03 14:22           ` Will Deacon
2017-10-24  8:42           ` Kim Phillips
2017-09-28 14:09 ` [PATCH v5 7/7] dt-bindings: Document devicetree binding for ARM SPE Will Deacon
2017-10-02 10:07   ` Mark Rutland

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=20171002141405.GC12847@arm.com \
    --to=will.deacon@arm.com \
    --cc=linux-arm-kernel@lists.infradead.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).