linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] Clean up PowerPC selftest stderr output
@ 2023-02-28  0:07 Benjamin Gray
  2023-02-28  0:07 ` [PATCH 1/3] selftests/powerpc: Use CLEAN macro to fix make warning Benjamin Gray
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Benjamin Gray @ 2023-02-28  0:07 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: Benjamin Gray

There are several messages being logged to stderr when building the PowerPC
selftests:

  $ make -j$(nproc) O=build -C tools/testing/selftests \
    INSTALL_PATH="$PWD"/out/selftests TARGETS=powerpc install > /dev/null

  Makefile:50: warning: overriding recipe for target 'clean'
  ../../lib.mk:124: warning: ignoring old recipe for target 'clean'
  1+0 records in
  1+0 records out
  65536 bytes (66 kB, 64 KiB) copied, 7.71e-05 s, 850 MB/s
  Makefile:50: warning: overriding recipe for target 'clean'
  ../../lib.mk:124: warning: ignoring old recipe for target 'clean'
  make[2]: warning: jobserver unavailable: using -j1.  Add '+' to parent make rule.
  ...
  make[2]: warning: jobserver unavailable: using -j1.  Add '+' to parent make rule.
  Makefile:50: warning: overriding recipe for target 'clean'
  ../../lib.mk:124: warning: ignoring old recipe for target 'clean'
  make[2]: warning: jobserver unavailable: using -j1.  Add '+' to parent make rule.
  ...
  make[2]: warning: jobserver unavailable: using -j1.  Add '+' to parent make rule.

This series fixes or silences them to make any legitimate build warnings more
apparent.


Benjamin Gray (3):
  selftests/powerpc: Use CLEAN macro to fix make warning
  selftests/powerpc: Pass make context to children
  selftests/powerpc: Make dd output quiet

 tools/testing/selftests/powerpc/Makefile     |  8 ++---
 tools/testing/selftests/powerpc/mm/Makefile  |  2 +-
 tools/testing/selftests/powerpc/pmu/Makefile | 31 +++++++++++---------
 3 files changed, 22 insertions(+), 19 deletions(-)


base-commit: ec0a1b360aec1ba0bdfad3dd69e300b028529c0d
--
2.39.2

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

* [PATCH 1/3] selftests/powerpc: Use CLEAN macro to fix make warning
  2023-02-28  0:07 [PATCH 0/3] Clean up PowerPC selftest stderr output Benjamin Gray
@ 2023-02-28  0:07 ` Benjamin Gray
  2023-02-28  0:07 ` [PATCH 2/3] selftests/powerpc: Pass make context to children Benjamin Gray
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Benjamin Gray @ 2023-02-28  0:07 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: Benjamin Gray

The CLEAN macro was added in 337f1e36 to prevent the

    Makefile:50: warning: overriding recipe for target 'clean'
    ../../lib.mk:124: warning: ignoring old recipe for target 'clean'

style warnings. Expand it's use to fix another case of redefining a
target directly.

Signed-off-by: Benjamin Gray <bgray@linux.ibm.com>
---
 tools/testing/selftests/powerpc/pmu/Makefile | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/tools/testing/selftests/powerpc/pmu/Makefile b/tools/testing/selftests/powerpc/pmu/Makefile
index 30803353bd7c..d2c1accc2e69 100644
--- a/tools/testing/selftests/powerpc/pmu/Makefile
+++ b/tools/testing/selftests/powerpc/pmu/Makefile
@@ -46,11 +46,14 @@ override define INSTALL_RULE
 	TARGET=event_code_tests; BUILD_TARGET=$$OUTPUT/$$TARGET; $(MAKE) OUTPUT=$$BUILD_TARGET -C $$TARGET install
 endef
 
-clean:
+DEFAULT_CLEAN := $(CLEAN)
+override define CLEAN
+	$(DEFAULT_CLEAN)
 	$(RM) $(TEST_GEN_PROGS) $(OUTPUT)/loop.o
 	TARGET=ebb; BUILD_TARGET=$$OUTPUT/$$TARGET; $(MAKE) OUTPUT=$$BUILD_TARGET -C $$TARGET clean
 	TARGET=sampling_tests; BUILD_TARGET=$$OUTPUT/$$TARGET; $(MAKE) OUTPUT=$$BUILD_TARGET -C $$TARGET clean
 	TARGET=event_code_tests; BUILD_TARGET=$$OUTPUT/$$TARGET; $(MAKE) OUTPUT=$$BUILD_TARGET -C $$TARGET clean
+endef
 
 ebb:
 	TARGET=$@; BUILD_TARGET=$$OUTPUT/$$TARGET; mkdir -p $$BUILD_TARGET; $(MAKE) OUTPUT=$$BUILD_TARGET -k -C $$TARGET all
@@ -61,4 +64,4 @@ sampling_tests:
 event_code_tests:
 	TARGET=$@; BUILD_TARGET=$$OUTPUT/$$TARGET; mkdir -p $$BUILD_TARGET; $(MAKE) OUTPUT=$$BUILD_TARGET -k -C $$TARGET all
 
-.PHONY: all run_tests clean ebb sampling_tests event_code_tests
+.PHONY: all run_tests ebb sampling_tests event_code_tests
-- 
2.39.2


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

* [PATCH 2/3] selftests/powerpc: Pass make context to children
  2023-02-28  0:07 [PATCH 0/3] Clean up PowerPC selftest stderr output Benjamin Gray
  2023-02-28  0:07 ` [PATCH 1/3] selftests/powerpc: Use CLEAN macro to fix make warning Benjamin Gray
@ 2023-02-28  0:07 ` Benjamin Gray
  2023-02-28  0:07 ` [PATCH 3/3] selftests/powerpc: Make dd output quiet Benjamin Gray
  2023-04-06  1:09 ` [PATCH 0/3] Clean up PowerPC selftest stderr output Michael Ellerman
  3 siblings, 0 replies; 5+ messages in thread
From: Benjamin Gray @ 2023-02-28  0:07 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: Benjamin Gray

Make supports passing the 'jobserver' (parallel make support) to child
invocations of make when either
	1. The target command uses $(MAKE) directly
	2. The command starts with '+'

This context is not passed through expansions that result in $(MAKE), so
the macros used in several places fail to pass on the jobserver context.
Warnings are also raised by the child mentioning this.

Prepend macros lines that invoke $(MAKE) with '+' to allow passing the
jobserver context to these children.

Signed-off-by: Benjamin Gray <bgray@linux.ibm.com>
---
 tools/testing/selftests/powerpc/Makefile     |  8 +++----
 tools/testing/selftests/powerpc/pmu/Makefile | 24 ++++++++++----------
 2 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/tools/testing/selftests/powerpc/Makefile b/tools/testing/selftests/powerpc/Makefile
index 6ba95cd19e42..ae2bfc0d822f 100644
--- a/tools/testing/selftests/powerpc/Makefile
+++ b/tools/testing/selftests/powerpc/Makefile
@@ -45,28 +45,28 @@ $(SUB_DIRS):
 include ../lib.mk
 
 override define RUN_TESTS
-	@for TARGET in $(SUB_DIRS); do \
+	+@for TARGET in $(SUB_DIRS); do \
 		BUILD_TARGET=$(OUTPUT)/$$TARGET;	\
 		$(MAKE) OUTPUT=$$BUILD_TARGET -C $$TARGET run_tests;\
 	done;
 endef
 
 override define INSTALL_RULE
-	@for TARGET in $(SUB_DIRS); do \
+	+@for TARGET in $(SUB_DIRS); do \
 		BUILD_TARGET=$(OUTPUT)/$$TARGET;	\
 		$(MAKE) OUTPUT=$$BUILD_TARGET -C $$TARGET install;\
 	done;
 endef
 
 override define EMIT_TESTS
-	@for TARGET in $(SUB_DIRS); do \
+	+@for TARGET in $(SUB_DIRS); do \
 		BUILD_TARGET=$(OUTPUT)/$$TARGET;	\
 		$(MAKE) OUTPUT=$$BUILD_TARGET -s -C $$TARGET emit_tests;\
 	done;
 endef
 
 override define CLEAN
-	@for TARGET in $(SUB_DIRS); do \
+	+@for TARGET in $(SUB_DIRS); do \
 		BUILD_TARGET=$(OUTPUT)/$$TARGET;	\
 		$(MAKE) OUTPUT=$$BUILD_TARGET -C $$TARGET clean; \
 	done;
diff --git a/tools/testing/selftests/powerpc/pmu/Makefile b/tools/testing/selftests/powerpc/pmu/Makefile
index d2c1accc2e69..2b95e44d20ff 100644
--- a/tools/testing/selftests/powerpc/pmu/Makefile
+++ b/tools/testing/selftests/powerpc/pmu/Makefile
@@ -25,34 +25,34 @@ $(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=sampling_tests; BUILD_TARGET=$$OUTPUT/$$TARGET; $(MAKE) OUTPUT=$$BUILD_TARGET -C $$TARGET run_tests
-	TARGET=event_code_tests; 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
+	+TARGET=sampling_tests; BUILD_TARGET=$$OUTPUT/$$TARGET; $(MAKE) OUTPUT=$$BUILD_TARGET -C $$TARGET run_tests
+	+TARGET=event_code_tests; 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=sampling_tests; BUILD_TARGET=$$OUTPUT/$$TARGET; $(MAKE) OUTPUT=$$BUILD_TARGET -s -C $$TARGET emit_tests
-	TARGET=event_code_tests; 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
+	+TARGET=sampling_tests; BUILD_TARGET=$$OUTPUT/$$TARGET; $(MAKE) OUTPUT=$$BUILD_TARGET -s -C $$TARGET emit_tests
+	+TARGET=event_code_tests; 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=sampling_tests; BUILD_TARGET=$$OUTPUT/$$TARGET; $(MAKE) OUTPUT=$$BUILD_TARGET -C $$TARGET install
-	TARGET=event_code_tests; BUILD_TARGET=$$OUTPUT/$$TARGET; $(MAKE) OUTPUT=$$BUILD_TARGET -C $$TARGET install
+	+TARGET=ebb; BUILD_TARGET=$$OUTPUT/$$TARGET; $(MAKE) OUTPUT=$$BUILD_TARGET -C $$TARGET install
+	+TARGET=sampling_tests; BUILD_TARGET=$$OUTPUT/$$TARGET; $(MAKE) OUTPUT=$$BUILD_TARGET -C $$TARGET install
+	+TARGET=event_code_tests; BUILD_TARGET=$$OUTPUT/$$TARGET; $(MAKE) OUTPUT=$$BUILD_TARGET -C $$TARGET install
 endef
 
 DEFAULT_CLEAN := $(CLEAN)
 override define CLEAN
 	$(DEFAULT_CLEAN)
 	$(RM) $(TEST_GEN_PROGS) $(OUTPUT)/loop.o
-	TARGET=ebb; BUILD_TARGET=$$OUTPUT/$$TARGET; $(MAKE) OUTPUT=$$BUILD_TARGET -C $$TARGET clean
-	TARGET=sampling_tests; BUILD_TARGET=$$OUTPUT/$$TARGET; $(MAKE) OUTPUT=$$BUILD_TARGET -C $$TARGET clean
-	TARGET=event_code_tests; BUILD_TARGET=$$OUTPUT/$$TARGET; $(MAKE) OUTPUT=$$BUILD_TARGET -C $$TARGET clean
+	+TARGET=ebb; BUILD_TARGET=$$OUTPUT/$$TARGET; $(MAKE) OUTPUT=$$BUILD_TARGET -C $$TARGET clean
+	+TARGET=sampling_tests; BUILD_TARGET=$$OUTPUT/$$TARGET; $(MAKE) OUTPUT=$$BUILD_TARGET -C $$TARGET clean
+	+TARGET=event_code_tests; BUILD_TARGET=$$OUTPUT/$$TARGET; $(MAKE) OUTPUT=$$BUILD_TARGET -C $$TARGET clean
 endef
 
 ebb:
-- 
2.39.2


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

* [PATCH 3/3] selftests/powerpc: Make dd output quiet
  2023-02-28  0:07 [PATCH 0/3] Clean up PowerPC selftest stderr output Benjamin Gray
  2023-02-28  0:07 ` [PATCH 1/3] selftests/powerpc: Use CLEAN macro to fix make warning Benjamin Gray
  2023-02-28  0:07 ` [PATCH 2/3] selftests/powerpc: Pass make context to children Benjamin Gray
@ 2023-02-28  0:07 ` Benjamin Gray
  2023-04-06  1:09 ` [PATCH 0/3] Clean up PowerPC selftest stderr output Michael Ellerman
  3 siblings, 0 replies; 5+ messages in thread
From: Benjamin Gray @ 2023-02-28  0:07 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: Benjamin Gray

dd logs info to stderr by default. This info is pointless in the
selftests and makes legitimate issues harder to spot.

Pass the option to silence the info logs. Actual errors would still be
printed.

Signed-off-by: Benjamin Gray <bgray@linux.ibm.com>
---
 tools/testing/selftests/powerpc/mm/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/testing/selftests/powerpc/mm/Makefile b/tools/testing/selftests/powerpc/mm/Makefile
index 19dd0b2ea397..4a6608beef0e 100644
--- a/tools/testing/selftests/powerpc/mm/Makefile
+++ b/tools/testing/selftests/powerpc/mm/Makefile
@@ -32,7 +32,7 @@ $(OUTPUT)/stack_expansion_ldst: CFLAGS += -fno-stack-protector
 $(OUTPUT)/stack_expansion_ldst: ../utils.c
 
 $(OUTPUT)/tempfile:
-	dd if=/dev/zero of=$@ bs=64k count=1
+	dd if=/dev/zero of=$@ bs=64k count=1 status=none
 
 $(OUTPUT)/tlbie_test: LDLIBS += -lpthread
 $(OUTPUT)/pkey_siginfo: LDLIBS += -lpthread
-- 
2.39.2


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

* Re: [PATCH 0/3] Clean up PowerPC selftest stderr output
  2023-02-28  0:07 [PATCH 0/3] Clean up PowerPC selftest stderr output Benjamin Gray
                   ` (2 preceding siblings ...)
  2023-02-28  0:07 ` [PATCH 3/3] selftests/powerpc: Make dd output quiet Benjamin Gray
@ 2023-04-06  1:09 ` Michael Ellerman
  3 siblings, 0 replies; 5+ messages in thread
From: Michael Ellerman @ 2023-04-06  1:09 UTC (permalink / raw)
  To: linuxppc-dev, Benjamin Gray

On Tue, 28 Feb 2023 11:07:06 +1100, Benjamin Gray wrote:
> There are several messages being logged to stderr when building the PowerPC
> selftests:
> 
>   $ make -j$(nproc) O=build -C tools/testing/selftests \
>     INSTALL_PATH="$PWD"/out/selftests TARGETS=powerpc install > /dev/null
> 
>   Makefile:50: warning: overriding recipe for target 'clean'
>   ../../lib.mk:124: warning: ignoring old recipe for target 'clean'
>   1+0 records in
>   1+0 records out
>   65536 bytes (66 kB, 64 KiB) copied, 7.71e-05 s, 850 MB/s
>   Makefile:50: warning: overriding recipe for target 'clean'
>   ../../lib.mk:124: warning: ignoring old recipe for target 'clean'
>   make[2]: warning: jobserver unavailable: using -j1.  Add '+' to parent make rule.
>   ...
>   make[2]: warning: jobserver unavailable: using -j1.  Add '+' to parent make rule.
>   Makefile:50: warning: overriding recipe for target 'clean'
>   ../../lib.mk:124: warning: ignoring old recipe for target 'clean'
>   make[2]: warning: jobserver unavailable: using -j1.  Add '+' to parent make rule.
>   ...
>   make[2]: warning: jobserver unavailable: using -j1.  Add '+' to parent make rule.
> 
> [...]

Applied to powerpc/next.

[1/3] selftests/powerpc: Use CLEAN macro to fix make warning
      https://git.kernel.org/powerpc/c/69608683a65be5322ef44091eaeb9890472b2eea
[2/3] selftests/powerpc: Pass make context to children
      https://git.kernel.org/powerpc/c/4ecd0868c5138238dec8a1549bb6ff8e5b48208b
[3/3] selftests/powerpc: Make dd output quiet
      https://git.kernel.org/powerpc/c/d3cf1662b665f20444a08bff52b6daae912e0d1d

cheers

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

end of thread, other threads:[~2023-04-06  1:11 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-28  0:07 [PATCH 0/3] Clean up PowerPC selftest stderr output Benjamin Gray
2023-02-28  0:07 ` [PATCH 1/3] selftests/powerpc: Use CLEAN macro to fix make warning Benjamin Gray
2023-02-28  0:07 ` [PATCH 2/3] selftests/powerpc: Pass make context to children Benjamin Gray
2023-02-28  0:07 ` [PATCH 3/3] selftests/powerpc: Make dd output quiet Benjamin Gray
2023-04-06  1:09 ` [PATCH 0/3] Clean up PowerPC selftest stderr output Michael Ellerman

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