public inbox for bpf@vger.kernel.org
 help / color / mirror / Atom feed
From: Leon Hwang <leon.hwang@linux.dev>
To: Alexei Starovoitov <alexei.starovoitov@gmail.com>
Cc: bpf <bpf@vger.kernel.org>, Alexei Starovoitov <ast@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>,
	Andrii Nakryiko <andrii@kernel.org>,
	Yonghong Song <yonghong.song@linux.dev>,
	Song Liu <song@kernel.org>, Eddy Z <eddyz87@gmail.com>,
	Manjusaka <me@manjusaka.me>,
	kernel-patches-bot@fb.com
Subject: Re: [PATCH bpf-next v4 2/4] bpf: Improve error reporting for freplace attachment failure
Date: Tue, 25 Feb 2025 21:50:17 +0800	[thread overview]
Message-ID: <ebc973a9-2e61-4e3a-89e0-492823ded721@linux.dev> (raw)
In-Reply-To: <CAADnVQKOeKfxL_3tCw1xWNS1CpXz-6pVUG-1UWhZwpPjRy+32A@mail.gmail.com>



On 2025/2/25 03:41, Alexei Starovoitov wrote:
> On Mon, Feb 24, 2025 at 7:34 AM Leon Hwang <leon.hwang@linux.dev> wrote:
>>
>> @@ -3539,7 +3540,7 @@ static int bpf_tracing_prog_attach(struct bpf_prog *prog,
>>                  */
>>                 struct bpf_attach_target_info tgt_info = {};
>>
>> -               err = bpf_check_attach_target(NULL, prog, tgt_prog, btf_id,
>> +               err = bpf_check_attach_target(log, prog, tgt_prog, btf_id,
>>                                               &tgt_info);
> 
> I still don't like this uapi addition.
> 
> It only helps a rare corner case of freplace usage:
>                 /* If there is no saved target, or the specified target is
>                  * different from the destination specified at load time, we
>                  * need a new trampoline and a check for compatibility
>                  */
> 
> If it was useful in more than one case we could consider it,
> but uapi addition for a single rare use, is imo wrong trade off.
> 

Got it.

I'm planning to implement a restrict version of
"bpf: make tracing program support multi-link"[0]. With log buffer, it
will be helpful to report the reason for declining attaching, especially
to report the tracee info that causes the attachment failure.

[0]
https://lore.kernel.org/bpf/20240311093526.1010158-1-dongmenglong.8@bytedance.com/

Thanks,
Leon


  parent reply	other threads:[~2025-02-25 13:50 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-24 15:33 [PATCH bpf-next v4 0/4] bpf: Improve error reporting for freplace attachment failure Leon Hwang
2025-02-24 15:33 ` [PATCH bpf-next v4 1/4] bpf, verifier: Add missing newline of bpf_log in bpf_check_attach_target Leon Hwang
2025-02-24 15:33 ` [PATCH bpf-next v4 2/4] bpf: Improve error reporting for freplace attachment failure Leon Hwang
2025-02-24 19:41   ` Alexei Starovoitov
2025-02-24 22:08     ` Andrii Nakryiko
2025-02-25 13:59       ` Leon Hwang
2025-02-25 17:19         ` Andrii Nakryiko
2025-02-26  3:17           ` Alexei Starovoitov
2025-02-26 14:17             ` Leon Hwang
2025-02-25 13:50     ` Leon Hwang [this message]
2025-02-25 16:03       ` Alexei Starovoitov
2025-02-24 15:33 ` [PATCH bpf-next v4 3/4] bpf, libbpf: Capture error message of " Leon Hwang
2025-02-24 15:33 ` [PATCH bpf-next v4 4/4] selftests/bpf: Add test case for freplace attachment failure log Leon Hwang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ebc973a9-2e61-4e3a-89e0-492823ded721@linux.dev \
    --to=leon.hwang@linux.dev \
    --cc=alexei.starovoitov@gmail.com \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=eddyz87@gmail.com \
    --cc=kernel-patches-bot@fb.com \
    --cc=me@manjusaka.me \
    --cc=song@kernel.org \
    --cc=yonghong.song@linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox