Re: [PATCH bpf-next 1/4] bpf: Add log support for perf link_create
From: Leon Hwang
Date: Thu Dec 03 2026 - 01:20:47 EST
On 3/12/26 09:40, Alexei Starovoitov wrote:
> On Wed Dec 2, 2026 at 3:37 PM UTC, Leon Hwang wrote:
[...]
>> diff --git a/include/linux/trace_events.h b/include/linux/trace_events.h
>> index dff8a209875c..0fe900813581 100644
>> --- a/include/linux/trace_events.h
>> +++ b/include/linux/trace_events.h
>> @@ -781,7 +781,8 @@ trace_trigger_soft_disabled(struct trace_event_file *file)
>> #ifdef CONFIG_BPF_EVENTS
>> unsigned int trace_call_bpf(struct trace_event_call *call, void *ctx);
>> unsigned int trace_call_bpf_faultable(struct trace_event_call *call, void *ctx);
>> -int perf_event_attach_bpf_prog(struct perf_event *event, struct bpf_prog *prog, u64 bpf_cookie);
>> +int perf_event_attach_bpf_prog(struct perf_event *event, struct bpf_prog *prog, u64 bpf_cookie,
>> + struct bpf_verifier_log *log);
>
> This is not landable.
> Don't you remember how netdev folks objected to such thing?
> Same story here.
>
Got it.
Perf has no equivalent of netlink extack. I'd like to pass a 'const char
**errmsg' to the perf attach helper, so it can return a static error
msg. On failure, BPF_LINK_CREATE can write the msg to the log buffer if
errmsg was set.
Thanks,
Leon