Skip to contentSkip to conversation

xen: add DEBUG_INFO Kconfig symbol

PATCH Superseded Olaf Hering 5 participants 15 messages Aug 31, 2018 – Sep 11, 2018

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 xen: add DEBUG_INFO Kconfig symbol

Creating debug info during build is not strictly required at runtime. Make it optional by introducing a new Kconfig knob "DEBUG_INFO". This slightly reduces build time and diskusage, if disabled.

---
 xen/Kconfig.debug | 7 +++++++
 xen/Rules.mk      | 5 ++++-
 2 files changed, 11 insertions(+), 1 deletion(-)
xen/Kconfig.debug +7 -0
index 380c4e8d75..1d8c2c94a9 100644
@@ -11,6 +11,13 @@ config DEBUG
 
 	  You probably want to say 'N' here.
 
+config DEBUG_INFO
+	bool "Compile Xen with debug info"
+	default y
+	---help---
+	  If you say Y here the resulting Xen will include debugging info
+	  resulting in a larger binary image.
+
 if DEBUG || EXPERT = "y"
 
 config CRASH_DEBUG
xen/Rules.mk +4 -1
index 47c954425d..47c5c694d6 100644
@@ -55,7 +55,10 @@ endif
 
 CFLAGS += -nostdinc -fno-builtin -fno-common
 CFLAGS += -Werror -Wredundant-decls -Wno-pointer-arith
-CFLAGS += -pipe -g -D__XEN__ -include $(BASEDIR)/include/xen/config.h
+ifeq ($(CONFIG_DEBUG_INFO),y)
+CFLAGS += -g
+endif
+CFLAGS += -pipe -D__XEN__ -include $(BASEDIR)/include/xen/config.h
 CFLAGS += '-D__OBJECT_FILE__="$@"'
 
 ifneq ($(clang),y)

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

#1 lore raw
Quoted 15 lines · Olaf Hering

Creating debug info during build is not strictly required at runtime. Make it optional by introducing a new Kconfig knob "DEBUG_INFO". This slightly reduces build time and diskusage, if disabled.

---
 xen/Kconfig.debug | 7 +++++++
 xen/Rules.mk      | 5 ++++-
 2 files changed, 11 insertions(+), 1 deletion(-)
xen/Kconfig.debug +0 -0
index 380c4e8d75..1d8c2c94a9 100644

xen/Kconfig.debug config DEBUG · line 16

Quoted 6 lines
xen/Kconfig.debug +3 -0
@@ -11,6 +11,13 @@ config DEBUG
 
 	  You probably want to say 'N' here.
 
+config DEBUG_INFO
+	bool "Compile Xen with debug info"
+	default y

At the very least this should be default DEBUG

But what is the difference between this and DEBUG anyway?

Wei.

Quoted 13 lines
xen/Kconfig.debug +4 -0
+	---help---
+	  If you say Y here the resulting Xen will include debugging info
+	  resulting in a larger binary image.
+
 if DEBUG || EXPERT = "y"
 
 config CRASH_DEBUG
xen/Rules.mk +0 -0
index 47c954425d..47c5c694d6 100644
@@ -55,7 +55,10 @@ endif
 

xen/Rules.mk endif · line 64

Quoted 10 lines
xen/Rules.mk +4 -1
 CFLAGS += -nostdinc -fno-builtin -fno-common
 CFLAGS += -Werror -Wredundant-decls -Wno-pointer-arith
-CFLAGS += -pipe -g -D__XEN__ -include $(BASEDIR)/include/xen/config.h
+ifeq ($(CONFIG_DEBUG_INFO),y)
+CFLAGS += -g
+endif
+CFLAGS += -pipe -D__XEN__ -include $(BASEDIR)/include/xen/config.h
 CFLAGS += '-D__OBJECT_FILE__="$@"'
 
 ifneq ($(clang),y)

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

#3 lore raw
In reply to Wei Liu
Quoted 18 lines
Quoted 1 line
Quoted 1 line · On 31.08.18 at 10:32, <[email protected]> wrote:
Quoted 16 lines · Olaf Hering

Creating debug info during build is not strictly required at runtime. Make it optional by introducing a new Kconfig knob "DEBUG_INFO". This slightly reduces build time and diskusage, if disabled.

