Skip to contentSkip to conversation

tools/pvhsim: Inherit the tools debug= setting

PATCH In review Andrew Cooper 2 participants 2 messages Oct 22, 2024 – Oct 24, 2024

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tools/pvhsim: Inherit the tools debug= setting

Right now, builds of pvshim are non-debug, because of pvshim_defconfig. However, this means that Gitlab CI testing is less effective than it wants to be.

Include Rules.mk, and feed the tools-wide debug= setting.

---
CC: Jan Beulich <[email protected]>
CC: Roger Pau Monné <[email protected]>
CC: Anthony PERARD <[email protected]>
CC: Marek Marczykowski-Górecki <[email protected]>

I don't particualrly like this, because while it ends up getting the appropriate choice of CONFIG_DEBUG, all other symbols with a default dependent on CONFIG_DEBUG get their non-debug form.

---
 tools/firmware/xen-dir/Makefile | 3 +++
 1 file changed, 3 insertions(+)
tools/firmware/xen-dir/Makefile +3 -0
index 6f5e208ab413..e19916f76722 100644
@@ -1,4 +1,5 @@
 XEN_ROOT = $(CURDIR)/../../..
+include $(XEN_ROOT)/tools/Rules.mk
 
 all: xen-shim
 
@@ -75,6 +76,8 @@ $(D): linkfarm.stamp
 
 $(D)/xen/.config: $(D)
 	$(MAKE) -C $(@D) KBUILD_DEFCONFIG=pvshim_defconfig defconfig
+	echo "CONFIG_DEBUG=$(if $(debug),y,n)" >> $@
+	$(MAKE) -C $(@D) olddefconfig
 
 xen-shim: $(D)/xen/.config
 	$(MAKE) -C $(<D) build
Signature · 1 line
2.39.5
#1 lore raw
Quoted 11 lines · Andrew Cooper
tools/firmware/xen-dir/Makefile +1 -0
index 6f5e208ab413..e19916f76722 100644
@@ -1,4 +1,5 @@
 XEN_ROOT = $(CURDIR)/../../..
+include $(XEN_ROOT)/tools/Rules.mk
 
 all: xen-shim
 

tools/firmware/xen-dir/Makefile $(D): linkfarm.stamp · line 79

Quoted 4 lines
tools/firmware/xen-dir/Makefile +1 -0
@@ -75,6 +76,8 @@ $(D): linkfarm.stamp
 
 $(D)/xen/.config: $(D)
 	$(MAKE) -C $(@D) KBUILD_DEFCONFIG=pvshim_defconfig defconfig
+	echo "CONFIG_DEBUG=$(if $(debug),y,n)" >> $@

I don't think this does what you think it does ;-).

In the GitLab CI, we have both "export debug=y" and "export debug=n", in both case that $(if ) will return 'y' because $(debug) is non-empty.

For one-liner to do this, there's a few option in Make and shell:

    $(if $(filter y,$(debug)),y,n)
    $$([ "$(debug)" = y ] && echo y || echo n)
    $$(case "$(debug)" in y) echo y;; *) echo n;; esac)

For the $(filter ) option, if one does debug='y no' make the $(if ) will expand to 'y', but it's probably good enough.

Thanks,

Signature · 5 lines
Anthony Perard | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vates solutions

web: https://vates.tech