Linux Perf Users
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Sasha Levin" <sashal@kernel.org>
Cc: linux-perf-users@vger.kernel.org
Subject: Re: [RFC PATCH 4/6] tools: build kernel selftests in tools_build
Date: Sun, 11 Oct 2026 23:46:29 +0000	[thread overview]
Message-ID: <sashiko-outbox-167522@kernel.org> (raw)
In-Reply-To: <20261011233647.2454648-5-sashal@kernel.org>

Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [High] build: static pattern rule fails on targets containing slashes
- [Medium] selftests: kexec tests excluded on supported architectures
--

commit 52a33182ba4feee21276ad02270b7c707e405a85
Author: Sasha Levin <sashal@kernel.org>

tools: build kernel selftests in tools_build

This commit adds a "Kernel selftests" sub-menu to tools_build. It allows
building selected targets under tools/testing/selftests in parallel without
running them.

> diff --git a/tools/Kconfig b/tools/Kconfig
> index 488f439592150..d713741782e22 100644
> --- a/tools/Kconfig
> +++ b/tools/Kconfig
[ ... ]
> +config TOOLS_BUILD_SELFTESTS_KEXEC
> +	bool "kexec"
> +	depends on X86_64

[Severity: Medium]
Does restricting this to X86_64 exclude kexec tests on other supported
architectures?

Looking at tools/testing/selftests/kexec/Makefile:

ifeq ($(ARCH_PROCESSED),$(filter $(ARCH_PROCESSED),x86 ppc64le))
TEST_PROGS := test_kexec_load.sh test_kexec_file_load.sh
TEST_FILES := kexec_common_lib.sh

The selftest natively supports building and installing scripts for both
x86 (including 32-bit) and ppc64le. Setting the Kconfig dependency
exclusively to X86_64 prevents these tests from being built or selected via
the new tools build infrastructure on architectures that fully support them,
which reduces test coverage.

> diff --git a/tools/Makefile.kbuild b/tools/Makefile.kbuild
> index 62fd494253eca..c31347258d0a9 100644
> --- a/tools/Makefile.kbuild
> +++ b/tools/Makefile.kbuild
[ ... ]
> +selftests-$(CONFIG_TOOLS_BUILD_SELFTESTS_FILESYSTEMS_MOUNT_CYCLE)	+= filesystems/mount_cycle

[ ... ]

> +selftest-targets := $(addprefix selftest-,$(selftests-y))
> +
> +__tools_build: $(selftest-targets)
> +
> +PHONY += $(selftest-targets)
> +$(selftest-targets): selftest-%: $(selftest-shared) FORCE
> +	$(call build,$(outdir)/selftests/$*,-C $(toolsdir)/testing/selftests/$* OUTPUT=$(outdir)/selftests/$* $(selftest-flags),$(selftest-shared) $(toolsdir)/testing/selftests/$* $(selftest-extra-$*),TOOLS_BUILD_SELFTESTS_$(shell echo $* | tr a-z/- A-Z__))

[Severity: High]
Does this static pattern rule fail and abort the build when the target
contains a slash?

When matching a target containing a slash, such as
selftest-filesystems/mount_cycle when
CONFIG_TOOLS_BUILD_SELFTESTS_FILESYSTEMS_MOUNT_CYCLE is enabled, against a
slash-less pattern like selftest-%, GNU Make semantics state that the
directory part is temporarily stripped.

Make then compares only the base name (mount_cycle) against the target
pattern (selftest-%). Since mount_cycle does not start with selftest-, the
match fails, and Make throws a fatal syntax error indicating the target does
not match the target pattern.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261011233647.2454648-1-sashal@kernel.org?part=4

  reply	other threads:[~2026-10-11 23:46 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-11 23:36 [RFC PATCH 0/6] kbuild: build the userspace tools in tools/ with the kernel Sasha Levin
2026-10-11 23:36 ` [RFC PATCH 1/6] kbuild: factor the userspace ABI flags out into KBUILD_USERABI Sasha Levin
2026-10-11 23:39   ` sashiko-bot
2026-10-11 23:36 ` [RFC PATCH 2/6] kbuild: add "make tools_build" to build userspace tools from tools/ Sasha Levin
2026-10-11 23:45   ` sashiko-bot
2026-10-11 23:36 ` [RFC PATCH 3/6] tools: build perf in tools_build Sasha Levin
2026-10-11 23:43   ` sashiko-bot
2026-10-12 22:07   ` Ian Rogers
2026-10-11 23:36 ` [RFC PATCH 4/6] tools: build kernel selftests " Sasha Levin
2026-10-11 23:46   ` sashiko-bot [this message]
2026-10-11 23:36 ` [RFC PATCH 5/6] kbuild: build the tools selected in tools/Kconfig as part of "make all" Sasha Levin
2026-10-11 23:44   ` sashiko-bot
2026-10-11 23:36 ` [RFC PATCH 6/6] Documentation: describe building tools with the kernel Sasha Levin
2026-10-11 23:39   ` sashiko-bot

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=sashiko-outbox-167522@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=sashal@kernel.org \
    --cc=sashiko-reviews@lists.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