From: David Vernet <void@manifault.com>
To: "Björn Töpel" <bjorn@kernel.org>
Cc: "Tejun Heo" <tj@kernel.org>, "Shuah Khan" <shuah@kernel.org>,
linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org,
"Björn Töpel" <bjorn@rivosinc.com>,
bpf@vger.kernel.org, linux-riscv@lists.infradead.org,
"Anders Roxell" <anders.roxell@linaro.org>
Subject: Re: [PATCH] selftests: sched_ext: Add sched_ext as proper selftest target
Date: Fri, 4 Oct 2024 14:00:13 -0500 [thread overview]
Message-ID: <20241004190013.GB56767@maniforge> (raw)
In-Reply-To: <20241004094247.795385-1-bjorn@kernel.org>
[-- Attachment #1: Type: text/plain, Size: 2773 bytes --]
On Fri, Oct 04, 2024 at 11:42:46AM +0200, Björn Töpel wrote:
> From: Björn Töpel <bjorn@rivosinc.com>
Thanks a lot Björn for working on this.
> The sched_ext selftests is missing proper cross-compilation support, a
> proper target entry, and out-of-tree build support.
>
> When building the kselftest suite, e.g.:
>
> make ARCH=riscv CROSS_COMPILE=riscv64-linux-gnu- \
> SKIP_TARGETS="" O=/output/foo -C tools/testing/selftests install
>
> The expectation is that the sched_ext is included, cross-built, and
> placed into /output/foo.
>
> Add CROSS_COMPILE, OUTPUT, and TARGETS support to the sched_ext
> selftest.
>
> Signed-off-by: Björn Töpel <bjorn@rivosinc.com>
> ---
> tools/testing/selftests/Makefile | 1 +
> tools/testing/selftests/sched_ext/Makefile | 59 +++++++++++++++-------
> 2 files changed, 41 insertions(+), 19 deletions(-)
>
> diff --git a/tools/testing/selftests/Makefile b/tools/testing/selftests/Makefile
> index b38199965f99..20ee8a0b795c 100644
> --- a/tools/testing/selftests/Makefile
> +++ b/tools/testing/selftests/Makefile
> @@ -88,6 +88,7 @@ TARGETS += rlimits
> TARGETS += rseq
> TARGETS += rtc
> TARGETS += rust
> +TARGETS += sched_ext
> TARGETS += seccomp
> TARGETS += sgx
> TARGETS += sigaltstack
> diff --git a/tools/testing/selftests/sched_ext/Makefile b/tools/testing/selftests/sched_ext/Makefile
> index 0754a2c110a1..66467a99184d 100644
> --- a/tools/testing/selftests/sched_ext/Makefile
> +++ b/tools/testing/selftests/sched_ext/Makefile
> @@ -13,14 +13,8 @@ LLVM_SUFFIX := $(LLVM)
> endif
>
> CC := $(LLVM_PREFIX)clang$(LLVM_SUFFIX) $(CLANG_FLAGS) -fintegrated-as
> -else
> -CC := gcc
Given that we're including ../lib.mk, can we just get rid of this whole block?
> endif # LLVM
>
> -ifneq ($(CROSS_COMPILE),)
> -$(error CROSS_COMPILE not supported for scx selftests)
> -endif # CROSS_COMPILE
> -
> CURDIR := $(abspath .)
> REPOROOT := $(abspath ../../../..)
> TOOLSDIR := $(REPOROOT)/tools
> @@ -34,18 +28,39 @@ GENHDR := $(GENDIR)/autoconf.h
> SCXTOOLSDIR := $(TOOLSDIR)/sched_ext
> SCXTOOLSINCDIR := $(TOOLSDIR)/sched_ext/include
>
> -OUTPUT_DIR := $(CURDIR)/build
> +ifeq (,$(OUTPUT))
> +OUTPUT := $(CURDIR)/build
> +RUNNER_DIR := $(CURDIR)
> +else
> +OUTPUT_DIR := $(OUTPUT)
This breaks if you use make from the selftests/sched_ext directory. AFAICT it
looks like OUTPUT is always set in ../lib.mk, so we always go to the OUTPUT_DIR
:= $(CURDIR) branch. Because of that, running `make clean` will delete the
whole sched_ext selftests directory. Also, did you mean for the first branch to
be:
+OUTPUT_DIR := $(CURDIR)/build
as opposed to:
> +OUTPUT := $(CURDIR)/build
[...]
Thanks,
David
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
prev parent reply other threads:[~2024-10-04 19:00 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-04 9:42 [PATCH] selftests: sched_ext: Add sched_ext as proper selftest target Björn Töpel
2024-10-04 17:46 ` Shuah Khan
2024-10-04 18:41 ` Shuah Khan
2024-10-04 19:00 ` David Vernet [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=20241004190013.GB56767@maniforge \
--to=void@manifault.com \
--cc=anders.roxell@linaro.org \
--cc=bjorn@kernel.org \
--cc=bjorn@rivosinc.com \
--cc=bpf@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=shuah@kernel.org \
--cc=tj@kernel.org \
/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