Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1742380

Re: [PATCH v5 6/7] drivers/perf: Add support for ARMv8.2 Statistical Profiling Extension

From Kim Phillips <kim.phillips@arm.com>
Newsgroups linux.kernel
Subject Re: [PATCH v5 6/7] drivers/perf: Add support for ARMv8.2 Statistical Profiling Extension
Date 2017-09-30 00:20 +0200
Message-ID <uvbNv-3Hg-1@gated-at.bofh.it> (permalink)
References <uuHFM-1y2-21@gated-at.bofh.it> <uuHPs-1Bi-13@gated-at.bofh.it>
Organization Arm

Show all headers | View raw


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.

> +	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?

Kim

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v5 0/7] Add support for the ARMv8.2 Statistical Profiling Extension Will Deacon <will.deacon@arm.com> - 2017-09-28 16:20 +0200
  [PATCH v5 4/7] arm64: sysreg: Move SPE registers and PSB into common header files Will Deacon <will.deacon@arm.com> - 2017-09-28 16:20 +0200
    Re: [PATCH v5 4/7] arm64: sysreg: Move SPE registers and PSB into  common header files Mark Rutland <mark.rutland@arm.com> - 2017-10-02 12:00 +0200
    Re: [PATCH v5 4/7] arm64: sysreg: Move SPE registers and PSB into  common header files Marc Zyngier <marc.zyngier@arm.com> - 2017-10-02 12:00 +0200
  [PATCH v5 7/7] dt-bindings: Document devicetree binding for ARM SPE Will Deacon <will.deacon@arm.com> - 2017-09-28 16:20 +0200
    Re: [PATCH v5 7/7] dt-bindings: Document devicetree binding for ARM  SPE Mark Rutland <mark.rutland@arm.com> - 2017-10-02 12:10 +0200
  [PATCH v5 6/7] drivers/perf: Add support for ARMv8.2 Statistical Profiling Extension Will Deacon <will.deacon@arm.com> - 2017-09-28 16:20 +0200
    Re: [PATCH v5 6/7] drivers/perf: Add support for ARMv8.2  Statistical Profiling Extension Kim Phillips <kim.phillips@arm.com> - 2017-09-30 00:20 +0200
      Re: [PATCH v5 6/7] drivers/perf: Add support for ARMv8.2 Statistical  Profiling Extension Arnaldo Carvalho de Melo <acme@redhat.com> - 2017-10-02 22:50 +0200
  [PATCH v5 2/7] perf/core: Export AUX buffer helpers to modules Will Deacon <will.deacon@arm.com> - 2017-09-28 16:20 +0200
  [PATCH v5 5/7] arm64: head: Init PMSCR_EL2.{PA,PCT} when entered at EL2 without VHE Will Deacon <will.deacon@arm.com> - 2017-09-28 16:20 +0200
    Re: [PATCH v5 5/7] arm64: head: Init PMSCR_EL2.{PA,PCT} when entered  at EL2 without VHE Mark Rutland <mark.rutland@arm.com> - 2017-10-02 12:10 +0200

csiph-web