Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1207543 > unrolled thread

[PATCH 0/7] Improvement kselftest support for arm and arm64

Started byBamvor Jian Zhang <bamvor.zhangjian@linaro.org>
First post2015-08-14 15:50 +0200
Last post2015-08-14 15:50 +0200
Articles 5 — 1 participant

Back to article view | Back to linux.kernel


Contents

  [PATCH 0/7] Improvement kselftest support for arm and arm64 Bamvor Jian Zhang <bamvor.zhangjian@linaro.org> - 2015-08-14 15:50 +0200
    [PATCH 4/7] selftests: check before install Bamvor Jian Zhang <bamvor.zhangjian@linaro.org> - 2015-08-14 15:50 +0200
    [PATCH 2/7] selftests: add CFLAGS_EXTRA Bamvor Jian Zhang <bamvor.zhangjian@linaro.org> - 2015-08-14 15:50 +0200
    [PATCH 6/7] selftests: only compile userfaultfd for x86 and powperpc Bamvor Jian Zhang <bamvor.zhangjian@linaro.org> - 2015-08-14 15:50 +0200
    [PATCH 3/7] selftests: exec: fix for running and installing Bamvor Jian Zhang <bamvor.zhangjian@linaro.org> - 2015-08-14 15:50 +0200

#1207543 — [PATCH 0/7] Improvement kselftest support for arm and arm64

FromBamvor Jian Zhang <bamvor.zhangjian@linaro.org>
Date2015-08-14 15:50 +0200
Subject[PATCH 0/7] Improvement kselftest support for arm and arm64
Message-ID<pXnwR-3Fg-3@gated-at.bofh.it>
This is my first attempt for improving the kselftest for arm/arm64
architecture. Eventually, we hope we could build(in an cross compile
environment) and run all the kselftest cases automatically(successful
of courses).

