All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] [RFC] Documentation/process: Add testing section to tip handbook
@ 2022-03-14 18:35 Dave Hansen
  2022-03-31 12:38 ` Borislav Petkov
  0 siblings, 1 reply; 3+ messages in thread
From: Dave Hansen @ 2022-03-14 18:35 UTC (permalink / raw)
  To: linux-kernel
  Cc: Dave Hansen, Jonathan Corbet, Borislav Petkov, Thomas Gleixner,
	x86, linux-doc

From: Dave Hansen <dave.hansen@linux.intel.com>

The kernel has a wide variety of debugging options to help catch
and squash bugs.  However, new debugging is added all the time and
the existing options can be hard to find.

Add a list of debugging options which tip maintainers expect to be
used to test contributions.

This should make it easier for contributors to test their code and
find issues before submission.

Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com>
Cc: Jonathan Corbet <corbet@lwn.net>
Cc: Borislav Petkov <bp@suse.de>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: x86@kernel.org
Cc: linux-doc@vger.kernel.org
---
 Documentation/process/maintainer-tip.rst | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/Documentation/process/maintainer-tip.rst b/Documentation/process/maintainer-tip.rst
index c74f4a81588b..75f86b0f1cf0 100644
--- a/Documentation/process/maintainer-tip.rst
+++ b/Documentation/process/maintainer-tip.rst
@@ -437,6 +437,30 @@ in a private repository which allows interested people to easily pull the
 series for testing. The usual way to offer this is a git URL in the cover
 letter of the patch series.
 
+Testing
+^^^^^^^
+
+Code should be tested before submitting to the tip maintainers.  Anything
+other than minor changes should be built, booted and tested with the
+following set of comprehensive (and heavyweight) set of kernel debugging
+options enabled.
+
+	CONFIG_X86_DEBUG_FPU=y
+	CONFIG_LOCK_STAT=y
+	CONFIG_DEBUG_VM=y
+	CONFIG_DEBUG_VM_VMACACHE=y
+	CONFIG_DEBUG_VM_RB=y
+	CONFIG_DEBUG_SLAB=y
+	CONFIG_DEBUG_KMEMLEAK=y
+	CONFIG_DEBUG_PAGEALLOC=y
+	CONFIG_SLUB_DEBUG_ON=y
+	CONFIG_KMEMCHECK=y
+	CONFIG_DEBUG_OBJECTS_ENABLE_DEFAULT=y
+	CONFIG_GCOV_KERNEL=y
+	CONFIG_LOCKDEP=y
+	CONFIG_PROVE_LOCKING=y
+	CONFIG_SCHEDSTATS=y
+	CONFIG_VMLINUX_VALIDATION=y
 
 Coding style notes
 ------------------
-- 
2.34.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] [RFC] Documentation/process: Add testing section to tip handbook
  2022-03-14 18:35 [PATCH] [RFC] Documentation/process: Add testing section to tip handbook Dave Hansen
@ 2022-03-31 12:38 ` Borislav Petkov
  2022-03-31 17:37   ` Dave Hansen
  0 siblings, 1 reply; 3+ messages in thread
From: Borislav Petkov @ 2022-03-31 12:38 UTC (permalink / raw)
  To: Dave Hansen
  Cc: linux-kernel, Jonathan Corbet, Borislav Petkov, Thomas Gleixner,
	x86, linux-doc

On Mon, Mar 14, 2022 at 11:35:52AM -0700, Dave Hansen wrote:
> From: Dave Hansen <dave.hansen@linux.intel.com>
> 
> The kernel has a wide variety of debugging options to help catch
> and squash bugs.  However, new debugging is added all the time and
> the existing options can be hard to find.
> 
> Add a list of debugging options which tip maintainers expect to be
> used to test contributions.
> 
> This should make it easier for contributors to test their code and
> find issues before submission.
> 
> Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com>
> Cc: Jonathan Corbet <corbet@lwn.net>
> Cc: Borislav Petkov <bp@suse.de>
> Cc: Thomas Gleixner <tglx@linutronix.de>
> Cc: x86@kernel.org
> Cc: linux-doc@vger.kernel.org
> ---
>  Documentation/process/maintainer-tip.rst | 24 ++++++++++++++++++++++++
>  1 file changed, 24 insertions(+)
> 
> diff --git a/Documentation/process/maintainer-tip.rst b/Documentation/process/maintainer-tip.rst
> index c74f4a81588b..75f86b0f1cf0 100644
> --- a/Documentation/process/maintainer-tip.rst
> +++ b/Documentation/process/maintainer-tip.rst
> @@ -437,6 +437,30 @@ in a private repository which allows interested people to easily pull the
>  series for testing. The usual way to offer this is a git URL in the cover
>  letter of the patch series.
>  
> +Testing
> +^^^^^^^
> +
> +Code should be tested before submitting to the tip maintainers.  Anything
> +other than minor changes should be built, booted and tested with the
> +following set of comprehensive (and heavyweight) set of kernel debugging
> +options enabled.
> +
> +	CONFIG_X86_DEBUG_FPU=y
> +	CONFIG_LOCK_STAT=y
> +	CONFIG_DEBUG_VM=y
> +	CONFIG_DEBUG_VM_VMACACHE=y
> +	CONFIG_DEBUG_VM_RB=y
> +	CONFIG_DEBUG_SLAB=y
> +	CONFIG_DEBUG_KMEMLEAK=y
> +	CONFIG_DEBUG_PAGEALLOC=y
> +	CONFIG_SLUB_DEBUG_ON=y
> +	CONFIG_KMEMCHECK=y
> +	CONFIG_DEBUG_OBJECTS_ENABLE_DEFAULT=y
> +	CONFIG_GCOV_KERNEL=y
> +	CONFIG_LOCKDEP=y
> +	CONFIG_PROVE_LOCKING=y
> +	CONFIG_SCHEDSTATS=y
> +	CONFIG_VMLINUX_VALIDATION=y

It would be cool if there were a command I can run so that I can enable
all those. Example:

$ grep CONFIG_VMLINUX_VALIDATION .config
$ ./scripts/config --enable CONFIG_VMLINUX_VALIDATION
$ grep CONFIG_VMLINUX_VALIDATION .config
CONFIG_VMLINUX_VALIDATION=y
$ make oldconfig
#
# configuration written to .config
#
$ grep CONFIG_VMLINUX_VALIDATION .config
$

Needs other options.

Maybe you could create a .config snippet which we can merge
with scripts/kconfig/merge_config.sh... or maybe start from
arch/x86/configs/x86_64_defconfig, add all those and call it

arch/x86/configs/x86_64_testconfig

or so.

-- 
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] [RFC] Documentation/process: Add testing section to tip handbook
  2022-03-31 12:38 ` Borislav Petkov
