From: "Ricardo B. Marlière" <rbm@suse.com>
To: "Ihor Solodrai" <ihor.solodrai@linux.dev>,
"Ricardo B. Marlière" <rbm@suse.com>,
"Alexei Starovoitov" <ast@kernel.org>,
"Daniel Borkmann" <daniel@iogearbox.net>,
"Andrii Nakryiko" <andrii@kernel.org>,
"Eduard Zingerman" <eddyz87@gmail.com>,
"Kumar Kartikeya Dwivedi" <memxor@gmail.com>,
"Martin KaFai Lau" <martin.lau@linux.dev>,
"Song Liu" <song@kernel.org>,
"Yonghong Song" <yonghong.song@linux.dev>,
"Jiri Olsa" <jolsa@kernel.org>,
"Emil Tsalapatis" <emil@etsalapatis.com>,
"Shuah Khan" <shuah@kernel.org>,
"Alexis Lothoré (eBPF Foundation)" <alexis.lothore@bootlin.com>,
"Christian Brauner" <brauner@kernel.org>
Cc: <bpf@vger.kernel.org>, <linux-kselftest@vger.kernel.org>,
<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 2/4] selftests/bpf: Install resolve_btfids.test.o.BTF where the test expects it
Date: Fri, 17 Jul 2026 14:02:52 -0300 [thread overview]
Message-ID: <DK10BEEYBU0Z.1T9AS7CA7LJID@suse.com> (raw)
In-Reply-To: <cebe82a7-203c-4b7e-a57f-0616850c58e3@linux.dev>
On Thu Jul 16, 2026 at 6:10 PM -03, Ihor Solodrai wrote:
> On 7/10/26 3:09 PM, Ricardo B. Marlière wrote:
>> prog_tests/resolve_btfids.c looks for "resolve_btfids.test.o.BTF" relative
>> to the running test_progs binary. resolve_btfids always writes
>> <obj.path>.BTF next to the object it processes, so building
>> resolve_btfids.test.o also produces resolve_btfids.test.o.BTF in the build
>> output directory as a side effect.
>>
>> INSTALL_RULE never carries it over: it is not part of TEST_FILES,
>> TEST_GEN_FILES or TRUNNER_EXTRA_FILES, and it is not copied by the *.bpf.o
>> rsync used for TEST_INST_SUBDIRS. After "make install", every flavor of
>> test_progs, including the default one, fails with "Failed to load BTF from
>> resolve_btfids.test.o.BTF", even though the file built fine and BTF ID
>> resolution itself works correctly.
>>
>> Install it next to the rest of the per-flavor build output, using an
>> explicit rsync in INSTALL_RULE like the one already used for bpftool.
>>
>> Fixes: 522397d05e7d ("resolve_btfids: Change in-place update with raw binary output")
>> Signed-off-by: Ricardo B. Marlière <rbm@suse.com>
>> ---
>> tools/testing/selftests/bpf/Makefile | 3 ++-
>> 1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/tools/testing/selftests/bpf/Makefile b/tools/testing/selftests/bpf/Makefile
>> index 47911c9b4977..7260d672acf7 100644
>> --- a/tools/testing/selftests/bpf/Makefile
>> +++ b/tools/testing/selftests/bpf/Makefile
>> @@ -1057,10 +1057,11 @@ override define INSTALL_RULE
>> $(DEFAULT_INSTALL_RULE)
>> @mkdir -p $(INSTALL_PATH)/tools/sbin
>> @rsync -a $(if $(PERMISSIVE),--ignore-missing-args) $(TRUNNER_BPFTOOL) $(INSTALL_PATH)/tools/sbin/
>> + @rsync -a $(if $(PERMISSIVE),--ignore-missing-args) $(OUTPUT)/resolve_btfids.test.o.BTF $(INSTALL_PATH)/
>
> I think you can squash patches #1 and #2 into a single "Fix make
> install target" patch.
>
> pw-bot: cr
>
> nit: This hardcodes the filename, and even though we only have one
> test that needs .BTF currently, you could add *.BTF to the loop:
>
> $(OUTPUT)/$$DIR/*.bpf.o $(OUTPUT)/$$DIR/*.BTF
>
> Then any future test that consumes a raw .BTF gets installed for free.
Good call! I'll prepare v2. Thanks for the review :)
>
>> @for DIR in $(TEST_INST_SUBDIRS); do \
>> mkdir -p $(INSTALL_PATH)/$$DIR; \
>> rsync -a $(if $(PERMISSIVE),--ignore-missing-args) \
>> - $(OUTPUT)/$$DIR/*.bpf.o \
>> + $(OUTPUT)/$$DIR/*.bpf.o $(OUTPUT)/$$DIR/resolve_btfids.test.o.BTF \
>> $(INSTALL_PATH)/$$DIR; \
>> done
>> endef
>>
next prev parent reply other threads:[~2026-07-17 17:02 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-10 22:09 [PATCH 0/4] selftests/bpf: A few edge case fixes Ricardo B. Marlière
2026-07-10 22:09 ` [PATCH 1/4] selftests/bpf: Install bpftool where test_progs expects to find it Ricardo B. Marlière
2026-07-13 15:32 ` Alexis Lothoré
2026-07-15 21:40 ` Ricardo B. Marlière
2026-07-16 21:09 ` Ihor Solodrai
2026-07-17 17:03 ` Ricardo B. Marlière
2026-07-20 7:24 ` Alexis Lothoré
2026-07-10 22:09 ` [PATCH 2/4] selftests/bpf: Install resolve_btfids.test.o.BTF where the test expects it Ricardo B. Marlière
2026-07-16 21:10 ` Ihor Solodrai
2026-07-17 17:02 ` Ricardo B. Marlière [this message]
2026-07-10 22:09 ` [PATCH 3/4] selftests/bpf: Fix lsm_bdev dev_t encoding mismatch Ricardo B. Marlière
2026-07-16 21:11 ` Ihor Solodrai
2026-07-17 17:02 ` Ricardo B. Marlière
2026-07-10 22:09 ` [PATCH 4/4] libbpf: Search /lib64 and /lib in resolve_full_path() Ricardo B. Marlière
2026-07-10 22:58 ` bot+bpf-ci
2026-07-16 21:12 ` Ihor Solodrai
2026-07-16 21:07 ` [PATCH 0/4] selftests/bpf: A few edge case fixes Ihor Solodrai
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=DK10BEEYBU0Z.1T9AS7CA7LJID@suse.com \
--to=rbm@suse.com \
--cc=alexis.lothore@bootlin.com \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=brauner@kernel.org \
--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@linux.dev \
--cc=memxor@gmail.com \
--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®