---
 xen/Kconfig.debug | 7 +++++++
 xen/Rules.mk      | 5 ++++-
 2 files changed, 11 insertions(+), 1 deletion(-)
xen/Kconfig.debug +0 -0
index 380c4e8d75..1d8c2c94a9 100644
@@ -11,6 +11,13 @@ config DEBUG
 
Quoted 7 lines

xen/Kconfig.debug config DEBUG · line 16

Quoted 5 lines
xen/Kconfig.debug +3 -0
 	  You probably want to say 'N' here.
 
+config DEBUG_INFO
+	bool "Compile Xen with debug info"
+	default y

At the very least this should be default DEBUG

I disagree - -g is being passed to the compiler unconditionally at present.

Quoted 1 line

But what is the difference between this and DEBUG anyway?

DEBUG_INFO controls use of the -g compiler option. DEBUG controls how e.g. ASSERT()s behave.

Jan

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

#6 lore raw
In reply to Olaf Hering
Quoted 5 lines
Quoted 1 line
Quoted 1 line · On 31.08.18 at 10:29, <[email protected]> wrote:
xen/Kconfig.debug +0 -0
@@ -11,6 +11,13 @@ config DEBUG
 

xen/Kconfig.debug config DEBUG · line 21

Quoted 10 lines
xen/Kconfig.debug +7 -0
 	  You probably want to say 'N' here.
 
+config DEBUG_INFO
+	bool "Compile Xen with debug info"
+	default y
+	---help---
+	  If you say Y here the resulting Xen will include debugging info
+	  resulting in a larger binary image.
+
 if DEBUG || EXPERT = "y"

Perhaps better move your addition into this conditional section?

xen/Rules.mk endif · line 59

Quoted 9 lines
xen/Rules.mk +2 -1
@@ -55,7 +55,10 @@ endif
 
 CFLAGS += -nostdinc -fno-builtin -fno-common
 CFLAGS += -Werror -Wredundant-decls -Wno-pointer-arith
-CFLAGS += -pipe -g -D__XEN__ -include $(BASEDIR)/include/xen/config.h
+ifeq ($(CONFIG_DEBUG_INFO),y)
+CFLAGS += -g

Note how a few lines down from here we already use CFLAGS-y. Please make this

CFLAGS-$(CONFIG_DEBUG_INFO) += -g

Jan

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

#4 lore raw
In reply to Jan Beulich
Quoted 18 lines · Jan Beulich
Quoted 18 lines
Quoted 1 line
Quoted 1 line · On 31.08.18 at 10:32, <[email protected]> wrote:
Quoted 16 lines · Olaf Hering

Creating debug info during build is not strictly required at runtime. Make it optional by introducing a new Kconfig knob "DEBUG_INFO". This slightly reduces build time and diskusage, if disabled.

---
 xen/Kconfig.debug | 7 +++++++
 xen/Rules.mk      | 5 ++++-
 2 files changed, 11 insertions(+), 1 deletion(-)
xen/Kconfig.debug +0 -0
index 380c4e8d75..1d8c2c94a9 100644
@@ -11,6 +11,13 @@ config DEBUG
 
Quoted 8 lines
Quoted 6 lines

xen/Kconfig.debug config DEBUG · line 16

Quoted 5 lines
xen/Kconfig.debug +3 -0
 	  You probably want to say 'N' here.
 
+config DEBUG_INFO
+	bool "Compile Xen with debug info"
+	default y

At the very least this should be default DEBUG

I disagree - -g is being passed to the compiler unconditionally at present.

+1

Distro packagers need to build debuginfo packages, and having a release build of Xen with xen-syms lacking all the debug symbols is quite useless.

~Andrew

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

#5 lore raw
Quoted 25 lines · Andrew Cooper
Quoted 24 lines · Jan Beulich
Quoted 24 lines
Quoted 1 line
Quoted 1 line · On 31.08.18 at 10:32, <[email protected]> wrote:
Quoted 15 lines · Olaf Hering

Creating debug info during build is not strictly required at runtime. Make it optional by introducing a new Kconfig knob "DEBUG_INFO". This slightly reduces build time and diskusage, if disabled.

---
 xen/Kconfig.debug | 7 +++++++
 xen/Rules.mk      | 5 ++++-
 2 files changed, 11 insertions(+), 1 deletion(-)
xen/Kconfig.debug +0 -0
index 380c4e8d75..1d8c2c94a9 100644

