From: bot+bpf-ci@kernel.org
To: zhaofuyu@vivo.com,bpf@vger.kernel.org,andrii.nakryiko@gmail.com,alan.maguire@oracle.com
Cc: andrii@kernel.org,ast@kernel.org,daniel@iogearbox.net,eddyz87@gmail.com,memxor@gmail.com,martin.lau@linux.dev,song@kernel.org,yonghong.song@linux.dev,jolsa@kernel.org,emil@etsalapatis.com,ihor.solodrai@linux.dev,shuah@kernel.org,yatsenko@meta.com,linux-kernel@vger.kernel.org,linux-kselftest@vger.kernel.org,zhaofuyu@vivo.com,ast@kernel.org,andrii@kernel.org,daniel@iogearbox.net,martin.lau@kernel.org,eddyz87@gmail.com,yonghong.song@linux.dev,clm@meta.com,ihor.solodrai@linux.dev
Subject: Re: [RFC PATCH bpf-next v3 1/2] libbpf: support selective kernel module BTF loading via bpf_object_open_opts
Date: Wed, 19 Aug 2026 09:35:50 +0000 (UTC) [thread overview]
Message-ID: <150459b74dba9ea3f0bd133f97039f998e25830ada87b803fcbc6c77b17bcf93@mail.kernel.org> (raw)
In-Reply-To: <20260819090426.267-2-zhaofuyu@vivo.com>
[-- Attachment #1: Type: text/plain, Size: 1402 bytes --]
> diff --git a/tools/lib/bpf/libbpf.c b/tools/lib/bpf/libbpf.c
> index b749c01742ee..957415341caf 100644
> --- a/tools/lib/bpf/libbpf.c
> +++ b/tools/lib/bpf/libbpf.c
> @@ -782,6 +782,13 @@ struct bpf_object {
> char *token_path;
> int token_fd;
>
> + /* kernel module BTFs to load, as specified via bpf_object_open_opts */
> + struct {
> + char **names;
> + size_t nr_names;
> + struct hashmap *names_map;
> + } *kmod_btfs;
> +
This isn't a bug, but since this holds module names rather than BTFs,
would a name like kmod_btf_filter read more clearly next to the existing
btf_modules field?
> char path[];
> };
[ ... ]
> @@ -5851,6 +5858,121 @@ int bpf_core_add_cands(struct bpf_core_cand *local_cand,
> return 0;
> }
>
> +static size_t mod_name_hash_fn(long key, void *ctx)
> +{
> + return str_hash((char *)key);
> +}
> +
> +static bool mod_name_equal_fn(long key1, long key2, void *ctx)
> +{
> + return strcmp((char *)key1, (char *)key2) == 0;
> +}
This isn't a bug, but these look identical to str_hash_fn()/str_equal_fn()
in btf_dump.c - would it be worth hoisting one copy into libbpf_internal.h
instead of adding a second pair?
[ ... ]
---
AI reviewed your patch. Please fix the bug or email reply why it's not a bug.
See: https://github.com/kernel-patches/vmtest/blob/master/ci/claude/README.md
CI run summary: https://github.com/kernel-patches/bpf/actions/runs/32236360082
next prev parent reply other threads:[~2026-08-19 9:35 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-19 9:04 [RFC PATCH bpf-next v3 0/2] libbpf: Improve BPF load performance by selectively loading kmod BTFs Fuyu Zhao
2026-08-19 9:04 ` [RFC PATCH bpf-next v3 1/2] libbpf: support selective kernel module BTF loading via bpf_object_open_opts Fuyu Zhao
2026-08-19 9:35 ` bot+bpf-ci [this message]
2026-08-20 23:58 ` Eduard Zingerman
2026-08-21 3:51 ` Fuyu Zhao
2026-08-21 18:51 ` Andrii Nakryiko
2026-08-22 11:57 ` Fuyu Zhao
2026-08-19 9:04 ` [RFC PATCH bpf-next v3 2/2] selftests/bpf: add tests for selective kmod BTF loading Fuyu Zhao
2026-08-19 9:50 ` bot+bpf-ci
2026-08-21 0:10 ` Eduard Zingerman
2026-08-21 3:51 ` Fuyu Zhao
2026-08-21 18:55 ` Andrii Nakryiko
2026-08-22 11:57 ` Fuyu Zhao
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=150459b74dba9ea3f0bd133f97039f998e25830ada87b803fcbc6c77b17bcf93@mail.kernel.org \
--to=bot+bpf-ci@kernel.org \
--cc=alan.maguire@oracle.com \
--cc=andrii.nakryiko@gmail.com \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=clm@meta.com \
--cc=daniel@iogearbox.net \
--cc=eddyz87@gmail.com \
--cc=emil@etsalapatis.com \
--cc=ihor.solodrai@linux.dev \
--cc=jolsa@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=martin.lau@kernel.org \
--cc=martin.lau@linux.dev \
--cc=memxor@gmail.com \
--cc=shuah@kernel.org \
--cc=song@kernel.org \
--cc=yatsenko@meta.com \
--cc=yonghong.song@linux.dev \
--cc=zhaofuyu@vivo.com \
/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®