[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAADnVQL4zBmS5Yo3skoA32YjFXz5qu0q9LuJ5Z-61EGwZzgD6Q@mail.gmail.com>
Date: Sat, 14 Nov 2020 08:07:29 -0800
From: Alexei Starovoitov <alexei.starovoitov@...il.com>
To: Florian Lehner <dev@...-flo.net>
Cc: bpf <bpf@...r.kernel.org>,
Network Development <netdev@...r.kernel.org>,
LKML <linux-kernel@...r.kernel.org>,
Alexei Starovoitov <ast@...nel.org>,
Daniel Borkmann <daniel@...earbox.net>,
Andrii Nakryiko <andrii@...nel.org>,
John Fastabend <john.fastabend@...il.com>,
Peter Zijlstra <peterz@...radead.org>,
Ingo Molnar <mingo@...hat.com>,
Arnaldo Carvalho de Melo <acme@...nel.org>
Subject: Re: [PATCH bpf,perf]] bpf,perf: return EOPNOTSUPP for attaching bpf
handler on PERF_COUNT_SW_DUMMY
On Sat, Nov 14, 2020 at 5:53 AM Florian Lehner <dev@...-flo.net> wrote:
>
> At the moment it is not possible to attach a bpf handler to a perf event
> of type PERF_TYPE_SOFTWARE with a configuration of PERF_COUNT_SW_DUMMY.
It is possible or it is not possible?
Such "commit log as an abstract statement" patches are a mystery to a reader.
Please explain what problem you're trying to solve and how it's being addressed.
> Signed-off-by: Florian Lehner <dev@...-flo.net>
> ---
> kernel/events/core.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/kernel/events/core.c b/kernel/events/core.c
> index da467e1dd49a..4e8846b7ceda 100644
> --- a/kernel/events/core.c
> +++ b/kernel/events/core.c
> @@ -9668,6 +9668,10 @@ static int perf_event_set_bpf_handler(struct perf_event *event, u32 prog_fd)
> if (event->prog)
> return -EEXIST;
>
> + if (event->attr.type == PERF_TYPE_SOFTWARE &&
> + event->attr.config == PERF_COUNT_SW_DUMMY)
> + return -EOPNOTSUPP;
Is it a fix or a feature?
If it is a fix please add 'Fixes:' tag.
Powered by blists - more mailing lists