diff mbox

[v2,1/7] build: add debug menu to Kconfig

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

Commit Message

Douglas Goldstein May 3, 2016, 2:29 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        | 7 +++++++
 xen/include/xen/config.h | 4 ++++
 3 files changed, 13 insertions(+)
 create mode 100644 xen/Kconfig.debug

Comments

Jan Beulich May 3, 2016, 2:38 p.m. UTC | #1
>>> On 03.05.16 at 16:29, <cardoe@cardoe.com> wrote:
> --- 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

At the same time you should delete the -DNDEBUG from xen/Rules.mk.
There shouldn't be two places controlling the same thing.

Jan
Douglas Goldstein May 3, 2016, 2:39 p.m. UTC | #2
On 5/3/16 9:38 AM, Jan Beulich wrote:
>>>> On 03.05.16 at 16:29, <cardoe@cardoe.com> wrote:
>> --- 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
> 
> At the same time you should delete the -DNDEBUG from xen/Rules.mk.
> There shouldn't be two places controlling the same thing.
> 
> Jan
> 

You're right. That hunk slipped to 3/7 during a rebase. I'll repost with
that moved to 1/7.
Jan Beulich May 3, 2016, 3:05 p.m. UTC | #3
>>> On 03.05.16 at 16:29, <cardoe@cardoe.com> wrote:
> --- /dev/null
> +++ b/xen/Kconfig.debug
> @@ -0,0 +1,7 @@
> +
> +menuconfig DEBUG
> +	bool "Debugging Options"

One more thing: In the unstable branch this should really default to
y, and the release check list should be adjusted to say that this
default needs to be dropped (or inverted) while preparing a release.

And obviously the "debug=" also needs to go away from ./Config.mk.

Jan
Andrew Cooper May 3, 2016, 3:10 p.m. UTC | #4
On 03/05/16 16:05, Jan Beulich wrote:
>>>> On 03.05.16 at 16:29, <cardoe@cardoe.com> wrote:
>> --- /dev/null
>> +++ b/xen/Kconfig.debug
>> @@ -0,0 +1,7 @@
>> +
>> +menuconfig DEBUG
>> +	bool "Debugging Options"
> One more thing: In the unstable branch this should really default to
> y, and the release check list should be adjusted to say that this
> default needs to be dropped (or inverted) while preparing a release.
>
> And obviously the "debug=" also needs to go away from ./Config.mk.

Things other than Xen make use of debug= in the root Config.mk. 
Valgrind client requests for example in libxc.

That option can't be moved without providing an alternative.

~Andrew
Jan Beulich May 3, 2016, 3:18 p.m. UTC | #5
>>> On 03.05.16 at 17:10, <andrew.cooper3@citrix.com> wrote:
> On 03/05/16 16:05, Jan Beulich wrote:
>>>>> On 03.05.16 at 16:29, <cardoe@cardoe.com> wrote:
>>> --- /dev/null
>>> +++ b/xen/Kconfig.debug
>>> @@ -0,0 +1,7 @@
>>> +
>>> +menuconfig DEBUG
>>> +	bool "Debugging Options"
>> One more thing: In the unstable branch this should really default to
>> y, and the release check list should be adjusted to say that this
>> default needs to be dropped (or inverted) while preparing a release.
>>
>> And obviously the "debug=" also needs to go away from ./Config.mk.
> 
> Things other than Xen make use of debug= in the root Config.mk. 
> Valgrind client requests for example in libxc.
> 
> That option can't be moved without providing an alternative.

Why can't it be moved into tools/ if that's where it is still of interest?

Jan
Douglas Goldstein May 4, 2016, 2:22 a.m. UTC | #6
On 5/3/16 10:18 AM, Jan Beulich wrote:
>>>> On 03.05.16 at 17:10, <andrew.cooper3@citrix.com> wrote:
>> On 03/05/16 16:05, Jan Beulich wrote:
>>>>>> On 03.05.16 at 16:29, <cardoe@cardoe.com> wrote:
>>>> --- /dev/null
>>>> +++ b/xen/Kconfig.debug
>>>> @@ -0,0 +1,7 @@
>>>> +
>>>> +menuconfig DEBUG
>>>> +	bool "Debugging Options"
>>> One more thing: In the unstable branch this should really default to
>>> y, and the release check list should be adjusted to say that this
>>> default needs to be dropped (or inverted) while preparing a release.
>>>
>>> And obviously the "debug=" also needs to go away from ./Config.mk.
>>
>> Things other than Xen make use of debug= in the root Config.mk. 
>> Valgrind client requests for example in libxc.
>>
>> That option can't be moved without providing an alternative.
> 
> Why can't it be moved into tools/ if that's where it is still of interest?
> 
> Jan
> 

You could argue it could then move into the autoconf script which would
make the knobs more consistent for each part of the tree. The tools/
bits always as autoconf and the xen/ bits as Kconfig.
Jan Beulich May 4, 2016, 7:17 a.m. UTC | #7
>>> On 04.05.16 at 04:22, <cardoe@cardoe.com> wrote:
> On 5/3/16 10:18 AM, Jan Beulich wrote:
>>>>> On 03.05.16 at 17:10, <andrew.cooper3@citrix.com> wrote:
>>> On 03/05/16 16:05, Jan Beulich wrote:
>>>>>>> On 03.05.16 at 16:29, <cardoe@cardoe.com> wrote:
>>>>> --- /dev/null
>>>>> +++ b/xen/Kconfig.debug
>>>>> @@ -0,0 +1,7 @@
>>>>> +
>>>>> +menuconfig DEBUG
>>>>> +	bool "Debugging Options"
>>>> One more thing: In the unstable branch this should really default to
>>>> y, and the release check list should be adjusted to say that this
>>>> default needs to be dropped (or inverted) while preparing a release.
>>>>
>>>> And obviously the "debug=" also needs to go away from ./Config.mk.
>>>
>>> Things other than Xen make use of debug= in the root Config.mk. 
>>> Valgrind client requests for example in libxc.
>>>
>>> That option can't be moved without providing an alternative.
>> 
>> Why can't it be moved into tools/ if that's where it is still of interest?
> 
> You could argue it could then move into the autoconf script which would
> make the knobs more consistent for each part of the tree. The tools/
> bits always as autoconf and the xen/ bits as Kconfig.

I agree, but perhaps as a separate step.

Jan
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..e5179f4
--- /dev/null
+++ b/xen/Kconfig.debug
@@ -0,0 +1,7 @@ 
+
+menuconfig DEBUG
+	bool "Debugging Options"
+	---help---
+	  If you want to debug Xen say Y and select any additional debugging
+	  support options. Enabling this option is intended for development
+	  purposes only, and not for production use.
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__ */