tools/build: Fix -s detection code for new make
Jiri Olsa
reviewerv2 cover tools/build: Fix -s detection code for new make
hi,
this fixes the detection of silent flag for newer make.
It'd be better to re-use the code, but I don't see simple way without more refactoring. I put that on my todo list.
v2 changes:
- adding the change for tools/scripts/Makefile.include as well
thanks,
jirka
---
Jiri Olsa (2):
tools/build: Fix -s detection code in tools/build/Makefile.build tools/build: Fix -s detection code in tools/scripts/Makefile.include
tools/build/Makefile.build | 10 +++++++++- tools/scripts/Makefile.include | 10 +++++++++- 2 files changed, 18 insertions(+), 2 deletions(-)
Jiri Olsa
reviewerPATCH v2 1/2 tools/build: Fix -s detection code in tools/build/Makefile.build
As Dmitry described in [1] changelog the current way of detecting -s option is broken for new make.
Changing the tools/build -s option detection the same way as it was fixed for root Makefile in [1].
[1] 4bf73588165b ("kbuild: Port silent mode detection to future gnu make.")
--- tools/build/Makefile.build | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-)
tools/build/Makefile.build +9 -1
@@ -20,7 +20,15 @@ else Q=@ endif -ifneq ($(findstring s,$(filter-out --%,$(MAKEFLAGS))),) +# If the user is running make -s (silent mode), suppress echoing of commands +# make-4.0 (and later) keep single letter options in the 1st word of MAKEFLAGS. +ifeq ($(filter 3.%,$(MAKE_VERSION)),) +short-opts := $(firstword -$(MAKEFLAGS)) +else +short-opts := $(filter-out --%,$(MAKEFLAGS)) +endif + +ifneq ($(findstring s,$(short-opts)),) quiet=silent_ endif
Signature · 1 line
2.41.0
Re: [PATCHv2 1/2] tools/build: Fix -s detection code in tools/build/Makefile.build
Hi Jiri,
Quoted 3 lines · Jiri Olsa
As Dmitry described in [1] changelog the current way of detecting -s option is broken for new make.
I'm not sure what -s option does for perf (at least). It doesn't seem much different whether I give it or not. Am I missing something?
Thanks,
Namhyung
Quoted 36 lines
Changing the
tools/build-s option detection the same way as it was fixed for rootMakefilein [1].[1]
4bf73588165b("kbuild: Port silent mode detection to future gnu make.")Cc Dmitry Goncharov <[email protected]>Signed-off-by Jiri Olsa <[email protected]>--- tools/build/Makefile.build | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-)tools/build/Makefile.build +9
-2@@ -20,7 +20,15 @@ else Q=@ endif -ifneq ($(findstring s,$(filter-out --%,$(MAKEFLAGS))),) +# If the user is running make -s (silent mode), suppress echoing of commands +# make-4.0 (and later) keep single letter options in the 1st word of MAKEFLAGS. +ifeq ($(filter 3.%,$(MAKE_VERSION)),) +short-opts := $(firstword -$(MAKEFLAGS)) +else +short-opts := $(filter-out --%,$(MAKEFLAGS)) +endif + +ifneq ($(findstring s,$(short-opts)),) quiet=silent_ endif --2.41.0
Re: [PATCHv2 1/2] tools/build: Fix -s detection code in tools/build/Makefile.build
Quoted 10 lines · Namhyung Kim
Hi Jiri,
Quoted 3 lines · Jiri Olsa
As Dmitry described in [1] changelog the current way of detecting -s option is broken for new make.
I'm not sure what -s option does for perf (at least). It doesn't seem much different whether I give it or not. Am I missing something?
what's your make version? the wrong output is visible when running with make version > 4.4 .. basicaly the -s is wrongly detected and you either get no output at all from some builds or overly verbose output
it's mentioned in the [1] commit changelog, I can put it to the changelog in new version
jirka
Quoted 40 lines
Thanks,
NamhyungQuoted 36 lines
Changing the
tools/build-s option detection the same way as it was fixed for rootMakefilein [1].[1]
4bf73588165b("kbuild: Port silent mode detection to future gnu make.")Cc Dmitry Goncharov <[email protected]>Signed-off-by Jiri Olsa <[email protected]>--- tools/build/Makefile.build | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-)tools/build/Makefile.build +9
-2@@ -20,7 +20,15 @@ else Q=@ endif -ifneq ($(findstring s,$(filter-out --%,$(MAKEFLAGS))),) +# If the user is running make -s (silent mode), suppress echoing of commands +# make-4.0 (and later) keep single letter options in the 1st word of MAKEFLAGS. +ifeq ($(filter 3.%,$(MAKE_VERSION)),) +short-opts := $(firstword -$(MAKEFLAGS)) +else +short-opts := $(filter-out --%,$(MAKEFLAGS)) +endif + +ifneq ($(findstring s,$(short-opts)),) quiet=silent_ endif --2.41.0
Re: [PATCHv2 1/2] tools/build: Fix -s detection code in tools/build/Makefile.build
Quoted 13 lines · Jiri Olsa
Quoted 10 lines · Namhyung Kim
Hi Jiri,
Quoted 3 lines · Jiri Olsa
As Dmitry described in [1] changelog the current way of detecting -s option is broken for new make.
I'm not sure what -s option does for perf (at least). It doesn't seem much different whether I give it or not. Am I missing something?
Quoted 7 lines
what's your make version? the wrong output is visible when running with make version > 4.4 .. basicaly the -s is wrongly detected and you either get no output at all from some builds or overly verbose output
it's mentioned in the [1] commit changelog, I can put it to the changelog in new version
IIUC it's about detecting make -s properly and not being confused by make a=s or something. I'm not objecting on it but I don't see what make -s does actually.
Anyway, my make version is 4.3.
Thanks,
Namhyung
Re: [PATCHv2 1/2] tools/build: Fix -s detection code in tools/build/Makefile.build
Quoted 19 lines · Namhyung Kim
Quoted 18 lines · Jiri Olsa
Quoted 10 lines · Namhyung Kim
Hi Jiri,
Quoted 3 lines · Jiri Olsa
As Dmitry described in [1] changelog the current way of detecting -s option is broken for new make.
I'm not sure what -s option does for perf (at least). It doesn't seem much different whether I give it or not. Am I missing something?
what's your make version? the wrong output is visible when running with make version > 4.4 .. basicaly the -s is wrongly detected and you either get no output at all from some builds or overly verbose output
Quoted 6 lines
Quoted 2 lines
it's mentioned in the [1] commit changelog, I can put it to the changelog in new version
IIUC it's about detecting
make -sproperly and not being confused bymake a=sor something. I'm not objecting on it but I don't see whatmake -sdoes actually.
so the tools/build/Makefile.build and tools/scripts/Makefile.include detect make -s option, which puts make into silent mode, so both makefiles switch off the output by setting quiet=silent_ or silent=1
the problem is that the detection of make -s option changed in make > 4.4 and current code could be tricked to switch to silent mode just by having 's' persent on the command line, like with 'a=s'
jirka
Quoted 5 lines
Anyway, my make version is 4.3.
Thanks,
Namhyung
Namhyung Kim
Acked-byRe: [PATCHv2 1/2] tools/build: Fix -s detection code in tools/build/Makefile.build
Quoted 28 lines · Jiri Olsa
Quoted 19 lines · Namhyung Kim
Quoted 18 lines · Jiri Olsa
Quoted 10 lines · Namhyung Kim
Hi Jiri,
Quoted 3 lines · Jiri Olsa
As Dmitry described in [1] changelog the current way of detecting -s option is broken for new make.
I'm not sure what -s option does for perf (at least). It doesn't seem much different whether I give it or not. Am I missing something?
what's your make version? the wrong output is visible when running with make version > 4.4 .. basicaly the -s is wrongly detected and you either get no output at all from some builds or overly verbose output
Quoted 6 lines
Quoted 2 lines
it's mentioned in the [1] commit changelog, I can put it to the changelog in new version
IIUC it's about detecting
make -sproperly and not being confused bymake a=sor something. I'm not objecting on it but I don't see whatmake -sdoes actually.
Quoted 7 lines
so the
tools/build/Makefile.buildandtools/scripts/Makefile.includedetect make -s option, which puts make into silent mode, so both makefiles switch off the output by setting quiet=silent_ or silent=1the problem is that the detection of make -s option changed in make > 4.4 and current code could be tricked to switch to silent mode just by having 's' persent on the command line, like with 'a=s'
I think our talk is circulating :-). Anyway I'm ok with the change, so
Which tree do you want to route it?
Thanks,
Namhyung
Re: [PATCHv2 1/2] tools/build: Fix -s detection code in tools/build/Makefile.build
Quoted 33 lines · Namhyung Kim
Quoted 32 lines · Jiri Olsa
Quoted 19 lines · Namhyung Kim
Quoted 18 lines · Jiri Olsa
Quoted 10 lines · Namhyung Kim
Hi Jiri,
Quoted 3 lines · Jiri Olsa
As Dmitry described in [1] changelog the current way of detecting -s option is broken for new make.
I'm not sure what -s option does for perf (at least). It doesn't seem much different whether I give it or not. Am I missing something?
what's your make version? the wrong output is visible when running with make version > 4.4 .. basicaly the -s is wrongly detected and you either get no output at all from some builds or overly verbose output
Quoted 6 lines
Quoted 2 lines
it's mentioned in the [1] commit changelog, I can put it to the changelog in new version
IIUC it's about detecting
make -sproperly and not being confused bymake a=sor something. I'm not objecting on it but I don't see whatmake -sdoes actually.so the
tools/build/Makefile.buildandtools/scripts/Makefile.includedetect make -s option, which puts make into silent mode, so both makefiles switch off the output by setting quiet=silent_ or silent=1
Quoted 5 lines
Quoted 3 lines
the problem is that the detection of make -s option changed in make > 4.4 and current code could be tricked to switch to silent mode just by having 's' persent on the command line, like with 'a=s'
I think our talk is circulating :-). Anyway I'm ok with the change, so
:) ok, thanks
Quoted 4 lines
Acked-by Namhyung Kim <[email protected]>Which tree do you want to route it?
I think perf tree is the best one to route it
thanks,
jirka
Re: [PATCHv2 1/2] tools/build: Fix -s detection code in tools/build/Makefile.build
Quoted 41 lines · Jiri Olsa
Quoted 33 lines · Namhyung Kim
Quoted 32 lines · Jiri Olsa
Quoted 19 lines · Namhyung Kim
Quoted 18 lines · Jiri Olsa
Quoted 10 lines · Namhyung Kim
Hi Jiri,
Quoted 3 lines · Jiri Olsa
As Dmitry described in [1] changelog the current way of detecting -s option is broken for new make.
I'm not sure what -s option does for perf (at least). It doesn't seem much different whether I give it or not. Am I missing something?
what's your make version? the wrong output is visible when running with make version > 4.4 .. basicaly the -s is wrongly detected and you either get no output at all from some builds or overly verbose output
Quoted 6 lines
Quoted 2 lines
it's mentioned in the [1] commit changelog, I can put it to the changelog in new version
IIUC it's about detecting
make -sproperly and not being confused bymake a=sor something. I'm not objecting on it but I don't see whatmake -sdoes actually.so the
tools/build/Makefile.buildandtools/scripts/Makefile.includedetect make -s option, which puts make into silent mode, so both makefiles switch off the output by setting quiet=silent_ or silent=1Quoted 5 lines
Quoted 3 lines
the problem is that the detection of make -s option changed in make > 4.4 and current code could be tricked to switch to silent mode just by having 's' persent on the command line, like with 'a=s'
I think our talk is circulating :-). Anyway I'm ok with the change, so
Quoted 8 lines
:) ok, thanks
Quoted 4 lines
Acked-by Namhyung Kim <[email protected]>Which tree do you want to route it?
I think perf tree is the best one to route it
Ok, I'll add it.
Thanks,
Namhyung
Jiri Olsa
reviewerPATCH v2 2/2 tools/build: Fix -s detection code in tools/scripts/Makefile.include
In reply to Jiri OlsaAs Dmitry described in [1] changelog the current way of detecting -s option is broken for new make.
Changing the tools/build -s option detection the same way as it was fixed for root Makefile in [1].
[1] 4bf73588165b ("kbuild: Port silent mode detection to future gnu make.")
--- tools/scripts/Makefile.include | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-)
tools/scripts/Makefile.include +9 -1
@@ -136,7 +136,15 @@ else NO_SUBDIR = : endif -ifneq ($(findstring s,$(filter-out --%,$(MAKEFLAGS))),) +# If the user is running make -s (silent mode), suppress echoing of commands +# make-4.0 (and later) keep single letter options in the 1st word of MAKEFLAGS. +ifeq ($(filter 3.%,$(MAKE_VERSION)),) +short-opts := $(firstword -$(MAKEFLAGS)) +else +short-opts := $(filter-out --%,$(MAKEFLAGS)) +endif + +ifneq ($(findstring s,$(short-opts)),) silent=1 endif
Signature · 1 line
2.41.0
Em Sun, Oct 08, 2023 at 11:22:49PM +0200, Jiri Olsa escreveu:
Quoted 8 lines
hi,
this fixes the detection of silent flag for newer make.It'd be better to re-use the code, but I don't see simple way without more refactoring. I put that on my todo list.
v2 changes:
- adding the change fortools/scripts/Makefile.includeas well
- Arnaldo
Quoted 12 lines
thanks,
jirka---
Jiri Olsa (2):
tools/build: Fix -s detection code intools/build/Makefile.buildtools/build: Fix -s detection code intools/scripts/Makefile.includetools/build/Makefile.build | 10 +++++++++- tools/scripts/Makefile.include | 10 +++++++++- 2 files changed, 18 insertions(+), 2 deletions(-)
Signature · 1 line
- Arnaldo
Namhyung Kim
AppliedQuoted 5 lines · Arnaldo Carvalho de Melo
Em Sun, Oct 08, 2023 at 11:22:49PM +0200, Jiri Olsa escreveu:
Quoted 3 lines
hi,
this fixes the detection of silent flag for newer make.
Quoted 7 lines
Quoted 5 lines
It'd be better to re-use the code, but I don't see simple way without more refactoring. I put that on my todo list.
v2 changes:
- adding the change fortools/scripts/Makefile.includeas well
Applied to perf-tools-next, thanks!