diff mbox

[v3,1/6] build: add debug menu to Kconfig

Message ID 1462914329-8797-2-git-send-email-cardoe@cardoe.com (mailing list archive)
State New, archived
Headers show

Commit Message

Douglas Goldstein May 10, 2016, 9:05 p.m. UTC
There are a number of debugging options for Xen so the idea is to have a
menu to group them all together. Enabling this menu item will also
disable NDEBUG which will result in more debug prints. This was
previously wired into the 'debug=y' command line option.

Signed-off-by: Doug Goldstein <cardoe@cardoe.com>
---
CC: Andrew Cooper <andrew.cooper3@citrix.com>
CC: George Dunlap <George.Dunlap@eu.citrix.com>
CC: Ian Jackson <ian.jackson@eu.citrix.com>
CC: Jan Beulich <jbeulich@suse.com>
CC: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
CC: Stefano Stabellini <sstabellini@kernel.org>
CC: Tim Deegan <tim@xen.org>
CC: Wei Liu <wei.liu2@citrix.com>
---
 xen/Kconfig              |  2 ++
 xen/Kconfig.debug        | 11 +++++++++++
 xen/Rules.mk             |  2 --
 xen/include/xen/config.h |  4 ++++
 4 files changed, 17 insertions(+), 2 deletions(-)
 create mode 100644 xen/Kconfig.debug

Comments

Konrad Rzeszutek Wilk May 13, 2016, 6:07 p.m. UTC | #1
On Tue, May 10, 2016 at 04:05:24PM -0500, Doug Goldstein wrote:
> There are a number of debugging options for Xen so the idea is to have a
> menu to group them all together. Enabling this menu item will also
> disable NDEBUG which will result in more debug prints. This was
> previously wired into the 'debug=y' command line option.
> 
> Signed-off-by: Doug Goldstein <cardoe@cardoe.com>
> ---
> CC: Andrew Cooper <andrew.cooper3@citrix.com>
> CC: George Dunlap <George.Dunlap@eu.citrix.com>
> CC: Ian Jackson <ian.jackson@eu.citrix.com>
> CC: Jan Beulich <jbeulich@suse.com>
> CC: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
> CC: Stefano Stabellini <sstabellini@kernel.org>
> CC: Tim Deegan <tim@xen.org>
> CC: Wei Liu <wei.liu2@citrix.com>
> ---
>  xen/Kconfig              |  2 ++
>  xen/Kconfig.debug        | 11 +++++++++++
>  xen/Rules.mk             |  2 --
>  xen/include/xen/config.h |  4 ++++
>  4 files changed, 17 insertions(+), 2 deletions(-)
>  create mode 100644 xen/Kconfig.debug
> 
> diff --git a/xen/Kconfig b/xen/Kconfig
> index fa8b27c..0fe7a1a 100644
> --- a/xen/Kconfig
> +++ b/xen/Kconfig
> @@ -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
> index 0000000..47dc885
> --- /dev/null
> +++ b/xen/Kconfig.debug
> @@ -0,0 +1,11 @@
> +
> +menu "Debugging Options"
> +
> +config DEBUG
> +	bool "Developer Checks"
> +	---help---
> +	  Enables 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."


Otherwise it looks good to me.
> +
> +endmenu
> diff --git a/xen/Rules.mk b/xen/Rules.mk
> index 961d533..f73d86e 100644
> --- a/xen/Rules.mk
> +++ b/xen/Rules.mk
> @@ -20,8 +20,6 @@ include $(XEN_ROOT)/Config.mk
>  ifeq ($(debug),y)
>  verbose       := y
>  frame_pointer := y
> -else
> -CFLAGS += -DNDEBUG
>  endif
>  ifeq ($(perfc_arrays),y)
>  perfc := y
> diff --git a/xen/include/xen/config.h b/xen/include/xen/config.h
> index ef6e5ee..473c5e8 100644
> --- a/xen/include/xen/config.h
> +++ b/xen/include/xen/config.h
> @@ -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__ */
> -- 
> 2.7.3
>
diff mbox

Patch

diff --git a/xen/Kconfig b/xen/Kconfig
index fa8b27c..0fe7a1a 100644
--- a/xen/Kconfig
+++ b/xen/Kconfig
@@ -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
index 0000000..47dc885
--- /dev/null
+++ b/xen/Kconfig.debug
@@ -0,0 +1,11 @@ 
+
+menu "Debugging Options"
+
+config DEBUG
+	bool "Developer Checks"
+	---help---
+	  Enables developer checks such as asserts and extra printks, this
+	  option is intended for development purposes only, and not for
+	  production use.
+
+endmenu
diff --git a/xen/Rules.mk b/xen/Rules.mk
index 961d533..f73d86e 100644
--- a/xen/Rules.mk
+++ b/xen/Rules.mk
@@ -20,8 +20,6 @@  include $(XEN_ROOT)/Config.mk
 ifeq ($(debug),y)
 verbose       := y
 frame_pointer := y
-else
-CFLAGS += -DNDEBUG
 endif
 ifeq ($(perfc_arrays),y)
 perfc := y
diff --git a/xen/include/xen/config.h b/xen/include/xen/config.h
index ef6e5ee..473c5e8 100644
--- a/xen/include/xen/config.h
+++ b/xen/include/xen/config.h
@@ -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__ */