linux-api.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] selftests: fix for KBUILD_OUTPUT
@ 2017-03-27  5:45 Bamvor Jian Zhang
  2017-03-27  5:46 ` [PATCH 1/2] selftests: fix the broken individual test for x86 Bamvor Jian Zhang
  2017-03-27  5:46 ` [PATCH 2/2] selftests: net: support KBUILD_OUTPUT for reuseport_bpf_numa Bamvor Jian Zhang
  0 siblings, 2 replies; 5+ messages in thread
From: Bamvor Jian Zhang @ 2017-03-27  5:45 UTC (permalink / raw)
  To: luto-kltTT9wpgjJwATOyAt5JVQ, shuahkh-JPH+aEBZ4P+UEJcrhfAQsw
  Cc: mpe-Gsx/Oe8HsFggBc27wqDAHg, linux-api-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	khilman-DgEjT+Ai2ygdnm+yROfE0A, broonie-DgEjT+Ai2ygdnm+yROfE0A,
	bamvor.zhangjian-hv44wF8Li93QT0dZR+AlfA,
	bamvor.zhangjian-QSEj5FYQhm4dnm+yROfE0A

These patches fix the two compile failures in x86 and net subnet
repectively. Test the folowing build method successful:

make -C tools/testing/selftests TARGETS=xxx
make -C tools/testing/selftests TARGETS=xxx clean
make -C tools/testing/selftests/xxx
make -C tools/testing/selftests/xxx clean
make ARCH=$ARCH CROSS_COMPILE=$CROSS_COMPILE -C tools/testing/selftests TARGETS=xxx
make ARCH=$ARCH CROSS_COMPILE=$CROSS_COMPILE -C tools/testing/selftests TARGETS=xxx clean

Bamvor Jian Zhang (2):
  selftests: fix the broken individual test for x86
  selftests: net:  support KBUILD_OUTPUT for reuseport_bpf_numa

 Documentation/kselftest.txt          |  6 ++++++
 tools/testing/selftests/net/Makefile |  2 +-
 tools/testing/selftests/x86/Makefile | 23 ++++++++++++++---------
 3 files changed, 21 insertions(+), 10 deletions(-)

-- 
1.9.1

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 1/2] selftests: fix the broken individual test for x86
  2017-03-27  5:45 [PATCH 0/2] selftests: fix for KBUILD_OUTPUT Bamvor Jian Zhang
@ 2017-03-27  5:46 ` Bamvor Jian Zhang
       [not found]   ` <20170327054601.22415-2-bamvor.zhangjian-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
  2017-03-27  5:46 ` [PATCH 2/2] selftests: net: support KBUILD_OUTPUT for reuseport_bpf_numa Bamvor Jian Zhang
  1 sibling, 1 reply; 5+ messages in thread
From: Bamvor Jian Zhang @ 2017-03-27  5:46 UTC (permalink / raw)
  To: luto, shuahkh
  Cc: mpe, linux-api, linux-kernel, khilman, broonie, bamvor.zhangjian,
	bamvor.zhangjian

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@amacapital.net>
Signed-off-by: Bamvor Jian Zhang <bamvor.zhangjian@linaro.org>
---
 Documentation/kselftest.txt          |  6 ++++++
 tools/testing/selftests/x86/Makefile | 23 ++++++++++++++---------
 2 files changed, 20 insertions(+), 9 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/x86/Makefile b/tools/testing/selftests/x86/Makefile
index 38e0a9c..855a2a1 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

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 2/2] selftests: net: support KBUILD_OUTPUT for reuseport_bpf_numa
  2017-03-27  5:45 [PATCH 0/2] selftests: fix for KBUILD_OUTPUT Bamvor Jian Zhang
  2017-03-27  5:46 ` [PATCH 1/2] selftests: fix the broken individual test for x86 Bamvor Jian Zhang
@ 2017-03-27  5:46 ` Bamvor Jian Zhang
  1 sibling, 0 replies; 5+ messages in thread
From: Bamvor Jian Zhang @ 2017-03-27  5:46 UTC (permalink / raw)
  To: luto, shuahkh
  Cc: mpe, linux-api, linux-kernel, khilman, broonie, bamvor.zhangjian,
	bamvor.zhangjian

reuseport_bpf_numa is not supported by KBUILD_OUTPUT machanism in net
subset. This patch fix this by adding $(OUTPUT) before the target.

Signed-off-by: Bamvor Jian Zhang <bamvor.zhangjian@linaro.org>
---
 tools/testing/selftests/net/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/testing/selftests/net/Makefile b/tools/testing/selftests/net/Makefile
index fbfe5d0..cc9425e 100644
--- a/tools/testing/selftests/net/Makefile
+++ b/tools/testing/selftests/net/Makefile
@@ -3,7 +3,7 @@
 CFLAGS =  -Wall -Wl,--no-as-needed -O2 -g
 CFLAGS += -I../../../../usr/include/
 
-reuseport_bpf_numa: LDFLAGS += -lnuma
+$(OUTPUT)/reuseport_bpf_numa: LDFLAGS += -lnuma
 
 TEST_PROGS := run_netsocktests run_afpackettests test_bpf.sh
 TEST_GEN_FILES =  socket
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/2] selftests: fix the broken individual test for x86
       [not found]   ` <20170327054601.22415-2-bamvor.zhangjian-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
@ 2017-03-28  0:22     ` Michael Ellerman
       [not found]       ` <87bmsm8d2a.fsf-W0DJWXSxmBNbyGPkN3NxC2scP1bn1w/D@public.gmane.org>
  0 siblings, 1 reply; 5+ messages in thread
From: Michael Ellerman @ 2017-03-28  0:22 UTC (permalink / raw)
  To: luto-kltTT9wpgjJwATOyAt5JVQ, shuahkh-JPH+aEBZ4P+UEJcrhfAQsw
  Cc: linux-api-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	khilman-DgEjT+Ai2ygdnm+yROfE0A, broonie-DgEjT+Ai2ygdnm+yROfE0A,
	bamvor.zhangjian-hv44wF8Li93QT0dZR+AlfA,
	bamvor.zhangjian-QSEj5FYQhm4dnm+yROfE0A

Bamvor Jian Zhang <bamvor.zhangjian-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org> writes:

> 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/x86/Makefile | 23 ++++++++++++++---------
>  2 files changed, 20 insertions(+), 9 deletions(-)

I don't think this is a good fix, it only fixes this one Makefile, and
it's quite verbose. But if it really bothers Andy then it would be OK as
a stop-gap for 4.11.

cheers

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/2] selftests: fix the broken individual test for x86
       [not found]       ` <87bmsm8d2a.fsf-W0DJWXSxmBNbyGPkN3NxC2scP1bn1w/D@public.gmane.org>
@ 2017-03-28 11:33         ` Bamvor Zhang Jian
  0 siblings, 0 replies; 5+ messages in thread
From: Bamvor Zhang Jian @ 2017-03-28 11:33 UTC (permalink / raw)
  To: Michael Ellerman
  Cc: Andy Lutomirski, Shuah Khan, linux-api, lkml, Kevin Hilman,
	Mark Brown, Zhang Jian(Bamvor)

Hi, Michael

On 28 March 2017 at 08:22, Michael Ellerman <mpe-Gsx/Oe8HsFggBc27wqDAHg@public.gmane.org> wrote:
> Bamvor Jian Zhang <bamvor.zhangjian-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org> writes:
>
>> 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/x86/Makefile | 23 ++++++++++++++---------
>>  2 files changed, 20 insertions(+), 9 deletions(-)
>
> I don't think this is a good fix, it only fixes this one Makefile, and
> it's quite verbose. But if it really bothers Andy then it would be OK as
> a stop-gap for 4.11.
Thanks for review.
Do you mean check this issue in other directory? I plan to do it.
Currently, the x86/Makefile do not use the TEST_GEN_XXX, so
if we found a better fix, we could convert x86/Makefile later.

Regards

Bamvor
>
> cheers
> --
> 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] 5+ messages in thread

end of thread, other threads:[~2017-03-28 11:33 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-27  5:45 [PATCH 0/2] selftests: fix for KBUILD_OUTPUT Bamvor Jian Zhang
2017-03-27  5:46 ` [PATCH 1/2] selftests: fix the broken individual test for x86 Bamvor Jian Zhang
     [not found]   ` <20170327054601.22415-2-bamvor.zhangjian-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2017-03-28  0:22     ` Michael Ellerman
     [not found]       ` <87bmsm8d2a.fsf-W0DJWXSxmBNbyGPkN3NxC2scP1bn1w/D@public.gmane.org>
2017-03-28 11:33         ` Bamvor Zhang Jian
2017-03-27  5:46 ` [PATCH 2/2] selftests: net: support KBUILD_OUTPUT for reuseport_bpf_numa Bamvor Jian Zhang

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).