xen/Kconfig.debug config DEBUG · line 16

Quoted 6 lines
xen/Kconfig.debug +3 -0
@@ -11,6 +11,13 @@ config DEBUG
 
 	  You probably want to say 'N' here.
 
+config DEBUG_INFO
+	bool "Compile Xen with debug info"
+	default y

At the very least this should be default DEBUG

Quoted 7 lines
Quoted 2 lines

I disagree - -g is being passed to the compiler unconditionally at present.

+1

Distro packagers need to build debuginfo packages, and having a release build of Xen with xen-syms lacking all the debug symbols is quite useless.

I see. I misunderstood the intent.

Wei.

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

#9 lore raw

Hi Jan,

Quoted 8 lines · Jan Beulich
Quoted 6 lines
Quoted 1 line
Quoted 1 line · On 31.08.18 at 11:02, <[email protected]> wrote:
Quoted 1 line · Jan Beulich

Perhaps better move your addition into this conditional section?

Then -g would disappear when DEBUG is disabled. Is that intentional?

It would still be available when EXPERT=y.

This feels a bit odd you suggest EXPERT=y here given you wrote earlier:

"But note that without debug info the quality of certain linker errors decreases, which is why I would recommend against doing so."

If that can improve compiler or distro needs to create debug-symbols package, then this should be selectable without EXPERT.

Cheers,

Signature · 6 lines
Julien Grall

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
#10 lore raw
Quoted 9 lines
Quoted 1 line
Quoted 1 line · On 31.08.18 at 11:50, <[email protected]> wrote:
Quoted 7 lines · Jan Beulich
Quoted 6 lines
Quoted 1 line
Quoted 1 line · On 31.08.18 at 11:02, <[email protected]> wrote:
Quoted 1 line · Jan Beulich

Perhaps better move your addition into this conditional section?

Then -g would disappear when DEBUG is disabled. Is that intentional?

Quoted 8 lines
Quoted 1 line

It would still be available when EXPERT=y.

This feels a bit odd you suggest EXPERT=y here given you wrote earlier:

"But note that without debug info the quality of certain linker errors decreases, which is why I would recommend against doing so."

If that can improve compiler or distro needs to create debug-symbols package, then this should be selectable without EXPERT.

Perhaps some misunderstanding? EXPERT=y would allow to turn _off_ that option; if would be _on_ by default.

Jan

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

#11 lore raw
In reply to Jan Beulich
Quoted 8 lines
Quoted 8 lines
Quoted 2 lines · On 31.08.18 at 10:43, <[email protected]> wrote:
Quoted 1 line · On 31.08.18 at 10:29, <[email protected]> wrote:
xen/Kconfig.debug +0 -0
@@ -11,6 +11,13 @@ config DEBUG
 
 	  You probably want to say 'N' here.
 
Quoted 10 lines

xen/Kconfig.debug config DEBUG · line 21

Quoted 8 lines
xen/Kconfig.debug +7 -0
+config DEBUG_INFO
+	bool "Compile Xen with debug info"
+	default y
+	---help---
+	  If you say Y here the resulting Xen will include debugging info
+	  resulting in a larger binary image.
+
 if DEBUG || EXPERT = "y"

Perhaps better move your addition into this conditional section?

So this was a bad suggestion after all - with DEBUG=n DEBUG_INFO is now implicitly n as well. The section needs to be moved back to where you had it as per above, with the _prompt_ depending on DEBUG || EXPERT="y".

Jan

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

#12 lore raw
Quoted 20 lines
Quoted 9 lines
Quoted 9 lines · On 10.09.18 at 15:21, <[email protected]> wrote:
Quoted 2 lines · On 31.08.18 at 10:43, <[email protected]> wrote:
Quoted 1 line · On 31.08.18 at 10:29, <[email protected]> wrote:
xen/Kconfig.debug +0 -0
@@ -11,6 +11,13 @@ config DEBUG
 
 	  You probably want to say 'N' here.
 
Quoted 10 lines

xen/Kconfig.debug config DEBUG · line 21

Quoted 8 lines
xen/Kconfig.debug +7 -0
+config DEBUG_INFO
+	bool "Compile Xen with debug info"
+	default y
+	---help---
+	  If you say Y here the resulting Xen will include debugging info
+	  resulting in a larger binary image.
+
 if DEBUG || EXPERT = "y"

