Hello,
The aim of this patch series is to improve the resctrl selftest.
Without these fixes, some unnecessary processing will be executed
and test results will be confusing.
There is no behavior change in test themselves.
[patch 1] Make write_schemata() run to set up shemata with 100% allocation
on first run in MBM test.
[patch 2] The MBA test result message is always output as "ok",
make output message to be "not ok" if MBA check result is failed.
[patch 3] When a child process is created by fork(), the buffer of the
parent process is also copied. Flush the buffer before
executing fork().
[patch 4] Add a signal handler to cleanup properly before exiting the
parent process if there is an error occurs after creating
a child process with fork() in the CAT test, and unregister
signal handler when each test finished.
[patch 5] Before exiting each test CMT/CAT/MBM/MBA, clear test result
files function cat/cmt/mbm/mba_test_cleanup() are called
twice. Delete once.
This patch series is based on Linux v6.2-rc3.
Difference from v4:
[patch 4]
- Reuse signal handler of other tests(MBM/MBA/CAT).
- Unregister signal handler when tests finished.
- Fix change log.
Pervious versions of this series:
[v1] https://lore.kernel.org/lkml/20220914015147.3071025-1-tan.shaopeng@jp.fujit…
[v2] https://lore.kernel.org/lkml/20221005013933.1486054-1-tan.shaopeng@jp.fujit…
[v3] https://lore.kernel.org/lkml/20221101094341.3383073-1-tan.shaopeng@jp.fujit…
[v4] https://lore.kernel.org/lkml/20221117010541.1014481-1-tan.shaopeng@jp.fujit…
Shaopeng Tan (5):
selftests/resctrl: Fix set up schemata with 100% allocation on first
run in MBM test
selftests/resctrl: Return MBA check result and make it to output
message
selftests/resctrl: Flush stdout file buffer before executing fork()
selftests/resctrl: Cleanup properly when an error occurs in CAT test
selftests/resctrl: Remove duplicate codes that clear each test result
file
tools/testing/selftests/resctrl/cat_test.c | 27 +++++----
tools/testing/selftests/resctrl/cmt_test.c | 7 +--
tools/testing/selftests/resctrl/fill_buf.c | 14 -----
tools/testing/selftests/resctrl/mba_test.c | 23 ++++----
tools/testing/selftests/resctrl/mbm_test.c | 20 +++----
tools/testing/selftests/resctrl/resctrl.h | 2 +
.../testing/selftests/resctrl/resctrl_tests.c | 4 --
tools/testing/selftests/resctrl/resctrl_val.c | 57 ++++++++++++++-----
tools/testing/selftests/resctrl/resctrlfs.c | 5 +-
9 files changed, 89 insertions(+), 70 deletions(-)
--
2.27.0
From: Mark Brown <broonie(a)kernel.org>
[ Upstream commit 9fdaca2c1e157dc0a3c0faecf3a6a68e7d8d0c7b ]
We are missing a ) when we attempt to complain about not having enough
configuration for clang, resulting in the rather inscrutable error:
../lib.mk:23: *** unterminated call to function 'error': missing ')'. Stop.
Add the required ) so we print the message we were trying to print.
Signed-off-by: Mark Brown <broonie(a)kernel.org>
Signed-off-by: Shuah Khan <skhan(a)linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal(a)kernel.org>
---
tools/testing/selftests/lib.mk | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/testing/selftests/lib.mk b/tools/testing/selftests/lib.mk
index 291144c284fb..f7900e75d230 100644
--- a/tools/testing/selftests/lib.mk
+++ b/tools/testing/selftests/lib.mk
@@ -20,7 +20,7 @@ CLANG_TARGET_FLAGS := $(CLANG_TARGET_FLAGS_$(ARCH))
ifeq ($(CROSS_COMPILE),)
ifeq ($(CLANG_TARGET_FLAGS),)
-$(error Specify CROSS_COMPILE or add '--target=' option to lib.mk
+$(error Specify CROSS_COMPILE or add '--target=' option to lib.mk)
else
CLANG_FLAGS += --target=$(CLANG_TARGET_FLAGS)
endif # CLANG_TARGET_FLAGS
--
2.39.0
Hello Paul,
while developing and testing the recent changes for errno/environ/auxv, I
found that I wasn't relying on the kernel that much and that I was mostly
using qemu in userland only with my local kernel.
I figured that it was more convenient for this purpose than rebuilding an
initramfs and kernel for a quick test, and decided to make this approach
easier to use for everyone by adding a "run-user" target to the Makefile
to do exactly this. E.g:
Native build:
$ time make -C tools/testing/selftests/nolibc run-user
...
make: Entering directory '/g/public/linux/master/tools/testing/selftests/nolibc'
MKDIR sysroot/x86/include
make[1]: Entering directory '/g/public/linux/master/tools/include/nolibc'
make[2]: Entering directory '/g/public/linux/master'
make[2]: Leaving directory '/g/public/linux/master'
make[2]: Entering directory '/g/public/linux/master'
INSTALL /g/public/linux/master/tools/testing/selftests/nolibc/sysroot/sysroot/include
make[2]: Leaving directory '/g/public/linux/master'
make[1]: Leaving directory '/g/public/linux/master/tools/include/nolibc'
CC nolibc-test
18 chroot_root = -1 EPERM [FAIL]
43 link_dir = -1 EACCES != (-1 EPERM) [FAIL]
See all results in /g/public/linux/master/tools/testing/selftests/nolibc/run.out
make: Leaving directory '/g/public/linux/master/tools/testing/selftests/nolibc'
real 0m0.966s
user 0m0.731s
sys 0m0.164s
Cross build:
$ time make -C tools/testing/selftests/nolibc run-user ARCH=s390 CROSS_COMPILE=/f/tc/nolibc/gcc-11.3.0-nolibc/s390-linux/bin/s390-linux-
make: Entering directory '/g/public/linux/master/tools/testing/selftests/nolibc'
MKDIR sysroot/s390/include
make[1]: Entering directory '/g/public/linux/master/tools/include/nolibc'
make[2]: Entering directory '/g/public/linux/master'
make[2]: Leaving directory '/g/public/linux/master'
make[2]: Entering directory '/g/public/linux/master'
INSTALL /g/public/linux/master/tools/testing/selftests/nolibc/sysroot/sysroot/include
make[2]: Leaving directory '/g/public/linux/master'
make[1]: Leaving directory '/g/public/linux/master/tools/include/nolibc'
CC nolibc-test
18 chroot_root = -1 EPERM [FAIL]
43 link_dir = -1 EACCES != (-1 EPERM) [FAIL]
See all results in /g/public/linux/master/tools/testing/selftests/nolibc/run.out
make: Leaving directory '/g/public/linux/master/tools/testing/selftests/nolibc'
real 0m1.014s
user 0m0.732s
sys 0m0.183s
In addition, the "x86_64" value for ARCH= is now supported as I got caught
too many times with it not working in this subdir while it's used for the
rest of the kernel ("x86" is used instead as coming from subarch.include).
Generally you don't type it as x86_64 probably is the native build for most
users, but when you start to test toolchains it's a different thing.
There's no matter of urgency for these patches, they're just a bit of
user-friendly stuff. As such, if you're fine with stacking them on top of
what you already have for 6.3, that will be great, otherwise they can
easily wait.
Thank you!
Willy
[CCing Ammar who could benefit from this]
---
Willy Tarreau (2):
selftests/nolibc: support "x86_64" for arch name
selftests/nolibc: add a "run-user" target to test the program in user
land
tools/testing/selftests/nolibc/Makefile | 10 ++++++++++
1 file changed, 10 insertions(+)
--
2.17.5