Subject: Re: [PATCH/RFC] Make perf_event_open() propagate errors for use in bpf_perf_event_open()

From: Peter Zijlstra <[email-masked]>
Date: Fri, 18 Jan 2019 17:19:59 +0100

On Fri, Jan 18, 2019 at 12:09:38PM -0300, Arnaldo Carvalho de Melo wrote:
> commit 1b3b3dee572d0b77a316ab6715091201be6832de
> Author: Arnaldo Carvalho de Melo <[email-masked]>
> Date:   Fri Jan 11 13:20:20 2019 -0300
> 
>     perf: Make perf_event_output() propagate the output() return
>     
>     For the original mode of operation it isn't needed, since we report back
>     errors via PERF_RECORD_LOST records in the ring buffer, but for use in
>     bpf_perf_event_output() it is convenient to return the errors, basically
>     -ENOSPC.
>     
>     Currently bpf_perf_event_output() returns an error indication, the last
>     thing it does, which is to push it to the ring buffer is that can fail
>     and if so, this failure won't be reported back to its users, fix it.
>     
>     Reported-by: Jamal Hadi Salim <[email-masked]>
>     Tested-by: Jamal Hadi Salim <[email-masked]>
>     Cc: Adrian Hunter <[email-masked]>
>     Cc: Alexei Starovoitov <[email-masked]>
>     Cc: Daniel Borkmann <[email-masked]>
>     Cc: Jiri Olsa <[email-masked]>
>     Cc: Namhyung Kim <[email-masked]>
>     Cc: Peter Zijlstra <[email-masked]>
>     Link: https://lkml.kernel.org/r/[email-masked]
>     Signed-off-by: Arnaldo Carvalho de Melo <[email-masked]>

/me hates on git-format :-)

Acked-by: Peter Zijlstra (Intel) <[email-masked]>