From: Eduard Zingerman <eddyz87@gmail.com>
To: Ihor Solodrai <ihor.solodrai@pm.me>
Cc: Andrii Nakryiko <andrii.nakryiko@gmail.com>,
Daniel Borkmann <daniel@iogearbox.net>,
"bpf@vger.kernel.org" <bpf@vger.kernel.org>,
"ast@kernel.org" <ast@kernel.org>,
"andrii@kernel.org" <andrii@kernel.org>,
"mykolal@fb.com" <mykolal@fb.com>
Subject: Re: [PATCH bpf-next v2] selftests/bpf: use auto-dependencies for test objects
Date: Tue, 16 Jul 2024 17:57:52 -0700 [thread overview]
Message-ID: <d52ab2026b37ac9e19a3181f7b81da1e1afb9365.camel@gmail.com> (raw)
In-Reply-To: <erDl1cz7tCQTTy5Z2SJzdqYmOTcoUjvgaU4m6Nq2ZlbMvUQxP0xnS2y90zhgQUQm6ygMN9dZdnXiiQrRkaia4WsX9E2wULrvngXmeTTggNU=@pm.me>
On Wed, 2024-07-17 at 00:36 +0000, Ihor Solodrai wrote:
> On Tuesday, July 16th, 2024 at 4:21 PM, Eduard Zingerman <eddyz87@gmail.com> wrote:
>
> [...]
>
> > The catch-all clause in the current makefile looks as follows:
> >
> > $(TRUNNER_BPF_OBJS): $(TRUNNER_OUTPUT)/%.bpf.o: \
> > $(TRUNNER_BPF_PROGS_DIR)/%.c \
> > $(TRUNNER_BPF_PROGS_DIR)/*.h \
> > ...
> >
> > This makes all .bpf.o files dependent on all BPF .c files.
> > .bpf.o files rebuild is the main time consumer, at-least for me.
>
> I might be nit-picking, but just so it's clear this target makes each
> individual %.bpf.o dependent on corresponding progs/%.c, and also on
> all the headers (because of *.h).
On current master touch progs/verifier_and.c leads to complete rebuild
of all bpf.o and test.o files. And here is one of the targets:
$ make test_progs -p | grep tools/testing/selftests/bpf/sockmap_listen.test.o: | tr ' ' '\n' | head
/home/eddy/work/bpf-next/tools/testing/selftests/bpf/sockmap_listen.test.o:
prog_tests/sockmap_listen.c
flow_dissector_load.h
ip_check_defrag_frags.h
/home/eddy/work/bpf-next/tools/testing/selftests/bpf/access_map_in_map.bpf.o
/home/eddy/work/bpf-next/tools/testing/selftests/bpf/arena_atomics.bpf.o
/home/eddy/work/bpf-next/tools/testing/selftests/bpf/arena_htab_asm.bpf.o
/home/eddy/work/bpf-next/tools/testing/selftests/bpf/arena_htab.bpf.o
/home/eddy/work/bpf-next/tools/testing/selftests/bpf/arena_list.bpf.o
/home/eddy/work/bpf-next/tools/testing/selftests/bpf/async_stack_depth.bpf.o
17:57:16 bpf$ make test_progs -p | grep tools/testing/selftests/bpf/sockmap_listen.test.o: | tr ' ' '\n' | grep bpf\.o | wc -l
760
> I don't think we can easily remove/replace the $(TRUNNER_BPF_OBJS)
> target, as it also defines a compilation recipe for .bpf.o files.
I don't think removing $(TRUNNER_BPF_OBJS) was suggested in the thread.
> > I think that simply replacing this catch all by something like:
> >
> > $(OUTPUT)/$(TRUNNER_BINARY): $(TRUNNER_BPF_OBJS)
> >
>
> Using a catch-all dependency (each %.test.o depends on *all* .bpf.o)
> is the current state of the Makefile, without the auto-dependencies
> patch:
>
> $(TRUNNER_TEST_OBJS): $(TRUNNER_OUTPUT)/%.test.o: \
> $(TRUNNER_TESTS_DIR)/%.c \
> $(TRUNNER_EXTRA_HDRS) \
> $(TRUNNER_BPF_OBJS) \ # this line
> $(TRUNNER_BPF_SKELS) \
> ...
Yes, sure, but this is bad, because it forces rebuild of all .test.o files.
Having auto-dependencies allows to get rid of this.
> In the v3 of the patch this dependency simply moved, such that each
> %.test.d file depends on *all* %.bpf.o, so essentially nothing changed
> there.
>
> So what we've been discussing so far is whether it's worth spending
> effort on removing/replacing this dependency, and how.
>
> Eduard's point about simplification of test cases seems reasonable.
> However it looks to me that whatever way of handling direct .bpf.o
> dependencies we might agree on, it would lead to an independent patch
> series.
>
> And settling on catch-all solution (even "for now") means settling on
> v3 of the patch.
I don't like .test.d dependency on all .bpf.o files (the v3 change)
as it does not encode the dependency we have:
test_progs depends on core_reloc.bpf.o at runtime.
next prev parent reply other threads:[~2024-07-17 0:57 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-12 4:36 [PATCH bpf-next v2] selftests/bpf: use auto-dependencies for test objects Ihor Solodrai
2024-07-12 15:26 ` Daniel Borkmann
2024-07-12 17:48 ` Ihor Solodrai
2024-07-12 19:06 ` Eduard Zingerman
2024-07-12 19:20 ` Andrii Nakryiko
2024-07-12 19:46 ` Eduard Zingerman
2024-07-12 19:52 ` Andrii Nakryiko
2024-07-15 1:17 ` Ihor Solodrai
2024-07-15 17:44 ` Andrii Nakryiko
2024-07-16 23:21 ` Eduard Zingerman
2024-07-17 0:36 ` Ihor Solodrai
2024-07-17 0:57 ` Eduard Zingerman [this message]
2024-07-17 1:49 ` Ihor Solodrai
2024-07-17 16:41 ` Andrii Nakryiko
2024-07-17 23:24 ` Eduard Zingerman
2024-07-18 15:34 ` Andrii Nakryiko
2024-07-18 22:42 ` Ihor Solodrai
2024-07-19 5:02 ` Andrii Nakryiko
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=d52ab2026b37ac9e19a3181f7b81da1e1afb9365.camel@gmail.com \
--to=eddyz87@gmail.com \
--cc=andrii.nakryiko@gmail.com \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=ihor.solodrai@pm.me \
--cc=mykolal@fb.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