Skip to contentSkip to conversation

mk: remove module compilation noise

PATCH In review Ferruh Yigit 2 participants 8 messages Sep 8, 2016 – Sep 23, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mk: remove module compilation noise

Following log generated by Linux kernel Makefiles:
(cat /dev/null; echo
kernel/.../build/lib/librte_eal/linuxapp/igb_uio/igb_uio.ko;) > .../build/lib/librte_eal/linuxapp/igb_uio/modules.order

This happens because $(Q) used for both Linux and DPDK makefiles and DPDK unsets this variable when V=0, which makes Linux verbose.

More details:
rte.modules calls kernel makefile with V=0 argument
kernel makefile includes igb_uio/Makefile, which includes rte.vars.mk rte.vars.mk unsets Q when V=0

---
 mk/rte.module.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
mk/rte.module.mk +1 -1
index 53ed4fe..10cb667 100644
@@ -78,7 +78,7 @@ build: _postbuild
 $(MODULE).ko: $(SRCS_LINKS)
 	@if [ ! -f $(notdir Makefile) ]; then ln -nfs $(SRCDIR)/Makefile . ; fi
 	@$(MAKE) -C $(RTE_KERNELDIR) M=$(CURDIR) O=$(RTE_KERNELDIR) \
-		CC="$(KERNELCC)" CROSS_COMPILE=$(CROSS) V=$(if $V,1,0)
+		CC="$(KERNELCC)" CROSS_COMPILE=$(CROSS) V=$(if $V,1,)
 
 # install module in $(RTE_OUTPUT)/kmod
 $(RTE_OUTPUT)/kmod/$(MODULE).ko: $(MODULE).ko
Signature · 1 line
2.7.4
#1 lore raw

2016-09-08 13:33, Ferruh Yigit:

Quoted 5 lines

Following log generated by Linux kernel Makefiles:
(cat /dev/null; echo
kernel/.../build/lib/librte_eal/linuxapp/igb_uio/igb_uio.ko;) > .../build/lib/librte_eal/linuxapp/igb_uio/modules.order

Quoted 7 lines

This happens because $(Q) used for both Linux and DPDK makefiles and DPDK unsets this variable when V=0, which makes Linux verbose.

More details:
rte.modules calls kernel makefile with V=0 argument
kernel makefile includes igb_uio/Makefile, which includes rte.vars.mk rte.vars.mk unsets Q when V=0

Yes good analysis.
Another consequence is that V=0 is equivalent to V=1 (verbose mode). I think it is better to fix the latter issue. I'll send a patch.

#2 lore raw

PATCH 1/1 mk: fix verbosity zero

Verbosity is considered enabled when $V is not empty. So V=0 and V=1 are equivalent.
It is fixed by unsetting V when it is 0.

A side effect is to fix kernel module compilation verbosity which is set to 0 when V is empty.

---
 mk/rte.sdkroot.mk | 3 +++
 mk/rte.vars.mk    | 3 +++
 2 files changed, 6 insertions(+)
mk/rte.sdkroot.mk +3 -0
index 55a9d8a..04ad523 100644
@@ -34,6 +34,9 @@ MAKEFLAGS += --no-print-directory
 # define Q to '@' or not. $(Q) is used to prefix all shell commands to
 # be executed silently.
 Q=@
+ifeq '$V' '0'
+override V=
+endif
 ifdef V
 ifeq ("$(origin V)", "command line")
 Q=
mk/rte.vars.mk +3 -0
index 28982a5..c240a0e 100644
@@ -46,6 +46,9 @@ endif
 # define Q to '@' or not. $(Q) is used to prefix all shell commands to
 # be executed silently.
 Q=@
+ifeq '$V' '0'
+override V=
+endif
 ifdef V
 ifeq ("$(origin V)", "command line")
 Q=
Signature · 1 line
2.7.0
#7 lore raw
In reply to Thomas Monjalon
Quoted 9 lines · Thomas Monjalon

2016-09-08 13:33, Ferruh Yigit:

Quoted 8 lines

Following log generated by Linux kernel Makefiles:
(cat /dev/null; echo
kernel/.../build/lib/librte_eal/linuxapp/igb_uio/igb_uio.ko;) > .../build/lib/librte_eal/linuxapp/igb_uio/modules.order

This happens because $(Q) used for both Linux and DPDK makefiles and DPDK unsets this variable when V=0, which makes Linux verbose.

Quoted 7 lines
Quoted 4 lines

More details:
rte.modules calls kernel makefile with V=0 argument
kernel makefile includes igb_uio/Makefile, which includes rte.vars.mk rte.vars.mk unsets Q when V=0

Yes good analysis.
Another consequence is that V=0 is equivalent to V=1 (verbose mode).

Yes.

Quoted 1 line

I think it is better to fix the latter issue. I'll send a patch.

OK.

#3 lore raw

Re: [PATCH] mk: fix verbosity zero

In reply to Thomas Monjalon
Quoted 19 lines · Thomas Monjalon

Verbosity is considered enabled when $V is not empty. So V=0 and V=1 are equivalent.
It is fixed by unsetting V when it is 0.

A side effect is to fix kernel module compilation verbosity which is set to 0 when V is empty.

---
 mk/rte.sdkroot.mk | 3 +++
 mk/rte.vars.mk    | 3 +++
 2 files changed, 6 insertions(+)
mk/rte.sdkroot.mk +0 -0
index 55a9d8a..04ad523 100644

mk/rte.sdkroot.mk MAKEFLAGS += --no-print-directory · line 40

Quoted 7 lines
mk/rte.sdkroot.mk +3 -0
@@ -34,6 +34,9 @@ MAKEFLAGS += --no-print-directory
 # define Q to '@' or not. $(Q) is used to prefix all shell commands to
 # be executed silently.
 Q=@
+ifeq '$V' '0'
+override V=
+endif
 ifdef V

Why not simply:
-ifdef V
+ifeq ($(V),1)

Quoted 17 lines
mk/rte.sdkroot.mk +0 -0
 ifeq ("$(origin V)", "command line")
 Q=
mk/rte.vars.mk +3 -0
index 28982a5..c240a0e 100644
@@ -46,6 +46,9 @@ endif
 # define Q to '@' or not. $(Q) is used to prefix all shell commands to
 # be executed silently.
 Q=@
+ifeq '$V' '0'
+override V=
+endif
 ifdef V
 ifeq ("$(origin V)", "command line")
 Q=
#4 lore raw

Re: [PATCH] mk: fix verbosity zero

2016-09-23 10:06, Ferruh Yigit:

Quoted 10 lines · Thomas Monjalon
Quoted 9 lines

Verbosity is considered enabled when $V is not empty. So V=0 and V=1 are equivalent.
It is fixed by unsetting V when it is 0.

A side effect is to fix kernel module compilation verbosity which is set to 0 when V is empty.

[...]

Quoted 12 lines

mk/rte.sdkroot.mk MAKEFLAGS += --no-print-directory · line 40

Quoted 10 lines
mk/rte.sdkroot.mk +3 -0
@@ -34,6 +34,9 @@ MAKEFLAGS += --no-print-directory
 # define Q to '@' or not. $(Q) is used to prefix all shell commands to
 # be executed silently.
 Q=@
+ifeq '$V' '0'
+override V=
+endif
 ifdef V

Why not simply:

Review

Quoted 2 lines
(quoted diff) +1 -1
-ifdef V
+ifeq ($(V),1)

Because:
- V could have a higher value
- $(if $V) construct is used in several places in the makefiles

	See git grep '$(if $(*V'
author Acked-by on v1 1/1
#5 lore raw

Re: [PATCH] mk: fix verbosity zero

In reply to Thomas Monjalon
Quoted 9 lines · Thomas Monjalon

Verbosity is considered enabled when $V is not empty. So V=0 and V=1 are equivalent.
It is fixed by unsetting V when it is 0.

A side effect is to fix kernel module compilation verbosity which is set to 0 when V is empty.

#6 lore raw

Re: [PATCH] mk: fix verbosity zero

2016-09-23 10:33, Ferruh Yigit:

Quoted 5 lines · Thomas Monjalon
Quoted 4 lines

Verbosity is considered enabled when $V is not empty. So V=0 and V=1 are equivalent.
It is fixed by unsetting V when it is 0.

Quoted 7 lines
Quoted 5 lines

A side effect is to fix kernel module compilation verbosity which is set to 0 when V is empty.

Applied with additional comment:
"It is a well spread shortcut in makefiles, see git grep '$(if $(*V'"