build: convert debug to Kconfig
authorDoug Goldstein <cardoe@cardoe.com>
Wed, 8 Jun 2016 12:04:30 +0000 (14:04 +0200)
committerJan Beulich <jbeulich@suse.com>
Wed, 8 Jun 2016 12:04:30 +0000 (14:04 +0200)
Enabling debug will disable NDEBUG which will result in more debug
prints.  There are a number of debugging options for Xen so place the
debug option under a menu for different debugging options to have a way
to group them all together.

Signed-off-by: Doug Goldstein <cardoe@cardoe.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Reviewed-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
xen/Kconfig
xen/Kconfig.debug [new file with mode: 0644]
xen/Rules.mk
xen/include/xen/config.h

index fa8b27c853aaf8c0259c6a8e48cc47660df2fd10..0fe7a1a251e9570dc31b93add25984476d601a99 100644 (file)
@@ -26,3 +26,5 @@ config DEFCONFIG_LIST
 config EXPERT
        string
        option env="XEN_CONFIG_EXPERT"
+
+source "Kconfig.debug"
diff --git a/xen/Kconfig.debug b/xen/Kconfig.debug
new file mode 100644 (file)
index 0000000..796af0c
--- /dev/null
@@ -0,0 +1,14 @@
+
+menu "Debugging Options"
+
+config DEBUG
+       bool "Developer Checks"
+       default y
+       ---help---
+         If you say Y here this will enable developer checks such as asserts
+         and extra printks. This option is intended for development purposes
+         only, and not for production use.
+
+         You probably want to say 'N' here.
+
+endmenu
index 961d533da2b5ac7a30c722b683e8bdde9f53ceee..da2f490f4ed26705749d486656554c106016dc08 100644 (file)
@@ -20,13 +20,14 @@ include $(XEN_ROOT)/Config.mk
 ifeq ($(debug),y)
 verbose       := y
 frame_pointer := y
-else
-CFLAGS += -DNDEBUG
 endif
 ifeq ($(perfc_arrays),y)
 perfc := y
 endif
 
+ifeq ($(origin debug),command line)
+$(warning "You must use 'make menuconfig' to enable/disable debug now.")
+endif
 ifneq ($(origin kexec),undefined)
 $(error "You must use 'make menuconfig' to enable/disable kexec now.")
 endif
index ef6e5ee22b46d11095c7ad580f5511a2b5548468..473c5e8c3e8e9c23847f5c76b8608e5ede9cfa0e 100644 (file)
@@ -81,4 +81,8 @@
 /* allow existing code to work with Kconfig variable */
 #define NR_CPUS CONFIG_NR_CPUS
 
+#ifndef CONFIG_DEBUG
+#define NDEBUG
+#endif
+
 #endif /* __XEN_CONFIG_H__ */