Re: [PATCH bpf-next v2 1/9] bpf: Add log support for tracing link_create

From: Leon Hwang

Date: Tue Nov 17 2026 - 20:56:42 EST


On 17/11/26 13:22, Alexei Starovoitov wrote:
> On Sat, Nov 14, 2026 at 07:06 AM Leon Hwang <leon.hwang@xxxxxxxxx> wrote:
>
> tldr: pls use uapi names where possible:
>
>> + bpf_log(log, "tgt_prog_fd and btf_id must be both set or both unset.\n");
>
> The uapi fields are target_fd and target_btf_id.
> tgt_prog_fd and btf_id are arguments of this function.
> Patches 2, 3 and 4 say target_fd for the same field.
>
>> + bpf_log(log, "Only allow re-attach for tracing and lsm progs.\n");
>
> I think this one misleads. A freplace prog can re-attach.
> It has to pass target_fd and target_btf_id.
> The comment above the check says so.
>
>> + bpf_log(log, "Invalid attach_btf.\n");
>
> attach_btf is a field of bpf_prog_aux. The user never set it.
> NULL means that the prog was loaded with attach_prog_fd.
> Such a prog can't re-attach at all.
>
>> + bpf_log(log, "Invalid kprobe_write_ctx.\n");
>
> Another bit of bpf_prog_aux.
> The rule is that both progs write to pt_regs, or none.
>
>> + bpf_log(log, "Invalid tracing attach_type.\n");
>
> LSM progs get here too.

Ack. Will update the log messages.

Thanks,
Leon

> [...]