[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190108102802.GC6808@hirez.programming.kicks-ass.net>
Date: Tue, 8 Jan 2019 11:28:02 +0100
From: Peter Zijlstra <peterz@...radead.org>
To: Andrew Murray <andrew.murray@....com>
Cc: Ingo Molnar <mingo@...hat.com>,
Arnaldo Carvalho de Melo <acme@...nel.org>,
Richard Henderson <rth@...ddle.net>,
Ivan Kokshaysky <ink@...assic.park.msu.ru>,
Matt Turner <mattst88@...il.com>,
Will Deacon <will.deacon@....com>,
Mark Rutland <mark.rutland@....com>,
Shawn Guo <shawnguo@...nel.org>,
Sascha Hauer <s.hauer@...gutronix.de>,
Benjamin Herrenschmidt <benh@...nel.crashing.org>,
Paul Mackerras <paulus@...ba.org>,
Thomas Gleixner <tglx@...utronix.de>,
Borislav Petkov <bp@...en8.de>,
Russell King <linux@...linux.org.uk>, suzuki.poulose@....com,
robin.murphy@....com, Michael Ellerman <mpe@...erman.id.au>,
x86@...nel.org, linuxppc-dev@...ts.ozlabs.org,
linux-kernel@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
linux-alpha@...r.kernel.org
Subject: Re: [PATCH v4 05/13] arm: perf: conditionally use
PERF_PMU_CAP_NO_EXCLUDE
On Mon, Jan 07, 2019 at 04:27:22PM +0000, Andrew Murray wrote:
> @@ -393,9 +386,8 @@ __hw_perf_event_init(struct perf_event *event)
> /*
> * Check whether we need to exclude the counter from certain modes.
> */
> + if (armpmu->set_event_filter &&
> + armpmu->set_event_filter(hwc, &event->attr)) {
> pr_debug("ARM performance counters do not support "
> "mode exclusion\n");
> return -EOPNOTSUPP;
This then requires all set_event_filter() implementations to check all
the various exclude options; also, set_event_filter() failing then
returns with -EOPNOTSUPP instead of the -EINVAL the CAP_NO_EXCLUDE
generates, which is again inconsitent.
If I look at (the very first git-grep found me)
armv7pmu_set_event_filter(), then I find it returning -EPERM (again
inconsistent but irrelevant because the actual value is not preserved)
for exclude_idle.
But it doesn't seem to check exclude_host at all for example.
> @@ -867,6 +859,9 @@ int armpmu_register(struct arm_pmu *pmu)
> if (ret)
> return ret;
>
> + if (!pmu->set_event_filter)
> + pmu->pmu.capabilities |= PERF_PMU_CAP_NO_EXCLUDE;
> +
> ret = perf_pmu_register(&pmu->pmu, pmu->name, -1);
> if (ret)
> goto out_destroy;
> --
> 2.7.4
>
Powered by blists - more mailing lists