* [PATCH v2 0/6] enable O and KBUILD_OUTPUT for kselftest @ 2016-11-29 11:55 bamvor.zhangjian 2016-11-29 11:55 ` [PATCH v2 1/6] selftests: remove duplicated all and clean target bamvor.zhangjian ` (2 more replies) 0 siblings, 3 replies; 21+ messages in thread From: bamvor.zhangjian @ 2016-11-29 11:55 UTC (permalink / raw) To: shuahkh; +Cc: linux-api, linux-kernel, khilman, broonie, mpe From: Bamvor Jian Zhang <bamvor.zhangjian@linaro.org> Here is my second version for enabling the KBUILD_OUTPUT for kselftest. The first version could be found here[1]. I fix and test all the TARGET in tools/testing/selftest/Makefile. For ppc, I test through fake target. There are six patches in these series. And five of them clean up the existing code. I split the clean up patches into five, hope it is easy to review. selftests: remove duplicated all and clean target selftests: remove useless TEST_DIRS a selftests: add pattern rules A selftests: remove CROSS_COMPILE in dedicated Makefile A selftests: add EXTRA_CLEAN for clean target selftests: enable O and KBUILD_OUTPUT Notes: A: Ack by Michael. a: ack by Michael. Minor update after rebase. In the first patch, I split the test files into two types: TEST_GEN_XXX means such file is generated during compiling. TEST_XXX means there is no need to compile before use. The main reason of this is the enablement of KBUILD_OUTPUT only need to care about TEST_GEN_XXX. I wanted to copy all the TEST_XXX with TEST_GEN_XXX, but I give up this idea in the end. Because people may puzzle why copy the file before installation. Because of the introducing of TEST_GEN_XXX, I update the top-level Makefile and lib.mk selftests directory. After introduce TEST_GEN_XXX, I could remove all the unnecessary all and clean targets. The second patch remove TEST_DIRS variable. And third patch add the pattern for compiling the c sourc code. The fourth patch remove the useless CROSS_COMPILE variable as it aleady exists in "tools/testing/selftests/lib.mk". Further more, The fifth patch add the EXTRA_CLEAN variable to clean up the duplicated clean target The last patch introduce the KBUILD_OUTPUT and O for kselftest instead using the existing kbuild system because user may compile kselftest directly (make -C tools/testing/selftests). Changes: 1. remove the useless *.o target in the following file suggested by Michael: tools/testing/selftests/powerpc/benchmarks/Makefile tools/testing/selftests/powerpc/copyloops/Makefile tools/testing/selftests/powerpc/dscr/Makefile tools/testing/selftests/powerpc/math/Makefile tools/testing/selftests/powerpc/primitives/Makefile tools/testing/selftests/powerpc/stringloops/Makefile tools/testing/selftests/powerpc/syscalls/Makefile tools/testing/selftests/powerpc/tm/Makefile 2. remove the useless "all" and "clean" target in bpf and nsfs which are added after my previous patch. 3. Improve the commit message. [1] http://www.spinics.net/lists/linux-api/msg20789.html Bamvor Jian Zhang (6): selftests: remove duplicated all and clean target selftests: remove useless TEST_DIRS selftests: add default rules for c source file selftests: remove CROSS_COMPILE in dedicated Makefile selftests: add EXTRA_CLEAN for clean target selftests: enable O and KBUILD_OUTPUT Documentation/kselftest.txt | 12 +++++++ tools/testing/selftests/Makefile | 36 ++++++++++++++----- tools/testing/selftests/bpf/Makefile | 10 ++---- tools/testing/selftests/breakpoints/Makefile | 10 ++---- tools/testing/selftests/capabilities/Makefile | 11 ++---- tools/testing/selftests/efivarfs/Makefile | 8 +---- tools/testing/selftests/exec/Makefile | 32 ++++++++--------- tools/testing/selftests/ftrace/Makefile | 6 ++-- tools/testing/selftests/futex/Makefile | 21 ++++++++--- tools/testing/selftests/futex/functional/Makefile | 12 ++----- tools/testing/selftests/ipc/Makefile | 7 +--- tools/testing/selftests/kcmp/Makefile | 6 ++-- tools/testing/selftests/lib.mk | 36 +++++++++++++++---- tools/testing/selftests/membarrier/Makefile | 6 +--- tools/testing/selftests/memfd/Makefile | 15 ++------ tools/testing/selftests/mount/Makefile | 7 +--- tools/testing/selftests/mqueue/Makefile | 6 +--- tools/testing/selftests/net/Makefile | 15 +++----- tools/testing/selftests/nsfs/Makefile | 9 +---- tools/testing/selftests/powerpc/Makefile | 15 ++++---- tools/testing/selftests/powerpc/alignment/Makefile | 9 ++--- .../testing/selftests/powerpc/benchmarks/Makefile | 15 +++----- .../selftests/powerpc/context_switch/Makefile | 9 ++--- tools/testing/selftests/powerpc/copyloops/Makefile | 19 ++++------ tools/testing/selftests/powerpc/dscr/Makefile | 13 +++---- tools/testing/selftests/powerpc/math/Makefile | 25 ++++++------- tools/testing/selftests/powerpc/mm/Makefile | 18 ++++------ tools/testing/selftests/powerpc/pmu/Makefile | 26 +++++++------- tools/testing/selftests/powerpc/pmu/ebb/Makefile | 15 +++----- .../testing/selftests/powerpc/primitives/Makefile | 9 ++--- .../testing/selftests/powerpc/stringloops/Makefile | 9 ++--- .../selftests/powerpc/switch_endian/Makefile | 17 ++++----- tools/testing/selftests/powerpc/syscalls/Makefile | 9 ++--- tools/testing/selftests/powerpc/tm/Makefile | 17 ++++----- tools/testing/selftests/powerpc/vphn/Makefile | 10 ++---- tools/testing/selftests/pstore/Makefile | 4 +-- tools/testing/selftests/ptrace/Makefile | 8 +---- tools/testing/selftests/seccomp/Makefile | 6 +--- tools/testing/selftests/sigaltstack/Makefile | 5 +-- tools/testing/selftests/size/Makefile | 10 ++---- tools/testing/selftests/timers/Makefile | 10 ++---- tools/testing/selftests/vm/Makefile | 41 +++++++++------------- tools/testing/selftests/x86/Makefile | 17 +++++---- tools/testing/selftests/zram/Makefile | 3 +- 44 files changed, 247 insertions(+), 357 deletions(-) -- 2.10.0 ^ permalink raw reply [flat|nested] 21+ messages in thread
* [PATCH v2 1/6] selftests: remove duplicated all and clean target 2016-11-29 11:55 [PATCH v2 0/6] enable O and KBUILD_OUTPUT for kselftest bamvor.zhangjian @ 2016-11-29 11:55 ` bamvor.zhangjian [not found] ` <20161129115552.8148-1-bamvor.zhangjian-hv44wF8Li93QT0dZR+AlfA@public.gmane.org> 2016-11-29 11:55 ` [PATCH v2 4/6] selftests: remove CROSS_COMPILE in dedicated Makefile bamvor.zhangjian 2 siblings, 0 replies; 21+ messages in thread From: bamvor.zhangjian @ 2016-11-29 11:55 UTC (permalink / raw) To: shuahkh; +Cc: linux-api, linux-kernel, khilman, broonie, mpe From: Bamvor Jian Zhang <bamvor.zhangjian@linaro.org> Currently, kselftest use TEST_PROGS, TEST_PROGS_EXTENDED, TEST_FILES to indicate the test program, extended test program and test files. It is easy to understand the purpose of these files. But mix of compiled and uncompiled files lead to duplicated "all" and "clean" targets. In order to remove the duplicated targets, introduce TEST_GEN_PROGS, TEST_GEN_PROGS_EXTENDED, TEST_GEN_FILES to indicate the compiled objects. Also, the later patch will make use of TEST_GEN_XXX to redirect these files to output directory indicated by KBUILD_OUTPUT or O. And add this changes to "Contributing new tests(details)" of Documentation/kselftest.txt. Signed-off-by: Bamvor Jian Zhang <bamvor.zhangjian@linaro.org> --- Documentation/kselftest.txt | 12 +++++++++++ tools/testing/selftests/bpf/Makefile | 10 ++------- tools/testing/selftests/breakpoints/Makefile | 10 +++------ tools/testing/selftests/capabilities/Makefile | 11 ++-------- tools/testing/selftests/efivarfs/Makefile | 8 +------- tools/testing/selftests/exec/Makefile | 10 ++++----- tools/testing/selftests/futex/functional/Makefile | 12 +++-------- tools/testing/selftests/ipc/Makefile | 7 +------ tools/testing/selftests/kcmp/Makefile | 6 ++---- tools/testing/selftests/lib.mk | 18 ++++++++++++---- tools/testing/selftests/membarrier/Makefile | 6 +----- tools/testing/selftests/memfd/Makefile | 14 +++---------- tools/testing/selftests/mount/Makefile | 6 ++---- tools/testing/selftests/mqueue/Makefile | 6 +----- tools/testing/selftests/net/Makefile | 13 ++++-------- tools/testing/selftests/nsfs/Makefile | 9 +------- tools/testing/selftests/powerpc/alignment/Makefile | 9 ++------ .../testing/selftests/powerpc/benchmarks/Makefile | 11 +++------- .../selftests/powerpc/context_switch/Makefile | 9 ++------ tools/testing/selftests/powerpc/copyloops/Makefile | 11 +++------- tools/testing/selftests/powerpc/dscr/Makefile | 13 ++++-------- tools/testing/selftests/powerpc/math/Makefile | 13 ++++-------- tools/testing/selftests/powerpc/mm/Makefile | 12 ++++------- tools/testing/selftests/powerpc/pmu/Makefile | 12 +++++------ tools/testing/selftests/powerpc/pmu/ebb/Makefile | 11 +++------- .../testing/selftests/powerpc/primitives/Makefile | 9 ++------ .../testing/selftests/powerpc/stringloops/Makefile | 9 ++------ .../selftests/powerpc/switch_endian/Makefile | 8 +++----- tools/testing/selftests/powerpc/syscalls/Makefile | 9 ++------ tools/testing/selftests/powerpc/tm/Makefile | 11 +++------- tools/testing/selftests/powerpc/vphn/Makefile | 10 +++------ tools/testing/selftests/ptrace/Makefile | 8 +------- tools/testing/selftests/seccomp/Makefile | 6 +----- tools/testing/selftests/sigaltstack/Makefile | 5 +---- tools/testing/selftests/size/Makefile | 6 +----- tools/testing/selftests/timers/Makefile | 9 ++------ tools/testing/selftests/vm/Makefile | 24 +++++++++------------- 37 files changed, 118 insertions(+), 255 deletions(-) diff --git a/Documentation/kselftest.txt b/Documentation/kselftest.txt index e5c7254..d431dc8 100644 --- a/Documentation/kselftest.txt +++ b/Documentation/kselftest.txt @@ -95,3 +95,15 @@ In general, the rules for selftests are * Don't cause the top-level "make run_tests" to fail if your feature is unconfigured. + +Contributing new tests(details) +=============================== + + * Use TEST_GEN_XXX if such binaries or files are generated during + compiling. + TEST_PROGS, TEST_GEN_PROGS mean it is the excutable tested by + default. + TEST_PROGS_EXTENDED, TEST_GEN_PROGS_EXTENDED mean it is the + executable which is not tested by default. + TEST_FILES, TEST_GEN_FILES mean it is the file which is used by + test. diff --git a/tools/testing/selftests/bpf/Makefile b/tools/testing/selftests/bpf/Makefile index 7a5f245..058351b 100644 --- a/tools/testing/selftests/bpf/Makefile +++ b/tools/testing/selftests/bpf/Makefile @@ -1,13 +1,7 @@ CFLAGS += -Wall -O2 -I../../../../usr/include -test_objs = test_verifier test_maps test_lru_map +TEST_GEN_PROGS = test_verifier test_maps test_lru_map -TEST_PROGS := test_verifier test_maps test_lru_map test_kmod.sh -TEST_FILES := $(test_objs) - -all: $(test_objs) +TEST_PROGS := test_kmod.sh include ../lib.mk - -clean: - $(RM) $(test_objs) diff --git a/tools/testing/selftests/breakpoints/Makefile b/tools/testing/selftests/breakpoints/Makefile index 61b79e8..72aa103 100644 --- a/tools/testing/selftests/breakpoints/Makefile +++ b/tools/testing/selftests/breakpoints/Makefile @@ -3,17 +3,13 @@ uname_M := $(shell uname -m 2>/dev/null || echo not) ARCH ?= $(shell echo $(uname_M) | sed -e s/i.86/x86/ -e s/x86_64/x86/) ifeq ($(ARCH),x86) -TEST_PROGS := breakpoint_test +TEST_GEN_PROGS := breakpoint_test endif ifeq ($(ARCH),aarch64) -TEST_PROGS := breakpoint_test_arm64 +TEST_GEN_PROGS := breakpoint_test_arm64 endif -TEST_PROGS += step_after_suspend_test - -all: $(TEST_PROGS) +TEST_GEN_PROGS += step_after_suspend_test include ../lib.mk -clean: - rm -fr breakpoint_test breakpoint_test_arm64 step_after_suspend_test diff --git a/tools/testing/selftests/capabilities/Makefile b/tools/testing/selftests/capabilities/Makefile index 008602a..29b8adf 100644 --- a/tools/testing/selftests/capabilities/Makefile +++ b/tools/testing/selftests/capabilities/Makefile @@ -1,15 +1,8 @@ -TEST_FILES := validate_cap -TEST_PROGS := test_execve - -BINARIES := $(TEST_FILES) $(TEST_PROGS) +TEST_GEN_FILES := validate_cap +TEST_GEN_PROGS := test_execve CFLAGS += -O2 -g -std=gnu99 -Wall LDLIBS += -lcap-ng -lrt -ldl -all: $(BINARIES) - -clean: - $(RM) $(BINARIES) - include ../lib.mk diff --git a/tools/testing/selftests/efivarfs/Makefile b/tools/testing/selftests/efivarfs/Makefile index 736c3dd..c49dcea 100644 --- a/tools/testing/selftests/efivarfs/Makefile +++ b/tools/testing/selftests/efivarfs/Makefile @@ -1,13 +1,7 @@ CFLAGS = -Wall -test_objs = open-unlink create-read - -all: $(test_objs) - +TEST_GEN_FILES := open-unlink create-read TEST_PROGS := efivarfs.sh -TEST_FILES := $(test_objs) include ../lib.mk -clean: - rm -f $(test_objs) diff --git a/tools/testing/selftests/exec/Makefile b/tools/testing/selftests/exec/Makefile index d430060..b3bf091 100644 --- a/tools/testing/selftests/exec/Makefile +++ b/tools/testing/selftests/exec/Makefile @@ -1,7 +1,4 @@ CFLAGS = -Wall -BINARIES = execveat -DEPS = execveat.symlink execveat.denatured script subdir -all: $(BINARIES) $(DEPS) subdir: mkdir -p $@ @@ -17,11 +14,12 @@ execveat.denatured: execveat %: %.c $(CC) $(CFLAGS) -o $@ $^ -TEST_PROGS := execveat +TEST_GEN_PROGS := execveat +TEST_GEN_FILES := execveat.symlink execveat.denatured script subdir # Makefile is a run-time dependency, since it's accessed by the execveat test -TEST_FILES := $(DEPS) Makefile +TEST_FILES := Makefile include ../lib.mk clean: - rm -rf $(BINARIES) $(DEPS) subdir.moved execveat.moved xxxxx* + rm -rf $(TEST_GEN_PROGS) $(TEST_GEN_FILES) subdir.moved execveat.moved xxxxx* diff --git a/tools/testing/selftests/futex/functional/Makefile b/tools/testing/selftests/futex/functional/Makefile index 9d6b75e..ac35782 100644 --- a/tools/testing/selftests/futex/functional/Makefile +++ b/tools/testing/selftests/futex/functional/Makefile @@ -3,7 +3,7 @@ CFLAGS := $(CFLAGS) -g -O2 -Wall -D_GNU_SOURCE -pthread $(INCLUDES) LDFLAGS := $(LDFLAGS) -pthread -lrt HEADERS := ../include/futextest.h -TARGETS := \ +TEST_GEN_FILES := \ futex_wait_timeout \ futex_wait_wouldblock \ futex_requeue_pi \ @@ -12,14 +12,8 @@ TARGETS := \ futex_wait_uninitialized_heap \ futex_wait_private_mapped_file -TEST_PROGS := $(TARGETS) run.sh - -.PHONY: all clean -all: $(TARGETS) - -$(TARGETS): $(HEADERS) +TEST_PROGS := run.sh include ../../lib.mk -clean: - rm -f $(TARGETS) +$(TEST_GEN_FILES): $(HEADERS) diff --git a/tools/testing/selftests/ipc/Makefile b/tools/testing/selftests/ipc/Makefile index 25d2e70..30ef4c7 100644 --- a/tools/testing/selftests/ipc/Makefile +++ b/tools/testing/selftests/ipc/Makefile @@ -11,12 +11,7 @@ endif CFLAGS += -I../../../../usr/include/ -all: - $(CC) $(CFLAGS) msgque.c -o msgque_test - -TEST_PROGS := msgque_test +TEST_GEN_PROGS := msgque include ../lib.mk -clean: - rm -fr ./msgque_test diff --git a/tools/testing/selftests/kcmp/Makefile b/tools/testing/selftests/kcmp/Makefile index 2ae7450..9e8b673 100644 --- a/tools/testing/selftests/kcmp/Makefile +++ b/tools/testing/selftests/kcmp/Makefile @@ -1,10 +1,8 @@ CFLAGS += -I../../../../usr/include/ -all: kcmp_test - -TEST_PROGS := kcmp_test +TEST_GEN_PROGS := kcmp_test include ../lib.mk clean: - $(RM) kcmp_test kcmp-test-file + $(RM) $(TEST_GEN_PROGS) kcmp-test-file diff --git a/tools/testing/selftests/lib.mk b/tools/testing/selftests/lib.mk index 50a93f5..9fddffd 100644 --- a/tools/testing/selftests/lib.mk +++ b/tools/testing/selftests/lib.mk @@ -3,7 +3,7 @@ CC := $(CROSS_COMPILE)gcc define RUN_TESTS - @for TEST in $(TEST_PROGS); do \ + @for TEST in $(TEST_GEN_PROGS) $(TEST_PROGS); do \ (./$$TEST && echo "selftests: $$TEST [PASS]") || echo "selftests: $$TEST [FAIL]"; \ done; endef @@ -14,8 +14,13 @@ run_tests: all define INSTALL_RULE @if [ "X$(TEST_PROGS)$(TEST_PROGS_EXTENDED)$(TEST_FILES)" != "X" ]; then \ mkdir -p ${INSTALL_PATH}; \ - echo "rsync -a $(TEST_DIRS) $(TEST_PROGS) $(TEST_PROGS_EXTENDED) $(TEST_FILES) $(INSTALL_PATH)/"; \ - rsync -a $(TEST_DIRS) $(TEST_PROGS) $(TEST_PROGS_EXTENDED) $(TEST_FILES) $(INSTALL_PATH)/; \ + echo "rsync -a $(TEST_DIRS) $(TEST_PROGS) $(TEST_PROGS_EXTENDED) $(TEST_FILES) $(INSTALL_PATH)/"; \ + rsync -a $(TEST_DIRS) $(TEST_PROGS) $(TEST_PROGS_EXTENDED) $(TEST_FILES) $(INSTALL_PATH)/; \ + fi + @if [ "X$(TEST_GEN_PROGS)$(TEST_GEN_PROGS_EXTENDED)$(TEST_GEN_FILES)" != "X" ]; then \ + mkdir -p ${INSTALL_PATH}; \ + echo "rsync -a $(TEST_GEN_PROGS) $(TEST_GEN_PROGS_EXTENDED) $(TEST_GEN_FILES) $(INSTALL_PATH)/"; \ + rsync -a $(TEST_GEN_PROGS) $(TEST_GEN_PROGS_EXTENDED) $(TEST_GEN_FILES) $(INSTALL_PATH)/; \ fi endef @@ -27,7 +32,7 @@ else endif define EMIT_TESTS - @for TEST in $(TEST_PROGS); do \ + @for TEST in $(TEST_GEN_PROGS) $(TEST_PROGS); do \ echo "(./$$TEST && echo \"selftests: $$TEST [PASS]\") || echo \"selftests: $$TEST [FAIL]\""; \ done; endef @@ -35,4 +40,9 @@ endef emit_tests: $(EMIT_TESTS) +all: $(TEST_GEN_PROGS) $(TEST_GEN_PROGS_EXTENDED) $(TEST_GEN_FILES) + +clean: + $(RM) -r $(TEST_GEN_PROGS) $(TEST_GEN_PROGS_EXTENDED) $(TEST_GEN_FILES) + .PHONY: run_tests all clean install emit_tests diff --git a/tools/testing/selftests/membarrier/Makefile b/tools/testing/selftests/membarrier/Makefile index a1a9708..0284553 100644 --- a/tools/testing/selftests/membarrier/Makefile +++ b/tools/testing/selftests/membarrier/Makefile @@ -1,10 +1,6 @@ CFLAGS += -g -I../../../../usr/include/ -TEST_PROGS := membarrier_test - -all: $(TEST_PROGS) +TEST_GEN_PROGS := membarrier_test include ../lib.mk -clean: - $(RM) $(TEST_PROGS) diff --git a/tools/testing/selftests/memfd/Makefile b/tools/testing/selftests/memfd/Makefile index fd396ac..2c87f23 100644 --- a/tools/testing/selftests/memfd/Makefile +++ b/tools/testing/selftests/memfd/Makefile @@ -4,19 +4,11 @@ CFLAGS += -I../../../../include/uapi/ CFLAGS += -I../../../../include/ CFLAGS += -I../../../../usr/include/ -TEST_PROGS := memfd_test - -all: $(TEST_PROGS) - -include ../lib.mk - -build_fuse: fuse_mnt fuse_test +TEST_PROGS := run_fuse_test.sh +TEST_GEN_FILES := memfd_test fuse_mnt fuse_test fuse_mnt.o: CFLAGS += $(shell pkg-config fuse --cflags) fuse_mnt: LDFLAGS += $(shell pkg-config fuse --libs) -run_fuse: build_fuse - @./run_fuse_test.sh || echo "fuse_test: [FAIL]" +include ../lib.mk -clean: - $(RM) memfd_test fuse_test diff --git a/tools/testing/selftests/mount/Makefile b/tools/testing/selftests/mount/Makefile index 5e35c9c..e8fb15e 100644 --- a/tools/testing/selftests/mount/Makefile +++ b/tools/testing/selftests/mount/Makefile @@ -1,14 +1,14 @@ # Makefile for mount selftests. CFLAGS = -Wall \ -O2 -all: unprivileged-remount-test unprivileged-remount-test: unprivileged-remount-test.c $(CC) $(CFLAGS) unprivileged-remount-test.c -o unprivileged-remount-test +TEST_GEN_PROGS := unprivileged-remount-test + include ../lib.mk -TEST_PROGS := unprivileged-remount-test override RUN_TESTS := if [ -f /proc/self/uid_map ] ; \ then \ ./unprivileged-remount-test ; \ @@ -17,5 +17,3 @@ override RUN_TESTS := if [ -f /proc/self/uid_map ] ; \ fi override EMIT_TESTS := echo "$(RUN_TESTS)" -clean: - rm -f unprivileged-remount-test diff --git a/tools/testing/selftests/mqueue/Makefile b/tools/testing/selftests/mqueue/Makefile index eebac29..79a664a 100644 --- a/tools/testing/selftests/mqueue/Makefile +++ b/tools/testing/selftests/mqueue/Makefile @@ -1,8 +1,6 @@ CFLAGS += -O2 LDLIBS = -lrt -lpthread -lpopt -TEST_PROGS := mq_open_tests mq_perf_tests - -all: $(TEST_PROGS) +TEST_GEN_PROGS := mq_open_tests mq_perf_tests include ../lib.mk @@ -16,5 +14,3 @@ override define EMIT_TESTS echo "./mq_perf_tests || echo \"selftests: mq_perf_tests [FAIL]\"" endef -clean: - rm -f mq_open_tests mq_perf_tests diff --git a/tools/testing/selftests/net/Makefile b/tools/testing/selftests/net/Makefile index e24e4c8..fe5b36d 100644 --- a/tools/testing/selftests/net/Makefile +++ b/tools/testing/selftests/net/Makefile @@ -3,20 +3,15 @@ CFLAGS = -Wall -Wl,--no-as-needed -O2 -g CFLAGS += -I../../../../usr/include/ -NET_PROGS = socket -NET_PROGS += psock_fanout psock_tpacket -NET_PROGS += reuseport_bpf reuseport_bpf_cpu reuseport_bpf_numa -NET_PROGS += reuseport_dualstack - -all: $(NET_PROGS) reuseport_bpf_numa: LDFLAGS += -lnuma %: %.c $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ TEST_PROGS := run_netsocktests run_afpackettests test_bpf.sh -TEST_FILES := $(NET_PROGS) +TEST_GEN_FILES = socket +TEST_GEN_FILES += psock_fanout psock_tpacket +TEST_GEN_FILES += reuseport_bpf reuseport_bpf_cpu reuseport_bpf_numa +TEST_GEN_FILES += reuseport_dualstack include ../lib.mk -clean: - $(RM) $(NET_PROGS) diff --git a/tools/testing/selftests/nsfs/Makefile b/tools/testing/selftests/nsfs/Makefile index 2306054..9ff7c7f 100644 --- a/tools/testing/selftests/nsfs/Makefile +++ b/tools/testing/selftests/nsfs/Makefile @@ -1,12 +1,5 @@ -TEST_PROGS := owner pidns +TEST_GEN_PROGS := owner pidns CFLAGS := -Wall -Werror -all: owner pidns -owner: owner.c -pidns: pidns.c - -clean: - $(RM) owner pidns - include ../lib.mk diff --git a/tools/testing/selftests/powerpc/alignment/Makefile b/tools/testing/selftests/powerpc/alignment/Makefile index ad6a4e4..16b2200 100644 --- a/tools/testing/selftests/powerpc/alignment/Makefile +++ b/tools/testing/selftests/powerpc/alignment/Makefile @@ -1,10 +1,5 @@ -TEST_PROGS := copy_unaligned copy_first_unaligned paste_unaligned paste_last_unaligned - -all: $(TEST_PROGS) - -$(TEST_PROGS): ../harness.c ../utils.c copy_paste_unaligned_common.c +TEST_GEN_PROGS := copy_unaligned copy_first_unaligned paste_unaligned paste_last_unaligned include ../../lib.mk -clean: - rm -f $(TEST_PROGS) +$(TEST_GEN_PROGS): ../harness.c ../utils.c copy_paste_unaligned_common.c diff --git a/tools/testing/selftests/powerpc/benchmarks/Makefile b/tools/testing/selftests/powerpc/benchmarks/Makefile index 545077f..08a55bd 100644 --- a/tools/testing/selftests/powerpc/benchmarks/Makefile +++ b/tools/testing/selftests/powerpc/benchmarks/Makefile @@ -1,16 +1,11 @@ -TEST_PROGS := gettimeofday context_switch mmap_bench futex_bench null_syscall +TEST_GEN_PROGS := gettimeofday context_switch mmap_bench futex_bench null_syscall CFLAGS += -O2 -all: $(TEST_PROGS) +$(TEST_GEN_PROGS): ../harness.c -$(TEST_PROGS): ../harness.c +include ../../lib.mk context_switch: ../utils.c context_switch: CFLAGS += -maltivec -mvsx -mabi=altivec context_switch: LDLIBS += -lpthread - -include ../../lib.mk - -clean: - rm -f $(TEST_PROGS) *.o diff --git a/tools/testing/selftests/powerpc/context_switch/Makefile b/tools/testing/selftests/powerpc/context_switch/Makefile index e164d14..e9351bb 100644 --- a/tools/testing/selftests/powerpc/context_switch/Makefile +++ b/tools/testing/selftests/powerpc/context_switch/Makefile @@ -1,10 +1,5 @@ -TEST_PROGS := cp_abort - -all: $(TEST_PROGS) - -$(TEST_PROGS): ../harness.c ../utils.c +TEST_GEN_PROGS := cp_abort include ../../lib.mk -clean: - rm -f $(TEST_PROGS) +$(TEST_GEN_PROGS): ../harness.c ../utils.c diff --git a/tools/testing/selftests/powerpc/copyloops/Makefile b/tools/testing/selftests/powerpc/copyloops/Makefile index 384843e..9ad1558 100644 --- a/tools/testing/selftests/powerpc/copyloops/Makefile +++ b/tools/testing/selftests/powerpc/copyloops/Makefile @@ -7,19 +7,14 @@ CFLAGS += -maltivec # Use our CFLAGS for the implicit .S rule ASFLAGS = $(CFLAGS) -TEST_PROGS := copyuser_64 copyuser_power7 memcpy_64 memcpy_power7 +TEST_GEN_PROGS := copyuser_64 copyuser_power7 memcpy_64 memcpy_power7 EXTRA_SOURCES := validate.c ../harness.c -all: $(TEST_PROGS) +include ../../lib.mk copyuser_64: CPPFLAGS += -D COPY_LOOP=test___copy_tofrom_user_base copyuser_power7: CPPFLAGS += -D COPY_LOOP=test___copy_tofrom_user_power7 memcpy_64: CPPFLAGS += -D COPY_LOOP=test_memcpy memcpy_power7: CPPFLAGS += -D COPY_LOOP=test_memcpy_power7 -$(TEST_PROGS): $(EXTRA_SOURCES) - -include ../../lib.mk - -clean: - rm -f $(TEST_PROGS) *.o +$(TEST_GEN_PROGS): $(EXTRA_SOURCES) diff --git a/tools/testing/selftests/powerpc/dscr/Makefile b/tools/testing/selftests/powerpc/dscr/Makefile index 49327ee..4262de4 100644 --- a/tools/testing/selftests/powerpc/dscr/Makefile +++ b/tools/testing/selftests/powerpc/dscr/Makefile @@ -1,14 +1,9 @@ -TEST_PROGS := dscr_default_test dscr_explicit_test dscr_user_test \ +TEST_GEN_PROGS := dscr_default_test dscr_explicit_test dscr_user_test \ dscr_inherit_test dscr_inherit_exec_test dscr_sysfs_test \ dscr_sysfs_thread_test -dscr_default_test: LDLIBS += -lpthread - -all: $(TEST_PROGS) - -$(TEST_PROGS): ../harness.c - include ../../lib.mk -clean: - rm -f $(TEST_PROGS) *.o +dscr_default_test: LDLIBS += -lpthread + +$(TEST_GEN_PROGS): ../harness.c diff --git a/tools/testing/selftests/powerpc/math/Makefile b/tools/testing/selftests/powerpc/math/Makefile index a505b66..814c385 100644 --- a/tools/testing/selftests/powerpc/math/Makefile +++ b/tools/testing/selftests/powerpc/math/Makefile @@ -1,9 +1,9 @@ -TEST_PROGS := fpu_syscall fpu_preempt fpu_signal vmx_syscall vmx_preempt vmx_signal vsx_preempt +TEST_GEN_PROGS := fpu_syscall fpu_preempt fpu_signal vmx_syscall vmx_preempt vmx_signal vsx_preempt -all: $(TEST_PROGS) +include ../../lib.mk -$(TEST_PROGS): ../harness.c -$(TEST_PROGS): CFLAGS += -O2 -g -pthread -m64 -maltivec +$(TEST_GEN_PROGS): ../harness.c +$(TEST_GEN_PROGS): CFLAGS += -O2 -g -pthread -m64 -maltivec fpu_syscall: fpu_asm.S fpu_preempt: fpu_asm.S @@ -15,8 +15,3 @@ vmx_signal: vmx_asm.S vsx_preempt: CFLAGS += -mvsx vsx_preempt: vsx_asm.S - -include ../../lib.mk - -clean: - rm -f $(TEST_PROGS) *.o diff --git a/tools/testing/selftests/powerpc/mm/Makefile b/tools/testing/selftests/powerpc/mm/Makefile index 3bdb96e..d563378 100644 --- a/tools/testing/selftests/powerpc/mm/Makefile +++ b/tools/testing/selftests/powerpc/mm/Makefile @@ -1,19 +1,15 @@ noarg: $(MAKE) -C ../ -TEST_PROGS := hugetlb_vs_thp_test subpage_prot prot_sao -TEST_FILES := tempfile +TEST_GEN_PROGS := hugetlb_vs_thp_test subpage_prot prot_sao +TEST_GEN_FILES := tempfile -all: $(TEST_PROGS) $(TEST_FILES) +include ../../lib.mk -$(TEST_PROGS): ../harness.c +$(TEST_GEN_PROGS): ../harness.c prot_sao: ../utils.c -include ../../lib.mk - tempfile: dd if=/dev/zero of=tempfile bs=64k count=1 -clean: - rm -f $(TEST_PROGS) tempfile diff --git a/tools/testing/selftests/powerpc/pmu/Makefile b/tools/testing/selftests/powerpc/pmu/Makefile index ac41a71..ab0f902 100644 --- a/tools/testing/selftests/powerpc/pmu/Makefile +++ b/tools/testing/selftests/powerpc/pmu/Makefile @@ -1,12 +1,14 @@ noarg: $(MAKE) -C ../ -TEST_PROGS := count_instructions l3_bank_test per_event_excludes +TEST_GEN_PROGS := count_instructions l3_bank_test per_event_excludes EXTRA_SOURCES := ../harness.c event.c lib.c ../utils.c -all: $(TEST_PROGS) ebb +include ../../lib.mk + +all: $(TEST_GEN_PROGS) ebb -$(TEST_PROGS): $(EXTRA_SOURCES) +$(TEST_GEN_PROGS): $(EXTRA_SOURCES) # loop.S can only be built 64-bit count_instructions: loop.S count_instructions.c $(EXTRA_SOURCES) @@ -14,8 +16,6 @@ count_instructions: loop.S count_instructions.c $(EXTRA_SOURCES) per_event_excludes: ../utils.c -include ../../lib.mk - DEFAULT_RUN_TESTS := $(RUN_TESTS) override define RUN_TESTS $(DEFAULT_RUN_TESTS) @@ -35,7 +35,7 @@ override define INSTALL_RULE endef clean: - rm -f $(TEST_PROGS) loop.o + $(RM) $(TEST_PROGS) loop.o $(MAKE) -C ebb clean ebb: diff --git a/tools/testing/selftests/powerpc/pmu/ebb/Makefile b/tools/testing/selftests/powerpc/pmu/ebb/Makefile index 8d2279c4..0bc2bd6 100644 --- a/tools/testing/selftests/powerpc/pmu/ebb/Makefile +++ b/tools/testing/selftests/powerpc/pmu/ebb/Makefile @@ -4,7 +4,7 @@ noarg: # The EBB handler is 64-bit code and everything links against it CFLAGS += -m64 -TEST_PROGS := reg_access_test event_attributes_test cycles_test \ +TEST_GEN_PROGS := reg_access_test event_attributes_test cycles_test \ cycles_with_freeze_test pmc56_overflow_test \ ebb_vs_cpu_event_test cpu_event_vs_ebb_test \ cpu_event_pinned_vs_ebb_test task_event_vs_ebb_test \ @@ -16,16 +16,11 @@ TEST_PROGS := reg_access_test event_attributes_test cycles_test \ lost_exception_test no_handler_test \ cycles_with_mmcr2_test -all: $(TEST_PROGS) +include ../../../lib.mk -$(TEST_PROGS): ../../harness.c ../../utils.c ../event.c ../lib.c \ +$(TEST_GEN_PROGS): ../../harness.c ../../utils.c ../event.c ../lib.c \ ebb.c ebb_handler.S trace.c busy_loop.S instruction_count_test: ../loop.S lost_exception_test: ../lib.c - -include ../../../lib.mk - -clean: - rm -f $(TEST_PROGS) diff --git a/tools/testing/selftests/powerpc/primitives/Makefile b/tools/testing/selftests/powerpc/primitives/Makefile index b68c622..175366d 100644 --- a/tools/testing/selftests/powerpc/primitives/Makefile +++ b/tools/testing/selftests/powerpc/primitives/Makefile @@ -1,12 +1,7 @@ CFLAGS += -I$(CURDIR) -TEST_PROGS := load_unaligned_zeropad - -all: $(TEST_PROGS) - -$(TEST_PROGS): ../harness.c +TEST_GEN_PROGS := load_unaligned_zeropad include ../../lib.mk -clean: - rm -f $(TEST_PROGS) *.o +$(TEST_GEN_PROGS): ../harness.c diff --git a/tools/testing/selftests/powerpc/stringloops/Makefile b/tools/testing/selftests/powerpc/stringloops/Makefile index 2a728f4..557b937 100644 --- a/tools/testing/selftests/powerpc/stringloops/Makefile +++ b/tools/testing/selftests/powerpc/stringloops/Makefile @@ -2,14 +2,9 @@ CFLAGS += -m64 CFLAGS += -I$(CURDIR) -TEST_PROGS := memcmp +TEST_GEN_PROGS := memcmp EXTRA_SOURCES := memcmp_64.S ../harness.c -all: $(TEST_PROGS) - -$(TEST_PROGS): $(EXTRA_SOURCES) - include ../../lib.mk -clean: - rm -f $(TEST_PROGS) *.o +$(TEST_GEN_PROGS): $(EXTRA_SOURCES) diff --git a/tools/testing/selftests/powerpc/switch_endian/Makefile b/tools/testing/selftests/powerpc/switch_endian/Makefile index e21d106..bd01223 100644 --- a/tools/testing/selftests/powerpc/switch_endian/Makefile +++ b/tools/testing/selftests/powerpc/switch_endian/Makefile @@ -1,8 +1,8 @@ -TEST_PROGS := switch_endian_test +TEST_GEN_PROGS := switch_endian_test ASFLAGS += -O2 -Wall -g -nostdlib -m64 -all: $(TEST_PROGS) +include ../../lib.mk switch_endian_test: check-reversed.S @@ -12,7 +12,5 @@ check-reversed.o: check.o check-reversed.S: check-reversed.o hexdump -v -e '/1 ".byte 0x%02X\n"' $< > $@ -include ../../lib.mk - clean: - rm -f $(TEST_PROGS) *.o check-reversed.S + $(RM) $(TEST_GEN_PROGS) *.o check-reversed.S diff --git a/tools/testing/selftests/powerpc/syscalls/Makefile b/tools/testing/selftests/powerpc/syscalls/Makefile index b35c794..da22ca7 100644 --- a/tools/testing/selftests/powerpc/syscalls/Makefile +++ b/tools/testing/selftests/powerpc/syscalls/Makefile @@ -1,12 +1,7 @@ -TEST_PROGS := ipc_unmuxed +TEST_GEN_PROGS := ipc_unmuxed CFLAGS += -I../../../../../usr/include -all: $(TEST_PROGS) - -$(TEST_PROGS): ../harness.c - include ../../lib.mk -clean: - rm -f $(TEST_PROGS) *.o +$(TEST_GEN_PROGS): ../harness.c diff --git a/tools/testing/selftests/powerpc/tm/Makefile b/tools/testing/selftests/powerpc/tm/Makefile index c6c53c8..117c624 100644 --- a/tools/testing/selftests/powerpc/tm/Makefile +++ b/tools/testing/selftests/powerpc/tm/Makefile @@ -1,12 +1,12 @@ SIGNAL_CONTEXT_CHK_TESTS := tm-signal-context-chk-gpr tm-signal-context-chk-fpu \ tm-signal-context-chk-vmx tm-signal-context-chk-vsx -TEST_PROGS := tm-resched-dscr tm-syscall tm-signal-msr-resv tm-signal-stack \ +TEST_GEN_PROGS := tm-resched-dscr tm-syscall tm-signal-msr-resv tm-signal-stack \ tm-vmxcopy tm-fork tm-tar tm-tmspr $(SIGNAL_CONTEXT_CHK_TESTS) -all: $(TEST_PROGS) +include ../../lib.mk -$(TEST_PROGS): ../harness.c ../utils.c +$(TEST_GEN_PROGS): ../harness.c ../utils.c CFLAGS += -mhtm @@ -16,8 +16,3 @@ tm-tmspr: CFLAGS += -pthread $(SIGNAL_CONTEXT_CHK_TESTS): tm-signal.S $(SIGNAL_CONTEXT_CHK_TESTS): CFLAGS += -mhtm -m64 -mvsx - -include ../../lib.mk - -clean: - rm -f $(TEST_PROGS) *.o diff --git a/tools/testing/selftests/powerpc/vphn/Makefile b/tools/testing/selftests/powerpc/vphn/Makefile index a485f2e..f8ced26 100644 --- a/tools/testing/selftests/powerpc/vphn/Makefile +++ b/tools/testing/selftests/powerpc/vphn/Makefile @@ -1,12 +1,8 @@ -TEST_PROGS := test-vphn +TEST_GEN_PROGS := test-vphn CFLAGS += -m64 -all: $(TEST_PROGS) - -$(TEST_PROGS): ../harness.c - include ../../lib.mk -clean: - rm -f $(TEST_PROGS) +$(TEST_GEN_PROGS): ../harness.c + diff --git a/tools/testing/selftests/ptrace/Makefile b/tools/testing/selftests/ptrace/Makefile index 453927f..8a2bc55 100644 --- a/tools/testing/selftests/ptrace/Makefile +++ b/tools/testing/selftests/ptrace/Makefile @@ -1,11 +1,5 @@ CFLAGS += -iquote../../../../include/uapi -Wall -peeksiginfo: peeksiginfo.c -all: peeksiginfo - -clean: - rm -f peeksiginfo - -TEST_PROGS := peeksiginfo +TEST_GEN_PROGS := peeksiginfo include ../lib.mk diff --git a/tools/testing/selftests/seccomp/Makefile b/tools/testing/selftests/seccomp/Makefile index 8401e87..5fa6fd2 100644 --- a/tools/testing/selftests/seccomp/Makefile +++ b/tools/testing/selftests/seccomp/Makefile @@ -1,10 +1,6 @@ -TEST_PROGS := seccomp_bpf +TEST_GEN_PROGS := seccomp_bpf CFLAGS += -Wl,-no-as-needed -Wall LDFLAGS += -lpthread -all: $(TEST_PROGS) - include ../lib.mk -clean: - $(RM) $(TEST_PROGS) diff --git a/tools/testing/selftests/sigaltstack/Makefile b/tools/testing/selftests/sigaltstack/Makefile index 56af56e..f68fbf8 100644 --- a/tools/testing/selftests/sigaltstack/Makefile +++ b/tools/testing/selftests/sigaltstack/Makefile @@ -1,8 +1,5 @@ CFLAGS = -Wall -BINARIES = sas -all: $(BINARIES) +TEST_GEN_PROGS = sas include ../lib.mk -clean: - rm -rf $(BINARIES) diff --git a/tools/testing/selftests/size/Makefile b/tools/testing/selftests/size/Makefile index bbd0b53..c67f357 100644 --- a/tools/testing/selftests/size/Makefile +++ b/tools/testing/selftests/size/Makefile @@ -1,11 +1,7 @@ -all: get_size get_size: get_size.c $(CC) -static -ffreestanding -nostartfiles -s $< -o $@ -TEST_PROGS := get_size +TEST_GEN_PROGS := get_size include ../lib.mk - -clean: - $(RM) get_size diff --git a/tools/testing/selftests/timers/Makefile b/tools/testing/selftests/timers/Makefile index 1d55568..4a3bffe 100644 --- a/tools/testing/selftests/timers/Makefile +++ b/tools/testing/selftests/timers/Makefile @@ -5,16 +5,13 @@ LDFLAGS += -lrt -lpthread # these are all "safe" tests that don't modify # system time or require escalated privledges -TEST_PROGS = posix_timers nanosleep nsleep-lat set-timer-lat mqueue-lat \ +TEST_GEN_PROGS = posix_timers nanosleep nsleep-lat set-timer-lat mqueue-lat \ inconsistency-check raw_skew threadtest rtctest -TEST_PROGS_EXTENDED = alarmtimer-suspend valid-adjtimex adjtick change_skew \ +TEST_GEN_PROGS_EXTENDED = alarmtimer-suspend valid-adjtimex adjtick change_skew \ skew_consistency clocksource-switch leap-a-day \ leapcrash set-tai set-2038 set-tz -bins = $(TEST_PROGS) $(TEST_PROGS_EXTENDED) - -all: ${bins} include ../lib.mk @@ -34,5 +31,3 @@ run_destructive_tests: run_tests ./set-tai ./set-2038 -clean: - rm -f ${bins} diff --git a/tools/testing/selftests/vm/Makefile b/tools/testing/selftests/vm/Makefile index bbab7f4..323383a 100644 --- a/tools/testing/selftests/vm/Makefile +++ b/tools/testing/selftests/vm/Makefile @@ -1,18 +1,17 @@ # Makefile for vm selftests CFLAGS = -Wall -I ../../../../usr/include $(EXTRA_CFLAGS) -BINARIES = compaction_test -BINARIES += hugepage-mmap -BINARIES += hugepage-shm -BINARIES += map_hugetlb -BINARIES += mlock2-tests -BINARIES += on-fault-limit -BINARIES += thuge-gen -BINARIES += transhuge-stress -BINARIES += userfaultfd -BINARIES += mlock-random-test +TEST_GEN_FILES = compaction_test +TEST_GEN_FILES += hugepage-mmap +TEST_GEN_FILES += hugepage-shm +TEST_GEN_FILES += map_hugetlb +TEST_GEN_FILES += mlock2-tests +TEST_GEN_FILES += on-fault-limit +TEST_GEN_FILES += thuge-gen +TEST_GEN_FILES += transhuge-stress +TEST_GEN_FILES += userfaultfd +TEST_GEN_FILES += mlock-random-test -all: $(BINARIES) %: %.c $(CC) $(CFLAGS) -o $@ $^ -lrt userfaultfd: userfaultfd.c ../../../../usr/include/linux/kernel.h @@ -25,9 +24,6 @@ mlock-random-test: mlock-random-test.c make -C ../../../.. headers_install TEST_PROGS := run_vmtests -TEST_FILES := $(BINARIES) include ../lib.mk -clean: - $(RM) $(BINARIES) -- 2.10.0 ^ permalink raw reply related [flat|nested] 21+ messages in thread
[parent not found: <20161129115552.8148-1-bamvor.zhangjian-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>]
* [PATCH v2 2/6] selftests: remove useless TEST_DIRS [not found] ` <20161129115552.8148-1-bamvor.zhangjian-hv44wF8Li93QT0dZR+AlfA@public.gmane.org> @ 2016-11-29 11:55 ` bamvor.zhangjian-hv44wF8Li93QT0dZR+AlfA 2016-11-29 11:55 ` [PATCH v2 3/6] selftests: add default rules for c source file bamvor.zhangjian-hv44wF8Li93QT0dZR+AlfA ` (3 subsequent siblings) 4 siblings, 0 replies; 21+ messages in thread From: bamvor.zhangjian-hv44wF8Li93QT0dZR+AlfA @ 2016-11-29 11:55 UTC (permalink / raw) To: shuahkh-JPH+aEBZ4P+UEJcrhfAQsw Cc: linux-api-u79uwXL29TY76Z2rM5mHXA, linux-kernel-u79uwXL29TY76Z2rM5mHXA, khilman-DgEjT+Ai2ygdnm+yROfE0A, broonie-DgEjT+Ai2ygdnm+yROfE0A, mpe-Gsx/Oe8HsFggBc27wqDAHg From: Bamvor Jian Zhang <bamvor.zhangjian-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org> The TEST_DIRS was introduced in Commit e8c1d7cdf137 ("selftests: copy TEST_DIRS to INSTALL_PATH") for coping a whole directory in ftrace. After rsync(with -a) is introduced by Commit 900d65ee11aa ("selftests: change install command to rsync"). Rsync could handle the directory without the definition of TEST_DIRS. This patch simply replace TEST_DIRS with TEST_FILES in ftrace and remove the TEST_DIRS in tools/testing/selftest/lib.mk Acked-by: Michael Ellerman <mpe-Gsx/Oe8HsFggBc27wqDAHg@public.gmane.org> Signed-off-by: Bamvor Jian Zhang <bamvor.zhangjian-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org> --- tools/testing/selftests/ftrace/Makefile | 2 +- tools/testing/selftests/lib.mk | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/testing/selftests/ftrace/Makefile b/tools/testing/selftests/ftrace/Makefile index 4e6ed13..a715300 100644 --- a/tools/testing/selftests/ftrace/Makefile +++ b/tools/testing/selftests/ftrace/Makefile @@ -1,7 +1,7 @@ all: TEST_PROGS := ftracetest -TEST_DIRS := test.d +TEST_FILES := test.d include ../lib.mk diff --git a/tools/testing/selftests/lib.mk b/tools/testing/selftests/lib.mk index 9fddffd..5b8634c 100644 --- a/tools/testing/selftests/lib.mk +++ b/tools/testing/selftests/lib.mk @@ -14,8 +14,8 @@ run_tests: all define INSTALL_RULE @if [ "X$(TEST_PROGS)$(TEST_PROGS_EXTENDED)$(TEST_FILES)" != "X" ]; then \ mkdir -p ${INSTALL_PATH}; \ - echo "rsync -a $(TEST_DIRS) $(TEST_PROGS) $(TEST_PROGS_EXTENDED) $(TEST_FILES) $(INSTALL_PATH)/"; \ - rsync -a $(TEST_DIRS) $(TEST_PROGS) $(TEST_PROGS_EXTENDED) $(TEST_FILES) $(INSTALL_PATH)/; \ + echo "rsync -a $(TEST_PROGS) $(TEST_PROGS_EXTENDED) $(TEST_FILES) $(INSTALL_PATH)/"; \ + rsync -a $(TEST_PROGS) $(TEST_PROGS_EXTENDED) $(TEST_FILES) $(INSTALL_PATH)/; \ fi @if [ "X$(TEST_GEN_PROGS)$(TEST_GEN_PROGS_EXTENDED)$(TEST_GEN_FILES)" != "X" ]; then \ mkdir -p ${INSTALL_PATH}; \ -- 2.10.0 ^ permalink raw reply related [flat|nested] 21+ messages in thread
* [PATCH v2 3/6] selftests: add default rules for c source file [not found] ` <20161129115552.8148-1-bamvor.zhangjian-hv44wF8Li93QT0dZR+AlfA@public.gmane.org> 2016-11-29 11:55 ` [PATCH v2 2/6] selftests: remove useless TEST_DIRS bamvor.zhangjian-hv44wF8Li93QT0dZR+AlfA @ 2016-11-29 11:55 ` bamvor.zhangjian-hv44wF8Li93QT0dZR+AlfA 2016-11-29 11:55 ` [PATCH v2 5/6] selftests: add EXTRA_CLEAN for clean target bamvor.zhangjian-hv44wF8Li93QT0dZR+AlfA ` (2 subsequent siblings) 4 siblings, 0 replies; 21+ messages in thread From: bamvor.zhangjian-hv44wF8Li93QT0dZR+AlfA @ 2016-11-29 11:55 UTC (permalink / raw) To: shuahkh-JPH+aEBZ4P+UEJcrhfAQsw Cc: linux-api-u79uwXL29TY76Z2rM5mHXA, linux-kernel-u79uwXL29TY76Z2rM5mHXA, khilman-DgEjT+Ai2ygdnm+yROfE0A, broonie-DgEjT+Ai2ygdnm+yROfE0A, mpe-Gsx/Oe8HsFggBc27wqDAHg From: Bamvor Jian Zhang <bamvor.zhangjian-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org> There are difference rules for compiling c source file in different testcases. In order to enable KBUILD_OUTPUT support in later patch, this patch introduce the default rules in "tools/testing/selftest/lib.mk" and remove the existing rules in each testcase. Acked-by: Michael Ellerman <mpe-Gsx/Oe8HsFggBc27wqDAHg@public.gmane.org> Signed-off-by: Bamvor Jian Zhang <bamvor.zhangjian-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org> --- tools/testing/selftests/exec/Makefile | 2 -- tools/testing/selftests/lib.mk | 3 +++ tools/testing/selftests/mount/Makefile | 3 --- tools/testing/selftests/net/Makefile | 2 -- tools/testing/selftests/size/Makefile | 4 +--- tools/testing/selftests/vm/Makefile | 17 ++++++----------- 6 files changed, 10 insertions(+), 21 deletions(-) diff --git a/tools/testing/selftests/exec/Makefile b/tools/testing/selftests/exec/Makefile index b3bf091..9eb1c3e 100644 --- a/tools/testing/selftests/exec/Makefile +++ b/tools/testing/selftests/exec/Makefile @@ -11,8 +11,6 @@ execveat.symlink: execveat execveat.denatured: execveat cp $< $@ chmod -x $@ -%: %.c - $(CC) $(CFLAGS) -o $@ $^ TEST_GEN_PROGS := execveat TEST_GEN_FILES := execveat.symlink execveat.denatured script subdir diff --git a/tools/testing/selftests/lib.mk b/tools/testing/selftests/lib.mk index 5b8634c..68d7c01 100644 --- a/tools/testing/selftests/lib.mk +++ b/tools/testing/selftests/lib.mk @@ -45,4 +45,7 @@ all: $(TEST_GEN_PROGS) $(TEST_GEN_PROGS_EXTENDED) $(TEST_GEN_FILES) clean: $(RM) -r $(TEST_GEN_PROGS) $(TEST_GEN_PROGS_EXTENDED) $(TEST_GEN_FILES) +%: %.c + $(CC) $(CFLAGS) $(LDFLAGS) $(LDLIBS) -o $@ $^ + .PHONY: run_tests all clean install emit_tests diff --git a/tools/testing/selftests/mount/Makefile b/tools/testing/selftests/mount/Makefile index e8fb15e..9093d7f 100644 --- a/tools/testing/selftests/mount/Makefile +++ b/tools/testing/selftests/mount/Makefile @@ -2,9 +2,6 @@ CFLAGS = -Wall \ -O2 -unprivileged-remount-test: unprivileged-remount-test.c - $(CC) $(CFLAGS) unprivileged-remount-test.c -o unprivileged-remount-test - TEST_GEN_PROGS := unprivileged-remount-test include ../lib.mk diff --git a/tools/testing/selftests/net/Makefile b/tools/testing/selftests/net/Makefile index fe5b36d..fbfe5d0 100644 --- a/tools/testing/selftests/net/Makefile +++ b/tools/testing/selftests/net/Makefile @@ -4,8 +4,6 @@ CFLAGS = -Wall -Wl,--no-as-needed -O2 -g CFLAGS += -I../../../../usr/include/ reuseport_bpf_numa: LDFLAGS += -lnuma -%: %.c - $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ TEST_PROGS := run_netsocktests run_afpackettests test_bpf.sh TEST_GEN_FILES = socket diff --git a/tools/testing/selftests/size/Makefile b/tools/testing/selftests/size/Makefile index c67f357..4685b3e 100644 --- a/tools/testing/selftests/size/Makefile +++ b/tools/testing/selftests/size/Makefile @@ -1,6 +1,4 @@ - -get_size: get_size.c - $(CC) -static -ffreestanding -nostartfiles -s $< -o $@ +CFLAGS := -static -ffreestanding -nostartfiles -s TEST_GEN_PROGS := get_size diff --git a/tools/testing/selftests/vm/Makefile b/tools/testing/selftests/vm/Makefile index 323383a..8141d51 100644 --- a/tools/testing/selftests/vm/Makefile +++ b/tools/testing/selftests/vm/Makefile @@ -1,6 +1,7 @@ # Makefile for vm selftests CFLAGS = -Wall -I ../../../../usr/include $(EXTRA_CFLAGS) +LDLIBS = -lrt TEST_GEN_FILES = compaction_test TEST_GEN_FILES += hugepage-mmap TEST_GEN_FILES += hugepage-shm @@ -12,18 +13,12 @@ TEST_GEN_FILES += transhuge-stress TEST_GEN_FILES += userfaultfd TEST_GEN_FILES += mlock-random-test -%: %.c - $(CC) $(CFLAGS) -o $@ $^ -lrt -userfaultfd: userfaultfd.c ../../../../usr/include/linux/kernel.h - $(CC) $(CFLAGS) -O2 -o $@ $< -lpthread - -mlock-random-test: mlock-random-test.c - $(CC) $(CFLAGS) -o $@ $< -lcap - -../../../../usr/include/linux/kernel.h: - make -C ../../../.. headers_install - TEST_PROGS := run_vmtests include ../lib.mk +userfaultfd: LDLIBS += -lpthread ../../../../usr/include/linux/kernel.h +mlock-random-test: LDLIBS += -lcap + +../../../../usr/include/linux/kernel.h: + make -C ../../../.. headers_install -- 2.10.0 ^ permalink raw reply related [flat|nested] 21+ messages in thread
* [PATCH v2 5/6] selftests: add EXTRA_CLEAN for clean target [not found] ` <20161129115552.8148-1-bamvor.zhangjian-hv44wF8Li93QT0dZR+AlfA@public.gmane.org> 2016-11-29 11:55 ` [PATCH v2 2/6] selftests: remove useless TEST_DIRS bamvor.zhangjian-hv44wF8Li93QT0dZR+AlfA 2016-11-29 11:55 ` [PATCH v2 3/6] selftests: add default rules for c source file bamvor.zhangjian-hv44wF8Li93QT0dZR+AlfA @ 2016-11-29 11:55 ` bamvor.zhangjian-hv44wF8Li93QT0dZR+AlfA 2016-11-29 11:55 ` [PATCH v2 6/6] selftests: enable O and KBUILD_OUTPUT bamvor.zhangjian-hv44wF8Li93QT0dZR+AlfA 2016-11-30 14:17 ` [PATCH v2 0/6] enable O and KBUILD_OUTPUT for kselftest Shuah Khan 4 siblings, 0 replies; 21+ messages in thread From: bamvor.zhangjian-hv44wF8Li93QT0dZR+AlfA @ 2016-11-29 11:55 UTC (permalink / raw) To: shuahkh-JPH+aEBZ4P+UEJcrhfAQsw Cc: linux-api-u79uwXL29TY76Z2rM5mHXA, linux-kernel-u79uwXL29TY76Z2rM5mHXA, khilman-DgEjT+Ai2ygdnm+yROfE0A, broonie-DgEjT+Ai2ygdnm+yROfE0A, mpe-Gsx/Oe8HsFggBc27wqDAHg From: Bamvor Jian Zhang <bamvor.zhangjian-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org> Some testcases need the clean extra data after running. This patch introduce the "EXTRA_CLEAN" variable to address this requirement. After KBUILD_OUTPUT is enabled in later patch, it will be easy to decide to if we need do the cleanup in the KBUILD_OUTPUT path(if the testcase ran immediately after compiled). Signed-off-by: Bamvor Jian Zhang <bamvor.zhangjian-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org> --- tools/testing/selftests/exec/Makefile | 19 +++++++++---------- tools/testing/selftests/ftrace/Makefile | 4 +--- tools/testing/selftests/kcmp/Makefile | 4 ++-- tools/testing/selftests/lib.mk | 2 +- .../testing/selftests/powerpc/switch_endian/Makefile | 5 ++--- tools/testing/selftests/pstore/Makefile | 4 +--- tools/testing/selftests/zram/Makefile | 3 +-- 7 files changed, 17 insertions(+), 24 deletions(-) diff --git a/tools/testing/selftests/exec/Makefile b/tools/testing/selftests/exec/Makefile index 9eb1c3e..48d1f86 100644 --- a/tools/testing/selftests/exec/Makefile +++ b/tools/testing/selftests/exec/Makefile @@ -1,5 +1,14 @@ CFLAGS = -Wall +TEST_GEN_PROGS := execveat +TEST_GEN_FILES := execveat.symlink execveat.denatured script subdir +# Makefile is a run-time dependency, since it's accessed by the execveat test +TEST_FILES := Makefile + +EXTRA_CLEAN := subdir.moved execveat.moved xxxxx* + +include ../lib.mk + subdir: mkdir -p $@ script: @@ -11,13 +20,3 @@ execveat.symlink: execveat execveat.denatured: execveat cp $< $@ chmod -x $@ - -TEST_GEN_PROGS := execveat -TEST_GEN_FILES := execveat.symlink execveat.denatured script subdir -# Makefile is a run-time dependency, since it's accessed by the execveat test -TEST_FILES := Makefile - -include ../lib.mk - -clean: - rm -rf $(TEST_GEN_PROGS) $(TEST_GEN_FILES) subdir.moved execveat.moved xxxxx* diff --git a/tools/testing/selftests/ftrace/Makefile b/tools/testing/selftests/ftrace/Makefile index a715300..6c64b42 100644 --- a/tools/testing/selftests/ftrace/Makefile +++ b/tools/testing/selftests/ftrace/Makefile @@ -2,8 +2,6 @@ all: TEST_PROGS := ftracetest TEST_FILES := test.d +EXTRA_CLEAN := logs/* include ../lib.mk - -clean: - rm -rf logs/* diff --git a/tools/testing/selftests/kcmp/Makefile b/tools/testing/selftests/kcmp/Makefile index 9e8b673..74a8add 100644 --- a/tools/testing/selftests/kcmp/Makefile +++ b/tools/testing/selftests/kcmp/Makefile @@ -2,7 +2,7 @@ CFLAGS += -I../../../../usr/include/ TEST_GEN_PROGS := kcmp_test +EXTRA_CLEAN := kcmp-test-file + include ../lib.mk -clean: - $(RM) $(TEST_GEN_PROGS) kcmp-test-file diff --git a/tools/testing/selftests/lib.mk b/tools/testing/selftests/lib.mk index 68d7c01..0f7a371 100644 --- a/tools/testing/selftests/lib.mk +++ b/tools/testing/selftests/lib.mk @@ -43,7 +43,7 @@ emit_tests: all: $(TEST_GEN_PROGS) $(TEST_GEN_PROGS_EXTENDED) $(TEST_GEN_FILES) clean: - $(RM) -r $(TEST_GEN_PROGS) $(TEST_GEN_PROGS_EXTENDED) $(TEST_GEN_FILES) + $(RM) -r $(TEST_GEN_PROGS) $(TEST_GEN_PROGS_EXTENDED) $(TEST_GEN_FILES) $(EXTRA_CLEAN) %: %.c $(CC) $(CFLAGS) $(LDFLAGS) $(LDLIBS) -o $@ $^ diff --git a/tools/testing/selftests/powerpc/switch_endian/Makefile b/tools/testing/selftests/powerpc/switch_endian/Makefile index bd01223..dbd05ac 100644 --- a/tools/testing/selftests/powerpc/switch_endian/Makefile +++ b/tools/testing/selftests/powerpc/switch_endian/Makefile @@ -2,6 +2,8 @@ TEST_GEN_PROGS := switch_endian_test ASFLAGS += -O2 -Wall -g -nostdlib -m64 +EXTRA_CLEAN = *.o check-reversed.S + include ../../lib.mk switch_endian_test: check-reversed.S @@ -11,6 +13,3 @@ check-reversed.o: check.o check-reversed.S: check-reversed.o hexdump -v -e '/1 ".byte 0x%02X\n"' $< > $@ - -clean: - $(RM) $(TEST_GEN_PROGS) *.o check-reversed.S diff --git a/tools/testing/selftests/pstore/Makefile b/tools/testing/selftests/pstore/Makefile index bd7abe2..c5f2440 100644 --- a/tools/testing/selftests/pstore/Makefile +++ b/tools/testing/selftests/pstore/Makefile @@ -5,11 +5,9 @@ all: TEST_PROGS := pstore_tests pstore_post_reboot_tests TEST_FILES := common_tests pstore_crash_test +EXTRA_CLEAN := logs/* *uuid include ../lib.mk run_crash: @sh pstore_crash_test || { echo "pstore_crash_test: [FAIL]"; exit 1; } - -clean: - rm -rf logs/* *uuid diff --git a/tools/testing/selftests/zram/Makefile b/tools/testing/selftests/zram/Makefile index 29d8034..c3a87e5 100644 --- a/tools/testing/selftests/zram/Makefile +++ b/tools/testing/selftests/zram/Makefile @@ -2,8 +2,7 @@ all: TEST_PROGS := zram.sh TEST_FILES := zram01.sh zram02.sh zram_lib.sh +EXTRA_CLEAN := err.log include ../lib.mk -clean: - $(RM) err.log -- 2.10.0 ^ permalink raw reply related [flat|nested] 21+ messages in thread
* [PATCH v2 6/6] selftests: enable O and KBUILD_OUTPUT [not found] ` <20161129115552.8148-1-bamvor.zhangjian-hv44wF8Li93QT0dZR+AlfA@public.gmane.org> ` (2 preceding siblings ...) 2016-11-29 11:55 ` [PATCH v2 5/6] selftests: add EXTRA_CLEAN for clean target bamvor.zhangjian-hv44wF8Li93QT0dZR+AlfA @ 2016-11-29 11:55 ` bamvor.zhangjian-hv44wF8Li93QT0dZR+AlfA [not found] ` <20161129115552.8148-7-bamvor.zhangjian-hv44wF8Li93QT0dZR+AlfA@public.gmane.org> 2016-11-30 14:17 ` [PATCH v2 0/6] enable O and KBUILD_OUTPUT for kselftest Shuah Khan 4 siblings, 1 reply; 21+ messages in thread From: bamvor.zhangjian-hv44wF8Li93QT0dZR+AlfA @ 2016-11-29 11:55 UTC (permalink / raw) To: shuahkh-JPH+aEBZ4P+UEJcrhfAQsw Cc: linux-api-u79uwXL29TY76Z2rM5mHXA, linux-kernel-u79uwXL29TY76Z2rM5mHXA, khilman-DgEjT+Ai2ygdnm+yROfE0A, broonie-DgEjT+Ai2ygdnm+yROfE0A, mpe-Gsx/Oe8HsFggBc27wqDAHg From: Bamvor Jian Zhang <bamvor.zhangjian-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org> Enable O and KBUILD_OUTPUT for kselftest. User could compile kselftest to another directory by passing O or KBUILD_OUTPUT. And O is high priority than KBUILD_OUTPUT. Signed-off-by: Bamvor Jian Zhang <bamvor.zhangjian-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org> --- tools/testing/selftests/Makefile | 36 ++++++++++++++++------ tools/testing/selftests/exec/Makefile | 13 ++++---- tools/testing/selftests/ftrace/Makefile | 2 +- tools/testing/selftests/futex/Makefile | 21 ++++++++++--- tools/testing/selftests/kcmp/Makefile | 2 +- tools/testing/selftests/lib.mk | 19 +++++++++--- tools/testing/selftests/powerpc/Makefile | 15 +++++---- .../testing/selftests/powerpc/benchmarks/Makefile | 6 ++-- tools/testing/selftests/powerpc/copyloops/Makefile | 8 ++--- tools/testing/selftests/powerpc/dscr/Makefile | 2 +- tools/testing/selftests/powerpc/math/Makefile | 12 ++++---- tools/testing/selftests/powerpc/mm/Makefile | 6 ++-- tools/testing/selftests/powerpc/pmu/Makefile | 16 +++++----- tools/testing/selftests/powerpc/pmu/ebb/Makefile | 4 +-- .../selftests/powerpc/switch_endian/Makefile | 8 ++--- tools/testing/selftests/powerpc/tm/Makefile | 6 ++-- tools/testing/selftests/vm/Makefile | 4 +-- tools/testing/selftests/x86/Makefile | 17 +++++----- 18 files changed, 122 insertions(+), 75 deletions(-) diff --git a/tools/testing/selftests/Makefile b/tools/testing/selftests/Makefile index a3144a3..848af7c 100644 --- a/tools/testing/selftests/Makefile +++ b/tools/testing/selftests/Makefile @@ -47,29 +47,44 @@ override LDFLAGS = override MAKEFLAGS = endif +BUILD := $(O) +ifndef BUILD + BUILD := $(KBUILD_OUTPUT) +endif +ifndef BUILD + BUILD := $(shell pwd) +endif + +export BUILD all: - for TARGET in $(TARGETS); do \ - make -C $$TARGET; \ + for TARGET in $(TARGETS); do \ + BUILD_TARGET=$$BUILD/$$TARGET; \ + mkdir $$BUILD_TARGET -p; \ + make OUTPUT=$$BUILD_TARGET -C $$TARGET;\ done; run_tests: all for TARGET in $(TARGETS); do \ - make -C $$TARGET run_tests; \ + BUILD_TARGET=$$BUILD/$$TARGET; \ + make OUTPUT=$$BUILD_TARGET -C $$TARGET run_tests;\ done; hotplug: for TARGET in $(TARGETS_HOTPLUG); do \ - make -C $$TARGET; \ + BUILD_TARGET=$$BUILD/$$TARGET; \ + make OUTPUT=$$BUILD_TARGET -C $$TARGET;\ done; run_hotplug: hotplug for TARGET in $(TARGETS_HOTPLUG); do \ - make -C $$TARGET run_full_test; \ + BUILD_TARGET=$$BUILD/$$TARGET; \ + make OUTPUT=$$BUILD_TARGET -C $$TARGET run_full_test;\ done; clean_hotplug: for TARGET in $(TARGETS_HOTPLUG); do \ - make -C $$TARGET clean; \ + BUILD_TARGET=$$BUILD/$$TARGET; \ + make OUTPUT=$$BUILD_TARGET -C $$TARGET clean;\ done; run_pstore_crash: @@ -84,7 +99,8 @@ ifdef INSTALL_PATH @# Ask all targets to install their files mkdir -p $(INSTALL_PATH) for TARGET in $(TARGETS); do \ - make -C $$TARGET INSTALL_PATH=$(INSTALL_PATH)/$$TARGET install; \ + BUILD_TARGET=$$BUILD/$$TARGET; \ + make OUTPUT=$$BUILD_TARGET -C $$TARGET INSTALL_PATH=$(INSTALL_PATH)/$$TARGET install; \ done; @# Ask all targets to emit their test scripts @@ -93,10 +109,11 @@ ifdef INSTALL_PATH echo "ROOT=\$$PWD" >> $(ALL_SCRIPT) for TARGET in $(TARGETS); do \ + BUILD_TARGET=$$BUILD/$$TARGET; \ echo "echo ; echo Running tests in $$TARGET" >> $(ALL_SCRIPT); \ echo "echo ========================================" >> $(ALL_SCRIPT); \ echo "cd $$TARGET" >> $(ALL_SCRIPT); \ - make -s --no-print-directory -C $$TARGET emit_tests >> $(ALL_SCRIPT); \ + make -s --no-print-directory OUTPUT=$$BUILD_TARGET -C $$TARGET emit_tests >> $(ALL_SCRIPT); \ echo "cd \$$ROOT" >> $(ALL_SCRIPT); \ done; @@ -107,7 +124,8 @@ endif clean: for TARGET in $(TARGETS); do \ - make -C $$TARGET clean; \ + BUILD_TARGET=$$BUILD/$$TARGET; \ + make OUTPUT=$$BUILD_TARGET -C $$TARGET clean;\ done; .PHONY: install diff --git a/tools/testing/selftests/exec/Makefile b/tools/testing/selftests/exec/Makefile index 48d1f86..2e13035 100644 --- a/tools/testing/selftests/exec/Makefile +++ b/tools/testing/selftests/exec/Makefile @@ -5,18 +5,19 @@ TEST_GEN_FILES := execveat.symlink execveat.denatured script subdir # Makefile is a run-time dependency, since it's accessed by the execveat test TEST_FILES := Makefile -EXTRA_CLEAN := subdir.moved execveat.moved xxxxx* +EXTRA_CLEAN := $(OUTPUT)/subdir.moved $(OUTPUT)/execveat.moved $(OUTPUT)/xxxxx* include ../lib.mk -subdir: +$(OUTPUT)/subdir: mkdir -p $@ -script: +$(OUTPUT)/script: echo '#!/bin/sh' > $@ echo 'exit $$*' >> $@ chmod +x $@ -execveat.symlink: execveat - ln -s -f $< $@ -execveat.denatured: execveat +$(OUTPUT)/execveat.symlink: $(OUTPUT)/execveat + cd $(OUTPUT) && ln -s -f $(shell basename $<) $(shell basename $@) +$(OUTPUT)/execveat.denatured: $(OUTPUT)/execveat cp $< $@ chmod -x $@ + diff --git a/tools/testing/selftests/ftrace/Makefile b/tools/testing/selftests/ftrace/Makefile index 6c64b42..a8a5e21 100644 --- a/tools/testing/selftests/ftrace/Makefile +++ b/tools/testing/selftests/ftrace/Makefile @@ -2,6 +2,6 @@ all: TEST_PROGS := ftracetest TEST_FILES := test.d -EXTRA_CLEAN := logs/* +EXTRA_CLEAN := $(OUTPUT)/logs/* include ../lib.mk diff --git a/tools/testing/selftests/futex/Makefile b/tools/testing/selftests/futex/Makefile index 6a17529..653c5cd 100644 --- a/tools/testing/selftests/futex/Makefile +++ b/tools/testing/selftests/futex/Makefile @@ -3,13 +3,18 @@ SUBDIRS := functional TEST_PROGS := run.sh .PHONY: all clean -all: - for DIR in $(SUBDIRS); do $(MAKE) -C $$DIR $@ ; done include ../lib.mk +all: + for DIR in $(SUBDIRS); do \ + BUILD_TARGET=$$OUTPUT/$$DIR; \ + mkdir $$BUILD_TARGET -p; \ + make OUTPUT=$$BUILD_TARGET -C $$DIR $@;\ + done + override define RUN_TESTS - ./run.sh + @if [ `dirname $(OUTPUT)` = $(PWD) ]; then ./run.sh; fi endef override define INSTALL_RULE @@ -17,7 +22,9 @@ override define INSTALL_RULE install -t $(INSTALL_PATH) $(TEST_PROGS) $(TEST_PROGS_EXTENDED) $(TEST_FILES) @for SUBDIR in $(SUBDIRS); do \ - $(MAKE) -C $$SUBDIR INSTALL_PATH=$(INSTALL_PATH)/$$SUBDIR install; \ + BUILD_TARGET=$$OUTPUT/$$SUBDIR; \ + mkdir $$BUILD_TARGET -p; \ + $(MAKE) OUTPUT=$$BUILD_TARGET -C $$SUBDIR INSTALL_PATH=$(INSTALL_PATH)/$$SUBDIR install; \ done; endef @@ -26,4 +33,8 @@ override define EMIT_TESTS endef clean: - for DIR in $(SUBDIRS); do $(MAKE) -C $$DIR $@ ; done + for DIR in $(SUBDIRS); do \ + BUILD_TARGET=$$OUTPUT/$$DIR; \ + mkdir $$BUILD_TARGET -p; \ + make OUTPUT=$$BUILD_TARGET -C $$DIR $@;\ + done diff --git a/tools/testing/selftests/kcmp/Makefile b/tools/testing/selftests/kcmp/Makefile index 74a8add..47aa988 100644 --- a/tools/testing/selftests/kcmp/Makefile +++ b/tools/testing/selftests/kcmp/Makefile @@ -2,7 +2,7 @@ CFLAGS += -I../../../../usr/include/ TEST_GEN_PROGS := kcmp_test -EXTRA_CLEAN := kcmp-test-file +EXTRA_CLEAN := $(OUTPUT)/kcmp-test-file include ../lib.mk diff --git a/tools/testing/selftests/lib.mk b/tools/testing/selftests/lib.mk index 0f7a371..01bb778 100644 --- a/tools/testing/selftests/lib.mk +++ b/tools/testing/selftests/lib.mk @@ -4,7 +4,8 @@ CC := $(CROSS_COMPILE)gcc define RUN_TESTS @for TEST in $(TEST_GEN_PROGS) $(TEST_PROGS); do \ - (./$$TEST && echo "selftests: $$TEST [PASS]") || echo "selftests: $$TEST [FAIL]"; \ + BASENAME_TEST=`basename $$TEST`; \ + cd `dirname $$TEST`; (./$$BASENAME_TEST && echo "selftests: $$BASENAME_TEST [PASS]") || echo "selftests: $$BASENAME_TEST [FAIL]"; cd -;\ done; endef @@ -33,19 +34,29 @@ endif define EMIT_TESTS @for TEST in $(TEST_GEN_PROGS) $(TEST_PROGS); do \ - echo "(./$$TEST && echo \"selftests: $$TEST [PASS]\") || echo \"selftests: $$TEST [FAIL]\""; \ + BASENAME_TEST=`basename $$TEST`; \ + echo "(./$$BASENAME_TEST && echo \"selftests: $$BASENAME_TEST [PASS]\") || echo \"selftests: $$BASENAME_TEST [FAIL]\""; \ done; endef emit_tests: $(EMIT_TESTS) +TEST_GEN_PROGS := $(patsubst %,$(OUTPUT)/%,$(TEST_GEN_PROGS)) +TEST_GEN_FILES := $(patsubst %,$(OUTPUT)/%,$(TEST_GEN_FILES)) + all: $(TEST_GEN_PROGS) $(TEST_GEN_PROGS_EXTENDED) $(TEST_GEN_FILES) clean: $(RM) -r $(TEST_GEN_PROGS) $(TEST_GEN_PROGS_EXTENDED) $(TEST_GEN_FILES) $(EXTRA_CLEAN) -%: %.c - $(CC) $(CFLAGS) $(LDFLAGS) $(LDLIBS) -o $@ $^ +$(OUTPUT)/%:%.c + $(CC) $(CFLAGS) $(LDFLAGS) $(LDLIBS) $< -o $@ + +$(OUTPUT)/%.o:%.S + $(CC) $(ASFLAGS) -c $< -o $@ + +$(OUTPUT)/%:%.S + $(CC) $(ASFLAGS) $< -o $@ .PHONY: run_tests all clean install emit_tests diff --git a/tools/testing/selftests/powerpc/Makefile b/tools/testing/selftests/powerpc/Makefile index c2c4211..1d48c0c 100644 --- a/tools/testing/selftests/powerpc/Makefile +++ b/tools/testing/selftests/powerpc/Makefile @@ -34,32 +34,35 @@ endif all: $(SUB_DIRS) $(SUB_DIRS): - $(MAKE) -k -C $@ all + BUILD_TARGET=$$OUTPUT/$@; mkdir -p $$BUILD_TARGET; $(MAKE) OUTPUT=$$BUILD_TARGET -k -C $@ all include ../lib.mk override define RUN_TESTS @for TARGET in $(SUB_DIRS); do \ - $(MAKE) -C $$TARGET run_tests; \ + BUILD_TARGET=$$OUTPUT/$$TARGET; \ + $(MAKE) OUTPUT=$$BUILD_TARGET -C $$TARGET run_tests;\ done; endef override define INSTALL_RULE @for TARGET in $(SUB_DIRS); do \ - $(MAKE) -C $$TARGET install; \ + BUILD_TARGET=$$OUTPUT/$$TARGET; \ + $(MAKE) OUTPUT=$$BUILD_TARGET -C $$TARGET install;\ done; endef override define EMIT_TESTS @for TARGET in $(SUB_DIRS); do \ - $(MAKE) -s -C $$TARGET emit_tests; \ + BUILD_TARGET=$$OUTPUT/$$TARGET; \ + $(MAKE) OUTPUT=$$BUILD_TARGET -s -C $$TARGET emit_tests;\ done; endef clean: @for TARGET in $(SUB_DIRS); do \ - $(MAKE) -C $$TARGET clean; \ - done; + BUILD_TARGET=$$OUTPUT/$$TARGET; \ + $(MAKE) OUTPUT=$$BUILD_TARGET -C $$TARGET clean;\ done; rm -f tags tags: diff --git a/tools/testing/selftests/powerpc/benchmarks/Makefile b/tools/testing/selftests/powerpc/benchmarks/Makefile index 08a55bd..286c6ed 100644 --- a/tools/testing/selftests/powerpc/benchmarks/Makefile +++ b/tools/testing/selftests/powerpc/benchmarks/Makefile @@ -6,6 +6,6 @@ $(TEST_GEN_PROGS): ../harness.c include ../../lib.mk -context_switch: ../utils.c -context_switch: CFLAGS += -maltivec -mvsx -mabi=altivec -context_switch: LDLIBS += -lpthread +$(OUTPUT)/context_switch: ../utils.c +$(OUTPUT)/context_switch: CFLAGS += -maltivec -mvsx -mabi=altivec +$(OUTPUT)/context_switch: LDLIBS += -lpthread diff --git a/tools/testing/selftests/powerpc/copyloops/Makefile b/tools/testing/selftests/powerpc/copyloops/Makefile index 9ad1558..681ab19 100644 --- a/tools/testing/selftests/powerpc/copyloops/Makefile +++ b/tools/testing/selftests/powerpc/copyloops/Makefile @@ -12,9 +12,9 @@ EXTRA_SOURCES := validate.c ../harness.c include ../../lib.mk -copyuser_64: CPPFLAGS += -D COPY_LOOP=test___copy_tofrom_user_base -copyuser_power7: CPPFLAGS += -D COPY_LOOP=test___copy_tofrom_user_power7 -memcpy_64: CPPFLAGS += -D COPY_LOOP=test_memcpy -memcpy_power7: CPPFLAGS += -D COPY_LOOP=test_memcpy_power7 +$(OUTPUT)/copyuser_64: CPPFLAGS += -D COPY_LOOP=test___copy_tofrom_user_base +$(OUTPUT)/copyuser_power7: CPPFLAGS += -D COPY_LOOP=test___copy_tofrom_user_power7 +$(OUTPUT)/memcpy_64: CPPFLAGS += -D COPY_LOOP=test_memcpy +$(OUTPUT)/memcpy_power7: CPPFLAGS += -D COPY_LOOP=test_memcpy_power7 $(TEST_GEN_PROGS): $(EXTRA_SOURCES) diff --git a/tools/testing/selftests/powerpc/dscr/Makefile b/tools/testing/selftests/powerpc/dscr/Makefile index 4262de4..c5639de 100644 --- a/tools/testing/selftests/powerpc/dscr/Makefile +++ b/tools/testing/selftests/powerpc/dscr/Makefile @@ -4,6 +4,6 @@ TEST_GEN_PROGS := dscr_default_test dscr_explicit_test dscr_user_test \ include ../../lib.mk -dscr_default_test: LDLIBS += -lpthread +$(OUTPUT)/dscr_default_test: LDLIBS += -lpthread $(TEST_GEN_PROGS): ../harness.c diff --git a/tools/testing/selftests/powerpc/math/Makefile b/tools/testing/selftests/powerpc/math/Makefile index 814c385..da9f42f 100644 --- a/tools/testing/selftests/powerpc/math/Makefile +++ b/tools/testing/selftests/powerpc/math/Makefile @@ -5,13 +5,13 @@ include ../../lib.mk $(TEST_GEN_PROGS): ../harness.c $(TEST_GEN_PROGS): CFLAGS += -O2 -g -pthread -m64 -maltivec -fpu_syscall: fpu_asm.S -fpu_preempt: fpu_asm.S -fpu_signal: fpu_asm.S +$(OUTPUT)/pu_syscall: fpu_asm.S +$(OUTPUT)/pu_preempt: fpu_asm.S +$(OUTPUT)/pu_signal: fpu_asm.S -vmx_syscall: vmx_asm.S -vmx_preempt: vmx_asm.S -vmx_signal: vmx_asm.S +$(OUTPUT)/mx_syscall: vmx_asm.S +$(OUTPUT)/mx_preempt: vmx_asm.S +$(OUTPUT)/mx_signal: vmx_asm.S vsx_preempt: CFLAGS += -mvsx vsx_preempt: vsx_asm.S diff --git a/tools/testing/selftests/powerpc/mm/Makefile b/tools/testing/selftests/powerpc/mm/Makefile index d563378..1cffe54 100644 --- a/tools/testing/selftests/powerpc/mm/Makefile +++ b/tools/testing/selftests/powerpc/mm/Makefile @@ -8,8 +8,8 @@ include ../../lib.mk $(TEST_GEN_PROGS): ../harness.c -prot_sao: ../utils.c +$(OUTPUT)/prot_sao: ../utils.c -tempfile: - dd if=/dev/zero of=tempfile bs=64k count=1 +$(OUTPUT)/tempfile: + dd if=/dev/zero of=$@ bs=64k count=1 diff --git a/tools/testing/selftests/powerpc/pmu/Makefile b/tools/testing/selftests/powerpc/pmu/Makefile index ab0f902..097b08a 100644 --- a/tools/testing/selftests/powerpc/pmu/Makefile +++ b/tools/testing/selftests/powerpc/pmu/Makefile @@ -11,34 +11,34 @@ all: $(TEST_GEN_PROGS) ebb $(TEST_GEN_PROGS): $(EXTRA_SOURCES) # loop.S can only be built 64-bit -count_instructions: loop.S count_instructions.c $(EXTRA_SOURCES) +$(OUTPUT)/count_instructions: loop.S count_instructions.c $(EXTRA_SOURCES) $(CC) $(CFLAGS) -m64 -o $@ $^ -per_event_excludes: ../utils.c +$(OUTPUT)/per_event_excludes: ../utils.c DEFAULT_RUN_TESTS := $(RUN_TESTS) override define RUN_TESTS $(DEFAULT_RUN_TESTS) - $(MAKE) -C ebb run_tests + TARGET=ebb; BUILD_TARGET=$$OUTPUT/$$TARGET; $(MAKE) OUTPUT=$$BUILD_TARGET -C $$TARGET run_tests endef DEFAULT_EMIT_TESTS := $(EMIT_TESTS) override define EMIT_TESTS $(DEFAULT_EMIT_TESTS) - $(MAKE) -s -C ebb emit_tests + TARGET=ebb; BUILD_TARGET=$$OUTPUT/$$TARGET; $(MAKE) OUTPUT=$$BUILD_TARGET -s -C $$TARGET emit_tests endef DEFAULT_INSTALL_RULE := $(INSTALL_RULE) override define INSTALL_RULE $(DEFAULT_INSTALL_RULE) - $(MAKE) -C ebb install + TARGET=ebb; BUILD_TARGET=$$OUTPUT/$$TARGET; $(MAKE) OUTPUT=$$BUILD_TARGET: -C $$TARGET install endef clean: - $(RM) $(TEST_PROGS) loop.o - $(MAKE) -C ebb clean + $(RM) $(TEST_GEN_PROGS) $(OUTPUT)/loop.o + TARGET=ebb; BUILD_TARGET=$$OUTPUT/$$TARGET; $(MAKE) OUTPUT=$$BUILD_TARGET: -C $$TARGET clean ebb: - $(MAKE) -k -C $@ all + TARGET=$@; BUILD_TARGET=$$OUTPUT/$$TARGET; mkdir -p $$BUILD_TARGET; $(MAKE) OUTPUT=$$BUILD_TARGET -k -C $$TARGET all .PHONY: all run_tests clean ebb diff --git a/tools/testing/selftests/powerpc/pmu/ebb/Makefile b/tools/testing/selftests/powerpc/pmu/ebb/Makefile index 0bc2bd6..6001fb0 100644 --- a/tools/testing/selftests/powerpc/pmu/ebb/Makefile +++ b/tools/testing/selftests/powerpc/pmu/ebb/Makefile @@ -21,6 +21,6 @@ include ../../../lib.mk $(TEST_GEN_PROGS): ../../harness.c ../../utils.c ../event.c ../lib.c \ ebb.c ebb_handler.S trace.c busy_loop.S -instruction_count_test: ../loop.S +$(OUTPUT)/instruction_count_test: ../loop.S -lost_exception_test: ../lib.c +$(OUTPUT)/lost_exception_test: ../lib.c diff --git a/tools/testing/selftests/powerpc/switch_endian/Makefile b/tools/testing/selftests/powerpc/switch_endian/Makefile index dbd05ac..b92c2a1 100644 --- a/tools/testing/selftests/powerpc/switch_endian/Makefile +++ b/tools/testing/selftests/powerpc/switch_endian/Makefile @@ -2,14 +2,14 @@ TEST_GEN_PROGS := switch_endian_test ASFLAGS += -O2 -Wall -g -nostdlib -m64 -EXTRA_CLEAN = *.o check-reversed.S +EXTRA_CLEAN = $(OUTPUT)/*.o $(OUTPUT)/check-reversed.S include ../../lib.mk -switch_endian_test: check-reversed.S +$(OUTPUT)/switch_endian_test: $(OUTPUT)/check-reversed.S -check-reversed.o: check.o +$(OUTPUT)/check-reversed.o: $(OUTPUT)/check.o $(CROSS_COMPILE)objcopy -j .text --reverse-bytes=4 -O binary $< $@ -check-reversed.S: check-reversed.o +$(OUTPUT)/check-reversed.S: $(OUTPUT)/check-reversed.o hexdump -v -e '/1 ".byte 0x%02X\n"' $< > $@ diff --git a/tools/testing/selftests/powerpc/tm/Makefile b/tools/testing/selftests/powerpc/tm/Makefile index 117c624..07da217 100644 --- a/tools/testing/selftests/powerpc/tm/Makefile +++ b/tools/testing/selftests/powerpc/tm/Makefile @@ -10,9 +10,9 @@ $(TEST_GEN_PROGS): ../harness.c ../utils.c CFLAGS += -mhtm -tm-syscall: tm-syscall-asm.S -tm-syscall: CFLAGS += -I../../../../../usr/include -tm-tmspr: CFLAGS += -pthread +$(OUTPUT)/tm-syscall: tm-syscall-asm.S +$(OUTPUT)/tm-syscall: CFLAGS += -I../../../../../usr/include +$(OUTPUT)/tm-tmspr: CFLAGS += -pthread $(SIGNAL_CONTEXT_CHK_TESTS): tm-signal.S $(SIGNAL_CONTEXT_CHK_TESTS): CFLAGS += -mhtm -m64 -mvsx diff --git a/tools/testing/selftests/vm/Makefile b/tools/testing/selftests/vm/Makefile index 8141d51..983140e 100644 --- a/tools/testing/selftests/vm/Makefile +++ b/tools/testing/selftests/vm/Makefile @@ -17,8 +17,8 @@ TEST_PROGS := run_vmtests include ../lib.mk -userfaultfd: LDLIBS += -lpthread ../../../../usr/include/linux/kernel.h -mlock-random-test: LDLIBS += -lcap +$(OUTPUT)/userfaultfd: LDLIBS += -lpthread ../../../../usr/include/linux/kernel.h +$(OUTPUT)/mlock-random-test: LDLIBS += -lcap ../../../../usr/include/linux/kernel.h: make -C ../../../.. headers_install diff --git a/tools/testing/selftests/x86/Makefile b/tools/testing/selftests/x86/Makefile index 8c1cb42..f251cf9 100644 --- a/tools/testing/selftests/x86/Makefile +++ b/tools/testing/selftests/x86/Makefile @@ -17,6 +17,9 @@ TARGETS_C_64BIT_ALL := $(TARGETS_C_BOTHBITS) $(TARGETS_C_64BIT_ONLY) BINARIES_32 := $(TARGETS_C_32BIT_ALL:%=%_32) BINARIES_64 := $(TARGETS_C_64BIT_ALL:%=%_64) +BINARIES_32 := $(patsubst %,$(OUTPUT)/%,$(BINARIES_32)) +BINARIES_64 := $(patsubst %,$(OUTPUT)/%,$(BINARIES_64)) + CFLAGS := -O2 -g -std=gnu99 -pthread -Wall UNAME_M := $(shell uname -m) @@ -40,10 +43,10 @@ all_64: $(BINARIES_64) clean: $(RM) $(BINARIES_32) $(BINARIES_64) -$(TARGETS_C_32BIT_ALL:%=%_32): %_32: %.c +$(BINARIES_32): $(OUTPUT)/%_32: %.c $(CC) -m32 -o $@ $(CFLAGS) $(EXTRA_CFLAGS) $^ -lrt -ldl -lm -$(TARGETS_C_64BIT_ALL:%=%_64): %_64: %.c +$(BINARIES_64): $(OUTPUT)/%_64: %.c $(CC) -m64 -o $@ $(CFLAGS) $(EXTRA_CFLAGS) $^ -lrt -ldl # x86_64 users should be encouraged to install 32-bit libraries @@ -65,12 +68,12 @@ warn_32bit_failure: endif # Some tests have additional dependencies. -sysret_ss_attrs_64: thunks.S -ptrace_syscall_32: raw_syscall_helper_32.S -test_syscall_vdso_32: thunks_32.S +$(OUTPUT)/sysret_ss_attrs_64: thunks.S +$(OUTPUT)/ptrace_syscall_32: raw_syscall_helper_32.S +$(OUTPUT)/test_syscall_vdso_32: thunks_32.S # check_initial_reg_state is special: it needs a custom entry, and it # needs to be static so that its interpreter doesn't destroy its initial # state. -check_initial_reg_state_32: CFLAGS += -Wl,-ereal_start -static -check_initial_reg_state_64: CFLAGS += -Wl,-ereal_start -static +$(OUTPUT)/check_initial_reg_state_32: CFLAGS += -Wl,-ereal_start -static +$(OUTPUT)/check_initial_reg_state_64: CFLAGS += -Wl,-ereal_start -static -- 2.10.0 ^ permalink raw reply related [flat|nested] 21+ messages in thread
[parent not found: <20161129115552.8148-7-bamvor.zhangjian-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>]
* Re: [PATCH v2 6/6] selftests: enable O and KBUILD_OUTPUT [not found] ` <20161129115552.8148-7-bamvor.zhangjian-hv44wF8Li93QT0dZR+AlfA@public.gmane.org> @ 2017-03-20 21:39 ` Andy Lutomirski [not found] ` <CALCETrUCbGC5tmzKzYn0qE5w8omk6ZRDj4p9qz5-Ho92+W5McA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> 0 siblings, 1 reply; 21+ messages in thread From: Andy Lutomirski @ 2017-03-20 21:39 UTC (permalink / raw) To: Zhangjian (Bamvor) Cc: Shuah Khan, Linux API, linux-kernel-u79uwXL29TY76Z2rM5mHXA, Kevin Hilman, Mark Brown, Michael Ellerman On Tue, Nov 29, 2016 at 3:55 AM, <bamvor.zhangjian-hv44wF8Li93QT0dZR+AlfA@public.gmane.org> wrote: > From: Bamvor Jian Zhang <bamvor.zhangjian-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org> > > Enable O and KBUILD_OUTPUT for kselftest. User could compile kselftest > to another directory by passing O or KBUILD_OUTPUT. And O is high > priority than KBUILD_OUTPUT. Sorry for noticing this late, but this patch (a8ba798bc8ec663cf02e80b0dd770324de9bafd9) is really annoying for people who *don't* use these fancy options: $ make -C tools/testing/selftests/x86 ldt_gdt_32 make: Entering directory '/home/luto/apps/linux/tools/testing/selftests/x86' Makefile:44: warning: overriding recipe for target 'clean' ../lib.mk:55: warning: ignoring old recipe for target 'clean' make: *** No rule to make target 'ldt_gdt_32'. Stop. make: Leaving directory '/home/luto/apps/linux/tools/testing/selftests/x86' Is there any way that you can make this work again? --Andy ^ permalink raw reply [flat|nested] 21+ messages in thread
[parent not found: <CALCETrUCbGC5tmzKzYn0qE5w8omk6ZRDj4p9qz5-Ho92+W5McA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>]
* Re: [PATCH v2 6/6] selftests: enable O and KBUILD_OUTPUT [not found] ` <CALCETrUCbGC5tmzKzYn0qE5w8omk6ZRDj4p9qz5-Ho92+W5McA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> @ 2017-03-21 8:35 ` Michael Ellerman [not found] ` <87fui7owls.fsf-W0DJWXSxmBNbyGPkN3NxC2scP1bn1w/D@public.gmane.org> 0 siblings, 1 reply; 21+ messages in thread From: Michael Ellerman @ 2017-03-21 8:35 UTC (permalink / raw) To: Andy Lutomirski, Zhangjian (Bamvor) Cc: Shuah Khan, Linux API, linux-kernel@vger.kernel.org, Kevin Hilman, Mark Brown Andy Lutomirski <luto-kltTT9wpgjJwATOyAt5JVQ@public.gmane.org> writes: > On Tue, Nov 29, 2016 at 3:55 AM, <bamvor.zhangjian-hv44wF8Li93QT0dZR+AlfA@public.gmane.org> wrote: >> From: Bamvor Jian Zhang <bamvor.zhangjian-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org> >> >> Enable O and KBUILD_OUTPUT for kselftest. User could compile kselftest >> to another directory by passing O or KBUILD_OUTPUT. And O is high >> priority than KBUILD_OUTPUT. > > Sorry for noticing this late, but this patch > (a8ba798bc8ec663cf02e80b0dd770324de9bafd9) is really annoying for > people who *don't* use these fancy options: Yeah sorry, it wasn't quite ready to go in. > $ make -C tools/testing/selftests/x86 ldt_gdt_32 > make: Entering directory '/home/luto/apps/linux/tools/testing/selftests/x86' > Makefile:44: warning: overriding recipe for target 'clean' > ../lib.mk:55: warning: ignoring old recipe for target 'clean' > make: *** No rule to make target 'ldt_gdt_32'. Stop. > make: Leaving directory '/home/luto/apps/linux/tools/testing/selftests/x86' > > Is there any way that you can make this work again? There obviously is *a* way, but I'm not sure there's a simple and obviously correct way that is an easy fix for 4.11. I see at least 18 Makefile's in tools/testing/selftests that use $(OUTPUT)/, which would all need to be updated at least to use $(OUTPUT) (no trailing slash), and then some other changes to not propagate OUTPUT when the user didn't specify it. But hopefully someone will prove me wrong. As a (poor) alternative you can do: $ cd tools/testing/selftests/x86; make $PWD/ldt_gdt_32 or just: $ make -C tools/testing/selftests/x86 cheers ^ permalink raw reply [flat|nested] 21+ messages in thread
[parent not found: <87fui7owls.fsf-W0DJWXSxmBNbyGPkN3NxC2scP1bn1w/D@public.gmane.org>]
* Re: [PATCH v2 6/6] selftests: enable O and KBUILD_OUTPUT [not found] ` <87fui7owls.fsf-W0DJWXSxmBNbyGPkN3NxC2scP1bn1w/D@public.gmane.org> @ 2017-03-21 9:00 ` Bamvor Zhang Jian 2017-03-21 13:54 ` Shuah Khan [not found] ` <CAFy1USRoKJ7G9ewLGBa1yy9V5UA+g=jo7O+eU1wV_rjKDYtJWg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> 0 siblings, 2 replies; 21+ messages in thread From: Bamvor Zhang Jian @ 2017-03-21 9:00 UTC (permalink / raw) To: Michael Ellerman Cc: Andy Lutomirski, Zhangjian (Bamvor), Shuah Khan, Linux API, linux-kernel-u79uwXL29TY76Z2rM5mHXA, Kevin Hilman, Mark Brown Hi, On 21 March 2017 at 16:35, Michael Ellerman <mpe-Gsx/Oe8HsFggBc27wqDAHg@public.gmane.org> wrote: > Andy Lutomirski <luto-kltTT9wpgjJwATOyAt5JVQ@public.gmane.org> writes: > >> On Tue, Nov 29, 2016 at 3:55 AM, <bamvor.zhangjian-hv44wF8Li93QT0dZR+AlfA@public.gmane.org> wrote: >>> From: Bamvor Jian Zhang <bamvor.zhangjian-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org> >>> >>> Enable O and KBUILD_OUTPUT for kselftest. User could compile kselftest >>> to another directory by passing O or KBUILD_OUTPUT. And O is high >>> priority than KBUILD_OUTPUT. >> >> Sorry for noticing this late, but this patch >> (a8ba798bc8ec663cf02e80b0dd770324de9bafd9) is really annoying for >> people who *don't* use these fancy options: > > Yeah sorry, it wasn't quite ready to go in. > >> $ make -C tools/testing/selftests/x86 ldt_gdt_32 >> make: Entering directory '/home/luto/apps/linux/tools/testing/selftests/x86' >> Makefile:44: warning: overriding recipe for target 'clean' >> ../lib.mk:55: warning: ignoring old recipe for target 'clean' >> make: *** No rule to make target 'ldt_gdt_32'. Stop. >> make: Leaving directory '/home/luto/apps/linux/tools/testing/selftests/x86' >> >> Is there any way that you can make this work again? > > There obviously is *a* way, but I'm not sure there's a simple and > obviously correct way that is an easy fix for 4.11. > > I see at least 18 Makefile's in tools/testing/selftests that use > $(OUTPUT)/, which would all need to be updated at least to use $(OUTPUT) > (no trailing slash), and then some other changes to not propagate OUTPUT > when the user didn't specify it. But hopefully someone will prove me > wrong. I also look at this issue. Originally, I use OUTPUT without slash in my patch. People argue that it is not very clear. So, I add slash in curent version. > > As a (poor) alternative you can do: > > $ cd tools/testing/selftests/x86; make $PWD/ldt_gdt_32 > > or just: > > $ make -C tools/testing/selftests/x86 > > cheers Do we really need "make -C tools/testing/selftests/x86 ldt_gdt_32"? It is useful but it will skip the top level Makefile of selftests. Regards Bamvor > -- > To unsubscribe from this list: send the line "unsubscribe linux-api" in > the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org > More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH v2 6/6] selftests: enable O and KBUILD_OUTPUT 2017-03-21 9:00 ` Bamvor Zhang Jian @ 2017-03-21 13:54 ` Shuah Khan 2017-03-21 16:09 ` Bamvor Zhang Jian [not found] ` <5daf0b79-a000-2adb-0b1e-f528d66ff6df-JPH+aEBZ4P+UEJcrhfAQsw@public.gmane.org> [not found] ` <CAFy1USRoKJ7G9ewLGBa1yy9V5UA+g=jo7O+eU1wV_rjKDYtJWg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> 1 sibling, 2 replies; 21+ messages in thread From: Shuah Khan @ 2017-03-21 13:54 UTC (permalink / raw) To: Bamvor Zhang Jian, Michael Ellerman Cc: Andy Lutomirski, Zhangjian (Bamvor), Linux API, linux-kernel, Kevin Hilman, Mark Brown, Shuah Khan On 03/21/2017 03:00 AM, Bamvor Zhang Jian wrote: > Hi, > > On 21 March 2017 at 16:35, Michael Ellerman <mpe@ellerman.id.au> wrote: >> Andy Lutomirski <luto@amacapital.net> writes: >> >>> On Tue, Nov 29, 2016 at 3:55 AM, <bamvor.zhangjian@huawei.com> wrote: >>>> From: Bamvor Jian Zhang <bamvor.zhangjian@linaro.org> >>>> >>>> Enable O and KBUILD_OUTPUT for kselftest. User could compile kselftest >>>> to another directory by passing O or KBUILD_OUTPUT. And O is high >>>> priority than KBUILD_OUTPUT. >>> >>> Sorry for noticing this late, but this patch >>> (a8ba798bc8ec663cf02e80b0dd770324de9bafd9) is really annoying for >>> people who *don't* use these fancy options: >> >> Yeah sorry, it wasn't quite ready to go in. Bamovar, Please give me heads up and ask me to not commit the patch, if you think it isn't ready. >> >>> $ make -C tools/testing/selftests/x86 ldt_gdt_32 >>> make: Entering directory '/home/luto/apps/linux/tools/testing/selftests/x86' >>> Makefile:44: warning: overriding recipe for target 'clean' >>> ../lib.mk:55: warning: ignoring old recipe for target 'clean' >>> make: *** No rule to make target 'ldt_gdt_32'. Stop. >>> make: Leaving directory '/home/luto/apps/linux/tools/testing/selftests/x86' >>> >>> Is there any way that you can make this work again? >> >> There obviously is *a* way, but I'm not sure there's a simple and >> obviously correct way that is an easy fix for 4.11. >> >> I see at least 18 Makefile's in tools/testing/selftests that use >> $(OUTPUT)/, which would all need to be updated at least to use $(OUTPUT) >> (no trailing slash), and then some other changes to not propagate OUTPUT >> when the user didn't specify it. But hopefully someone will prove me >> wrong. > I also look at this issue. Originally, I use OUTPUT without slash in my > patch. People argue that it is not very clear. So, I add slash in curent > version. >> >> As a (poor) alternative you can do: >> >> $ cd tools/testing/selftests/x86; make $PWD/ldt_gdt_32 >> >> or just: >> >> $ make -C tools/testing/selftests/x86 >> >> cheers > Do we really need "make -C tools/testing/selftests/x86 ldt_gdt_32"? > It is useful but it will skip the top level Makefile of selftests. Being able to build individual tests is an important use-case. Please see kselftest.txt under Documentation directory for all the use-cases and new patches shouldn't break these use-cases. Breaking these use-cases is a regression and we have to fix it. thanks, -- Shuah > > Regards > > Bamvor >> -- >> To unsubscribe from this list: send the line "unsubscribe linux-api" in >> the body of a message to majordomo@vger.kernel.org >> More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH v2 6/6] selftests: enable O and KBUILD_OUTPUT 2017-03-21 13:54 ` Shuah Khan @ 2017-03-21 16:09 ` Bamvor Zhang Jian [not found] ` <CAFy1USRjGvF3iwWa8k54fFzcMaMcN3VCQ1qMpZ3RSqZvT17Atw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> [not found] ` <5daf0b79-a000-2adb-0b1e-f528d66ff6df-JPH+aEBZ4P+UEJcrhfAQsw@public.gmane.org> 1 sibling, 1 reply; 21+ messages in thread From: Bamvor Zhang Jian @ 2017-03-21 16:09 UTC (permalink / raw) To: Shuah Khan Cc: Michael Ellerman, Andy Lutomirski, Zhangjian (Bamvor), Linux API, linux-kernel, Kevin Hilman, Mark Brown Hi, Shuah On 21 March 2017 at 21:54, Shuah Khan <shuahkh@osg.samsung.com> wrote: > On 03/21/2017 03:00 AM, Bamvor Zhang Jian wrote: >> Hi, >> >> On 21 March 2017 at 16:35, Michael Ellerman <mpe@ellerman.id.au> wrote: >>> Andy Lutomirski <luto@amacapital.net> writes: >>> >>>> On Tue, Nov 29, 2016 at 3:55 AM, <bamvor.zhangjian@huawei.com> wrote: >>>>> From: Bamvor Jian Zhang <bamvor.zhangjian@linaro.org> >>>>> >>>>> Enable O and KBUILD_OUTPUT for kselftest. User could compile kselftest >>>>> to another directory by passing O or KBUILD_OUTPUT. And O is high >>>>> priority than KBUILD_OUTPUT. >>>> >>>> Sorry for noticing this late, but this patch >>>> (a8ba798bc8ec663cf02e80b0dd770324de9bafd9) is really annoying for >>>> people who *don't* use these fancy options: >>> >>> Yeah sorry, it wasn't quite ready to go in. > > Bamovar, > > Please give me heads up and ask me to not commit the patch, > if you think it isn't ready. > >>> >>>> $ make -C tools/testing/selftests/x86 ldt_gdt_32 >>>> make: Entering directory '/home/luto/apps/linux/tools/testing/selftests/x86' >>>> Makefile:44: warning: overriding recipe for target 'clean' >>>> ../lib.mk:55: warning: ignoring old recipe for target 'clean' >>>> make: *** No rule to make target 'ldt_gdt_32'. Stop. >>>> make: Leaving directory '/home/luto/apps/linux/tools/testing/selftests/x86' >>>> >>>> Is there any way that you can make this work again? >>> >>> There obviously is *a* way, but I'm not sure there's a simple and >>> obviously correct way that is an easy fix for 4.11. >>> >>> I see at least 18 Makefile's in tools/testing/selftests that use >>> $(OUTPUT)/, which would all need to be updated at least to use $(OUTPUT) >>> (no trailing slash), and then some other changes to not propagate OUTPUT >>> when the user didn't specify it. But hopefully someone will prove me >>> wrong. >> I also look at this issue. Originally, I use OUTPUT without slash in my >> patch. People argue that it is not very clear. So, I add slash in curent >> version. >>> >>> As a (poor) alternative you can do: >>> >>> $ cd tools/testing/selftests/x86; make $PWD/ldt_gdt_32 >>> >>> or just: >>> >>> $ make -C tools/testing/selftests/x86 >>> >>> cheers >> Do we really need "make -C tools/testing/selftests/x86 ldt_gdt_32"? >> It is useful but it will skip the top level Makefile of selftests. > > Being able to build individual tests is an important use-case. Please > see kselftest.txt under Documentation directory for all the use-cases > and new patches shouldn't break these use-cases. Understand. I am sorry I do not know this use case before. And I read kselftest.txt again, I do not find this use case is mentioned. So, I add a few lines in kselftest.txt to avoid break this use case in future. Is there any other use cases I should test? > > Breaking these use-cases is a regression and we have to fix it Here is a fix. I could build individual test case in x86 and build the whole x86 test cases successful respectively. And I do a quick test for all the subsets. Please review the patch if it is make sense to you and Michael. At the same time, I am buildind and testing all the testcases. Michael: could you please do me a favor to test the powerpc part? Thanks. >From 21b17710d23783c5148303e5628b52d281e6f62b Mon Sep 17 00:00:00 2001 From: Bamvor Jian Zhang <bamvor.zhangjian@linaro.org> Date: Tue, 21 Mar 2017 22:38:01 +0800 Subject: [PATCH] selftests: fix the broken individual test for x86 Andy Lutomirski report that build individual testcase in x86 is broken: $ make -C tools/testing/selftests/x86 ldt_gdt_32 make: Entering directory '/home/luto/apps/linux/tools/testing/selftests/x86' Makefile:44: warning: overriding recipe for target 'clean' ../lib.mk:55: warning: ignoring old recipe for target 'clean' make: *** No rule to make target 'ldt_gdt_32'. Stop. make: Leaving directory '/home/luto/apps/linux/tools/testing/selftests/x86' This patch fix this issue by removing the slash after OUTPUT. And also mention this use case in Documentation/kselftests.txt Reported-by: Andy Lutomirski <luto@amacapital.net> Suggested-by: Michael Ellerman <mpe@ellerman.id.au> Signed-off-by: Bamvor Jian Zhang <bamvor.zhangjian@linaro.org> --- Documentation/kselftest.txt | 5 +++++ tools/testing/selftests/Makefile | 16 ++++++++-------- tools/testing/selftests/exec/Makefile | 10 +++++----- tools/testing/selftests/ftrace/Makefile | 2 +- tools/testing/selftests/futex/Makefile | 12 ++++++------ tools/testing/selftests/kcmp/Makefile | 2 +- tools/testing/selftests/lib.mk | 10 +++++----- tools/testing/selftests/powerpc/Makefile | 18 +++++++++--------- tools/testing/selftests/powerpc/benchmarks/Makefile | 6 +++--- tools/testing/selftests/powerpc/copyloops/Makefile | 8 ++++---- tools/testing/selftests/powerpc/dscr/Makefile | 2 +- tools/testing/selftests/powerpc/math/Makefile | 16 ++++++++-------- tools/testing/selftests/powerpc/mm/Makefile | 4 ++-- tools/testing/selftests/powerpc/pmu/Makefile | 16 ++++++++-------- tools/testing/selftests/powerpc/pmu/ebb/Makefile | 4 ++-- tools/testing/selftests/powerpc/switch_endian/Makefile | 8 ++++---- tools/testing/selftests/powerpc/tm/Makefile | 8 ++++---- tools/testing/selftests/vm/Makefile | 8 ++++---- tools/testing/selftests/x86/Makefile | 18 +++++++++--------- 19 files changed, 89 insertions(+), 84 deletions(-) diff --git a/Documentation/kselftest.txt b/Documentation/kselftest.txt index 5bd5903..6197e94 100644 --- a/Documentation/kselftest.txt +++ b/Documentation/kselftest.txt @@ -42,6 +42,11 @@ You can specify multiple tests to build and run: See the top-level tools/testing/selftests/Makefile for the list of all possible targets. +Building individual test case of a subset +========================================= +You could build the individual test case in subset if subset supported: + $ make -C tools/testing/selftests/x86 ldt_gdt_32 + Running the full range hotplug selftests ======================================== diff --git a/tools/testing/selftests/Makefile b/tools/testing/selftests/Makefile index e8b79a7..6cc93c1 100644 --- a/tools/testing/selftests/Makefile +++ b/tools/testing/selftests/Makefile @@ -64,31 +64,31 @@ all: for TARGET in $(TARGETS); do \ BUILD_TARGET=$$BUILD/$$TARGET; \ mkdir $$BUILD_TARGET -p; \ - make OUTPUT=$$BUILD_TARGET -C $$TARGET;\ + make OUTPUT=$$BUILD_TARGET/ -C $$TARGET;\ done; run_tests: all for TARGET in $(TARGETS); do \ BUILD_TARGET=$$BUILD/$$TARGET; \ - make OUTPUT=$$BUILD_TARGET -C $$TARGET run_tests;\ + make OUTPUT=$$BUILD_TARGET/ -C $$TARGET run_tests;\ done; hotplug: for TARGET in $(TARGETS_HOTPLUG); do \ BUILD_TARGET=$$BUILD/$$TARGET; \ - make OUTPUT=$$BUILD_TARGET -C $$TARGET;\ + make OUTPUT=$$BUILD_TARGET/ -C $$TARGET;\ done; run_hotplug: hotplug for TARGET in $(TARGETS_HOTPLUG); do \ BUILD_TARGET=$$BUILD/$$TARGET; \ - make OUTPUT=$$BUILD_TARGET -C $$TARGET run_full_test;\ + make OUTPUT=$$BUILD_TARGET/ -C $$TARGET run_full_test;\ done; clean_hotplug: for TARGET in $(TARGETS_HOTPLUG); do \ BUILD_TARGET=$$BUILD/$$TARGET; \ - make OUTPUT=$$BUILD_TARGET -C $$TARGET clean;\ + make OUTPUT=$$BUILD_TARGET/ -C $$TARGET clean;\ done; run_pstore_crash: @@ -104,7 +104,7 @@ ifdef INSTALL_PATH mkdir -p $(INSTALL_PATH) for TARGET in $(TARGETS); do \ BUILD_TARGET=$$BUILD/$$TARGET; \ - make OUTPUT=$$BUILD_TARGET -C $$TARGET INSTALL_PATH=$(INSTALL_PATH)/$$TARGET install; \ + make OUTPUT=$$BUILD_TARGET/ -C $$TARGET INSTALL_PATH=$(INSTALL_PATH)/$$TARGET install; \ done; @# Ask all targets to emit their test scripts @@ -117,7 +117,7 @@ ifdef INSTALL_PATH echo "echo ; echo Running tests in $$TARGET" >> $(ALL_SCRIPT); \ echo "echo ========================================" >> $(ALL_SCRIPT); \ echo "cd $$TARGET" >> $(ALL_SCRIPT); \ - make -s --no-print-directory OUTPUT=$$BUILD_TARGET -C $$TARGET emit_tests >> $(ALL_SCRIPT); \ + make -s --no-print-directory OUTPUT=$$BUILD_TARGET/ -C $$TARGET emit_tests >> $(ALL_SCRIPT); \ echo "cd \$$ROOT" >> $(ALL_SCRIPT); \ done; @@ -129,7 +129,7 @@ endif clean: for TARGET in $(TARGETS); do \ BUILD_TARGET=$$BUILD/$$TARGET; \ - make OUTPUT=$$BUILD_TARGET -C $$TARGET clean;\ + make OUTPUT=$$BUILD_TARGET/ -C $$TARGET clean;\ done; .PHONY: install diff --git a/tools/testing/selftests/exec/Makefile b/tools/testing/selftests/exec/Makefile index 2e13035..2f3b200 100644 --- a/tools/testing/selftests/exec/Makefile +++ b/tools/testing/selftests/exec/Makefile @@ -5,19 +5,19 @@ TEST_GEN_FILES := execveat.symlink execveat.denatured script subdir # Makefile is a run-time dependency, since it's accessed by the execveat test TEST_FILES := Makefile -EXTRA_CLEAN := $(OUTPUT)/subdir.moved $(OUTPUT)/execveat.moved $(OUTPUT)/xxxxx* +EXTRA_CLEAN := $(OUTPUT)subdir.moved $(OUTPUT)execveat.moved $(OUTPUT)xxxxx* include ../lib.mk -$(OUTPUT)/subdir: +$(OUTPUT)subdir: mkdir -p $@ -$(OUTPUT)/script: +$(OUTPUT)script: echo '#!/bin/sh' > $@ echo 'exit $$*' >> $@ chmod +x $@ -$(OUTPUT)/execveat.symlink: $(OUTPUT)/execveat +$(OUTPUT)execveat.symlink: $(OUTPUT)execveat cd $(OUTPUT) && ln -s -f $(shell basename $<) $(shell basename $@) -$(OUTPUT)/execveat.denatured: $(OUTPUT)/execveat +$(OUTPUT)execveat.denatured: $(OUTPUT)execveat cp $< $@ chmod -x $@ diff --git a/tools/testing/selftests/ftrace/Makefile b/tools/testing/selftests/ftrace/Makefile index a8a5e21..33bb29b 100644 --- a/tools/testing/selftests/ftrace/Makefile +++ b/tools/testing/selftests/ftrace/Makefile @@ -2,6 +2,6 @@ all: TEST_PROGS := ftracetest TEST_FILES := test.d -EXTRA_CLEAN := $(OUTPUT)/logs/* +EXTRA_CLEAN := $(OUTPUT)logs/* include ../lib.mk diff --git a/tools/testing/selftests/futex/Makefile b/tools/testing/selftests/futex/Makefile index 653c5cd..11c6c49 100644 --- a/tools/testing/selftests/futex/Makefile +++ b/tools/testing/selftests/futex/Makefile @@ -8,9 +8,9 @@ include ../lib.mk all: for DIR in $(SUBDIRS); do \ - BUILD_TARGET=$$OUTPUT/$$DIR; \ + BUILD_TARGET=$$OUTPUT$$DIR; \ mkdir $$BUILD_TARGET -p; \ - make OUTPUT=$$BUILD_TARGET -C $$DIR $@;\ + make OUTPUT=$$BUILD_TARGET/ -C $$DIR $@;\ done override define RUN_TESTS @@ -22,9 +22,9 @@ override define INSTALL_RULE install -t $(INSTALL_PATH) $(TEST_PROGS) $(TEST_PROGS_EXTENDED) $(TEST_FILES) @for SUBDIR in $(SUBDIRS); do \ - BUILD_TARGET=$$OUTPUT/$$SUBDIR; \ + BUILD_TARGET=$$OUTPUT$$SUBDIR; \ mkdir $$BUILD_TARGET -p; \ - $(MAKE) OUTPUT=$$BUILD_TARGET -C $$SUBDIR INSTALL_PATH=$(INSTALL_PATH)/$$SUBDIR install; \ + $(MAKE) OUTPUT=$$BUILD_TARGET/ -C $$SUBDIR INSTALL_PATH=$(INSTALL_PATH)/$$SUBDIR install; \ done; endef @@ -34,7 +34,7 @@ endef clean: for DIR in $(SUBDIRS); do \ - BUILD_TARGET=$$OUTPUT/$$DIR; \ + BUILD_TARGET=$$OUTPUT$$DIR; \ mkdir $$BUILD_TARGET -p; \ - make OUTPUT=$$BUILD_TARGET -C $$DIR $@;\ + make OUTPUT=$$BUILD_TARGET/ -C $$DIR $@;\ done diff --git a/tools/testing/selftests/kcmp/Makefile b/tools/testing/selftests/kcmp/Makefile index 47aa988..0fb599e 100644 --- a/tools/testing/selftests/kcmp/Makefile +++ b/tools/testing/selftests/kcmp/Makefile @@ -2,7 +2,7 @@ CFLAGS += -I../../../../usr/include/ TEST_GEN_PROGS := kcmp_test -EXTRA_CLEAN := $(OUTPUT)/kcmp-test-file +EXTRA_CLEAN := $(OUTPUT)kcmp-test-file include ../lib.mk diff --git a/tools/testing/selftests/lib.mk b/tools/testing/selftests/lib.mk index ce96d80..716e920 100644 --- a/tools/testing/selftests/lib.mk +++ b/tools/testing/selftests/lib.mk @@ -2,8 +2,8 @@ # Makefile can operate with or without the kbuild infrastructure. CC := $(CROSS_COMPILE)gcc -TEST_GEN_PROGS := $(patsubst %,$(OUTPUT)/%,$(TEST_GEN_PROGS)) -TEST_GEN_FILES := $(patsubst %,$(OUTPUT)/%,$(TEST_GEN_FILES)) +TEST_GEN_PROGS := $(patsubst %,$(OUTPUT)%,$(TEST_GEN_PROGS)) +TEST_GEN_FILES := $(patsubst %,$(OUTPUT)%,$(TEST_GEN_FILES)) all: $(TEST_GEN_PROGS) $(TEST_GEN_PROGS_EXTENDED) $(TEST_GEN_FILES) @@ -50,13 +50,13 @@ emit_tests: clean: $(RM) -r $(TEST_GEN_PROGS) $(TEST_GEN_PROGS_EXTENDED) $(TEST_GEN_FILES) $(EXTRA_CLEAN) -$(OUTPUT)/%:%.c +$(OUTPUT)%:%.c $(LINK.c) $^ $(LDLIBS) -o $@ -$(OUTPUT)/%.o:%.S +$(OUTPUT)%.o:%.S $(COMPILE.S) $^ -o $@ -$(OUTPUT)/%:%.S +$(OUTPUT)%:%.S $(LINK.S) $^ $(LDLIBS) -o $@ .PHONY: run_tests all clean install emit_tests diff --git a/tools/testing/selftests/powerpc/Makefile b/tools/testing/selftests/powerpc/Makefile index 1c5d057..1a1a33c 100644 --- a/tools/testing/selftests/powerpc/Makefile +++ b/tools/testing/selftests/powerpc/Makefile @@ -34,35 +34,35 @@ endif all: $(SUB_DIRS) $(SUB_DIRS): - BUILD_TARGET=$$OUTPUT/$@; mkdir -p $$BUILD_TARGET; $(MAKE) OUTPUT=$$BUILD_TARGET -k -C $@ all + BUILD_TARGET=$$OUTPUT$@; mkdir -p $$BUILD_TARGET; $(MAKE) OUTPUT=$$BUILD_TARGET/ -k -C $@ all include ../lib.mk override define RUN_TESTS @for TARGET in $(SUB_DIRS); do \ - BUILD_TARGET=$$OUTPUT/$$TARGET; \ - $(MAKE) OUTPUT=$$BUILD_TARGET -C $$TARGET run_tests;\ + BUILD_TARGET=$$OUTPUT$$TARGET; \ + $(MAKE) OUTPUT=$$BUILD_TARGET/ -C $$TARGET run_tests;\ done; endef override define INSTALL_RULE @for TARGET in $(SUB_DIRS); do \ - BUILD_TARGET=$$OUTPUT/$$TARGET; \ - $(MAKE) OUTPUT=$$BUILD_TARGET -C $$TARGET install;\ + BUILD_TARGET=$$OUTPUT$$TARGET; \ + $(MAKE) OUTPUT=$$BUILD_TARGET/ -C $$TARGET install;\ done; endef override define EMIT_TESTS @for TARGET in $(SUB_DIRS); do \ - BUILD_TARGET=$$OUTPUT/$$TARGET; \ - $(MAKE) OUTPUT=$$BUILD_TARGET -s -C $$TARGET emit_tests;\ + BUILD_TARGET=$$OUTPUT$$TARGET; \ + $(MAKE) OUTPUT=$$BUILD_TARGET/ -s -C $$TARGET emit_tests;\ done; endef clean: @for TARGET in $(SUB_DIRS); do \ - BUILD_TARGET=$$OUTPUT/$$TARGET; \ - $(MAKE) OUTPUT=$$BUILD_TARGET -C $$TARGET clean; \ + BUILD_TARGET=$$OUTPUT$$TARGET; \ + $(MAKE) OUTPUT=$$BUILD_TARGET/ -C $$TARGET clean; \ done; rm -f tags diff --git a/tools/testing/selftests/powerpc/benchmarks/Makefile b/tools/testing/selftests/powerpc/benchmarks/Makefile index fb96a89..c720780 100644 --- a/tools/testing/selftests/powerpc/benchmarks/Makefile +++ b/tools/testing/selftests/powerpc/benchmarks/Makefile @@ -6,6 +6,6 @@ include ../../lib.mk $(TEST_GEN_PROGS): ../harness.c -$(OUTPUT)/context_switch: ../utils.c -$(OUTPUT)/context_switch: CFLAGS += -maltivec -mvsx -mabi=altivec -$(OUTPUT)/context_switch: LDLIBS += -lpthread +$(OUTPUT)context_switch: ../utils.c +$(OUTPUT)context_switch: CFLAGS += -maltivec -mvsx -mabi=altivec +$(OUTPUT)context_switch: LDLIBS += -lpthread diff --git a/tools/testing/selftests/powerpc/copyloops/Makefile b/tools/testing/selftests/powerpc/copyloops/Makefile index 681ab19..60e195a 100644 --- a/tools/testing/selftests/powerpc/copyloops/Makefile +++ b/tools/testing/selftests/powerpc/copyloops/Makefile @@ -12,9 +12,9 @@ EXTRA_SOURCES := validate.c ../harness.c include ../../lib.mk -$(OUTPUT)/copyuser_64: CPPFLAGS += -D COPY_LOOP=test___copy_tofrom_user_base -$(OUTPUT)/copyuser_power7: CPPFLAGS += -D COPY_LOOP=test___copy_tofrom_user_power7 -$(OUTPUT)/memcpy_64: CPPFLAGS += -D COPY_LOOP=test_memcpy -$(OUTPUT)/memcpy_power7: CPPFLAGS += -D COPY_LOOP=test_memcpy_power7 +$(OUTPUT)copyuser_64: CPPFLAGS += -D COPY_LOOP=test___copy_tofrom_user_base +$(OUTPUT)copyuser_power7: CPPFLAGS += -D COPY_LOOP=test___copy_tofrom_user_power7 +$(OUTPUT)memcpy_64: CPPFLAGS += -D COPY_LOOP=test_memcpy +$(OUTPUT)memcpy_power7: CPPFLAGS += -D COPY_LOOP=test_memcpy_power7 $(TEST_GEN_PROGS): $(EXTRA_SOURCES) diff --git a/tools/testing/selftests/powerpc/dscr/Makefile b/tools/testing/selftests/powerpc/dscr/Makefile index c5639de..378f825 100644 --- a/tools/testing/selftests/powerpc/dscr/Makefile +++ b/tools/testing/selftests/powerpc/dscr/Makefile @@ -4,6 +4,6 @@ TEST_GEN_PROGS := dscr_default_test dscr_explicit_test dscr_user_test \ include ../../lib.mk -$(OUTPUT)/dscr_default_test: LDLIBS += -lpthread +$(OUTPUT)dscr_default_test: LDLIBS += -lpthread $(TEST_GEN_PROGS): ../harness.c diff --git a/tools/testing/selftests/powerpc/math/Makefile b/tools/testing/selftests/powerpc/math/Makefile index fa8bae9..73d6f52 100644 --- a/tools/testing/selftests/powerpc/math/Makefile +++ b/tools/testing/selftests/powerpc/math/Makefile @@ -5,13 +5,13 @@ include ../../lib.mk $(TEST_GEN_PROGS): ../harness.c $(TEST_GEN_PROGS): CFLAGS += -O2 -g -pthread -m64 -maltivec -$(OUTPUT)/fpu_syscall: fpu_asm.S -$(OUTPUT)/fpu_preempt: fpu_asm.S -$(OUTPUT)/fpu_signal: fpu_asm.S +$(OUTPUT)fpu_syscall: fpu_asm.S +$(OUTPUT)fpu_preempt: fpu_asm.S +$(OUTPUT)fpu_signal: fpu_asm.S -$(OUTPUT)/vmx_syscall: vmx_asm.S -$(OUTPUT)/vmx_preempt: vmx_asm.S -$(OUTPUT)/vmx_signal: vmx_asm.S +$(OUTPUT)vmx_syscall: vmx_asm.S +$(OUTPUT)vmx_preempt: vmx_asm.S +$(OUTPUT)vmx_signal: vmx_asm.S -$(OUTPUT)/vsx_preempt: CFLAGS += -mvsx -$(OUTPUT)/vsx_preempt: vsx_asm.S +$(OUTPUT)vsx_preempt: CFLAGS += -mvsx +$(OUTPUT)vsx_preempt: vsx_asm.S diff --git a/tools/testing/selftests/powerpc/mm/Makefile b/tools/testing/selftests/powerpc/mm/Makefile index 1cffe54..d4d2e68 100644 --- a/tools/testing/selftests/powerpc/mm/Makefile +++ b/tools/testing/selftests/powerpc/mm/Makefile @@ -8,8 +8,8 @@ include ../../lib.mk $(TEST_GEN_PROGS): ../harness.c -$(OUTPUT)/prot_sao: ../utils.c +$(OUTPUT)prot_sao: ../utils.c -$(OUTPUT)/tempfile: +$(OUTPUT)tempfile: dd if=/dev/zero of=$@ bs=64k count=1 diff --git a/tools/testing/selftests/powerpc/pmu/Makefile b/tools/testing/selftests/powerpc/pmu/Makefile index e4e55d1..17a9be7 100644 --- a/tools/testing/selftests/powerpc/pmu/Makefile +++ b/tools/testing/selftests/powerpc/pmu/Makefile @@ -11,34 +11,34 @@ all: $(TEST_GEN_PROGS) ebb $(TEST_GEN_PROGS): $(EXTRA_SOURCES) # loop.S can only be built 64-bit -$(OUTPUT)/count_instructions: loop.S count_instructions.c $(EXTRA_SOURCES) +$(OUTPUT)count_instructions: loop.S count_instructions.c $(EXTRA_SOURCES) $(CC) $(CFLAGS) -m64 -o $@ $^ -$(OUTPUT)/per_event_excludes: ../utils.c +$(OUTPUT)per_event_excludes: ../utils.c DEFAULT_RUN_TESTS := $(RUN_TESTS) override define RUN_TESTS $(DEFAULT_RUN_TESTS) - TARGET=ebb; BUILD_TARGET=$$OUTPUT/$$TARGET; $(MAKE) OUTPUT=$$BUILD_TARGET -C $$TARGET run_tests + TARGET=ebb; BUILD_TARGET=$$OUTPUT$$TARGET; $(MAKE) OUTPUT=$$BUILD_TARGET/ -C $$TARGET run_tests endef DEFAULT_EMIT_TESTS := $(EMIT_TESTS) override define EMIT_TESTS $(DEFAULT_EMIT_TESTS) - TARGET=ebb; BUILD_TARGET=$$OUTPUT/$$TARGET; $(MAKE) OUTPUT=$$BUILD_TARGET -s -C $$TARGET emit_tests + TARGET=ebb; BUILD_TARGET=$$OUTPUT$$TARGET; $(MAKE) OUTPUT=$$BUILD_TARGET/ -s -C $$TARGET emit_tests endef DEFAULT_INSTALL_RULE := $(INSTALL_RULE) override define INSTALL_RULE $(DEFAULT_INSTALL_RULE) - TARGET=ebb; BUILD_TARGET=$$OUTPUT/$$TARGET; $(MAKE) OUTPUT=$$BUILD_TARGET -C $$TARGET install + TARGET=ebb; BUILD_TARGET=$$OUTPUT$$TARGET; $(MAKE) OUTPUT=$$BUILD_TARGET/ -C $$TARGET install endef clean: - $(RM) $(TEST_GEN_PROGS) $(OUTPUT)/loop.o - TARGET=ebb; BUILD_TARGET=$$OUTPUT/$$TARGET; $(MAKE) OUTPUT=$$BUILD_TARGET -C $$TARGET clean + $(RM) $(TEST_GEN_PROGS) $(OUTPUT)loop.o + TARGET=ebb; BUILD_TARGET=$$OUTPUT$$TARGET; $(MAKE) OUTPUT=$$BUILD_TARGET/ -C $$TARGET clean ebb: - TARGET=$@; BUILD_TARGET=$$OUTPUT/$$TARGET; mkdir -p $$BUILD_TARGET; $(MAKE) OUTPUT=$$BUILD_TARGET -k -C $$TARGET all + TARGET=$@; BUILD_TARGET=$$OUTPUT$$TARGET; mkdir -p $$BUILD_TARGET; $(MAKE) OUTPUT=$$BUILD_TARGET/ -k -C $$TARGET all .PHONY: all run_tests clean ebb diff --git a/tools/testing/selftests/powerpc/pmu/ebb/Makefile b/tools/testing/selftests/powerpc/pmu/ebb/Makefile index 6001fb0..1512260 100644 --- a/tools/testing/selftests/powerpc/pmu/ebb/Makefile +++ b/tools/testing/selftests/powerpc/pmu/ebb/Makefile @@ -21,6 +21,6 @@ include ../../../lib.mk $(TEST_GEN_PROGS): ../../harness.c ../../utils.c ../event.c ../lib.c \ ebb.c ebb_handler.S trace.c busy_loop.S -$(OUTPUT)/instruction_count_test: ../loop.S +$(OUTPUT)instruction_count_test: ../loop.S -$(OUTPUT)/lost_exception_test: ../lib.c +$(OUTPUT)lost_exception_test: ../lib.c diff --git a/tools/testing/selftests/powerpc/switch_endian/Makefile b/tools/testing/selftests/powerpc/switch_endian/Makefile index b92c2a1..4d0bbf7 100644 --- a/tools/testing/selftests/powerpc/switch_endian/Makefile +++ b/tools/testing/selftests/powerpc/switch_endian/Makefile @@ -2,14 +2,14 @@ TEST_GEN_PROGS := switch_endian_test ASFLAGS += -O2 -Wall -g -nostdlib -m64 -EXTRA_CLEAN = $(OUTPUT)/*.o $(OUTPUT)/check-reversed.S +EXTRA_CLEAN = $(OUTPUT)*.o $(OUTPUT)check-reversed.S include ../../lib.mk -$(OUTPUT)/switch_endian_test: $(OUTPUT)/check-reversed.S +$(OUTPUT)switch_endian_test: $(OUTPUT)check-reversed.S -$(OUTPUT)/check-reversed.o: $(OUTPUT)/check.o +$(OUTPUT)check-reversed.o: $(OUTPUT)check.o $(CROSS_COMPILE)objcopy -j .text --reverse-bytes=4 -O binary $< $@ -$(OUTPUT)/check-reversed.S: $(OUTPUT)/check-reversed.o +$(OUTPUT)check-reversed.S: $(OUTPUT)check-reversed.o hexdump -v -e '/1 ".byte 0x%02X\n"' $< > $@ diff --git a/tools/testing/selftests/powerpc/tm/Makefile b/tools/testing/selftests/powerpc/tm/Makefile index 5576ee6..9c76e25 100644 --- a/tools/testing/selftests/powerpc/tm/Makefile +++ b/tools/testing/selftests/powerpc/tm/Makefile @@ -10,10 +10,10 @@ $(TEST_GEN_PROGS): ../harness.c ../utils.c CFLAGS += -mhtm -$(OUTPUT)/tm-syscall: tm-syscall-asm.S -$(OUTPUT)/tm-syscall: CFLAGS += -I../../../../../usr/include -$(OUTPUT)/tm-tmspr: CFLAGS += -pthread +$(OUTPUT)tm-syscall: tm-syscall-asm.S +$(OUTPUT)tm-syscall: CFLAGS += -I../../../../../usr/include +$(OUTPUT)tm-tmspr: CFLAGS += -pthread -SIGNAL_CONTEXT_CHK_TESTS := $(patsubst %,$(OUTPUT)/%,$(SIGNAL_CONTEXT_CHK_TESTS)) +SIGNAL_CONTEXT_CHK_TESTS := $(patsubst %,$(OUTPUT)%,$(SIGNAL_CONTEXT_CHK_TESTS)) $(SIGNAL_CONTEXT_CHK_TESTS): tm-signal.S $(SIGNAL_CONTEXT_CHK_TESTS): CFLAGS += -mhtm -m64 -mvsx diff --git a/tools/testing/selftests/vm/Makefile b/tools/testing/selftests/vm/Makefile index 222ee45..1e7c02c 100644 --- a/tools/testing/selftests/vm/Makefile +++ b/tools/testing/selftests/vm/Makefile @@ -19,10 +19,10 @@ TEST_PROGS := run_vmtests include ../lib.mk -$(OUTPUT)/userfaultfd: LDLIBS += -lpthread ../../../../usr/include/linux/kernel.h -$(OUTPUT)/userfaultfd_hugetlb: LDLIBS += -lpthread ../../../../usr/include/linux/kernel.h -$(OUTPUT)/userfaultfd_shmem: LDLIBS += -lpthread ../../../../usr/include/linux/kernel.h -$(OUTPUT)/mlock-random-test: LDLIBS += -lcap +$(OUTPUT)userfaultfd: LDLIBS += -lpthread ../../../../usr/include/linux/kernel.h +$(OUTPUT)userfaultfd_hugetlb: LDLIBS += -lpthread ../../../../usr/include/linux/kernel.h +$(OUTPUT)userfaultfd_shmem: LDLIBS += -lpthread ../../../../usr/include/linux/kernel.h +$(OUTPUT)mlock-random-test: LDLIBS += -lcap ../../../../usr/include/linux/kernel.h: make -C ../../../.. headers_install diff --git a/tools/testing/selftests/x86/Makefile b/tools/testing/selftests/x86/Makefile index 3a5ebae..42db9f4 100644 --- a/tools/testing/selftests/x86/Makefile +++ b/tools/testing/selftests/x86/Makefile @@ -17,8 +17,8 @@ TARGETS_C_64BIT_ALL := $(TARGETS_C_BOTHBITS) $(TARGETS_C_64BIT_ONLY) BINARIES_32 := $(TARGETS_C_32BIT_ALL:%=%_32) BINARIES_64 := $(TARGETS_C_64BIT_ALL:%=%_64) -BINARIES_32 := $(patsubst %,$(OUTPUT)/%,$(BINARIES_32)) -BINARIES_64 := $(patsubst %,$(OUTPUT)/%,$(BINARIES_64)) +BINARIES_32 := $(patsubst %,$(OUTPUT)%,$(BINARIES_32)) +BINARIES_64 := $(patsubst %,$(OUTPUT)%,$(BINARIES_64)) CFLAGS := -O2 -g -std=gnu99 -pthread -Wall @@ -43,10 +43,10 @@ all_64: $(BINARIES_64) clean: $(RM) $(BINARIES_32) $(BINARIES_64) -$(BINARIES_32): $(OUTPUT)/%_32: %.c +$(BINARIES_32): $(OUTPUT)%_32: %.c $(CC) -m32 -o $@ $(CFLAGS) $(EXTRA_CFLAGS) $^ -lrt -ldl -lm -$(BINARIES_64): $(OUTPUT)/%_64: %.c +$(BINARIES_64): $(OUTPUT)%_64: %.c $(CC) -m64 -o $@ $(CFLAGS) $(EXTRA_CFLAGS) $^ -lrt -ldl # x86_64 users should be encouraged to install 32-bit libraries @@ -68,12 +68,12 @@ warn_32bit_failure: endif # Some tests have additional dependencies. -$(OUTPUT)/sysret_ss_attrs_64: thunks.S -$(OUTPUT)/ptrace_syscall_32: raw_syscall_helper_32.S -$(OUTPUT)/test_syscall_vdso_32: thunks_32.S +$(OUTPUT)sysret_ss_attrs_64: thunks.S +$(OUTPUT)ptrace_syscall_32: raw_syscall_helper_32.S +$(OUTPUT)test_syscall_vdso_32: thunks_32.S # check_initial_reg_state is special: it needs a custom entry, and it # needs to be static so that its interpreter doesn't destroy its initial # state. -$(OUTPUT)/check_initial_reg_state_32: CFLAGS += -Wl,-ereal_start -static -$(OUTPUT)/check_initial_reg_state_64: CFLAGS += -Wl,-ereal_start -static +$(OUTPUT)check_initial_reg_state_32: CFLAGS += -Wl,-ereal_start -static +$(OUTPUT)check_initial_reg_state_64: CFLAGS += -Wl,-ereal_start -static -- 1.9.1 Regards Bamvor > > thanks, > -- Shuah > >> >> Regards >> >> Bamvor >>> -- >>> To unsubscribe from this list: send the line "unsubscribe linux-api" in >>> the body of a message to majordomo@vger.kernel.org >>> More majordomo info at http://vger.kernel.org/majordomo-info.html > ^ permalink raw reply related [flat|nested] 21+ messages in thread
[parent not found: <CAFy1USRjGvF3iwWa8k54fFzcMaMcN3VCQ1qMpZ3RSqZvT17Atw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>]
* Re: [PATCH v2 6/6] selftests: enable O and KBUILD_OUTPUT [not found] ` <CAFy1USRjGvF3iwWa8k54fFzcMaMcN3VCQ1qMpZ3RSqZvT17Atw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> @ 2017-03-21 18:02 ` Shuah Khan [not found] ` <4243a5e3-a971-387d-e492-262d76db4540-JPH+aEBZ4P+UEJcrhfAQsw@public.gmane.org> 2017-03-22 11:35 ` Michael Ellerman 1 sibling, 1 reply; 21+ messages in thread From: Shuah Khan @ 2017-03-21 18:02 UTC (permalink / raw) To: Bamvor Zhang Jian Cc: Michael Ellerman, Andy Lutomirski, Zhangjian (Bamvor), Linux API, linux-kernel-u79uwXL29TY76Z2rM5mHXA, Kevin Hilman, Mark Brown, shuah Khan On 03/21/2017 10:09 AM, Bamvor Zhang Jian wrote: > Hi, Shuah > > On 21 March 2017 at 21:54, Shuah Khan <shuahkh-JPH+aEBZ4P+UEJcrhfAQsw@public.gmane.org> wrote: >> On 03/21/2017 03:00 AM, Bamvor Zhang Jian wrote: >>> Hi, >>> >>> On 21 March 2017 at 16:35, Michael Ellerman <mpe-Gsx/Oe8HsFggBc27wqDAHg@public.gmane.org> wrote: >>>> Andy Lutomirski <luto-kltTT9wpgjJwATOyAt5JVQ@public.gmane.org> writes: >>>> >>>>> On Tue, Nov 29, 2016 at 3:55 AM, <bamvor.zhangjian-hv44wF8Li93QT0dZR+AlfA@public.gmane.org> wrote: >>>>>> From: Bamvor Jian Zhang <bamvor.zhangjian-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org> >>>>>> >>>>>> Enable O and KBUILD_OUTPUT for kselftest. User could compile kselftest >>>>>> to another directory by passing O or KBUILD_OUTPUT. And O is high >>>>>> priority than KBUILD_OUTPUT. >>>>> >>>>> Sorry for noticing this late, but this patch >>>>> (a8ba798bc8ec663cf02e80b0dd770324de9bafd9) is really annoying for >>>>> people who *don't* use these fancy options: >>>> >>>> Yeah sorry, it wasn't quite ready to go in. >> >> Bamovar, >> >> Please give me heads up and ask me to not commit the patch, >> if you think it isn't ready. >> >>>> >>>>> $ make -C tools/testing/selftests/x86 ldt_gdt_32 >>>>> make: Entering directory '/home/luto/apps/linux/tools/testing/selftests/x86' >>>>> Makefile:44: warning: overriding recipe for target 'clean' >>>>> ../lib.mk:55: warning: ignoring old recipe for target 'clean' >>>>> make: *** No rule to make target 'ldt_gdt_32'. Stop. >>>>> make: Leaving directory '/home/luto/apps/linux/tools/testing/selftests/x86' >>>>> >>>>> Is there any way that you can make this work again? >>>> >>>> There obviously is *a* way, but I'm not sure there's a simple and >>>> obviously correct way that is an easy fix for 4.11. >>>> >>>> I see at least 18 Makefile's in tools/testing/selftests that use >>>> $(OUTPUT)/, which would all need to be updated at least to use $(OUTPUT) >>>> (no trailing slash), and then some other changes to not propagate OUTPUT >>>> when the user didn't specify it. But hopefully someone will prove me >>>> wrong. >>> I also look at this issue. Originally, I use OUTPUT without slash in my >>> patch. People argue that it is not very clear. So, I add slash in curent >>> version. >>>> >>>> As a (poor) alternative you can do: >>>> >>>> $ cd tools/testing/selftests/x86; make $PWD/ldt_gdt_32 >>>> >>>> or just: >>>> >>>> $ make -C tools/testing/selftests/x86 >>>> >>>> cheers >>> Do we really need "make -C tools/testing/selftests/x86 ldt_gdt_32"? >>> It is useful but it will skip the top level Makefile of selftests. >> >> Being able to build individual tests is an important use-case. Please >> see kselftest.txt under Documentation directory for all the use-cases >> and new patches shouldn't break these use-cases. > Understand. I am sorry I do not know this use case before. And I read > kselftest.txt again, I do not find this use case is mentioned. So, > I add a few lines in kselftest.txt to avoid break this use case in future. > Is there any other use cases I should test? Running an individual test as in the example below should be allowed. make -C tools/testing/selftests hotplug Also individual tests are often run from the test director. For example, cd tools/testing/selftests/x86; make thanks, -- Shuah >> >> Breaking these use-cases is a regression and we have to fix it > Here is a fix. I could build individual test case in x86 and build the whole > x86 test cases successful respectively. And I do a quick test for all the > subsets. Please review the patch if it is make sense to you and Michael. > At the same time, I am buildind and testing all the testcases. > > Michael: could you please do me a favor to test the powerpc part? Thanks. > > From 21b17710d23783c5148303e5628b52d281e6f62b Mon Sep 17 00:00:00 2001 > From: Bamvor Jian Zhang <bamvor.zhangjian-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org> > Date: Tue, 21 Mar 2017 22:38:01 +0800 > Subject: [PATCH] selftests: fix the broken individual test for x86 > > Andy Lutomirski report that build individual testcase in x86 is broken: > > $ make -C tools/testing/selftests/x86 ldt_gdt_32 > make: Entering directory '/home/luto/apps/linux/tools/testing/selftests/x86' > Makefile:44: warning: overriding recipe for target 'clean' > ../lib.mk:55: warning: ignoring old recipe for target 'clean' > make: *** No rule to make target 'ldt_gdt_32'. Stop. > make: Leaving directory '/home/luto/apps/linux/tools/testing/selftests/x86' > > This patch fix this issue by removing the slash after OUTPUT. > And also mention this use case in Documentation/kselftests.txt > > Reported-by: Andy Lutomirski <luto-kltTT9wpgjJwATOyAt5JVQ@public.gmane.org> > Suggested-by: Michael Ellerman <mpe-Gsx/Oe8HsFggBc27wqDAHg@public.gmane.org> > Signed-off-by: Bamvor Jian Zhang <bamvor.zhangjian-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org> > --- > Documentation/kselftest.txt | 5 +++++ > tools/testing/selftests/Makefile | 16 ++++++++-------- > tools/testing/selftests/exec/Makefile | 10 +++++----- > tools/testing/selftests/ftrace/Makefile | 2 +- > tools/testing/selftests/futex/Makefile | 12 ++++++------ > tools/testing/selftests/kcmp/Makefile | 2 +- > tools/testing/selftests/lib.mk | 10 +++++----- > tools/testing/selftests/powerpc/Makefile | 18 +++++++++--------- > tools/testing/selftests/powerpc/benchmarks/Makefile | 6 +++--- > tools/testing/selftests/powerpc/copyloops/Makefile | 8 ++++---- > tools/testing/selftests/powerpc/dscr/Makefile | 2 +- > tools/testing/selftests/powerpc/math/Makefile | 16 ++++++++-------- > tools/testing/selftests/powerpc/mm/Makefile | 4 ++-- > tools/testing/selftests/powerpc/pmu/Makefile | 16 ++++++++-------- > tools/testing/selftests/powerpc/pmu/ebb/Makefile | 4 ++-- > tools/testing/selftests/powerpc/switch_endian/Makefile | 8 ++++---- > tools/testing/selftests/powerpc/tm/Makefile | 8 ++++---- > tools/testing/selftests/vm/Makefile | 8 ++++---- > tools/testing/selftests/x86/Makefile | 18 +++++++++--------- > 19 files changed, 89 insertions(+), 84 deletions(-) > > diff --git a/Documentation/kselftest.txt b/Documentation/kselftest.txt > index 5bd5903..6197e94 100644 > --- a/Documentation/kselftest.txt > +++ b/Documentation/kselftest.txt > @@ -42,6 +42,11 @@ You can specify multiple tests to build and run: > See the top-level tools/testing/selftests/Makefile for the list of all > possible targets. > > +Building individual test case of a subset > +========================================= > +You could build the individual test case in subset if subset supported: > + $ make -C tools/testing/selftests/x86 ldt_gdt_32 > + > > Running the full range hotplug selftests > ======================================== > diff --git a/tools/testing/selftests/Makefile b/tools/testing/selftests/Makefile > index e8b79a7..6cc93c1 100644 > --- a/tools/testing/selftests/Makefile > +++ b/tools/testing/selftests/Makefile > @@ -64,31 +64,31 @@ all: > for TARGET in $(TARGETS); do \ > BUILD_TARGET=$$BUILD/$$TARGET; \ > mkdir $$BUILD_TARGET -p; \ > - make OUTPUT=$$BUILD_TARGET -C $$TARGET;\ > + make OUTPUT=$$BUILD_TARGET/ -C $$TARGET;\ > done; > > run_tests: all > for TARGET in $(TARGETS); do \ > BUILD_TARGET=$$BUILD/$$TARGET; \ > - make OUTPUT=$$BUILD_TARGET -C $$TARGET run_tests;\ > + make OUTPUT=$$BUILD_TARGET/ -C $$TARGET run_tests;\ > done; > > hotplug: > for TARGET in $(TARGETS_HOTPLUG); do \ > BUILD_TARGET=$$BUILD/$$TARGET; \ > - make OUTPUT=$$BUILD_TARGET -C $$TARGET;\ > + make OUTPUT=$$BUILD_TARGET/ -C $$TARGET;\ > done; > > run_hotplug: hotplug > for TARGET in $(TARGETS_HOTPLUG); do \ > BUILD_TARGET=$$BUILD/$$TARGET; \ > - make OUTPUT=$$BUILD_TARGET -C $$TARGET run_full_test;\ > + make OUTPUT=$$BUILD_TARGET/ -C $$TARGET run_full_test;\ > done; > > clean_hotplug: > for TARGET in $(TARGETS_HOTPLUG); do \ > BUILD_TARGET=$$BUILD/$$TARGET; \ > - make OUTPUT=$$BUILD_TARGET -C $$TARGET clean;\ > + make OUTPUT=$$BUILD_TARGET/ -C $$TARGET clean;\ > done; > > run_pstore_crash: > @@ -104,7 +104,7 @@ ifdef INSTALL_PATH > mkdir -p $(INSTALL_PATH) > for TARGET in $(TARGETS); do \ > BUILD_TARGET=$$BUILD/$$TARGET; \ > - make OUTPUT=$$BUILD_TARGET -C $$TARGET > INSTALL_PATH=$(INSTALL_PATH)/$$TARGET install; \ > + make OUTPUT=$$BUILD_TARGET/ -C $$TARGET > INSTALL_PATH=$(INSTALL_PATH)/$$TARGET install; \ > done; > > @# Ask all targets to emit their test scripts > @@ -117,7 +117,7 @@ ifdef INSTALL_PATH > echo "echo ; echo Running tests in $$TARGET" >> $(ALL_SCRIPT); \ > echo "echo ========================================" >> $(ALL_SCRIPT); \ > echo "cd $$TARGET" >> $(ALL_SCRIPT); \ > - make -s --no-print-directory OUTPUT=$$BUILD_TARGET -C $$TARGET > emit_tests >> $(ALL_SCRIPT); \ > + make -s --no-print-directory OUTPUT=$$BUILD_TARGET/ -C $$TARGET > emit_tests >> $(ALL_SCRIPT); \ > echo "cd \$$ROOT" >> $(ALL_SCRIPT); \ > done; > > @@ -129,7 +129,7 @@ endif > clean: > for TARGET in $(TARGETS); do \ > BUILD_TARGET=$$BUILD/$$TARGET; \ > - make OUTPUT=$$BUILD_TARGET -C $$TARGET clean;\ > + make OUTPUT=$$BUILD_TARGET/ -C $$TARGET clean;\ > done; > > .PHONY: install > diff --git a/tools/testing/selftests/exec/Makefile > b/tools/testing/selftests/exec/Makefile > index 2e13035..2f3b200 100644 > --- a/tools/testing/selftests/exec/Makefile > +++ b/tools/testing/selftests/exec/Makefile > @@ -5,19 +5,19 @@ TEST_GEN_FILES := execveat.symlink > execveat.denatured script subdir > # Makefile is a run-time dependency, since it's accessed by the execveat test > TEST_FILES := Makefile > > -EXTRA_CLEAN := $(OUTPUT)/subdir.moved $(OUTPUT)/execveat.moved $(OUTPUT)/xxxxx* > +EXTRA_CLEAN := $(OUTPUT)subdir.moved $(OUTPUT)execveat.moved $(OUTPUT)xxxxx* > > include ../lib.mk > > -$(OUTPUT)/subdir: > +$(OUTPUT)subdir: > mkdir -p $@ > -$(OUTPUT)/script: > +$(OUTPUT)script: > echo '#!/bin/sh' > $@ > echo 'exit $$*' >> $@ > chmod +x $@ > -$(OUTPUT)/execveat.symlink: $(OUTPUT)/execveat > +$(OUTPUT)execveat.symlink: $(OUTPUT)execveat > cd $(OUTPUT) && ln -s -f $(shell basename $<) $(shell basename $@) > -$(OUTPUT)/execveat.denatured: $(OUTPUT)/execveat > +$(OUTPUT)execveat.denatured: $(OUTPUT)execveat > cp $< $@ > chmod -x $@ > > diff --git a/tools/testing/selftests/ftrace/Makefile > b/tools/testing/selftests/ftrace/Makefile > index a8a5e21..33bb29b 100644 > --- a/tools/testing/selftests/ftrace/Makefile > +++ b/tools/testing/selftests/ftrace/Makefile > @@ -2,6 +2,6 @@ all: > > TEST_PROGS := ftracetest > TEST_FILES := test.d > -EXTRA_CLEAN := $(OUTPUT)/logs/* > +EXTRA_CLEAN := $(OUTPUT)logs/* > > include ../lib.mk > diff --git a/tools/testing/selftests/futex/Makefile > b/tools/testing/selftests/futex/Makefile > index 653c5cd..11c6c49 100644 > --- a/tools/testing/selftests/futex/Makefile > +++ b/tools/testing/selftests/futex/Makefile > @@ -8,9 +8,9 @@ include ../lib.mk > > all: > for DIR in $(SUBDIRS); do \ > - BUILD_TARGET=$$OUTPUT/$$DIR; \ > + BUILD_TARGET=$$OUTPUT$$DIR; \ > mkdir $$BUILD_TARGET -p; \ > - make OUTPUT=$$BUILD_TARGET -C $$DIR $@;\ > + make OUTPUT=$$BUILD_TARGET/ -C $$DIR $@;\ > done > > override define RUN_TESTS > @@ -22,9 +22,9 @@ override define INSTALL_RULE > install -t $(INSTALL_PATH) $(TEST_PROGS) $(TEST_PROGS_EXTENDED) $(TEST_FILES) > > @for SUBDIR in $(SUBDIRS); do \ > - BUILD_TARGET=$$OUTPUT/$$SUBDIR; \ > + BUILD_TARGET=$$OUTPUT$$SUBDIR; \ > mkdir $$BUILD_TARGET -p; \ > - $(MAKE) OUTPUT=$$BUILD_TARGET -C $$SUBDIR > INSTALL_PATH=$(INSTALL_PATH)/$$SUBDIR install; \ > + $(MAKE) OUTPUT=$$BUILD_TARGET/ -C $$SUBDIR > INSTALL_PATH=$(INSTALL_PATH)/$$SUBDIR install; \ > done; > endef > > @@ -34,7 +34,7 @@ endef > > clean: > for DIR in $(SUBDIRS); do \ > - BUILD_TARGET=$$OUTPUT/$$DIR; \ > + BUILD_TARGET=$$OUTPUT$$DIR; \ > mkdir $$BUILD_TARGET -p; \ > - make OUTPUT=$$BUILD_TARGET -C $$DIR $@;\ > + make OUTPUT=$$BUILD_TARGET/ -C $$DIR $@;\ > done > diff --git a/tools/testing/selftests/kcmp/Makefile > b/tools/testing/selftests/kcmp/Makefile > index 47aa988..0fb599e 100644 > --- a/tools/testing/selftests/kcmp/Makefile > +++ b/tools/testing/selftests/kcmp/Makefile > @@ -2,7 +2,7 @@ CFLAGS += -I../../../../usr/include/ > > TEST_GEN_PROGS := kcmp_test > > -EXTRA_CLEAN := $(OUTPUT)/kcmp-test-file > +EXTRA_CLEAN := $(OUTPUT)kcmp-test-file > > include ../lib.mk > > diff --git a/tools/testing/selftests/lib.mk b/tools/testing/selftests/lib.mk > index ce96d80..716e920 100644 > --- a/tools/testing/selftests/lib.mk > +++ b/tools/testing/selftests/lib.mk > @@ -2,8 +2,8 @@ > # Makefile can operate with or without the kbuild infrastructure. > CC := $(CROSS_COMPILE)gcc > > -TEST_GEN_PROGS := $(patsubst %,$(OUTPUT)/%,$(TEST_GEN_PROGS)) > -TEST_GEN_FILES := $(patsubst %,$(OUTPUT)/%,$(TEST_GEN_FILES)) > +TEST_GEN_PROGS := $(patsubst %,$(OUTPUT)%,$(TEST_GEN_PROGS)) > +TEST_GEN_FILES := $(patsubst %,$(OUTPUT)%,$(TEST_GEN_FILES)) > > all: $(TEST_GEN_PROGS) $(TEST_GEN_PROGS_EXTENDED) $(TEST_GEN_FILES) > > @@ -50,13 +50,13 @@ emit_tests: > clean: > $(RM) -r $(TEST_GEN_PROGS) $(TEST_GEN_PROGS_EXTENDED) > $(TEST_GEN_FILES) $(EXTRA_CLEAN) > > -$(OUTPUT)/%:%.c > +$(OUTPUT)%:%.c > $(LINK.c) $^ $(LDLIBS) -o $@ > > -$(OUTPUT)/%.o:%.S > +$(OUTPUT)%.o:%.S > $(COMPILE.S) $^ -o $@ > > -$(OUTPUT)/%:%.S > +$(OUTPUT)%:%.S > $(LINK.S) $^ $(LDLIBS) -o $@ > > .PHONY: run_tests all clean install emit_tests > diff --git a/tools/testing/selftests/powerpc/Makefile > b/tools/testing/selftests/powerpc/Makefile > index 1c5d057..1a1a33c 100644 > --- a/tools/testing/selftests/powerpc/Makefile > +++ b/tools/testing/selftests/powerpc/Makefile > @@ -34,35 +34,35 @@ endif > all: $(SUB_DIRS) > > $(SUB_DIRS): > - BUILD_TARGET=$$OUTPUT/$@; mkdir -p $$BUILD_TARGET; $(MAKE) > OUTPUT=$$BUILD_TARGET -k -C $@ all > + BUILD_TARGET=$$OUTPUT$@; mkdir -p $$BUILD_TARGET; $(MAKE) > OUTPUT=$$BUILD_TARGET/ -k -C $@ all > > include ../lib.mk > > override define RUN_TESTS > @for TARGET in $(SUB_DIRS); do \ > - BUILD_TARGET=$$OUTPUT/$$TARGET; \ > - $(MAKE) OUTPUT=$$BUILD_TARGET -C $$TARGET run_tests;\ > + BUILD_TARGET=$$OUTPUT$$TARGET; \ > + $(MAKE) OUTPUT=$$BUILD_TARGET/ -C $$TARGET run_tests;\ > done; > endef > > override define INSTALL_RULE > @for TARGET in $(SUB_DIRS); do \ > - BUILD_TARGET=$$OUTPUT/$$TARGET; \ > - $(MAKE) OUTPUT=$$BUILD_TARGET -C $$TARGET install;\ > + BUILD_TARGET=$$OUTPUT$$TARGET; \ > + $(MAKE) OUTPUT=$$BUILD_TARGET/ -C $$TARGET install;\ > done; > endef > > override define EMIT_TESTS > @for TARGET in $(SUB_DIRS); do \ > - BUILD_TARGET=$$OUTPUT/$$TARGET; \ > - $(MAKE) OUTPUT=$$BUILD_TARGET -s -C $$TARGET emit_tests;\ > + BUILD_TARGET=$$OUTPUT$$TARGET; \ > + $(MAKE) OUTPUT=$$BUILD_TARGET/ -s -C $$TARGET emit_tests;\ > done; > endef > > clean: > @for TARGET in $(SUB_DIRS); do \ > - BUILD_TARGET=$$OUTPUT/$$TARGET; \ > - $(MAKE) OUTPUT=$$BUILD_TARGET -C $$TARGET clean; \ > + BUILD_TARGET=$$OUTPUT$$TARGET; \ > + $(MAKE) OUTPUT=$$BUILD_TARGET/ -C $$TARGET clean; \ > done; > rm -f tags > > diff --git a/tools/testing/selftests/powerpc/benchmarks/Makefile > b/tools/testing/selftests/powerpc/benchmarks/Makefile > index fb96a89..c720780 100644 > --- a/tools/testing/selftests/powerpc/benchmarks/Makefile > +++ b/tools/testing/selftests/powerpc/benchmarks/Makefile > @@ -6,6 +6,6 @@ include ../../lib.mk > > $(TEST_GEN_PROGS): ../harness.c > > -$(OUTPUT)/context_switch: ../utils.c > -$(OUTPUT)/context_switch: CFLAGS += -maltivec -mvsx -mabi=altivec > -$(OUTPUT)/context_switch: LDLIBS += -lpthread > +$(OUTPUT)context_switch: ../utils.c > +$(OUTPUT)context_switch: CFLAGS += -maltivec -mvsx -mabi=altivec > +$(OUTPUT)context_switch: LDLIBS += -lpthread > diff --git a/tools/testing/selftests/powerpc/copyloops/Makefile > b/tools/testing/selftests/powerpc/copyloops/Makefile > index 681ab19..60e195a 100644 > --- a/tools/testing/selftests/powerpc/copyloops/Makefile > +++ b/tools/testing/selftests/powerpc/copyloops/Makefile > @@ -12,9 +12,9 @@ EXTRA_SOURCES := validate.c ../harness.c > > include ../../lib.mk > > -$(OUTPUT)/copyuser_64: CPPFLAGS += -D > COPY_LOOP=test___copy_tofrom_user_base > -$(OUTPUT)/copyuser_power7: CPPFLAGS += -D > COPY_LOOP=test___copy_tofrom_user_power7 > -$(OUTPUT)/memcpy_64: CPPFLAGS += -D COPY_LOOP=test_memcpy > -$(OUTPUT)/memcpy_power7: CPPFLAGS += -D COPY_LOOP=test_memcpy_power7 > +$(OUTPUT)copyuser_64: CPPFLAGS += -D COPY_LOOP=test___copy_tofrom_user_base > +$(OUTPUT)copyuser_power7: CPPFLAGS += -D > COPY_LOOP=test___copy_tofrom_user_power7 > +$(OUTPUT)memcpy_64: CPPFLAGS += -D COPY_LOOP=test_memcpy > +$(OUTPUT)memcpy_power7: CPPFLAGS += -D COPY_LOOP=test_memcpy_power7 > > $(TEST_GEN_PROGS): $(EXTRA_SOURCES) > diff --git a/tools/testing/selftests/powerpc/dscr/Makefile > b/tools/testing/selftests/powerpc/dscr/Makefile > index c5639de..378f825 100644 > --- a/tools/testing/selftests/powerpc/dscr/Makefile > +++ b/tools/testing/selftests/powerpc/dscr/Makefile > @@ -4,6 +4,6 @@ TEST_GEN_PROGS := dscr_default_test dscr_explicit_test > dscr_user_test \ > > include ../../lib.mk > > -$(OUTPUT)/dscr_default_test: LDLIBS += -lpthread > +$(OUTPUT)dscr_default_test: LDLIBS += -lpthread > > $(TEST_GEN_PROGS): ../harness.c > diff --git a/tools/testing/selftests/powerpc/math/Makefile > b/tools/testing/selftests/powerpc/math/Makefile > index fa8bae9..73d6f52 100644 > --- a/tools/testing/selftests/powerpc/math/Makefile > +++ b/tools/testing/selftests/powerpc/math/Makefile > @@ -5,13 +5,13 @@ include ../../lib.mk > $(TEST_GEN_PROGS): ../harness.c > $(TEST_GEN_PROGS): CFLAGS += -O2 -g -pthread -m64 -maltivec > > -$(OUTPUT)/fpu_syscall: fpu_asm.S > -$(OUTPUT)/fpu_preempt: fpu_asm.S > -$(OUTPUT)/fpu_signal: fpu_asm.S > +$(OUTPUT)fpu_syscall: fpu_asm.S > +$(OUTPUT)fpu_preempt: fpu_asm.S > +$(OUTPUT)fpu_signal: fpu_asm.S > > -$(OUTPUT)/vmx_syscall: vmx_asm.S > -$(OUTPUT)/vmx_preempt: vmx_asm.S > -$(OUTPUT)/vmx_signal: vmx_asm.S > +$(OUTPUT)vmx_syscall: vmx_asm.S > +$(OUTPUT)vmx_preempt: vmx_asm.S > +$(OUTPUT)vmx_signal: vmx_asm.S > > -$(OUTPUT)/vsx_preempt: CFLAGS += -mvsx > -$(OUTPUT)/vsx_preempt: vsx_asm.S > +$(OUTPUT)vsx_preempt: CFLAGS += -mvsx > +$(OUTPUT)vsx_preempt: vsx_asm.S > diff --git a/tools/testing/selftests/powerpc/mm/Makefile > b/tools/testing/selftests/powerpc/mm/Makefile > index 1cffe54..d4d2e68 100644 > --- a/tools/testing/selftests/powerpc/mm/Makefile > +++ b/tools/testing/selftests/powerpc/mm/Makefile > @@ -8,8 +8,8 @@ include ../../lib.mk > > $(TEST_GEN_PROGS): ../harness.c > > -$(OUTPUT)/prot_sao: ../utils.c > +$(OUTPUT)prot_sao: ../utils.c > > -$(OUTPUT)/tempfile: > +$(OUTPUT)tempfile: > dd if=/dev/zero of=$@ bs=64k count=1 > > diff --git a/tools/testing/selftests/powerpc/pmu/Makefile > b/tools/testing/selftests/powerpc/pmu/Makefile > index e4e55d1..17a9be7 100644 > --- a/tools/testing/selftests/powerpc/pmu/Makefile > +++ b/tools/testing/selftests/powerpc/pmu/Makefile > @@ -11,34 +11,34 @@ all: $(TEST_GEN_PROGS) ebb > $(TEST_GEN_PROGS): $(EXTRA_SOURCES) > > # loop.S can only be built 64-bit > -$(OUTPUT)/count_instructions: loop.S count_instructions.c $(EXTRA_SOURCES) > +$(OUTPUT)count_instructions: loop.S count_instructions.c $(EXTRA_SOURCES) > $(CC) $(CFLAGS) -m64 -o $@ $^ > > -$(OUTPUT)/per_event_excludes: ../utils.c > +$(OUTPUT)per_event_excludes: ../utils.c > > DEFAULT_RUN_TESTS := $(RUN_TESTS) > override define RUN_TESTS > $(DEFAULT_RUN_TESTS) > - TARGET=ebb; BUILD_TARGET=$$OUTPUT/$$TARGET; $(MAKE) > OUTPUT=$$BUILD_TARGET -C $$TARGET run_tests > + TARGET=ebb; BUILD_TARGET=$$OUTPUT$$TARGET; $(MAKE) > OUTPUT=$$BUILD_TARGET/ -C $$TARGET run_tests > endef > > DEFAULT_EMIT_TESTS := $(EMIT_TESTS) > override define EMIT_TESTS > $(DEFAULT_EMIT_TESTS) > - TARGET=ebb; BUILD_TARGET=$$OUTPUT/$$TARGET; $(MAKE) > OUTPUT=$$BUILD_TARGET -s -C $$TARGET emit_tests > + TARGET=ebb; BUILD_TARGET=$$OUTPUT$$TARGET; $(MAKE) > OUTPUT=$$BUILD_TARGET/ -s -C $$TARGET emit_tests > endef > > DEFAULT_INSTALL_RULE := $(INSTALL_RULE) > override define INSTALL_RULE > $(DEFAULT_INSTALL_RULE) > - TARGET=ebb; BUILD_TARGET=$$OUTPUT/$$TARGET; $(MAKE) > OUTPUT=$$BUILD_TARGET -C $$TARGET install > + TARGET=ebb; BUILD_TARGET=$$OUTPUT$$TARGET; $(MAKE) > OUTPUT=$$BUILD_TARGET/ -C $$TARGET install > endef > > clean: > - $(RM) $(TEST_GEN_PROGS) $(OUTPUT)/loop.o > - TARGET=ebb; BUILD_TARGET=$$OUTPUT/$$TARGET; $(MAKE) > OUTPUT=$$BUILD_TARGET -C $$TARGET clean > + $(RM) $(TEST_GEN_PROGS) $(OUTPUT)loop.o > + TARGET=ebb; BUILD_TARGET=$$OUTPUT$$TARGET; $(MAKE) > OUTPUT=$$BUILD_TARGET/ -C $$TARGET clean > > ebb: > - TARGET=$@; BUILD_TARGET=$$OUTPUT/$$TARGET; mkdir -p $$BUILD_TARGET; > $(MAKE) OUTPUT=$$BUILD_TARGET -k -C $$TARGET all > + TARGET=$@; BUILD_TARGET=$$OUTPUT$$TARGET; mkdir -p $$BUILD_TARGET; > $(MAKE) OUTPUT=$$BUILD_TARGET/ -k -C $$TARGET all > > .PHONY: all run_tests clean ebb > diff --git a/tools/testing/selftests/powerpc/pmu/ebb/Makefile > b/tools/testing/selftests/powerpc/pmu/ebb/Makefile > index 6001fb0..1512260 100644 > --- a/tools/testing/selftests/powerpc/pmu/ebb/Makefile > +++ b/tools/testing/selftests/powerpc/pmu/ebb/Makefile > @@ -21,6 +21,6 @@ include ../../../lib.mk > $(TEST_GEN_PROGS): ../../harness.c ../../utils.c ../event.c ../lib.c \ > ebb.c ebb_handler.S trace.c busy_loop.S > > -$(OUTPUT)/instruction_count_test: ../loop.S > +$(OUTPUT)instruction_count_test: ../loop.S > > -$(OUTPUT)/lost_exception_test: ../lib.c > +$(OUTPUT)lost_exception_test: ../lib.c > diff --git a/tools/testing/selftests/powerpc/switch_endian/Makefile > b/tools/testing/selftests/powerpc/switch_endian/Makefile > index b92c2a1..4d0bbf7 100644 > --- a/tools/testing/selftests/powerpc/switch_endian/Makefile > +++ b/tools/testing/selftests/powerpc/switch_endian/Makefile > @@ -2,14 +2,14 @@ TEST_GEN_PROGS := switch_endian_test > > ASFLAGS += -O2 -Wall -g -nostdlib -m64 > > -EXTRA_CLEAN = $(OUTPUT)/*.o $(OUTPUT)/check-reversed.S > +EXTRA_CLEAN = $(OUTPUT)*.o $(OUTPUT)check-reversed.S > > include ../../lib.mk > > -$(OUTPUT)/switch_endian_test: $(OUTPUT)/check-reversed.S > +$(OUTPUT)switch_endian_test: $(OUTPUT)check-reversed.S > > -$(OUTPUT)/check-reversed.o: $(OUTPUT)/check.o > +$(OUTPUT)check-reversed.o: $(OUTPUT)check.o > $(CROSS_COMPILE)objcopy -j .text --reverse-bytes=4 -O binary $< $@ > > -$(OUTPUT)/check-reversed.S: $(OUTPUT)/check-reversed.o > +$(OUTPUT)check-reversed.S: $(OUTPUT)check-reversed.o > hexdump -v -e '/1 ".byte 0x%02X\n"' $< > $@ > diff --git a/tools/testing/selftests/powerpc/tm/Makefile > b/tools/testing/selftests/powerpc/tm/Makefile > index 5576ee6..9c76e25 100644 > --- a/tools/testing/selftests/powerpc/tm/Makefile > +++ b/tools/testing/selftests/powerpc/tm/Makefile > @@ -10,10 +10,10 @@ $(TEST_GEN_PROGS): ../harness.c ../utils.c > > CFLAGS += -mhtm > > -$(OUTPUT)/tm-syscall: tm-syscall-asm.S > -$(OUTPUT)/tm-syscall: CFLAGS += -I../../../../../usr/include > -$(OUTPUT)/tm-tmspr: CFLAGS += -pthread > +$(OUTPUT)tm-syscall: tm-syscall-asm.S > +$(OUTPUT)tm-syscall: CFLAGS += -I../../../../../usr/include > +$(OUTPUT)tm-tmspr: CFLAGS += -pthread > > -SIGNAL_CONTEXT_CHK_TESTS := $(patsubst > %,$(OUTPUT)/%,$(SIGNAL_CONTEXT_CHK_TESTS)) > +SIGNAL_CONTEXT_CHK_TESTS := $(patsubst > %,$(OUTPUT)%,$(SIGNAL_CONTEXT_CHK_TESTS)) > $(SIGNAL_CONTEXT_CHK_TESTS): tm-signal.S > $(SIGNAL_CONTEXT_CHK_TESTS): CFLAGS += -mhtm -m64 -mvsx > diff --git a/tools/testing/selftests/vm/Makefile > b/tools/testing/selftests/vm/Makefile > index 222ee45..1e7c02c 100644 > --- a/tools/testing/selftests/vm/Makefile > +++ b/tools/testing/selftests/vm/Makefile > @@ -19,10 +19,10 @@ TEST_PROGS := run_vmtests > > include ../lib.mk > > -$(OUTPUT)/userfaultfd: LDLIBS += -lpthread > ../../../../usr/include/linux/kernel.h > -$(OUTPUT)/userfaultfd_hugetlb: LDLIBS += -lpthread > ../../../../usr/include/linux/kernel.h > -$(OUTPUT)/userfaultfd_shmem: LDLIBS += -lpthread > ../../../../usr/include/linux/kernel.h > -$(OUTPUT)/mlock-random-test: LDLIBS += -lcap > +$(OUTPUT)userfaultfd: LDLIBS += -lpthread > ../../../../usr/include/linux/kernel.h > +$(OUTPUT)userfaultfd_hugetlb: LDLIBS += -lpthread > ../../../../usr/include/linux/kernel.h > +$(OUTPUT)userfaultfd_shmem: LDLIBS += -lpthread > ../../../../usr/include/linux/kernel.h > +$(OUTPUT)mlock-random-test: LDLIBS += -lcap > > ../../../../usr/include/linux/kernel.h: > make -C ../../../.. headers_install > diff --git a/tools/testing/selftests/x86/Makefile > b/tools/testing/selftests/x86/Makefile > index 3a5ebae..42db9f4 100644 > --- a/tools/testing/selftests/x86/Makefile > +++ b/tools/testing/selftests/x86/Makefile > @@ -17,8 +17,8 @@ TARGETS_C_64BIT_ALL := $(TARGETS_C_BOTHBITS) > $(TARGETS_C_64BIT_ONLY) > BINARIES_32 := $(TARGETS_C_32BIT_ALL:%=%_32) > BINARIES_64 := $(TARGETS_C_64BIT_ALL:%=%_64) > > -BINARIES_32 := $(patsubst %,$(OUTPUT)/%,$(BINARIES_32)) > -BINARIES_64 := $(patsubst %,$(OUTPUT)/%,$(BINARIES_64)) > +BINARIES_32 := $(patsubst %,$(OUTPUT)%,$(BINARIES_32)) > +BINARIES_64 := $(patsubst %,$(OUTPUT)%,$(BINARIES_64)) > > CFLAGS := -O2 -g -std=gnu99 -pthread -Wall > > @@ -43,10 +43,10 @@ all_64: $(BINARIES_64) > clean: > $(RM) $(BINARIES_32) $(BINARIES_64) > > -$(BINARIES_32): $(OUTPUT)/%_32: %.c > +$(BINARIES_32): $(OUTPUT)%_32: %.c > $(CC) -m32 -o $@ $(CFLAGS) $(EXTRA_CFLAGS) $^ -lrt -ldl -lm > > -$(BINARIES_64): $(OUTPUT)/%_64: %.c > +$(BINARIES_64): $(OUTPUT)%_64: %.c > $(CC) -m64 -o $@ $(CFLAGS) $(EXTRA_CFLAGS) $^ -lrt -ldl > > # x86_64 users should be encouraged to install 32-bit libraries > @@ -68,12 +68,12 @@ warn_32bit_failure: > endif > > # Some tests have additional dependencies. > -$(OUTPUT)/sysret_ss_attrs_64: thunks.S > -$(OUTPUT)/ptrace_syscall_32: raw_syscall_helper_32.S > -$(OUTPUT)/test_syscall_vdso_32: thunks_32.S > +$(OUTPUT)sysret_ss_attrs_64: thunks.S > +$(OUTPUT)ptrace_syscall_32: raw_syscall_helper_32.S > +$(OUTPUT)test_syscall_vdso_32: thunks_32.S > > # check_initial_reg_state is special: it needs a custom entry, and it > # needs to be static so that its interpreter doesn't destroy its initial > # state. > -$(OUTPUT)/check_initial_reg_state_32: CFLAGS += -Wl,-ereal_start -static > -$(OUTPUT)/check_initial_reg_state_64: CFLAGS += -Wl,-ereal_start -static > +$(OUTPUT)check_initial_reg_state_32: CFLAGS += -Wl,-ereal_start -static > +$(OUTPUT)check_initial_reg_state_64: CFLAGS += -Wl,-ereal_start -static > ^ permalink raw reply [flat|nested] 21+ messages in thread
[parent not found: <4243a5e3-a971-387d-e492-262d76db4540-JPH+aEBZ4P+UEJcrhfAQsw@public.gmane.org>]
* Re: [PATCH v2 6/6] selftests: enable O and KBUILD_OUTPUT [not found] ` <4243a5e3-a971-387d-e492-262d76db4540-JPH+aEBZ4P+UEJcrhfAQsw@public.gmane.org> @ 2017-03-22 12:55 ` Bamvor Zhang Jian 0 siblings, 0 replies; 21+ messages in thread From: Bamvor Zhang Jian @ 2017-03-22 12:55 UTC (permalink / raw) To: Shuah Khan Cc: Michael Ellerman, Andy Lutomirski, Zhangjian (Bamvor), Linux API, linux-kernel-u79uwXL29TY76Z2rM5mHXA, Kevin Hilman, Mark Brown Hi, Shuah On 21 March 2017 at 19:02, Shuah Khan <shuahkh-JPH+aEBZ4P+UEJcrhfAQsw@public.gmane.org> wrote: > On 03/21/2017 10:09 AM, Bamvor Zhang Jian wrote: >> Hi, Shuah >> >> On 21 March 2017 at 21:54, Shuah Khan <shuahkh-JPH+aEBZ4P+UEJcrhfAQsw@public.gmane.org> wrote: >>> On 03/21/2017 03:00 AM, Bamvor Zhang Jian wrote: >>>> Hi, >>>> >>>> On 21 March 2017 at 16:35, Michael Ellerman <mpe-Gsx/Oe8HsFggBc27wqDAHg@public.gmane.org> wrote: >>>>> Andy Lutomirski <luto-kltTT9wpgjJwATOyAt5JVQ@public.gmane.org> writes: >>>>> >>>>>> On Tue, Nov 29, 2016 at 3:55 AM, <bamvor.zhangjian-hv44wF8Li93QT0dZR+AlfA@public.gmane.org> wrote: >>>>>>> From: Bamvor Jian Zhang <bamvor.zhangjian-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org> >>>>>>> >>>>>>> Enable O and KBUILD_OUTPUT for kselftest. User could compile kselftest >>>>>>> to another directory by passing O or KBUILD_OUTPUT. And O is high >>>>>>> priority than KBUILD_OUTPUT. >>>>>> >>>>>> Sorry for noticing this late, but this patch >>>>>> (a8ba798bc8ec663cf02e80b0dd770324de9bafd9) is really annoying for >>>>>> people who *don't* use these fancy options: >>>>> >>>>> Yeah sorry, it wasn't quite ready to go in. >>> >>> Bamovar, >>> >>> Please give me heads up and ask me to not commit the patch, >>> if you think it isn't ready. >>> >>>>> >>>>>> $ make -C tools/testing/selftests/x86 ldt_gdt_32 >>>>>> make: Entering directory '/home/luto/apps/linux/tools/testing/selftests/x86' >>>>>> Makefile:44: warning: overriding recipe for target 'clean' >>>>>> ../lib.mk:55: warning: ignoring old recipe for target 'clean' >>>>>> make: *** No rule to make target 'ldt_gdt_32'. Stop. >>>>>> make: Leaving directory '/home/luto/apps/linux/tools/testing/selftests/x86' >>>>>> >>>>>> Is there any way that you can make this work again? >>>>> >>>>> There obviously is *a* way, but I'm not sure there's a simple and >>>>> obviously correct way that is an easy fix for 4.11. >>>>> >>>>> I see at least 18 Makefile's in tools/testing/selftests that use >>>>> $(OUTPUT)/, which would all need to be updated at least to use $(OUTPUT) >>>>> (no trailing slash), and then some other changes to not propagate OUTPUT >>>>> when the user didn't specify it. But hopefully someone will prove me >>>>> wrong. >>>> I also look at this issue. Originally, I use OUTPUT without slash in my >>>> patch. People argue that it is not very clear. So, I add slash in curent >>>> version. >>>>> >>>>> As a (poor) alternative you can do: >>>>> >>>>> $ cd tools/testing/selftests/x86; make $PWD/ldt_gdt_32 >>>>> >>>>> or just: >>>>> >>>>> $ make -C tools/testing/selftests/x86 >>>>> >>>>> cheers >>>> Do we really need "make -C tools/testing/selftests/x86 ldt_gdt_32"? >>>> It is useful but it will skip the top level Makefile of selftests. >>> >>> Being able to build individual tests is an important use-case. Please >>> see kselftest.txt under Documentation directory for all the use-cases >>> and new patches shouldn't break these use-cases. >> Understand. I am sorry I do not know this use case before. And I read >> kselftest.txt again, I do not find this use case is mentioned. So, >> I add a few lines in kselftest.txt to avoid break this use case in future. >> Is there any other use cases I should test? > > Running an individual test as in the example below should be allowed. > make -C tools/testing/selftests hotplug Yes. This is what I test for the previous patches. I test all the subset of testcases, > > Also individual tests are often run from the test director. For example, > > cd tools/testing/selftests/x86; make This is what I am missing. I think we should also mention that do not break the things if user bypass the toplevel Makefile of kselftests. Glad to know all the senarios. I just send a new patch. Please take a look. Regards Bamvor > thanks, > -- Shuah > >>> >>> Breaking these use-cases is a regression and we have to fix it >> Here is a fix. I could build individual test case in x86 and build the whole >> x86 test cases successful respectively. And I do a quick test for all the >> subsets. Please review the patch if it is make sense to you and Michael. >> At the same time, I am buildind and testing all the testcases. >> >> Michael: could you please do me a favor to test the powerpc part? Thanks. >> >> From 21b17710d23783c5148303e5628b52d281e6f62b Mon Sep 17 00:00:00 2001 >> From: Bamvor Jian Zhang <bamvor.zhangjian-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org> >> Date: Tue, 21 Mar 2017 22:38:01 +0800 >> Subject: [PATCH] selftests: fix the broken individual test for x86 >> >> Andy Lutomirski report that build individual testcase in x86 is broken: >> >> $ make -C tools/testing/selftests/x86 ldt_gdt_32 >> make: Entering directory '/home/luto/apps/linux/tools/testing/selftests/x86' >> Makefile:44: warning: overriding recipe for target 'clean' >> ../lib.mk:55: warning: ignoring old recipe for target 'clean' >> make: *** No rule to make target 'ldt_gdt_32'. Stop. >> make: Leaving directory '/home/luto/apps/linux/tools/testing/selftests/x86' >> >> This patch fix this issue by removing the slash after OUTPUT. >> And also mention this use case in Documentation/kselftests.txt >> >> Reported-by: Andy Lutomirski <luto-kltTT9wpgjJwATOyAt5JVQ@public.gmane.org> >> Suggested-by: Michael Ellerman <mpe-Gsx/Oe8HsFggBc27wqDAHg@public.gmane.org> >> Signed-off-by: Bamvor Jian Zhang <bamvor.zhangjian-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org> >> --- >> Documentation/kselftest.txt | 5 +++++ >> tools/testing/selftests/Makefile | 16 ++++++++-------- >> tools/testing/selftests/exec/Makefile | 10 +++++----- >> tools/testing/selftests/ftrace/Makefile | 2 +- >> tools/testing/selftests/futex/Makefile | 12 ++++++------ >> tools/testing/selftests/kcmp/Makefile | 2 +- >> tools/testing/selftests/lib.mk | 10 +++++----- >> tools/testing/selftests/powerpc/Makefile | 18 +++++++++--------- >> tools/testing/selftests/powerpc/benchmarks/Makefile | 6 +++--- >> tools/testing/selftests/powerpc/copyloops/Makefile | 8 ++++---- >> tools/testing/selftests/powerpc/dscr/Makefile | 2 +- >> tools/testing/selftests/powerpc/math/Makefile | 16 ++++++++-------- >> tools/testing/selftests/powerpc/mm/Makefile | 4 ++-- >> tools/testing/selftests/powerpc/pmu/Makefile | 16 ++++++++-------- >> tools/testing/selftests/powerpc/pmu/ebb/Makefile | 4 ++-- >> tools/testing/selftests/powerpc/switch_endian/Makefile | 8 ++++---- >> tools/testing/selftests/powerpc/tm/Makefile | 8 ++++---- >> tools/testing/selftests/vm/Makefile | 8 ++++---- >> tools/testing/selftests/x86/Makefile | 18 +++++++++--------- >> 19 files changed, 89 insertions(+), 84 deletions(-) >> >> diff --git a/Documentation/kselftest.txt b/Documentation/kselftest.txt >> index 5bd5903..6197e94 100644 >> --- a/Documentation/kselftest.txt >> +++ b/Documentation/kselftest.txt >> @@ -42,6 +42,11 @@ You can specify multiple tests to build and run: >> See the top-level tools/testing/selftests/Makefile for the list of all >> possible targets. >> >> +Building individual test case of a subset >> +========================================= >> +You could build the individual test case in subset if subset supported: >> + $ make -C tools/testing/selftests/x86 ldt_gdt_32 >> + >> >> Running the full range hotplug selftests >> ======================================== >> diff --git a/tools/testing/selftests/Makefile b/tools/testing/selftests/Makefile >> index e8b79a7..6cc93c1 100644 >> --- a/tools/testing/selftests/Makefile >> +++ b/tools/testing/selftests/Makefile >> @@ -64,31 +64,31 @@ all: >> for TARGET in $(TARGETS); do \ >> BUILD_TARGET=$$BUILD/$$TARGET; \ >> mkdir $$BUILD_TARGET -p; \ >> - make OUTPUT=$$BUILD_TARGET -C $$TARGET;\ >> + make OUTPUT=$$BUILD_TARGET/ -C $$TARGET;\ >> done; >> >> run_tests: all >> for TARGET in $(TARGETS); do \ >> BUILD_TARGET=$$BUILD/$$TARGET; \ >> - make OUTPUT=$$BUILD_TARGET -C $$TARGET run_tests;\ >> + make OUTPUT=$$BUILD_TARGET/ -C $$TARGET run_tests;\ >> done; >> >> hotplug: >> for TARGET in $(TARGETS_HOTPLUG); do \ >> BUILD_TARGET=$$BUILD/$$TARGET; \ >> - make OUTPUT=$$BUILD_TARGET -C $$TARGET;\ >> + make OUTPUT=$$BUILD_TARGET/ -C $$TARGET;\ >> done; >> >> run_hotplug: hotplug >> for TARGET in $(TARGETS_HOTPLUG); do \ >> BUILD_TARGET=$$BUILD/$$TARGET; \ >> - make OUTPUT=$$BUILD_TARGET -C $$TARGET run_full_test;\ >> + make OUTPUT=$$BUILD_TARGET/ -C $$TARGET run_full_test;\ >> done; >> >> clean_hotplug: >> for TARGET in $(TARGETS_HOTPLUG); do \ >> BUILD_TARGET=$$BUILD/$$TARGET; \ >> - make OUTPUT=$$BUILD_TARGET -C $$TARGET clean;\ >> + make OUTPUT=$$BUILD_TARGET/ -C $$TARGET clean;\ >> done; >> >> run_pstore_crash: >> @@ -104,7 +104,7 @@ ifdef INSTALL_PATH >> mkdir -p $(INSTALL_PATH) >> for TARGET in $(TARGETS); do \ >> BUILD_TARGET=$$BUILD/$$TARGET; \ >> - make OUTPUT=$$BUILD_TARGET -C $$TARGET >> INSTALL_PATH=$(INSTALL_PATH)/$$TARGET install; \ >> + make OUTPUT=$$BUILD_TARGET/ -C $$TARGET >> INSTALL_PATH=$(INSTALL_PATH)/$$TARGET install; \ >> done; >> >> @# Ask all targets to emit their test scripts >> @@ -117,7 +117,7 @@ ifdef INSTALL_PATH >> echo "echo ; echo Running tests in $$TARGET" >> $(ALL_SCRIPT); \ >> echo "echo ========================================" >> $(ALL_SCRIPT); \ >> echo "cd $$TARGET" >> $(ALL_SCRIPT); \ >> - make -s --no-print-directory OUTPUT=$$BUILD_TARGET -C $$TARGET >> emit_tests >> $(ALL_SCRIPT); \ >> + make -s --no-print-directory OUTPUT=$$BUILD_TARGET/ -C $$TARGET >> emit_tests >> $(ALL_SCRIPT); \ >> echo "cd \$$ROOT" >> $(ALL_SCRIPT); \ >> done; >> >> @@ -129,7 +129,7 @@ endif >> clean: >> for TARGET in $(TARGETS); do \ >> BUILD_TARGET=$$BUILD/$$TARGET; \ >> - make OUTPUT=$$BUILD_TARGET -C $$TARGET clean;\ >> + make OUTPUT=$$BUILD_TARGET/ -C $$TARGET clean;\ >> done; >> >> .PHONY: install >> diff --git a/tools/testing/selftests/exec/Makefile >> b/tools/testing/selftests/exec/Makefile >> index 2e13035..2f3b200 100644 >> --- a/tools/testing/selftests/exec/Makefile >> +++ b/tools/testing/selftests/exec/Makefile >> @@ -5,19 +5,19 @@ TEST_GEN_FILES := execveat.symlink >> execveat.denatured script subdir >> # Makefile is a run-time dependency, since it's accessed by the execveat test >> TEST_FILES := Makefile >> >> -EXTRA_CLEAN := $(OUTPUT)/subdir.moved $(OUTPUT)/execveat.moved $(OUTPUT)/xxxxx* >> +EXTRA_CLEAN := $(OUTPUT)subdir.moved $(OUTPUT)execveat.moved $(OUTPUT)xxxxx* >> >> include ../lib.mk >> >> -$(OUTPUT)/subdir: >> +$(OUTPUT)subdir: >> mkdir -p $@ >> -$(OUTPUT)/script: >> +$(OUTPUT)script: >> echo '#!/bin/sh' > $@ >> echo 'exit $$*' >> $@ >> chmod +x $@ >> -$(OUTPUT)/execveat.symlink: $(OUTPUT)/execveat >> +$(OUTPUT)execveat.symlink: $(OUTPUT)execveat >> cd $(OUTPUT) && ln -s -f $(shell basename $<) $(shell basename $@) >> -$(OUTPUT)/execveat.denatured: $(OUTPUT)/execveat >> +$(OUTPUT)execveat.denatured: $(OUTPUT)execveat >> cp $< $@ >> chmod -x $@ >> >> diff --git a/tools/testing/selftests/ftrace/Makefile >> b/tools/testing/selftests/ftrace/Makefile >> index a8a5e21..33bb29b 100644 >> --- a/tools/testing/selftests/ftrace/Makefile >> +++ b/tools/testing/selftests/ftrace/Makefile >> @@ -2,6 +2,6 @@ all: >> >> TEST_PROGS := ftracetest >> TEST_FILES := test.d >> -EXTRA_CLEAN := $(OUTPUT)/logs/* >> +EXTRA_CLEAN := $(OUTPUT)logs/* >> >> include ../lib.mk >> diff --git a/tools/testing/selftests/futex/Makefile >> b/tools/testing/selftests/futex/Makefile >> index 653c5cd..11c6c49 100644 >> --- a/tools/testing/selftests/futex/Makefile >> +++ b/tools/testing/selftests/futex/Makefile >> @@ -8,9 +8,9 @@ include ../lib.mk >> >> all: >> for DIR in $(SUBDIRS); do \ >> - BUILD_TARGET=$$OUTPUT/$$DIR; \ >> + BUILD_TARGET=$$OUTPUT$$DIR; \ >> mkdir $$BUILD_TARGET -p; \ >> - make OUTPUT=$$BUILD_TARGET -C $$DIR $@;\ >> + make OUTPUT=$$BUILD_TARGET/ -C $$DIR $@;\ >> done >> >> override define RUN_TESTS >> @@ -22,9 +22,9 @@ override define INSTALL_RULE >> install -t $(INSTALL_PATH) $(TEST_PROGS) $(TEST_PROGS_EXTENDED) $(TEST_FILES) >> >> @for SUBDIR in $(SUBDIRS); do \ >> - BUILD_TARGET=$$OUTPUT/$$SUBDIR; \ >> + BUILD_TARGET=$$OUTPUT$$SUBDIR; \ >> mkdir $$BUILD_TARGET -p; \ >> - $(MAKE) OUTPUT=$$BUILD_TARGET -C $$SUBDIR >> INSTALL_PATH=$(INSTALL_PATH)/$$SUBDIR install; \ >> + $(MAKE) OUTPUT=$$BUILD_TARGET/ -C $$SUBDIR >> INSTALL_PATH=$(INSTALL_PATH)/$$SUBDIR install; \ >> done; >> endef >> >> @@ -34,7 +34,7 @@ endef >> >> clean: >> for DIR in $(SUBDIRS); do \ >> - BUILD_TARGET=$$OUTPUT/$$DIR; \ >> + BUILD_TARGET=$$OUTPUT$$DIR; \ >> mkdir $$BUILD_TARGET -p; \ >> - make OUTPUT=$$BUILD_TARGET -C $$DIR $@;\ >> + make OUTPUT=$$BUILD_TARGET/ -C $$DIR $@;\ >> done >> diff --git a/tools/testing/selftests/kcmp/Makefile >> b/tools/testing/selftests/kcmp/Makefile >> index 47aa988..0fb599e 100644 >> --- a/tools/testing/selftests/kcmp/Makefile >> +++ b/tools/testing/selftests/kcmp/Makefile >> @@ -2,7 +2,7 @@ CFLAGS += -I../../../../usr/include/ >> >> TEST_GEN_PROGS := kcmp_test >> >> -EXTRA_CLEAN := $(OUTPUT)/kcmp-test-file >> +EXTRA_CLEAN := $(OUTPUT)kcmp-test-file >> >> include ../lib.mk >> >> diff --git a/tools/testing/selftests/lib.mk b/tools/testing/selftests/lib.mk >> index ce96d80..716e920 100644 >> --- a/tools/testing/selftests/lib.mk >> +++ b/tools/testing/selftests/lib.mk >> @@ -2,8 +2,8 @@ >> # Makefile can operate with or without the kbuild infrastructure. >> CC := $(CROSS_COMPILE)gcc >> >> -TEST_GEN_PROGS := $(patsubst %,$(OUTPUT)/%,$(TEST_GEN_PROGS)) >> -TEST_GEN_FILES := $(patsubst %,$(OUTPUT)/%,$(TEST_GEN_FILES)) >> +TEST_GEN_PROGS := $(patsubst %,$(OUTPUT)%,$(TEST_GEN_PROGS)) >> +TEST_GEN_FILES := $(patsubst %,$(OUTPUT)%,$(TEST_GEN_FILES)) >> >> all: $(TEST_GEN_PROGS) $(TEST_GEN_PROGS_EXTENDED) $(TEST_GEN_FILES) >> >> @@ -50,13 +50,13 @@ emit_tests: >> clean: >> $(RM) -r $(TEST_GEN_PROGS) $(TEST_GEN_PROGS_EXTENDED) >> $(TEST_GEN_FILES) $(EXTRA_CLEAN) >> >> -$(OUTPUT)/%:%.c >> +$(OUTPUT)%:%.c >> $(LINK.c) $^ $(LDLIBS) -o $@ >> >> -$(OUTPUT)/%.o:%.S >> +$(OUTPUT)%.o:%.S >> $(COMPILE.S) $^ -o $@ >> >> -$(OUTPUT)/%:%.S >> +$(OUTPUT)%:%.S >> $(LINK.S) $^ $(LDLIBS) -o $@ >> >> .PHONY: run_tests all clean install emit_tests >> diff --git a/tools/testing/selftests/powerpc/Makefile >> b/tools/testing/selftests/powerpc/Makefile >> index 1c5d057..1a1a33c 100644 >> --- a/tools/testing/selftests/powerpc/Makefile >> +++ b/tools/testing/selftests/powerpc/Makefile >> @@ -34,35 +34,35 @@ endif >> all: $(SUB_DIRS) >> >> $(SUB_DIRS): >> - BUILD_TARGET=$$OUTPUT/$@; mkdir -p $$BUILD_TARGET; $(MAKE) >> OUTPUT=$$BUILD_TARGET -k -C $@ all >> + BUILD_TARGET=$$OUTPUT$@; mkdir -p $$BUILD_TARGET; $(MAKE) >> OUTPUT=$$BUILD_TARGET/ -k -C $@ all >> >> include ../lib.mk >> >> override define RUN_TESTS >> @for TARGET in $(SUB_DIRS); do \ >> - BUILD_TARGET=$$OUTPUT/$$TARGET; \ >> - $(MAKE) OUTPUT=$$BUILD_TARGET -C $$TARGET run_tests;\ >> + BUILD_TARGET=$$OUTPUT$$TARGET; \ >> + $(MAKE) OUTPUT=$$BUILD_TARGET/ -C $$TARGET run_tests;\ >> done; >> endef >> >> override define INSTALL_RULE >> @for TARGET in $(SUB_DIRS); do \ >> - BUILD_TARGET=$$OUTPUT/$$TARGET; \ >> - $(MAKE) OUTPUT=$$BUILD_TARGET -C $$TARGET install;\ >> + BUILD_TARGET=$$OUTPUT$$TARGET; \ >> + $(MAKE) OUTPUT=$$BUILD_TARGET/ -C $$TARGET install;\ >> done; >> endef >> >> override define EMIT_TESTS >> @for TARGET in $(SUB_DIRS); do \ >> - BUILD_TARGET=$$OUTPUT/$$TARGET; \ >> - $(MAKE) OUTPUT=$$BUILD_TARGET -s -C $$TARGET emit_tests;\ >> + BUILD_TARGET=$$OUTPUT$$TARGET; \ >> + $(MAKE) OUTPUT=$$BUILD_TARGET/ -s -C $$TARGET emit_tests;\ >> done; >> endef >> >> clean: >> @for TARGET in $(SUB_DIRS); do \ >> - BUILD_TARGET=$$OUTPUT/$$TARGET; \ >> - $(MAKE) OUTPUT=$$BUILD_TARGET -C $$TARGET clean; \ >> + BUILD_TARGET=$$OUTPUT$$TARGET; \ >> + $(MAKE) OUTPUT=$$BUILD_TARGET/ -C $$TARGET clean; \ >> done; >> rm -f tags >> >> diff --git a/tools/testing/selftests/powerpc/benchmarks/Makefile >> b/tools/testing/selftests/powerpc/benchmarks/Makefile >> index fb96a89..c720780 100644 >> --- a/tools/testing/selftests/powerpc/benchmarks/Makefile >> +++ b/tools/testing/selftests/powerpc/benchmarks/Makefile >> @@ -6,6 +6,6 @@ include ../../lib.mk >> >> $(TEST_GEN_PROGS): ../harness.c >> >> -$(OUTPUT)/context_switch: ../utils.c >> -$(OUTPUT)/context_switch: CFLAGS += -maltivec -mvsx -mabi=altivec >> -$(OUTPUT)/context_switch: LDLIBS += -lpthread >> +$(OUTPUT)context_switch: ../utils.c >> +$(OUTPUT)context_switch: CFLAGS += -maltivec -mvsx -mabi=altivec >> +$(OUTPUT)context_switch: LDLIBS += -lpthread >> diff --git a/tools/testing/selftests/powerpc/copyloops/Makefile >> b/tools/testing/selftests/powerpc/copyloops/Makefile >> index 681ab19..60e195a 100644 >> --- a/tools/testing/selftests/powerpc/copyloops/Makefile >> +++ b/tools/testing/selftests/powerpc/copyloops/Makefile >> @@ -12,9 +12,9 @@ EXTRA_SOURCES := validate.c ../harness.c >> >> include ../../lib.mk >> >> -$(OUTPUT)/copyuser_64: CPPFLAGS += -D >> COPY_LOOP=test___copy_tofrom_user_base >> -$(OUTPUT)/copyuser_power7: CPPFLAGS += -D >> COPY_LOOP=test___copy_tofrom_user_power7 >> -$(OUTPUT)/memcpy_64: CPPFLAGS += -D COPY_LOOP=test_memcpy >> -$(OUTPUT)/memcpy_power7: CPPFLAGS += -D COPY_LOOP=test_memcpy_power7 >> +$(OUTPUT)copyuser_64: CPPFLAGS += -D COPY_LOOP=test___copy_tofrom_user_base >> +$(OUTPUT)copyuser_power7: CPPFLAGS += -D >> COPY_LOOP=test___copy_tofrom_user_power7 >> +$(OUTPUT)memcpy_64: CPPFLAGS += -D COPY_LOOP=test_memcpy >> +$(OUTPUT)memcpy_power7: CPPFLAGS += -D COPY_LOOP=test_memcpy_power7 >> >> $(TEST_GEN_PROGS): $(EXTRA_SOURCES) >> diff --git a/tools/testing/selftests/powerpc/dscr/Makefile >> b/tools/testing/selftests/powerpc/dscr/Makefile >> index c5639de..378f825 100644 >> --- a/tools/testing/selftests/powerpc/dscr/Makefile >> +++ b/tools/testing/selftests/powerpc/dscr/Makefile >> @@ -4,6 +4,6 @@ TEST_GEN_PROGS := dscr_default_test dscr_explicit_test >> dscr_user_test \ >> >> include ../../lib.mk >> >> -$(OUTPUT)/dscr_default_test: LDLIBS += -lpthread >> +$(OUTPUT)dscr_default_test: LDLIBS += -lpthread >> >> $(TEST_GEN_PROGS): ../harness.c >> diff --git a/tools/testing/selftests/powerpc/math/Makefile >> b/tools/testing/selftests/powerpc/math/Makefile >> index fa8bae9..73d6f52 100644 >> --- a/tools/testing/selftests/powerpc/math/Makefile >> +++ b/tools/testing/selftests/powerpc/math/Makefile >> @@ -5,13 +5,13 @@ include ../../lib.mk >> $(TEST_GEN_PROGS): ../harness.c >> $(TEST_GEN_PROGS): CFLAGS += -O2 -g -pthread -m64 -maltivec >> >> -$(OUTPUT)/fpu_syscall: fpu_asm.S >> -$(OUTPUT)/fpu_preempt: fpu_asm.S >> -$(OUTPUT)/fpu_signal: fpu_asm.S >> +$(OUTPUT)fpu_syscall: fpu_asm.S >> +$(OUTPUT)fpu_preempt: fpu_asm.S >> +$(OUTPUT)fpu_signal: fpu_asm.S >> >> -$(OUTPUT)/vmx_syscall: vmx_asm.S >> -$(OUTPUT)/vmx_preempt: vmx_asm.S >> -$(OUTPUT)/vmx_signal: vmx_asm.S >> +$(OUTPUT)vmx_syscall: vmx_asm.S >> +$(OUTPUT)vmx_preempt: vmx_asm.S >> +$(OUTPUT)vmx_signal: vmx_asm.S >> >> -$(OUTPUT)/vsx_preempt: CFLAGS += -mvsx >> -$(OUTPUT)/vsx_preempt: vsx_asm.S >> +$(OUTPUT)vsx_preempt: CFLAGS += -mvsx >> +$(OUTPUT)vsx_preempt: vsx_asm.S >> diff --git a/tools/testing/selftests/powerpc/mm/Makefile >> b/tools/testing/selftests/powerpc/mm/Makefile >> index 1cffe54..d4d2e68 100644 >> --- a/tools/testing/selftests/powerpc/mm/Makefile >> +++ b/tools/testing/selftests/powerpc/mm/Makefile >> @@ -8,8 +8,8 @@ include ../../lib.mk >> >> $(TEST_GEN_PROGS): ../harness.c >> >> -$(OUTPUT)/prot_sao: ../utils.c >> +$(OUTPUT)prot_sao: ../utils.c >> >> -$(OUTPUT)/tempfile: >> +$(OUTPUT)tempfile: >> dd if=/dev/zero of=$@ bs=64k count=1 >> >> diff --git a/tools/testing/selftests/powerpc/pmu/Makefile >> b/tools/testing/selftests/powerpc/pmu/Makefile >> index e4e55d1..17a9be7 100644 >> --- a/tools/testing/selftests/powerpc/pmu/Makefile >> +++ b/tools/testing/selftests/powerpc/pmu/Makefile >> @@ -11,34 +11,34 @@ all: $(TEST_GEN_PROGS) ebb >> $(TEST_GEN_PROGS): $(EXTRA_SOURCES) >> >> # loop.S can only be built 64-bit >> -$(OUTPUT)/count_instructions: loop.S count_instructions.c $(EXTRA_SOURCES) >> +$(OUTPUT)count_instructions: loop.S count_instructions.c $(EXTRA_SOURCES) >> $(CC) $(CFLAGS) -m64 -o $@ $^ >> >> -$(OUTPUT)/per_event_excludes: ../utils.c >> +$(OUTPUT)per_event_excludes: ../utils.c >> >> DEFAULT_RUN_TESTS := $(RUN_TESTS) >> override define RUN_TESTS >> $(DEFAULT_RUN_TESTS) >> - TARGET=ebb; BUILD_TARGET=$$OUTPUT/$$TARGET; $(MAKE) >> OUTPUT=$$BUILD_TARGET -C $$TARGET run_tests >> + TARGET=ebb; BUILD_TARGET=$$OUTPUT$$TARGET; $(MAKE) >> OUTPUT=$$BUILD_TARGET/ -C $$TARGET run_tests >> endef >> >> DEFAULT_EMIT_TESTS := $(EMIT_TESTS) >> override define EMIT_TESTS >> $(DEFAULT_EMIT_TESTS) >> - TARGET=ebb; BUILD_TARGET=$$OUTPUT/$$TARGET; $(MAKE) >> OUTPUT=$$BUILD_TARGET -s -C $$TARGET emit_tests >> + TARGET=ebb; BUILD_TARGET=$$OUTPUT$$TARGET; $(MAKE) >> OUTPUT=$$BUILD_TARGET/ -s -C $$TARGET emit_tests >> endef >> >> DEFAULT_INSTALL_RULE := $(INSTALL_RULE) >> override define INSTALL_RULE >> $(DEFAULT_INSTALL_RULE) >> - TARGET=ebb; BUILD_TARGET=$$OUTPUT/$$TARGET; $(MAKE) >> OUTPUT=$$BUILD_TARGET -C $$TARGET install >> + TARGET=ebb; BUILD_TARGET=$$OUTPUT$$TARGET; $(MAKE) >> OUTPUT=$$BUILD_TARGET/ -C $$TARGET install >> endef >> >> clean: >> - $(RM) $(TEST_GEN_PROGS) $(OUTPUT)/loop.o >> - TARGET=ebb; BUILD_TARGET=$$OUTPUT/$$TARGET; $(MAKE) >> OUTPUT=$$BUILD_TARGET -C $$TARGET clean >> + $(RM) $(TEST_GEN_PROGS) $(OUTPUT)loop.o >> + TARGET=ebb; BUILD_TARGET=$$OUTPUT$$TARGET; $(MAKE) >> OUTPUT=$$BUILD_TARGET/ -C $$TARGET clean >> >> ebb: >> - TARGET=$@; BUILD_TARGET=$$OUTPUT/$$TARGET; mkdir -p $$BUILD_TARGET; >> $(MAKE) OUTPUT=$$BUILD_TARGET -k -C $$TARGET all >> + TARGET=$@; BUILD_TARGET=$$OUTPUT$$TARGET; mkdir -p $$BUILD_TARGET; >> $(MAKE) OUTPUT=$$BUILD_TARGET/ -k -C $$TARGET all >> >> .PHONY: all run_tests clean ebb >> diff --git a/tools/testing/selftests/powerpc/pmu/ebb/Makefile >> b/tools/testing/selftests/powerpc/pmu/ebb/Makefile >> index 6001fb0..1512260 100644 >> --- a/tools/testing/selftests/powerpc/pmu/ebb/Makefile >> +++ b/tools/testing/selftests/powerpc/pmu/ebb/Makefile >> @@ -21,6 +21,6 @@ include ../../../lib.mk >> $(TEST_GEN_PROGS): ../../harness.c ../../utils.c ../event.c ../lib.c \ >> ebb.c ebb_handler.S trace.c busy_loop.S >> >> -$(OUTPUT)/instruction_count_test: ../loop.S >> +$(OUTPUT)instruction_count_test: ../loop.S >> >> -$(OUTPUT)/lost_exception_test: ../lib.c >> +$(OUTPUT)lost_exception_test: ../lib.c >> diff --git a/tools/testing/selftests/powerpc/switch_endian/Makefile >> b/tools/testing/selftests/powerpc/switch_endian/Makefile >> index b92c2a1..4d0bbf7 100644 >> --- a/tools/testing/selftests/powerpc/switch_endian/Makefile >> +++ b/tools/testing/selftests/powerpc/switch_endian/Makefile >> @@ -2,14 +2,14 @@ TEST_GEN_PROGS := switch_endian_test >> >> ASFLAGS += -O2 -Wall -g -nostdlib -m64 >> >> -EXTRA_CLEAN = $(OUTPUT)/*.o $(OUTPUT)/check-reversed.S >> +EXTRA_CLEAN = $(OUTPUT)*.o $(OUTPUT)check-reversed.S >> >> include ../../lib.mk >> >> -$(OUTPUT)/switch_endian_test: $(OUTPUT)/check-reversed.S >> +$(OUTPUT)switch_endian_test: $(OUTPUT)check-reversed.S >> >> -$(OUTPUT)/check-reversed.o: $(OUTPUT)/check.o >> +$(OUTPUT)check-reversed.o: $(OUTPUT)check.o >> $(CROSS_COMPILE)objcopy -j .text --reverse-bytes=4 -O binary $< $@ >> >> -$(OUTPUT)/check-reversed.S: $(OUTPUT)/check-reversed.o >> +$(OUTPUT)check-reversed.S: $(OUTPUT)check-reversed.o >> hexdump -v -e '/1 ".byte 0x%02X\n"' $< > $@ >> diff --git a/tools/testing/selftests/powerpc/tm/Makefile >> b/tools/testing/selftests/powerpc/tm/Makefile >> index 5576ee6..9c76e25 100644 >> --- a/tools/testing/selftests/powerpc/tm/Makefile >> +++ b/tools/testing/selftests/powerpc/tm/Makefile >> @@ -10,10 +10,10 @@ $(TEST_GEN_PROGS): ../harness.c ../utils.c >> >> CFLAGS += -mhtm >> >> -$(OUTPUT)/tm-syscall: tm-syscall-asm.S >> -$(OUTPUT)/tm-syscall: CFLAGS += -I../../../../../usr/include >> -$(OUTPUT)/tm-tmspr: CFLAGS += -pthread >> +$(OUTPUT)tm-syscall: tm-syscall-asm.S >> +$(OUTPUT)tm-syscall: CFLAGS += -I../../../../../usr/include >> +$(OUTPUT)tm-tmspr: CFLAGS += -pthread >> >> -SIGNAL_CONTEXT_CHK_TESTS := $(patsubst >> %,$(OUTPUT)/%,$(SIGNAL_CONTEXT_CHK_TESTS)) >> +SIGNAL_CONTEXT_CHK_TESTS := $(patsubst >> %,$(OUTPUT)%,$(SIGNAL_CONTEXT_CHK_TESTS)) >> $(SIGNAL_CONTEXT_CHK_TESTS): tm-signal.S >> $(SIGNAL_CONTEXT_CHK_TESTS): CFLAGS += -mhtm -m64 -mvsx >> diff --git a/tools/testing/selftests/vm/Makefile >> b/tools/testing/selftests/vm/Makefile >> index 222ee45..1e7c02c 100644 >> --- a/tools/testing/selftests/vm/Makefile >> +++ b/tools/testing/selftests/vm/Makefile >> @@ -19,10 +19,10 @@ TEST_PROGS := run_vmtests >> >> include ../lib.mk >> >> -$(OUTPUT)/userfaultfd: LDLIBS += -lpthread >> ../../../../usr/include/linux/kernel.h >> -$(OUTPUT)/userfaultfd_hugetlb: LDLIBS += -lpthread >> ../../../../usr/include/linux/kernel.h >> -$(OUTPUT)/userfaultfd_shmem: LDLIBS += -lpthread >> ../../../../usr/include/linux/kernel.h >> -$(OUTPUT)/mlock-random-test: LDLIBS += -lcap >> +$(OUTPUT)userfaultfd: LDLIBS += -lpthread >> ../../../../usr/include/linux/kernel.h >> +$(OUTPUT)userfaultfd_hugetlb: LDLIBS += -lpthread >> ../../../../usr/include/linux/kernel.h >> +$(OUTPUT)userfaultfd_shmem: LDLIBS += -lpthread >> ../../../../usr/include/linux/kernel.h >> +$(OUTPUT)mlock-random-test: LDLIBS += -lcap >> >> ../../../../usr/include/linux/kernel.h: >> make -C ../../../.. headers_install >> diff --git a/tools/testing/selftests/x86/Makefile >> b/tools/testing/selftests/x86/Makefile >> index 3a5ebae..42db9f4 100644 >> --- a/tools/testing/selftests/x86/Makefile >> +++ b/tools/testing/selftests/x86/Makefile >> @@ -17,8 +17,8 @@ TARGETS_C_64BIT_ALL := $(TARGETS_C_BOTHBITS) >> $(TARGETS_C_64BIT_ONLY) >> BINARIES_32 := $(TARGETS_C_32BIT_ALL:%=%_32) >> BINARIES_64 := $(TARGETS_C_64BIT_ALL:%=%_64) >> >> -BINARIES_32 := $(patsubst %,$(OUTPUT)/%,$(BINARIES_32)) >> -BINARIES_64 := $(patsubst %,$(OUTPUT)/%,$(BINARIES_64)) >> +BINARIES_32 := $(patsubst %,$(OUTPUT)%,$(BINARIES_32)) >> +BINARIES_64 := $(patsubst %,$(OUTPUT)%,$(BINARIES_64)) >> >> CFLAGS := -O2 -g -std=gnu99 -pthread -Wall >> >> @@ -43,10 +43,10 @@ all_64: $(BINARIES_64) >> clean: >> $(RM) $(BINARIES_32) $(BINARIES_64) >> >> -$(BINARIES_32): $(OUTPUT)/%_32: %.c >> +$(BINARIES_32): $(OUTPUT)%_32: %.c >> $(CC) -m32 -o $@ $(CFLAGS) $(EXTRA_CFLAGS) $^ -lrt -ldl -lm >> >> -$(BINARIES_64): $(OUTPUT)/%_64: %.c >> +$(BINARIES_64): $(OUTPUT)%_64: %.c >> $(CC) -m64 -o $@ $(CFLAGS) $(EXTRA_CFLAGS) $^ -lrt -ldl >> >> # x86_64 users should be encouraged to install 32-bit libraries >> @@ -68,12 +68,12 @@ warn_32bit_failure: >> endif >> >> # Some tests have additional dependencies. >> -$(OUTPUT)/sysret_ss_attrs_64: thunks.S >> -$(OUTPUT)/ptrace_syscall_32: raw_syscall_helper_32.S >> -$(OUTPUT)/test_syscall_vdso_32: thunks_32.S >> +$(OUTPUT)sysret_ss_attrs_64: thunks.S >> +$(OUTPUT)ptrace_syscall_32: raw_syscall_helper_32.S >> +$(OUTPUT)test_syscall_vdso_32: thunks_32.S >> >> # check_initial_reg_state is special: it needs a custom entry, and it >> # needs to be static so that its interpreter doesn't destroy its initial >> # state. >> -$(OUTPUT)/check_initial_reg_state_32: CFLAGS += -Wl,-ereal_start -static >> -$(OUTPUT)/check_initial_reg_state_64: CFLAGS += -Wl,-ereal_start -static >> +$(OUTPUT)check_initial_reg_state_32: CFLAGS += -Wl,-ereal_start -static >> +$(OUTPUT)check_initial_reg_state_64: CFLAGS += -Wl,-ereal_start -static >> > ^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH v2 6/6] selftests: enable O and KBUILD_OUTPUT [not found] ` <CAFy1USRjGvF3iwWa8k54fFzcMaMcN3VCQ1qMpZ3RSqZvT17Atw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> 2017-03-21 18:02 ` Shuah Khan @ 2017-03-22 11:35 ` Michael Ellerman 1 sibling, 0 replies; 21+ messages in thread From: Michael Ellerman @ 2017-03-22 11:35 UTC (permalink / raw) To: Bamvor Zhang Jian, Shuah Khan Cc: Andy Lutomirski, Zhangjian (Bamvor), Linux API, linux-kernel@vger.kernel.org, Kevin Hilman, Mark Brown Bamvor Zhang Jian <bamvor.zhangjian-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org> writes: > Here is a fix. I could build individual test case in x86 and build the whole > x86 test cases successful respectively. And I do a quick test for all the > subsets. Please review the patch if it is make sense to you and Michael. > At the same time, I am buildind and testing all the testcases. > > Michael: could you please do me a favor to test the powerpc part? Thanks. I would but the patch is white spaced damaged, can you resend it? You can also test powerpc yourself, if you just install a cross compiler: Fedora $ sudo dnf install gcc-c++-powerpc64-linux-gnu binutils-powerpc64-linux-gnu gcc-powerpc64-linux-gnu Ubuntu $ sudo apt-get install gcc-powerpc64le-linux-gnu gcc-powerpc-linux-gnu libc-dev-powerpc-cross libc-dev-ppc64el-cross $ make ARCH=powerpc headers_install $ make ARCH=powerpc CROSS_COMPILE=powerpc64le-linux-gnu- -C tools/testing/selftests cheers ^ permalink raw reply [flat|nested] 21+ messages in thread
[parent not found: <5daf0b79-a000-2adb-0b1e-f528d66ff6df-JPH+aEBZ4P+UEJcrhfAQsw@public.gmane.org>]
* Re: [PATCH v2 6/6] selftests: enable O and KBUILD_OUTPUT [not found] ` <5daf0b79-a000-2adb-0b1e-f528d66ff6df-JPH+aEBZ4P+UEJcrhfAQsw@public.gmane.org> @ 2017-03-22 11:46 ` Michael Ellerman 0 siblings, 0 replies; 21+ messages in thread From: Michael Ellerman @ 2017-03-22 11:46 UTC (permalink / raw) To: Bamvor Zhang Jian Cc: Andy Lutomirski, Zhangjian (Bamvor), Linux API, linux-kernel@vger.kernel.org, Kevin Hilman, Mark Brown, Shuah Khan Shuah Khan <shuahkh-JPH+aEBZ4P+UEJcrhfAQsw@public.gmane.org> writes: > On 03/21/2017 03:00 AM, Bamvor Zhang Jian wrote: >> On 21 March 2017 at 16:35, Michael Ellerman <mpe-Gsx/Oe8HsFggBc27wqDAHg@public.gmane.org> wrote: >>> Andy Lutomirski <luto-kltTT9wpgjJwATOyAt5JVQ@public.gmane.org> writes: >>>> On Tue, Nov 29, 2016 at 3:55 AM, <bamvor.zhangjian-hv44wF8Li93QT0dZR+AlfA@public.gmane.org> wrote: >>>>> From: Bamvor Jian Zhang <bamvor.zhangjian-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org> >>>>> >>>>> Enable O and KBUILD_OUTPUT for kselftest. User could compile kselftest >>>>> to another directory by passing O or KBUILD_OUTPUT. And O is high >>>>> priority than KBUILD_OUTPUT. >>>> >>>> Sorry for noticing this late, but this patch >>>> (a8ba798bc8ec663cf02e80b0dd770324de9bafd9) is really annoying for >>>> people who *don't* use these fancy options: >>> >>> Yeah sorry, it wasn't quite ready to go in. > > Bamovar, > > Please give me heads up and ask me to not commit the patch, > if you think it isn't ready. That was me who wrote that above. >> Do we really need "make -C tools/testing/selftests/x86 ldt_gdt_32"? >> It is useful but it will skip the top level Makefile of selftests. > > Being able to build individual tests is an important use-case. Then it needs to be tested before changes are merged. cheers ^ permalink raw reply [flat|nested] 21+ messages in thread
[parent not found: <CAFy1USRoKJ7G9ewLGBa1yy9V5UA+g=jo7O+eU1wV_rjKDYtJWg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>]
* Re: [PATCH v2 6/6] selftests: enable O and KBUILD_OUTPUT [not found] ` <CAFy1USRoKJ7G9ewLGBa1yy9V5UA+g=jo7O+eU1wV_rjKDYtJWg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> @ 2017-03-22 11:38 ` Michael Ellerman [not found] ` <87d1d9czi4.fsf-W0DJWXSxmBNbyGPkN3NxC2scP1bn1w/D@public.gmane.org> 0 siblings, 1 reply; 21+ messages in thread From: Michael Ellerman @ 2017-03-22 11:38 UTC (permalink / raw) To: Bamvor Zhang Jian Cc: Andy Lutomirski, Zhangjian (Bamvor), Shuah Khan, Linux API, linux-kernel@vger.kernel.org, Kevin Hilman, Mark Brown Bamvor Zhang Jian <bamvor.zhangjian-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org> writes: > On 21 March 2017 at 16:35, Michael Ellerman <mpe-Gsx/Oe8HsFggBc27wqDAHg@public.gmane.org> wrote: >> I see at least 18 Makefile's in tools/testing/selftests that use >> $(OUTPUT)/, which would all need to be updated at least to use $(OUTPUT) >> (no trailing slash), and then some other changes to not propagate OUTPUT >> when the user didn't specify it. But hopefully someone will prove me >> wrong. > I also look at this issue. Originally, I use OUTPUT without slash in my > patch. People argue that it is not very clear. So, I add slash in curent > version. That was me, you can say so. I wasn't thinking at the time of OUTPUT being empty, but with hindsight obviously I should have. cheers ^ permalink raw reply [flat|nested] 21+ messages in thread
[parent not found: <87d1d9czi4.fsf-W0DJWXSxmBNbyGPkN3NxC2scP1bn1w/D@public.gmane.org>]
* Re: [PATCH v2 6/6] selftests: enable O and KBUILD_OUTPUT [not found] ` <87d1d9czi4.fsf-W0DJWXSxmBNbyGPkN3NxC2scP1bn1w/D@public.gmane.org> @ 2017-03-22 12:52 ` Bamvor Zhang Jian 0 siblings, 0 replies; 21+ messages in thread From: Bamvor Zhang Jian @ 2017-03-22 12:52 UTC (permalink / raw) To: Michael Ellerman Cc: Andy Lutomirski, Zhangjian (Bamvor), Shuah Khan, Linux API, linux-kernel-u79uwXL29TY76Z2rM5mHXA, Kevin Hilman, Mark Brown Hi, Michael, Shuah On 22 March 2017 at 12:38, Michael Ellerman <mpe-Gsx/Oe8HsFggBc27wqDAHg@public.gmane.org> wrote: > Bamvor Zhang Jian <bamvor.zhangjian-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org> writes: >> On 21 March 2017 at 16:35, Michael Ellerman <mpe-Gsx/Oe8HsFggBc27wqDAHg@public.gmane.org> wrote: >>> I see at least 18 Makefile's in tools/testing/selftests that use >>> $(OUTPUT)/, which would all need to be updated at least to use $(OUTPUT) >>> (no trailing slash), and then some other changes to not propagate OUTPUT >>> when the user didn't specify it. But hopefully someone will prove me >>> wrong. >> I also look at this issue. Originally, I use OUTPUT without slash in my >> patch. People argue that it is not very clear. So, I add slash in curent >> version. > > That was me, you can say so. > > I wasn't thinking at the time of OUTPUT being empty, but with hindsight > obviously I should have. After think about it. I find a way to keep OUTPUT with out slash. Could you please take a look? I have already test the x86 with the following method: make -C tools/testing/selftests TAREGTS=x86 make -C tools/testing/selftests/x86 make -C tools/testing/selftests/x86 xxx The build flag and dependency is correct. Build all the testcase succesful. I am running the test and try difference build method. Hope I could solve the regression soon. Regards Bamvor >From ae092145868def26665b588d718d1a7ab28b5c15 Mon Sep 17 00:00:00 2001 From: Bamvor Jian Zhang <bamvor.zhangjian-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org> Date: Wed, 22 Mar 2017 20:34:25 +0800 Subject: [PATCH] selftests: fix the broken individual test for x86 Andy Lutomirski report that build individual testcase in x86 is broken: $ make -C tools/testing/selftests/x86 ldt_gdt_32 make: Entering directory '/home/luto/apps/linux/tools/testing/selftests/x86' Makefile:44: warning: overriding recipe for target 'clean' ../lib.mk:55: warning: ignoring old recipe for target 'clean' make: *** No rule to make target 'ldt_gdt_32'. Stop. make: Leaving directory '/home/luto/apps/linux/tools/testing/selftests/x86' This patch fix this issue by adding default OUTPUT and convert target in Makefile of x86. And also mention this use case in Documentation/kselftests.txt Reported-by: Andy Lutomirski <luto-kltTT9wpgjJwATOyAt5JVQ@public.gmane.org> Signed-off-by: Bamvor Jian Zhang <bamvor.zhangjian-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org> --- Documentation/kselftest.txt | 6 ++++++ tools/testing/selftests/lib.mk | 2 +- tools/testing/selftests/x86/Makefile | 23 ++++++++++++++--------- 3 files changed, 21 insertions(+), 10 deletions(-) diff --git a/Documentation/kselftest.txt b/Documentation/kselftest.txt index 5bd5903..3dfca71 100644 --- a/Documentation/kselftest.txt +++ b/Documentation/kselftest.txt @@ -43,6 +43,12 @@ See the top-level tools/testing/selftests/Makefile for the list of all possible targets. +Building individual test case of a subset +========================================= +You could build the individual test case in subset if subset supported: + $ make -C tools/testing/selftests/x86 ldt_gdt_32 + + Running the full range hotplug selftests ======================================== diff --git a/tools/testing/selftests/lib.mk b/tools/testing/selftests/lib.mk index 069a1c9..df2fbfb 100644 --- a/tools/testing/selftests/lib.mk +++ b/tools/testing/selftests/lib.mk @@ -2,7 +2,7 @@ # Makefile can operate with or without the kbuild infrastructure. CC := $(CROSS_COMPILE)gcc -OUTPUT ?= $(shell pwd)/ +OUTPUT ?= $(shell pwd) TEST_GEN_PROGS := $(patsubst %,$(OUTPUT)/%,$(TEST_GEN_PROGS)) TEST_GEN_FILES := $(patsubst %,$(OUTPUT)/%,$(TEST_GEN_FILES)) diff --git a/tools/testing/selftests/x86/Makefile b/tools/testing/selftests/x86/Makefile index 3a5ebae..f8ea3bb 100644 --- a/tools/testing/selftests/x86/Makefile +++ b/tools/testing/selftests/x86/Makefile @@ -17,8 +17,8 @@ TARGETS_C_64BIT_ALL := $(TARGETS_C_BOTHBITS) $(TARGETS_C_64BIT_ONLY) BINARIES_32 := $(TARGETS_C_32BIT_ALL:%=%_32) BINARIES_64 := $(TARGETS_C_64BIT_ALL:%=%_64) -BINARIES_32 := $(patsubst %,$(OUTPUT)/%,$(BINARIES_32)) -BINARIES_64 := $(patsubst %,$(OUTPUT)/%,$(BINARIES_64)) +BINARIES_32_FULL_PATH := $(patsubst %,$(OUTPUT)/%,$(BINARIES_32)) +BINARIES_64_FULL_PATH := $(patsubst %,$(OUTPUT)/%,$(BINARIES_64)) CFLAGS := -O2 -g -std=gnu99 -pthread -Wall @@ -28,25 +28,29 @@ CAN_BUILD_X86_64 := $(shell ./check_cc.sh $(CC) trivial_64bit_program.c) ifeq ($(CAN_BUILD_I386),1) all: all_32 -TEST_PROGS += $(BINARIES_32) +TEST_PROGS += $(BINARIES_32_FULL_PATH) endif ifeq ($(CAN_BUILD_X86_64),1) all: all_64 -TEST_PROGS += $(BINARIES_64) +TEST_PROGS += $(BINARIES_64_FULL_PATH) endif -all_32: $(BINARIES_32) +all_32: $(BINARIES_32_FULL_PATH) -all_64: $(BINARIES_64) +all_64: $(BINARIES_64_FULL_PATH) clean: - $(RM) $(BINARIES_32) $(BINARIES_64) + $(RM) $(BINARIES_32_FULL_PATH) $(BINARIES_64_FULL_PATH) -$(BINARIES_32): $(OUTPUT)/%_32: %.c +$(BINARIES_32): %_32: $(OUTPUT)/%_32 + +$(BINARIES_64): %_64: $(OUTPUT)/%_64 + +$(BINARIES_32_FULL_PATH): $(OUTPUT)/%_32: %.c $(CC) -m32 -o $@ $(CFLAGS) $(EXTRA_CFLAGS) $^ -lrt -ldl -lm -$(BINARIES_64): $(OUTPUT)/%_64: %.c +$(BINARIES_64_FULL_PATH): $(OUTPUT)/%_64: %.c $(CC) -m64 -o $@ $(CFLAGS) $(EXTRA_CFLAGS) $^ -lrt -ldl # x86_64 users should be encouraged to install 32-bit libraries @@ -77,3 +81,4 @@ $(OUTPUT)/test_syscall_vdso_32: thunks_32.S # state. $(OUTPUT)/check_initial_reg_state_32: CFLAGS += -Wl,-ereal_start -static $(OUTPUT)/check_initial_reg_state_64: CFLAGS += -Wl,-ereal_start -static + -- 1.9.1 > cheers ^ permalink raw reply related [flat|nested] 21+ messages in thread
* Re: [PATCH v2 0/6] enable O and KBUILD_OUTPUT for kselftest [not found] ` <20161129115552.8148-1-bamvor.zhangjian-hv44wF8Li93QT0dZR+AlfA@public.gmane.org> ` (3 preceding siblings ...) 2016-11-29 11:55 ` [PATCH v2 6/6] selftests: enable O and KBUILD_OUTPUT bamvor.zhangjian-hv44wF8Li93QT0dZR+AlfA @ 2016-11-30 14:17 ` Shuah Khan [not found] ` <01b97008-3311-7b5b-4424-76bd3d560b40-JPH+aEBZ4P+UEJcrhfAQsw@public.gmane.org> 4 siblings, 1 reply; 21+ messages in thread From: Shuah Khan @ 2016-11-30 14:17 UTC (permalink / raw) To: bamvor.zhangjian-hv44wF8Li93QT0dZR+AlfA, mpe-Gsx/Oe8HsFggBc27wqDAHg, Shuah Khan Cc: linux-api-u79uwXL29TY76Z2rM5mHXA, linux-kernel-u79uwXL29TY76Z2rM5mHXA, khilman-DgEjT+Ai2ygdnm+yROfE0A, broonie-DgEjT+Ai2ygdnm+yROfE0A On 11/29/2016 04:55 AM, bamvor.zhangjian-hv44wF8Li93QT0dZR+AlfA@public.gmane.org wrote: > From: Bamvor Jian Zhang <bamvor.zhangjian-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org> > > Here is my second version for enabling the KBUILD_OUTPUT for kselftest. > The first version could be found here[1]. I fix and test all the TARGET > in tools/testing/selftest/Makefile. For ppc, I test through fake target. > > There are six patches in these series. And five of them clean up the > existing code. I split the clean up patches into five, hope it is easy > to review. > > selftests: remove duplicated all and clean target > selftests: remove useless TEST_DIRS > a selftests: add pattern rules > A selftests: remove CROSS_COMPILE in dedicated Makefile > A selftests: add EXTRA_CLEAN for clean target > selftests: enable O and KBUILD_OUTPUT > > Notes: > A: Ack by Michael. > a: ack by Michael. Minor update after rebase. Bamovar/Michael, Are these rebased to linux-next? Michael was concerned about conflicts with powerpc tree. Would rebasing to linux-next help avoiding conflicts? Still looking to get them into 4.10 if possible. thanks, -- Shuah > > In the first patch, I split the test files into two types: > TEST_GEN_XXX means such file is generated during compiling. TEST_XXX > means there is no need to compile before use. The main reason of this > is the enablement of KBUILD_OUTPUT only need to care about TEST_GEN_XXX. > I wanted to copy all the TEST_XXX with TEST_GEN_XXX, but I give up this > idea in the end. Because people may puzzle why copy the file before > installation. > > Because of the introducing of TEST_GEN_XXX, I update the top-level > Makefile and lib.mk selftests directory. After introduce TEST_GEN_XXX, I > could remove all the unnecessary all and clean targets. > > The second patch remove TEST_DIRS variable. And third patch add the > pattern for compiling the c sourc code. The fourth patch remove the > useless CROSS_COMPILE variable as it aleady exists in > "tools/testing/selftests/lib.mk". > > Further more, The fifth patch add the EXTRA_CLEAN variable to clean up > the duplicated clean target > > The last patch introduce the KBUILD_OUTPUT and O for kselftest instead > using the existing kbuild system because user may compile kselftest > directly (make -C tools/testing/selftests). > > Changes: > 1. remove the useless *.o target in the following file suggested by > Michael: > tools/testing/selftests/powerpc/benchmarks/Makefile > tools/testing/selftests/powerpc/copyloops/Makefile > tools/testing/selftests/powerpc/dscr/Makefile > tools/testing/selftests/powerpc/math/Makefile > tools/testing/selftests/powerpc/primitives/Makefile > tools/testing/selftests/powerpc/stringloops/Makefile > tools/testing/selftests/powerpc/syscalls/Makefile > tools/testing/selftests/powerpc/tm/Makefile > > 2. remove the useless "all" and "clean" target in bpf and nsfs which > are added after my previous patch. > > 3. Improve the commit message. > > [1] http://www.spinics.net/lists/linux-api/msg20789.html > > Bamvor Jian Zhang (6): > selftests: remove duplicated all and clean target > selftests: remove useless TEST_DIRS > selftests: add default rules for c source file > selftests: remove CROSS_COMPILE in dedicated Makefile > selftests: add EXTRA_CLEAN for clean target > selftests: enable O and KBUILD_OUTPUT > > Documentation/kselftest.txt | 12 +++++++ > tools/testing/selftests/Makefile | 36 ++++++++++++++----- > tools/testing/selftests/bpf/Makefile | 10 ++---- > tools/testing/selftests/breakpoints/Makefile | 10 ++---- > tools/testing/selftests/capabilities/Makefile | 11 ++---- > tools/testing/selftests/efivarfs/Makefile | 8 +---- > tools/testing/selftests/exec/Makefile | 32 ++++++++--------- > tools/testing/selftests/ftrace/Makefile | 6 ++-- > tools/testing/selftests/futex/Makefile | 21 ++++++++--- > tools/testing/selftests/futex/functional/Makefile | 12 ++----- > tools/testing/selftests/ipc/Makefile | 7 +--- > tools/testing/selftests/kcmp/Makefile | 6 ++-- > tools/testing/selftests/lib.mk | 36 +++++++++++++++---- > tools/testing/selftests/membarrier/Makefile | 6 +--- > tools/testing/selftests/memfd/Makefile | 15 ++------ > tools/testing/selftests/mount/Makefile | 7 +--- > tools/testing/selftests/mqueue/Makefile | 6 +--- > tools/testing/selftests/net/Makefile | 15 +++----- > tools/testing/selftests/nsfs/Makefile | 9 +---- > tools/testing/selftests/powerpc/Makefile | 15 ++++---- > tools/testing/selftests/powerpc/alignment/Makefile | 9 ++--- > .../testing/selftests/powerpc/benchmarks/Makefile | 15 +++----- > .../selftests/powerpc/context_switch/Makefile | 9 ++--- > tools/testing/selftests/powerpc/copyloops/Makefile | 19 ++++------ > tools/testing/selftests/powerpc/dscr/Makefile | 13 +++---- > tools/testing/selftests/powerpc/math/Makefile | 25 ++++++------- > tools/testing/selftests/powerpc/mm/Makefile | 18 ++++------ > tools/testing/selftests/powerpc/pmu/Makefile | 26 +++++++------- > tools/testing/selftests/powerpc/pmu/ebb/Makefile | 15 +++----- > .../testing/selftests/powerpc/primitives/Makefile | 9 ++--- > .../testing/selftests/powerpc/stringloops/Makefile | 9 ++--- > .../selftests/powerpc/switch_endian/Makefile | 17 ++++----- > tools/testing/selftests/powerpc/syscalls/Makefile | 9 ++--- > tools/testing/selftests/powerpc/tm/Makefile | 17 ++++----- > tools/testing/selftests/powerpc/vphn/Makefile | 10 ++---- > tools/testing/selftests/pstore/Makefile | 4 +-- > tools/testing/selftests/ptrace/Makefile | 8 +---- > tools/testing/selftests/seccomp/Makefile | 6 +--- > tools/testing/selftests/sigaltstack/Makefile | 5 +-- > tools/testing/selftests/size/Makefile | 10 ++---- > tools/testing/selftests/timers/Makefile | 10 ++---- > tools/testing/selftests/vm/Makefile | 41 +++++++++------------- > tools/testing/selftests/x86/Makefile | 17 +++++---- > tools/testing/selftests/zram/Makefile | 3 +- > 44 files changed, 247 insertions(+), 357 deletions(-) > ^ permalink raw reply [flat|nested] 21+ messages in thread
[parent not found: <01b97008-3311-7b5b-4424-76bd3d560b40-JPH+aEBZ4P+UEJcrhfAQsw@public.gmane.org>]
* Re: [PATCH v2 0/6] enable O and KBUILD_OUTPUT for kselftest [not found] ` <01b97008-3311-7b5b-4424-76bd3d560b40-JPH+aEBZ4P+UEJcrhfAQsw@public.gmane.org> @ 2016-11-30 15:32 ` Bamvor Zhang Jian [not found] ` <CAFy1USRENze0J3MZUddvyTdChNBzRUAQBx2pPEfbFFiitxwtsw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> 0 siblings, 1 reply; 21+ messages in thread From: Bamvor Zhang Jian @ 2016-11-30 15:32 UTC (permalink / raw) To: Shuah Khan Cc: Zhang Jian(Bamvor), Michael Ellerman, linux-api, lkml, Kevin Hilman, Mark Brown Hi, Shuah, Michael On 30 November 2016 at 22:17, Shuah Khan <shuahkh-JPH+aEBZ4P+UEJcrhfAQsw@public.gmane.org> wrote: > On 11/29/2016 04:55 AM, bamvor.zhangjian-hv44wF8Li93QT0dZR+AlfA@public.gmane.org wrote: >> From: Bamvor Jian Zhang <bamvor.zhangjian-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org> >> >> Here is my second version for enabling the KBUILD_OUTPUT for kselftest. >> The first version could be found here[1]. I fix and test all the TARGET >> in tools/testing/selftest/Makefile. For ppc, I test through fake target. >> >> There are six patches in these series. And five of them clean up the >> existing code. I split the clean up patches into five, hope it is easy >> to review. >> >> selftests: remove duplicated all and clean target >> selftests: remove useless TEST_DIRS >> a selftests: add pattern rules >> A selftests: remove CROSS_COMPILE in dedicated Makefile >> A selftests: add EXTRA_CLEAN for clean target >> selftests: enable O and KBUILD_OUTPUT >> >> Notes: >> A: Ack by Michael. >> a: ack by Michael. Minor update after rebase. > > Bamovar/Michael, > > Are these rebased to linux-next? Michael was concerned about > conflicts with powerpc tree. Would rebasing to linux-next help > avoiding conflicts? Yes. I rebase to latest linux-next. It is taged as 1128 when I rebase them yesterday. I fix some conflict when rebase. Regards Bamvor > > Still looking to get them into 4.10 if possible. > > thanks, > -- Shuah > >> >> In the first patch, I split the test files into two types: >> TEST_GEN_XXX means such file is generated during compiling. TEST_XXX >> means there is no need to compile before use. The main reason of this >> is the enablement of KBUILD_OUTPUT only need to care about TEST_GEN_XXX. >> I wanted to copy all the TEST_XXX with TEST_GEN_XXX, but I give up this >> idea in the end. Because people may puzzle why copy the file before >> installation. >> >> Because of the introducing of TEST_GEN_XXX, I update the top-level >> Makefile and lib.mk selftests directory. After introduce TEST_GEN_XXX, I >> could remove all the unnecessary all and clean targets. >> >> The second patch remove TEST_DIRS variable. And third patch add the >> pattern for compiling the c sourc code. The fourth patch remove the >> useless CROSS_COMPILE variable as it aleady exists in >> "tools/testing/selftests/lib.mk". >> >> Further more, The fifth patch add the EXTRA_CLEAN variable to clean up >> the duplicated clean target >> >> The last patch introduce the KBUILD_OUTPUT and O for kselftest instead >> using the existing kbuild system because user may compile kselftest >> directly (make -C tools/testing/selftests). >> >> Changes: >> 1. remove the useless *.o target in the following file suggested by >> Michael: >> tools/testing/selftests/powerpc/benchmarks/Makefile >> tools/testing/selftests/powerpc/copyloops/Makefile >> tools/testing/selftests/powerpc/dscr/Makefile >> tools/testing/selftests/powerpc/math/Makefile >> tools/testing/selftests/powerpc/primitives/Makefile >> tools/testing/selftests/powerpc/stringloops/Makefile >> tools/testing/selftests/powerpc/syscalls/Makefile >> tools/testing/selftests/powerpc/tm/Makefile >> >> 2. remove the useless "all" and "clean" target in bpf and nsfs which >> are added after my previous patch. >> >> 3. Improve the commit message. >> >> [1] http://www.spinics.net/lists/linux-api/msg20789.html >> >> Bamvor Jian Zhang (6): >> selftests: remove duplicated all and clean target >> selftests: remove useless TEST_DIRS >> selftests: add default rules for c source file >> selftests: remove CROSS_COMPILE in dedicated Makefile >> selftests: add EXTRA_CLEAN for clean target >> selftests: enable O and KBUILD_OUTPUT >> >> Documentation/kselftest.txt | 12 +++++++ >> tools/testing/selftests/Makefile | 36 ++++++++++++++----- >> tools/testing/selftests/bpf/Makefile | 10 ++---- >> tools/testing/selftests/breakpoints/Makefile | 10 ++---- >> tools/testing/selftests/capabilities/Makefile | 11 ++---- >> tools/testing/selftests/efivarfs/Makefile | 8 +---- >> tools/testing/selftests/exec/Makefile | 32 ++++++++--------- >> tools/testing/selftests/ftrace/Makefile | 6 ++-- >> tools/testing/selftests/futex/Makefile | 21 ++++++++--- >> tools/testing/selftests/futex/functional/Makefile | 12 ++----- >> tools/testing/selftests/ipc/Makefile | 7 +--- >> tools/testing/selftests/kcmp/Makefile | 6 ++-- >> tools/testing/selftests/lib.mk | 36 +++++++++++++++---- >> tools/testing/selftests/membarrier/Makefile | 6 +--- >> tools/testing/selftests/memfd/Makefile | 15 ++------ >> tools/testing/selftests/mount/Makefile | 7 +--- >> tools/testing/selftests/mqueue/Makefile | 6 +--- >> tools/testing/selftests/net/Makefile | 15 +++----- >> tools/testing/selftests/nsfs/Makefile | 9 +---- >> tools/testing/selftests/powerpc/Makefile | 15 ++++---- >> tools/testing/selftests/powerpc/alignment/Makefile | 9 ++--- >> .../testing/selftests/powerpc/benchmarks/Makefile | 15 +++----- >> .../selftests/powerpc/context_switch/Makefile | 9 ++--- >> tools/testing/selftests/powerpc/copyloops/Makefile | 19 ++++------ >> tools/testing/selftests/powerpc/dscr/Makefile | 13 +++---- >> tools/testing/selftests/powerpc/math/Makefile | 25 ++++++------- >> tools/testing/selftests/powerpc/mm/Makefile | 18 ++++------ >> tools/testing/selftests/powerpc/pmu/Makefile | 26 +++++++------- >> tools/testing/selftests/powerpc/pmu/ebb/Makefile | 15 +++----- >> .../testing/selftests/powerpc/primitives/Makefile | 9 ++--- >> .../testing/selftests/powerpc/stringloops/Makefile | 9 ++--- >> .../selftests/powerpc/switch_endian/Makefile | 17 ++++----- >> tools/testing/selftests/powerpc/syscalls/Makefile | 9 ++--- >> tools/testing/selftests/powerpc/tm/Makefile | 17 ++++----- >> tools/testing/selftests/powerpc/vphn/Makefile | 10 ++---- >> tools/testing/selftests/pstore/Makefile | 4 +-- >> tools/testing/selftests/ptrace/Makefile | 8 +---- >> tools/testing/selftests/seccomp/Makefile | 6 +--- >> tools/testing/selftests/sigaltstack/Makefile | 5 +-- >> tools/testing/selftests/size/Makefile | 10 ++---- >> tools/testing/selftests/timers/Makefile | 10 ++---- >> tools/testing/selftests/vm/Makefile | 41 +++++++++------------- >> tools/testing/selftests/x86/Makefile | 17 +++++---- >> tools/testing/selftests/zram/Makefile | 3 +- >> 44 files changed, 247 insertions(+), 357 deletions(-) >> > > -- > To unsubscribe from this list: send the line "unsubscribe linux-api" in > the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org > More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 21+ messages in thread
[parent not found: <CAFy1USRENze0J3MZUddvyTdChNBzRUAQBx2pPEfbFFiitxwtsw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>]
* Re: [PATCH v2 0/6] enable O and KBUILD_OUTPUT for kselftest [not found] ` <CAFy1USRENze0J3MZUddvyTdChNBzRUAQBx2pPEfbFFiitxwtsw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> @ 2016-12-01 19:35 ` Shuah Khan 0 siblings, 0 replies; 21+ messages in thread From: Shuah Khan @ 2016-12-01 19:35 UTC (permalink / raw) To: Bamvor Zhang Jian Cc: Zhang Jian(Bamvor), Michael Ellerman, linux-api, lkml, Kevin Hilman, Mark Brown, Shuah Khan On 11/30/2016 08:32 AM, Bamvor Zhang Jian wrote: > Hi, Shuah, Michael > > On 30 November 2016 at 22:17, Shuah Khan <shuahkh-JPH+aEBZ4P+UEJcrhfAQsw@public.gmane.org> wrote: >> On 11/29/2016 04:55 AM, bamvor.zhangjian-hv44wF8Li93QT0dZR+AlfA@public.gmane.org wrote: >>> From: Bamvor Jian Zhang <bamvor.zhangjian-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org> >>> >>> Here is my second version for enabling the KBUILD_OUTPUT for kselftest. >>> The first version could be found here[1]. I fix and test all the TARGET >>> in tools/testing/selftest/Makefile. For ppc, I test through fake target. >>> >>> There are six patches in these series. And five of them clean up the >>> existing code. I split the clean up patches into five, hope it is easy >>> to review. >>> >>> selftests: remove duplicated all and clean target >>> selftests: remove useless TEST_DIRS >>> a selftests: add pattern rules >>> A selftests: remove CROSS_COMPILE in dedicated Makefile >>> A selftests: add EXTRA_CLEAN for clean target >>> selftests: enable O and KBUILD_OUTPUT >>> >>> Notes: >>> A: Ack by Michael. >>> a: ack by Michael. Minor update after rebase. >> >> Bamovar/Michael, >> >> Are these rebased to linux-next? Michael was concerned about >> conflicts with powerpc tree. Would rebasing to linux-next help >> avoiding conflicts? > Yes. I rebase to latest linux-next. It is taged as 1128 when I rebase > them yesterday. I fix some conflict when rebase. > Hi Bemovar, These patches don't apply to linux-kselftest next and I can't apply them now. Looks like there are new tests that came through a netdev tree already in linux-next. It does happen when a new feature goes into a tree with the test. So for now we will have to wait on these and when 4.10-rc1 comes out, please rebase it on linux-kselftest latest. I will try to get these into 4.10-rc1 fixes thanks, -- Shuah ^ permalink raw reply [flat|nested] 21+ messages in thread
* [PATCH v2 4/6] selftests: remove CROSS_COMPILE in dedicated Makefile 2016-11-29 11:55 [PATCH v2 0/6] enable O and KBUILD_OUTPUT for kselftest bamvor.zhangjian 2016-11-29 11:55 ` [PATCH v2 1/6] selftests: remove duplicated all and clean target bamvor.zhangjian [not found] ` <20161129115552.8148-1-bamvor.zhangjian-hv44wF8Li93QT0dZR+AlfA@public.gmane.org> @ 2016-11-29 11:55 ` bamvor.zhangjian 2 siblings, 0 replies; 21+ messages in thread From: bamvor.zhangjian @ 2016-11-29 11:55 UTC (permalink / raw) To: shuahkh; +Cc: linux-api, linux-kernel, khilman, broonie, mpe From: Bamvor Jian Zhang <bamvor.zhangjian@linaro.org> After previous clean up patches, memfd and timers could get CROSS_COMPILE from tools/testing/selftest/lib.mk. There is no need to preserve these definition. So, this patch remove them. Acked-by: Michael Ellerman <mpe@ellerman.id.au> Signed-off-by: Bamvor Jian Zhang <bamvor.zhangjian@linaro.org> --- tools/testing/selftests/memfd/Makefile | 1 - tools/testing/selftests/timers/Makefile | 1 - 2 files changed, 2 deletions(-) diff --git a/tools/testing/selftests/memfd/Makefile b/tools/testing/selftests/memfd/Makefile index 2c87f23..79891d0 100644 --- a/tools/testing/selftests/memfd/Makefile +++ b/tools/testing/selftests/memfd/Makefile @@ -1,4 +1,3 @@ -CC = $(CROSS_COMPILE)gcc CFLAGS += -D_FILE_OFFSET_BITS=64 CFLAGS += -I../../../../include/uapi/ CFLAGS += -I../../../../include/ diff --git a/tools/testing/selftests/timers/Makefile b/tools/testing/selftests/timers/Makefile index 4a3bffe..b90e50c 100644 --- a/tools/testing/selftests/timers/Makefile +++ b/tools/testing/selftests/timers/Makefile @@ -1,4 +1,3 @@ -CC = $(CROSS_COMPILE)gcc BUILD_FLAGS = -DKTEST CFLAGS += -O3 -Wl,-no-as-needed -Wall $(BUILD_FLAGS) LDFLAGS += -lrt -lpthread -- 2.10.0 ^ permalink raw reply related [flat|nested] 21+ messages in thread
end of thread, other threads:[~2017-03-22 12:55 UTC | newest] Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2016-11-29 11:55 [PATCH v2 0/6] enable O and KBUILD_OUTPUT for kselftest bamvor.zhangjian 2016-11-29 11:55 ` [PATCH v2 1/6] selftests: remove duplicated all and clean target bamvor.zhangjian [not found] ` <20161129115552.8148-1-bamvor.zhangjian-hv44wF8Li93QT0dZR+AlfA@public.gmane.org> 2016-11-29 11:55 ` [PATCH v2 2/6] selftests: remove useless TEST_DIRS bamvor.zhangjian-hv44wF8Li93QT0dZR+AlfA 2016-11-29 11:55 ` [PATCH v2 3/6] selftests: add default rules for c source file bamvor.zhangjian-hv44wF8Li93QT0dZR+AlfA 2016-11-29 11:55 ` [PATCH v2 5/6] selftests: add EXTRA_CLEAN for clean target bamvor.zhangjian-hv44wF8Li93QT0dZR+AlfA 2016-11-29 11:55 ` [PATCH v2 6/6] selftests: enable O and KBUILD_OUTPUT bamvor.zhangjian-hv44wF8Li93QT0dZR+AlfA [not found] ` <20161129115552.8148-7-bamvor.zhangjian-hv44wF8Li93QT0dZR+AlfA@public.gmane.org> 2017-03-20 21:39 ` Andy Lutomirski [not found] ` <CALCETrUCbGC5tmzKzYn0qE5w8omk6ZRDj4p9qz5-Ho92+W5McA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> 2017-03-21 8:35 ` Michael Ellerman [not found] ` <87fui7owls.fsf-W0DJWXSxmBNbyGPkN3NxC2scP1bn1w/D@public.gmane.org> 2017-03-21 9:00 ` Bamvor Zhang Jian 2017-03-21 13:54 ` Shuah Khan 2017-03-21 16:09 ` Bamvor Zhang Jian [not found] ` <CAFy1USRjGvF3iwWa8k54fFzcMaMcN3VCQ1qMpZ3RSqZvT17Atw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> 2017-03-21 18:02 ` Shuah Khan [not found] ` <4243a5e3-a971-387d-e492-262d76db4540-JPH+aEBZ4P+UEJcrhfAQsw@public.gmane.org> 2017-03-22 12:55 ` Bamvor Zhang Jian 2017-03-22 11:35 ` Michael Ellerman [not found] ` <5daf0b79-a000-2adb-0b1e-f528d66ff6df-JPH+aEBZ4P+UEJcrhfAQsw@public.gmane.org> 2017-03-22 11:46 ` Michael Ellerman [not found] ` <CAFy1USRoKJ7G9ewLGBa1yy9V5UA+g=jo7O+eU1wV_rjKDYtJWg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> 2017-03-22 11:38 ` Michael Ellerman [not found] ` <87d1d9czi4.fsf-W0DJWXSxmBNbyGPkN3NxC2scP1bn1w/D@public.gmane.org> 2017-03-22 12:52 ` Bamvor Zhang Jian 2016-11-30 14:17 ` [PATCH v2 0/6] enable O and KBUILD_OUTPUT for kselftest Shuah Khan [not found] ` <01b97008-3311-7b5b-4424-76bd3d560b40-JPH+aEBZ4P+UEJcrhfAQsw@public.gmane.org> 2016-11-30 15:32 ` Bamvor Zhang Jian [not found] ` <CAFy1USRENze0J3MZUddvyTdChNBzRUAQBx2pPEfbFFiitxwtsw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> 2016-12-01 19:35 ` Shuah Khan 2016-11-29 11:55 ` [PATCH v2 4/6] selftests: remove CROSS_COMPILE in dedicated Makefile bamvor.zhangjian
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).