@ 2022-03-31 17:37   ` Dave Hansen
  0 siblings, 0 replies; 3+ messages in thread
From: Dave Hansen @ 2022-03-31 17:37 UTC (permalink / raw)
  To: Borislav Petkov, Dave Hansen
  Cc: linux-kernel, Jonathan Corbet, Borislav Petkov, Thomas Gleixner,
	x86, linux-doc

On 3/31/22 05:38, Borislav Petkov wrote:
>> +Code should be tested before submitting to the tip maintainers.  Anything
>> +other than minor changes should be built, booted and tested with the
>> +following set of comprehensive (and heavyweight) set of kernel debugging
>> +options enabled.
>> +
>> +	CONFIG_X86_DEBUG_FPU=y
>> +	CONFIG_LOCK_STAT=y
...
> It would be cool if there were a command I can run so that I can enable
> all those. Example:
> 
> $ grep CONFIG_VMLINUX_VALIDATION .config
> $ ./scripts/config --enable CONFIG_VMLINUX_VALIDATION
> $ grep CONFIG_VMLINUX_VALIDATION .config
> CONFIG_VMLINUX_VALIDATION=y
> $ make oldconfig
> #
> # configuration written to .config
> #
> $ grep CONFIG_VMLINUX_VALIDATION .config
> $
> 
> Needs other options.
> 
> Maybe you could create a .config snippet which we can merge
> with scripts/kconfig/merge_config.sh... or maybe start from
> arch/x86/configs/x86_64_defconfig, add all those and call it
> 
> arch/x86/configs/x86_64_testconfig

Well, after some digging around it turns out that we're not the first
ones with this problem.  Just throwing those options into:

	kernel/configs/x86_debug.config

and doing:

	make x86_debug.config

will magically do:

	Using .config as base
	Merging /home/davehans/linux.git/kernel/configs/x86_debug.config
	#
	# merged configuration written to .config (needs make)
	...

Who knew?  I'll move the options and send another patch.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-03-31 17:37 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-14 18:35 [PATCH] [RFC] Documentation/process: Add testing section to tip handbook Dave Hansen
2022-03-31 12:38 ` Borislav Petkov
2022-03-31 17:37   ` Dave Hansen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.