I realize that there are lots of improvement for kselftest after the
lastest pull request for kselftest. So, All my work is based on the
lastest linux-next tree ("30b42f4 Add linux-next specific files for
20150813").

In this series, I try to make all the testcases compiling and
installation successful.

Patch 1 rename jumplabel target to static_keys in the Makefile.

Patch 2 add CFLAGS_EXTRA to fix the cross comiling failure.

Patch 3 fix the running the installation issue for exec testcase.

Patch 4 check if there are files need to be installed. This is
useful when such testcase is not built for specific architecture.
E.g. x86 testcases for arm/arm64.

Patch 5, 6 and 7 check the architecture before build and install.

Bamvor Jian Zhang (7):
  selftests: rename jump label to static_keys
  selftests: add CFLAGS_EXTRA
  selftests: exec: fix for running and installing
  selftests: check before install
  selftests: disable seccomp for arm64
  selftests: only compile userfaultfd for x86 and powperpc
  selftests: breakpoints: fix installing error on the architecture
    except x86

 tools/testing/selftests/Makefile             |  3 +--
 tools/testing/selftests/breakpoints/Makefile | 16 +++-------------
 tools/testing/selftests/exec/Makefile        | 14 +++++++++++---
 tools/testing/selftests/lib.mk               | 15 ++++++++++-----
 tools/testing/selftests/seccomp/Makefile     |  6 ++++++
 tools/testing/selftests/vm/Makefile          | 12 ++++++++++++
 6 files changed, 43 insertions(+), 23 deletions(-)

-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [next] | [standalone]


#1207544 — [PATCH 4/7] selftests: check before install

FromBamvor Jian Zhang <bamvor.zhangjian@linaro.org>
Date2015-08-14 15:50 +0200
Subject[PATCH 4/7] selftests: check before install
Message-ID<pXnwS-3Fg-11@gated-at.bofh.it>
In reply to#1207543
When the test cases is not supported by the current architecture
the install files(TEST_PROGS, TEST_PROGS_EXTENDED and TEST_FILES)
will be empty. Check it before installation to dismiss a failure
reported by install program.

Signed-off-by: Bamvor Jian Zhang <bamvor.zhangjian@linaro.org>
---
 tools/testing/selftests/Makefile |  1 -
 tools/testing/selftests/lib.mk   | 13 ++++++++-----
 2 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/tools/testing/selftests/Makefile b/tools/testing/selftests/Makefile
index 5f1d643..1d4a29a 100644
--- a/tools/testing/selftests/Makefile
+++ b/tools/testing/selftests/Makefile
@@ -73,7 +73,6 @@ ifdef INSTALL_PATH
 	@# Ask all targets to install their files
 	mkdir -p $(INSTALL_PATH)
 	for TARGET in $(TARGETS); do \
-		mkdir -p $(INSTALL_PATH)/$$TARGET ; \
 		make -C $$TARGET INSTALL_PATH=$(INSTALL_PATH)/$$TARGET install; \
 	done;
 
diff --git a/tools/testing/selftests/lib.mk b/tools/testing/selftests/lib.mk
index 1acfd02..4e14665 100644
--- a/tools/testing/selftests/lib.mk
+++ b/tools/testing/selftests/lib.mk
@@ -14,11 +14,14 @@ run_tests: all
 	$(RUN_TESTS)
 
 define INSTALL_RULE
-	mkdir -p $(INSTALL_PATH)
-	@for TEST_DIR in $(TEST_DIRS); do\
-		cp -r $$TEST_DIR $(INSTALL_PATH); \
-	done;
-	install -t $(INSTALL_PATH) $(TEST_PROGS) $(TEST_PROGS_EXTENDED) $(TEST_FILES)
+	@if [ "X$(TEST_PROGS)$(TEST_PROGS_EXTENDED)$(TEST_FILES)" != "X" ]; then			\
+		mkdir -p $(INSTALL_PATH);								\
+		for TEST_DIR in $(TEST_DIRS); do							\
+			cp -r $$TEST_DIR $(INSTALL_PATH);						\
+		done;											\
+		echo "install -t $(INSTALL_PATH) $(TEST_PROGS) $(TEST_PROGS_EXTENDED) $(TEST_FILES)";	\
+		install -t $(INSTALL_PATH) $(TEST_PROGS) $(TEST_PROGS_EXTENDED) $(TEST_FILES);		\
+	fi
 endef
 
 install: all
-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1207545 — [PATCH 2/7] selftests: add CFLAGS_EXTRA

FromBamvor Jian Zhang <bamvor.zhangjian@linaro.org>
Date2015-08-14 15:50 +0200
Subject[PATCH 2/7] selftests: add CFLAGS_EXTRA
Message-ID<pXnwS-3Fg-17@gated-at.bofh.it>
In reply to#1207543
One may pass the "-I /path/to/headers -L /path/to/lib" through
CFLAGS_EXTRA for cross compiling. mqueue could compile pass
in this way when we provide the popt.h and libpopt.so. And kdbus
could compile pass with sys/capability and libcap.so

Sed-off-by: Bamvor Jian Zhang <bamvor.zhangjian@linaro.org>

--
Originally, I want to add something like --sysroot to the compile
which mean the user need to provide the full filesystem including
headers and library for compiler. With CFLAGS_EXTRA, the user only
need to provide the minimal headers and/or librarys for building.
---
 tools/testing/selftests/lib.mk | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/tools/testing/selftests/lib.mk b/tools/testing/selftests/lib.mk
index ee412ba..1acfd02 100644
--- a/tools/testing/selftests/lib.mk
+++ b/tools/testing/selftests/lib.mk
@@ -2,6 +2,8 @@
 # Makefile can operate with or without the kbuild infrastructure.
 CC := $(CROSS_COMPILE)gcc
 
+CFLAGS += $(CFLAGS_EXTRA)
+
 define RUN_TESTS
 	@for TEST in $(TEST_PROGS); do \
 		(./$$TEST && echo "selftests: $$TEST [PASS]") || echo "selftests: $$TEST [FAIL]"; \
-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1207546 — [PATCH 6/7] selftests: only compile userfaultfd for x86 and powperpc

FromBamvor Jian Zhang <bamvor.zhangjian@linaro.org>
Date2015-08-14 15:50 +0200
Subject[PATCH 6/7] selftests: only compile userfaultfd for x86 and powperpc
Message-ID<pXnwS-3Fg-23@gated-at.bofh.it>
In reply to#1207543
Signed-off-by: Bamvor Jian Zhang <bamvor.zhangjian@linaro.org>
---
 tools/testing/selftests/vm/Makefile | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/tools/testing/selftests/vm/Makefile b/tools/testing/selftests/vm/Makefile
index bb888c6..4dd6e4f 100644
--- a/tools/testing/selftests/vm/Makefile
+++ b/tools/testing/selftests/vm/Makefile
@@ -1,5 +1,15 @@
 # Makefile for vm selftests
 
+uname_M := $(shell uname -m 2>/dev/null || echo not)
+ARCH ?= $(shell echo $(uname_M) | sed -e s/i.86/i386/ -e s/ppc.*/powerpc/)
+
+ifeq ($(ARCH),powerpc)
+support_userfaultfd = yes
+endif
+ifeq ($(ARCH),x86)
+support_userfaultfd = yes
+endif
+
 CFLAGS = -Wall
 BINARIES = compaction_test
 BINARIES += hugepage-mmap
@@ -9,7 +19,9 @@ BINARIES += mlock2-tests
 BINARIES += on-fault-limit
 BINARIES += thuge-gen
 BINARIES += transhuge-stress
+ifdef support_userfaultfd
 BINARIES += userfaultfd
+endif
 
 all: $(BINARIES)
 %: %.c
-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1207549 — [PATCH 3/7] selftests: exec: fix for running and installing

FromBamvor Jian Zhang <bamvor.zhangjian@linaro.org>
Date2015-08-14 15:50 +0200
Subject[PATCH 3/7] selftests: exec: fix for running and installing
Message-ID<pXnwS-3Fg-27@gated-at.bofh.it>
In reply to#1207543
Fix three issues in exec testcase:

Add RUN_TESTS rules in order to running the testcases in the build
directory through "make TARGETS=exec kselftest"

Copy symbol link and non-executable file instead of install it,
otherwise this test will fail after installation.

Exec testcases need a "Makefile" in line 346, otherwise it will
be ENOENT instead of EACCES.

Signed-off-by: Bamvor Jian Zhang <bamvor.zhangjian@linaro.org>
---
 tools/testing/selftests/exec/Makefile | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/tools/testing/selftests/exec/Makefile b/tools/testing/selftests/exec/Makefile
index 6b76bfd..34966a0 100644
--- a/tools/testing/selftests/exec/Makefile
+++ b/tools/testing/selftests/exec/Makefile
@@ -1,4 +1,4 @@
-CFLAGS = -Wall
+CFLAGS = -Wall -g
 BINARIES = execveat
 DEPS = execveat.symlink execveat.denatured script
 all: $(BINARIES) $(DEPS)
@@ -18,11 +18,19 @@ execveat.denatured: execveat
 	$(CC) $(CFLAGS) -o $@ $^
 
 TEST_PROGS := execveat
-TEST_FILES := $(DEPS)
+TEST_FILES := script
 
 include ../lib.mk
 
-override EMIT_TESTS := echo "mkdir -p subdir; (./execveat && echo \"selftests: execveat [PASS]\") || echo \"selftests: execveat [FAIL]\""
+override RUN_TESTS := mkdir -p subdir; (./execveat && echo "selftests: execveat [PASS]") || echo "selftests: execveat [FAIL]"
+
+override EMIT_TESTS := echo "mkdir -p subdir; touch Makefile; (./execveat && echo \"selftests: execveat [PASS]\") || echo \"selftests: execveat [FAIL]\""
+
+override define INSTALL_RULE
+       mkdir -p $(INSTALL_PATH)
+       install -t $(INSTALL_PATH) $(TEST_PROGS) $(TEST_PROGS_EXTENDED) $(TEST_FILES)
+       cp -a execveat.symlink execveat.denatured $(INSTALL_PATH)
+endef
 
 clean:
 	rm -rf $(BINARIES) $(DEPS) subdir.moved execveat.moved xxxxx*
-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web