From: KaFai Wan <mannkafai@gmail.com>
To: Yafang Shao <laoar.shao@gmail.com>,
Alexei Starovoitov <alexei.starovoitov@gmail.com>
Cc: Alexei Starovoitov <ast@kernel.org>,
Daniel Borkmann <daniel@iogearbox.net>,
John Fastabend <john.fastabend@gmail.com>,
Andrii Nakryiko <andrii@kernel.org>,
Martin KaFai Lau <martin.lau@linux.dev>,
Eduard <eddyz87@gmail.com>, Song Liu <song@kernel.org>,
Yonghong Song <yonghong.song@linux.dev>,
KP Singh <kpsingh@kernel.org>,
Stanislav Fomichev <sdf@fomichev.me>,
Hao Luo <haoluo@google.com>, Jiri Olsa <jolsa@kernel.org>,
Mykola Lysenko <mykolal@fb.com>, Shuah Khan <shuah@kernel.org>,
LKML <linux-kernel@vger.kernel.org>, bpf <bpf@vger.kernel.org>,
"open list:KERNEL SELFTEST FRAMEWORK"
<linux-kselftest@vger.kernel.org>
Subject: Re: [PATCH bpf-next 2/3] bpf: Show precise rejected function when attaching to __btf_id functions
Date: Fri, 11 Jul 2025 19:42:05 +0800 [thread overview]
Message-ID: <c8a1f651ebb6e0f0f1c0459c9dadc4d01dfa2662.camel@gmail.com> (raw)
In-Reply-To: <CALOAHbCMCnYe=d04Ong5GzdMjK553CooF5XrBi0kQUwoh0oDrA@mail.gmail.com>
On Fri, 2025-07-11 at 17:57 +0800, Yafang Shao wrote:
> On Fri, Jul 11, 2025 at 1:19 AM Alexei Starovoitov
> <alexei.starovoitov@gmail.com> wrote:
> >
> > On Thu, Jul 10, 2025 at 9:27 AM KaFai Wan <mannkafai@gmail.com>
> > wrote:
> > >
> > > Show the precise rejected function name when attaching tracing to
> > > __btf_id functions.
> > >
> > > $ ./fentry
> > > libbpf: prog 'migrate_disable': BPF program load failed: -EINVAL
> > > libbpf: prog 'migrate_disable': -- BEGIN PROG LOAD LOG --
> > > Attaching tracing to __btf_id function 'migrate_disable' is
> > > rejected.
> > >
> > > Signed-off-by: KaFai Wan <mannkafai@gmail.com>
> > > ---
> > > kernel/bpf/verifier.c | 2 ++
> > > 1 file changed, 2 insertions(+)
> > >
> > > diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c
> > > index 275d82fb1a1a..2779d63e1f8b 100644
> > > --- a/kernel/bpf/verifier.c
> > > +++ b/kernel/bpf/verifier.c
> > > @@ -23938,6 +23938,8 @@ static int check_attach_btf_id(struct
> > > bpf_verifier_env *env)
> > > return ret;
> > > } else if (prog->type == BPF_PROG_TYPE_TRACING &&
> > > btf_id_set_contains(&btf_id_deny, btf_id)) {
> > > + verbose(env, "Attaching tracing to __btf_id
> > > function '%s' is rejected.\n",
> > > + tgt_info.tgt_name);
> >
> > "Attaching tracing to __btf_id" ?! What does it mean?
>
> The term "tracing" refers to BPF_PROG_TYPE_TRACING. I believe it is
> useful because it helps identify which functions cannot be attached
> by
> a given BPF program type.
Thanks, this is what I want to express.
> Perhaps we should replace "tracing" with "a tracing prog" for
> clarity?
Looks good, may be 'tracing programs' could be fine.
>
> > Drop "__btf_id" and "tracing" bits.
>
--
Thanks,
KaFai
next prev parent reply other threads:[~2025-07-11 11:42 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-10 16:27 [PATCH bpf-next 0/3] bpf: Show precise rejected function when attaching to __noreturn and " KaFai Wan
2025-07-10 16:27 ` [PATCH bpf-next 1/3] bpf: Show precise rejected function when attaching to __noreturn functions KaFai Wan
2025-07-10 16:27 ` [PATCH bpf-next 2/3] bpf: Show precise rejected function when attaching to __btf_id functions KaFai Wan
2025-07-10 17:19 ` Alexei Starovoitov
2025-07-11 9:57 ` Yafang Shao
2025-07-11 11:42 ` KaFai Wan [this message]
2025-07-11 12:02 ` KaFai Wan
2025-07-10 16:27 ` [PATCH bpf-next 3/3] selftests/bpf: Add selftest for attaching tracing " KaFai Wan
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=c8a1f651ebb6e0f0f1c0459c9dadc4d01dfa2662.camel@gmail.com \
--to=mannkafai@gmail.com \
--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=haoluo@google.com \
--cc=john.fastabend@gmail.com \
--cc=jolsa@kernel.org \
--cc=kpsingh@kernel.org \
--cc=laoar.shao@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=martin.lau@linux.dev \
--cc=mykolal@fb.com \
--cc=sdf@fomichev.me \
--cc=shuah@kernel.org \
--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
all inboxes | Powered by JetHome®