Perhaps better move your addition into this conditional section?

Quoted 4 lines

So this was a bad suggestion after all - with DEBUG=n DEBUG_INFO is now implicitly n as well. The section needs to be moved back to where you had it as per above, with the _prompt_ depending on DEBUG || EXPERT="y".

Furthermore - is COVERAGE without DEBUG_INFO of any use? Are there perhaps any other dependencies (I think/hope live patching logic doesn't depend on debug info)?

Jan

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

#13 lore raw
Quoted 18 lines · Jan Beulich
Quoted 18 lines
Quoted 18 lines
Quoted 7 lines · On 10.09.18 at 15:21, <[email protected]> wrote:
Quoted 2 lines · On 31.08.18 at 10:43, <[email protected]> wrote:
Quoted 1 line · On 31.08.18 at 10:29, <[email protected]> wrote:
xen/Kconfig.debug +0 -0
@@ -11,6 +11,13 @@ config DEBUG
 

xen/Kconfig.debug config DEBUG · line 21

Quoted 10 lines
xen/Kconfig.debug +7 -0
 	  You probably want to say 'N' here.
 
+config DEBUG_INFO
+	bool "Compile Xen with debug info"
+	default y
+	---help---
+	  If you say Y here the resulting Xen will include debugging info
+	  resulting in a larger binary image.
+
 if DEBUG || EXPERT = "y"

Perhaps better move your addition into this conditional section?

Quoted 5 lines
Quoted 4 lines

So this was a bad suggestion after all - with DEBUG=n DEBUG_INFO is now implicitly n as well. The section needs to be moved back to where you had it as per above, with the _prompt_ depending on DEBUG || EXPERT="y".

Furthermore - is COVERAGE without DEBUG_INFO of any use?

Yes - very much so.

From a "how much of my binary does do my tests cover" point of view, you want the release binary rather than the debug binary.

In some copious free time, I'd like to automate the measurements of "how much of Xen does the XTF suite cover?"

Quoted 3 lines

Are there
perhaps any other dependencies (I think/hope live patching logic doesn't depend on debug info)?

The livepatch build depends on xen-syms containing all the debug information, but the runtime logic doesn't, I believe.

~Andrew

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

#14 lore raw
Quoted 24 lines
Quoted 1 line
Quoted 1 line · On 10.09.18 at 19:51, <[email protected]> wrote:
Quoted 22 lines · Jan Beulich
Quoted 22 lines
Quoted 9 lines
Quoted 9 lines · On 10.09.18 at 15:21, <[email protected]> wrote:
Quoted 2 lines · On 31.08.18 at 10:43, <[email protected]> wrote:
Quoted 1 line · On 31.08.18 at 10:29, <[email protected]> wrote:
xen/Kconfig.debug +0 -0
@@ -11,6 +11,13 @@ config DEBUG
 
 	  You probably want to say 'N' here.
 
Quoted 9 lines

xen/Kconfig.debug config DEBUG · line 21

Quoted 8 lines
xen/Kconfig.debug +7 -0
+config DEBUG_INFO
+	bool "Compile Xen with debug info"
+	default y
+	---help---
+	  If you say Y here the resulting Xen will include debugging info
+	  resulting in a larger binary image.
+
 if DEBUG || EXPERT = "y"

Perhaps better move your addition into this conditional section?

So this was a bad suggestion after all - with DEBUG=n DEBUG_INFO is now implicitly n as well. The section needs to be moved back to where you had it as per above, with the _prompt_ depending on DEBUG || EXPERT="y".

Quoted 6 lines
Quoted 1 line

Furthermore - is COVERAGE without DEBUG_INFO of any use?

Yes - very much so.

From a "how much of my binary does do my tests cover" point of view, you want the release binary rather than the debug binary.

Did you confuse DEBUG and DEBUG_INFO? My question was because I suspect the analyzer to want/need to have debug information available.

Quoted 6 lines
Quoted 3 lines

Are there
perhaps any other dependencies (I think/hope live patching logic doesn't depend on debug info)?

The livepatch build depends on xen-syms containing all the debug information, but the runtime logic doesn't, I believe.

But if the livepatch build requires debug information (rather than just the ELF symbol table), then it _is_ depending on DEBUG_INFO.

Jan

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel