From: "Alex Bennée" <alex.bennee@linaro.org>
To: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
Cc: qemu-devel@nongnu.org,
"Philippe Mathieu-Daudé" <philmd@linaro.org>,
"Paolo Bonzini" <pbonzini@redhat.com>,
"Thomas Huth" <thuth@redhat.com>
Subject: Re: [PATCH for 10.1 11/13] tests/tcg: reduce the number of plugin tests combinations
Date: Thu, 24 Jul 2025 13:48:18 +0100 [thread overview]
Message-ID: <87tt31u54d.fsf@draig.linaro.org> (raw)
In-Reply-To: <CAAjaMXbtw0dw23w2Jx6PmVtZFThj-5w1GzUq0BnzZ7WME-dO6g@mail.gmail.com> (Manos Pitsidianakis's message of "Thu, 24 Jul 2025 15:05:03 +0300")
Manos Pitsidianakis <manos.pitsidianakis@linaro.org> writes:
> On Thu, Jul 24, 2025 at 3:00 PM Alex Bennée <alex.bennee@linaro.org> wrote:
>>
>> Manos Pitsidianakis <manos.pitsidianakis@linaro.org> writes:
>>
>> > On Thu, Jul 24, 2025 at 2:00 PM Alex Bennée <alex.bennee@linaro.org> wrote:
>> >>
>> >> As our set of multiarch tests has grown the practice of running every
>> >> plugin with every test is becoming unsustainable. If we switch to
>> >> ensuring every test gets run with at least one plugin we can speed
>> >> things up.
>> >>
>> >> Some plugins do need to be run with specific tests (for example the
>> >> memory instrumentation test). We can handle this by manually adding
>> >> them to EXTRA_RUNS. We also need to wrap rules in a CONFIG_PLUGIN test
>> >> so we don't enable the runs when plugins are not enabled.
>> >>
>> >> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
>> >> ---
>> >> tests/tcg/Makefile.target | 23 ++++++++++++++-----
>> >> tests/tcg/multiarch/Makefile.target | 8 +++++--
>> >> .../multiarch/system/Makefile.softmmu-target | 11 +++++----
>> >> 3 files changed, 30 insertions(+), 12 deletions(-)
>> >>
>> >> diff --git a/tests/tcg/Makefile.target b/tests/tcg/Makefile.target
>> >> index a12b15637ea..18afd5be194 100644
>> >> --- a/tests/tcg/Makefile.target
>> >> +++ b/tests/tcg/Makefile.target
>> >> @@ -173,14 +173,25 @@ PLUGINS=$(filter-out $(DISABLE_PLUGINS), \
>> >> # We need to ensure expand the run-plugin-TEST-with-PLUGIN
>> >> # pre-requistes manually here as we can't use stems to handle it. We
>> >> # only expand MULTIARCH_TESTS which are common on most of our targets
>> >> -# to avoid an exponential explosion as new tests are added. We also
>> >> -# add some special helpers the run-plugin- rules can use below.
>> >> +# and rotate the plugins so we don't grow too out of control as new
>> >> +# tests are added. Plugins that need to run with a specific test
>> >> +# should ensure they add their combination to EXTRA_RUNS.
>> >>
>> >> ifneq ($(MULTIARCH_TESTS),)
>> >> -$(foreach p,$(PLUGINS), \
>> >> - $(foreach t,$(MULTIARCH_TESTS),\
>> >> - $(eval run-plugin-$(t)-with-$(p): $t $p) \
>> >> - $(eval RUN_TESTS+=run-plugin-$(t)-with-$(p))))
>> >> +
>> >> +NUM_PLUGINS := $(words $(PLUGINS))
>> >> +NUM_TESTS := $(words $(MULTIARCH_TESTS))
>> >> +
>> >> +define mod_plus_one
>> >> + $(shell $(PYTHON) -c "print( ($(1) % $(2)) + 1 )")
>> >> +endef
>> >> +
>> >> +$(foreach _idx, $(shell seq 1 $(NUM_TESTS)), \
>> >> + $(eval _test := $(word $(_idx), $(MULTIARCH_TESTS))) \
>> >> + $(eval _plugin := $(word $(call mod_plus_one, $(_idx), $(NUM_PLUGINS)), $(PLUGINS))) \
>> >> + $(eval run-plugin-$(_test)-with-$(_plugin): $(_test) $(_plugin)) \
>> >> + $(eval RUN_TESTS+=run-plugin-$(_test)-with-$(_plugin)))
>> >> +
>> >> endif # MULTIARCH_TESTS
>> >> endif # CONFIG_PLUGIN
>> >>
>> >> diff --git a/tests/tcg/multiarch/Makefile.target b/tests/tcg/multiarch/Makefile.target
>> >> index bfdf7197a7b..38345ff8805 100644
>> >> --- a/tests/tcg/multiarch/Makefile.target
>> >> +++ b/tests/tcg/multiarch/Makefile.target
>> >> @@ -189,6 +189,10 @@ run-plugin-semiconsole-with-%:
>> >> TESTS += semihosting semiconsole
>> >> endif
>> >>
>> >> +test-plugin-mem-access: CFLAGS+=-pthread -O0
>> >> +test-plugin-mem-access: LDFLAGS+=-pthread -O0
>> >> +
>> >> +ifeq ($(CONFIG_PLUGIN),y)
>> >> # Test plugin memory access instrumentation
>> >> run-plugin-test-plugin-mem-access-with-libmem.so: \
>> >> PLUGIN_ARGS=$(COMMA)print-accesses=true
>> >> @@ -197,8 +201,8 @@ run-plugin-test-plugin-mem-access-with-libmem.so: \
>> >> $(SRC_PATH)/tests/tcg/multiarch/check-plugin-output.sh \
>> >> $(QEMU) $<
>> >>
>> >> -test-plugin-mem-access: CFLAGS+=-pthread -O0
>> >> -test-plugin-mem-access: LDFLAGS+=-pthread -O0
>> >> +EXTRA_RUNS += run-plugin-test-plugin-mem-access-with-libmem.so
>> >> +endif
>> >>
>> >> # Update TESTS
>> >> TESTS += $(MULTIARCH_TESTS)
>> >> diff --git a/tests/tcg/multiarch/system/Makefile.softmmu-target b/tests/tcg/multiarch/system/Makefile.softmmu-target
>> >> index 5acf2700812..4171b4e6aa0 100644
>> >> --- a/tests/tcg/multiarch/system/Makefile.softmmu-target
>> >> +++ b/tests/tcg/multiarch/system/Makefile.softmmu-target
>> >> @@ -71,8 +71,11 @@ endif
>> >> MULTIARCH_RUNS += run-gdbstub-memory run-gdbstub-interrupt \
>> >> run-gdbstub-untimely-packet run-gdbstub-registers
>> >>
>> >> +ifeq ($(CONFIG_PLUGIN),y)
>> >> # Test plugin memory access instrumentation
>> >> -run-plugin-memory-with-libmem.so: \
>> >> - PLUGIN_ARGS=$(COMMA)region-summary=true
>> >> -run-plugin-memory-with-libmem.so: \
>> >> - CHECK_PLUGIN_OUTPUT_COMMAND=$(MULTIARCH_SYSTEM_SRC)/validate-memory-counts.py $@.out
>> >> +run-plugin-memory-with-libmem.so: memory libmem.so
>> >
>> > Hm why wasn't this needed before this change?
>> >
>> > I see the make `memory` target sets CHECK_UNALIGNED but where is
>> > libmem.so target coming from?
>> >
>> >> +run-plugin-memory-with-libmem.so: PLUGIN_ARGS=$(COMMA)region-summary=true
>> >> +run-plugin-memory-with-libmem.so: CHECK_PLUGIN_OUTPUT_COMMAND=$(MULTIARCH_SYSTEM_SRC)/validate-memory-counts.py $@.out
>> >> +
>> >> +EXTRA_RUNS += run-plugin-memory-with-libmem.so
>>
>> Because we add it to EXTRA_RUNS so we don't want that if plugins won't
>> work. We could just wrap EXTRA_RUNS but the rest of the recipe is moot
>> at that point anyway.
>
> I am asking about the line
>
>> +run-plugin-memory-with-libmem.so: memory libmem.so
>
> Which adds two make target prerequisites `memory` and `libmem.so`, I
> don't see where they came from, or maybe I am not understanding the
> makefile logic here correctly.
Originally we generated the pre-reqs in the:
$(foreach p,$(PLUGINS), \
$(foreach t,$(MULTIARCH_TESTS),\
loop. Now that doesn't cover every combination we need to add an
explicit prereq for the test case we know we will run.
>
>>
>> >> +endif
>> >> --
>> >> 2.47.2
>> >>
>> >>
>>
>> --
>> Alex Bennée
>> Virtualisation Tech Lead @ Linaro
--
Alex Bennée
Virtualisation Tech Lead @ Linaro
next prev parent reply other threads:[~2025-07-24 12:49 UTC|newest]
Thread overview: 37+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-24 10:59 [PATCH for 10.1 00/13] documentation updates and test tweaks Alex Bennée
2025-07-24 10:59 ` [PATCH for 10.1 01/13] docs/user: clarify user-mode expects the same OS Alex Bennée
2025-07-24 11:02 ` Manos Pitsidianakis
2025-07-24 10:59 ` [PATCH for 10.1 02/13] docs/system: reword the TAP notes to remove tarball ref Alex Bennée
2025-07-24 11:07 ` Manos Pitsidianakis
2025-07-24 10:59 ` [PATCH for 10.1 03/13] docs/user: clean up headings Alex Bennée
2025-07-24 11:09 ` Manos Pitsidianakis
2025-07-25 1:13 ` Richard Henderson
2025-07-25 1:14 ` Richard Henderson
2025-07-24 10:59 ` [PATCH for 10.1 04/13] docs/user: slightly reword section on system calls Alex Bennée
2025-07-24 11:10 ` Manos Pitsidianakis
2025-07-24 10:59 ` [PATCH for 10.1 05/13] docs/user: expand section on threading Alex Bennée
2025-07-24 11:13 ` Manos Pitsidianakis
2025-07-24 10:59 ` [PATCH for 10.1 06/13] tests/functional: add hypervisor test for aarch64 Alex Bennée
2025-07-24 13:38 ` Thomas Huth
2025-07-24 10:59 ` [PATCH for 10.1 07/13] tests/tcg: skip libsyscall.so on softmmu tests Alex Bennée
2025-07-24 11:14 ` Manos Pitsidianakis
2025-07-24 10:59 ` [PATCH for 10.1 08/13] tests/tcg: remove ADDITIONAL_PLUGINS_TESTS Alex Bennée
2025-07-24 11:15 ` Manos Pitsidianakis
2025-07-24 10:59 ` [PATCH for 10.1 09/13] tests/tcg: don't include multiarch tests if not supported Alex Bennée
2025-07-24 11:17 ` Manos Pitsidianakis
2025-07-24 10:59 ` [PATCH for 10.1 10/13] configure: expose PYTHON to test/tcg/config-host.mak Alex Bennée
2025-07-24 11:18 ` Manos Pitsidianakis
2025-07-24 10:59 ` [PATCH for 10.1 11/13] tests/tcg: reduce the number of plugin tests combinations Alex Bennée
2025-07-24 11:25 ` Manos Pitsidianakis
2025-07-24 11:59 ` Alex Bennée
2025-07-24 12:05 ` Manos Pitsidianakis
2025-07-24 12:48 ` Alex Bennée [this message]
2025-07-24 12:53 ` Manos Pitsidianakis
2025-07-24 10:59 ` [PATCH for 10.1 12/13] tests/docker: add --arch-only to qemu deps for all-test-cross Alex Bennée
2025-07-24 11:30 ` Manos Pitsidianakis
2025-07-24 10:59 ` [PATCH for 10.1 13/13] tests/docker: handle host-arch selection " Alex Bennée
2025-07-24 11:29 ` Manos Pitsidianakis
2025-07-24 12:36 ` Alex Bennée
2025-07-24 12:49 ` Manos Pitsidianakis
2025-07-25 11:57 ` Alex Bennée
2025-07-25 12:46 ` Manos Pitsidianakis
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=87tt31u54d.fsf@draig.linaro.org \
--to=alex.bennee@linaro.org \
--cc=manos.pitsidianakis@linaro.org \
--cc=pbonzini@redhat.com \
--cc=philmd@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=thuth@redhat.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;
as well as URLs for NNTP newsgroup(s).