[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200117151658.GH14879@hirez.programming.kicks-ass.net>
Date: Fri, 17 Jan 2020 16:16:58 +0100
From: Peter Zijlstra <peterz@...radead.org>
To: James Clark <James.Clark@....com>
Cc: Will Deacon <will@...nel.org>,
"linux-arm-kernel@...ts.infradead.org"
<linux-arm-kernel@...ts.infradead.org>, nd <nd@....com>,
Mark Rutland <Mark.Rutland@....com>,
Ingo Molnar <mingo@...hat.com>,
Arnaldo Carvalho de Melo <acme@...nel.org>,
Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
Jiri Olsa <jolsa@...hat.com>,
Tan Xiaojun <tanxiaojun@...wei.com>,
Al Grant <Al.Grant@....com>,
Namhyung Kim <namhyung@...nel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 1/1] Return EINVAL when precise_ip perf events are
requested on Arm
On Fri, Jan 17, 2020 at 03:00:37PM +0000, James Clark wrote:
> Hi Peter,
>
> Do you mean something like this?
Yes.
> diff --git a/kernel/events/core.c b/kernel/events/core.c
> index 43d1d4945433..f74acd085bea 100644
> --- a/kernel/events/core.c
> +++ b/kernel/events/core.c
> @@ -10812,6 +10812,12 @@ perf_event_alloc(struct perf_event_attr *attr, int cpu,
> goto err_pmu;
> }
>
> + if (event->attr.precise_ip &&
> + !(pmu->capabilities & PERF_PMU_CAP_PRECISE_IP)) {
> + err = -EOPNOTSUPP;
> + goto err_pmu;
> + }
> +
> err = exclusive_event_init(event);
> if (err)
> goto err_pmu;
>
>
> Or should it only be done via sysfs to not break userspace?
So we've added checks like this in the past and gotten away with it. Do
you already know of some userspace that will break due to it?
An alternative approach is adding a sysctl like kernel.perf_nostrict
which would disable this or something, that way 'old' userspace has a
chicken bit.
Powered by blists - more mailing lists