From: bot+bpf-ci@kernel.org
To: zhaofuyu@vivo.com,bpf@vger.kernel.org,eddyz87@gmail.com,andrii.nakryiko@gmail.com,alan.maguire@oracle.com
Cc: andrii@kernel.org,ast@kernel.org,daniel@iogearbox.net,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: [PATCH bpf-next v5 2/2] selftests/bpf: add tests for selective module BTF loading
Date: Wed, 26 Aug 2026 14:13:44 +0000 (UTC) [thread overview]
Message-ID: <e95579f6ec8d261f3a4303a5ca9e7111bde07ef2ee3fa48e487c1d33cbe3c3d6@mail.kernel.org> (raw)
In-Reply-To: <20260826131428.302-3-zhaofuyu@vivo.com>
[-- Attachment #1: Type: text/plain, Size: 2221 bytes --]
> diff --git a/tools/testing/selftests/bpf/prog_tests/btf_module_names.c b/tools/testing/selftests/bpf/prog_tests/btf_module_names.c
> new file mode 100644
> index 0000000000000..3dc72bef014c8
> --- /dev/null
> +++ b/tools/testing/selftests/bpf/prog_tests/btf_module_names.c
> @@ -0,0 +1,139 @@
> +// SPDX-License-Identifier: GPL-2.0
> +#include <test_progs.h>
> +#include "btf_module_names.skel.h"
> +
> +static void btf_module_names_load(void)
> +{
> + struct btf_module_names *skel = NULL;
> + int ret;
> + static const char *mod_names[] = { "bpf_testmod" };
> +
> + LIBBPF_OPTS(bpf_object_open_opts, opts,
> + .btf_module_names = mod_names,
> + .nr_btf_module_names = 1,
> + );
[ ... ]
> +static void btf_module_names_skip(void)
> +{
> + struct btf_module_names *skel = NULL;
> + int ret;
> + static const char *mod_names[] = { "module_nonexist" };
> +
> + LIBBPF_OPTS(bpf_object_open_opts, opts,
> + .btf_module_names = mod_names,
> + .nr_btf_module_names = 1,
> + );
[ ... ]
> +static void btf_module_names_empty(void)
> +{
> + struct btf_module_names *skel = NULL;
> + int ret;
> + static const char *mod_names[] = { "" };
> +
> + LIBBPF_OPTS(bpf_object_open_opts, opts,
> + .btf_module_names = mod_names,
> + );
[ ... ]
> +static void btf_module_names_invalid(void)
> +{
> + struct btf_module_names *skel = NULL;
> + const char *names[] = { NULL };
> + const char *empty_names[] = { "" };
> + const char *duplicate_names[] = {
> + "bpf_testmod", "bpf_testmod",
> + };
> + LIBBPF_OPTS(bpf_object_open_opts, opts,
> + .btf_module_names = names,
> + .nr_btf_module_names = 1,
> + );
This isn't a bug, but could the three static const char *mod_names[]
declarations in btf_module_names_load(), btf_module_names_skip(), and
btf_module_names_empty() just be automatic arrays, matching the non-static
declarations in btf_module_names_invalid()? Since libbpf strdup()s the
entries, the static storage doesn't add anything beyond inconsistency within
this new file.
---
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/32974547426
prev parent reply other threads:[~2026-08-26 14:13 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-26 13:14 [PATCH bpf-next v5 0/2] libbpf: Improve BPF load performance by selectively loading kmod BTFs Fuyu Zhao
2026-08-26 13:14 ` [PATCH bpf-next v5 1/2] libbpf: support selective kernel module BTF loading via bpf_object_open_opts Fuyu Zhao
2026-08-26 14:13 ` bot+bpf-ci
2026-08-26 13:14 ` [PATCH bpf-next v5 2/2] selftests/bpf: add tests for selective module BTF loading Fuyu Zhao
2026-08-26 14:13 ` bot+bpf-ci [this message]
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=e95579f6ec8d261f3a4303a5ca9e7111bde07ef2ee3fa48e487c1d33cbe3c3d6@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®