Skip to contentSkip to conversation

Kconfig.debug: combine Kconfig debug options

PATCH In review Randy.Dunlap 3 participants 7 messages Jul 24, 2004 – Jul 28, 2004

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Kconfig.debug: combine Kconfig debug options

Localize Kconfig debug options into one file (lib/Kconfig.debug) for easier maintenance and searching.

Summary of changes:

. localizes the following symbols in lib/Kconfig.debug:
DEBUG_KERNEL, MAGIC_SYSRQ, DEBUG_SLAB, DEBUG_SPINLOCK, DEBUG_SPINLOCK_SLEEP, DEBUG_HIGHMEM, DEBUG_BUGVERBOSE, DEBUG_INFO
and FRAME_POINTER for some instances of it (if it's freely user-selectable) but not for the cases where it's forced or it depends on some other options.
. adds DEBUG_KERNEL requirement to some DEBUG_vars;
. remove KALLSYMS from S390-specific kernel hacking menu;
use KALLSYMS in the EMBEDDED menu instead;
. add CRIS and M68KNOMMU symbols for use in lib/Kconfig.debug; . eliminate duplicate "General setup" labels in sparc64 config; . whitespace cleanup;
. fixed a few trival typos;

Portions of the original patch were also done by Bartlomiej Zolnierkiewicz <[email protected]>

 arch/alpha/Kconfig           |  104 ---------------------------
 arch/alpha/Kconfig.debug     |   59 +++++++++++++++
 arch/arm/Kconfig             |  163 -------------------------------------------
 arch/arm/Kconfig.debug       |  115 ++++++++++++++++++++++++++++++
 arch/arm26/Kconfig           |  117 ------------------------------
 arch/arm26/Kconfig.debug     |   60 +++++++++++++++
 arch/cris/Kconfig            |   56 +-------------
 arch/cris/Kconfig.debug      |   28 +++++++
 arch/h8300/Kconfig           |   75 -------------------
 arch/h8300/Kconfig.debug     |   68 +++++++++++++++++
 arch/i386/Kconfig            |  148 ++-------------------------------------
 arch/i386/Kconfig.debug      |   58 +++++++++++++++
 arch/ia64/Kconfig            |  114 ------------------------------
 arch/ia64/Kconfig.debug      |   64 ++++++++++++++++
 arch/m68k/Kconfig            |   43 -----------
 arch/m68k/Kconfig.debug      |    5 +
 arch/m68knommu/Kconfig       |   66 +----------------
 arch/m68knommu/Kconfig.debug |   42 +++++++++++
 arch/mips/Kconfig            |  146 ++------------------------------------
 arch/mips/Kconfig.debug      |   76 ++++++++++++++++++++
 arch/parisc/Kconfig          |   51 -------------
 arch/parisc/Kconfig.debug    |    5 +
 arch/ppc/Kconfig             |  127 ---------------------------------
 arch/ppc/Kconfig.debug       |   72 ++++++++++++++++++
 arch/ppc64/Kconfig           |   97 -------------------------
 arch/ppc64/Kconfig.debug     |   57 +++++++++++++++
 arch/s390/Kconfig            |   65 +----------------
 arch/s390/Kconfig.debug      |    5 +
 arch/sh/Kconfig              |  162 +-----------------------------------------
 arch/sh/Kconfig.debug        |  124 ++++++++++++++++++++++++++++++++
 arch/sh64/Kconfig            |   50 -------------
 arch/sh64/Kconfig.debug      |   37 +++++++++
 arch/sparc/Kconfig           |   78 --------------------
 arch/sparc/Kconfig.debug     |   14 +++
 arch/sparc64/Kconfig         |  109 ----------------------------
 arch/sparc64/Kconfig.debug   |   44 +++++++++++
 arch/um/Kconfig              |   73 +------------------
 arch/um/Kconfig.debug        |   39 ++++++++++
 arch/v850/Kconfig            |   32 --------
 arch/v850/Kconfig.debug      |   10 ++
 arch/x86_64/Kconfig          |  134 ++++-------------------------------
 arch/x86_64/Kconfig.debug    |   56 ++++++++++++++
 init/Kconfig                 |    3 
 lib/Kconfig.debug            |  100 ++++++++++++++++++++++++++
 44 files changed, 1230 insertions(+), 1921 deletions(-)

Approx. 132 KB. Patch is available at
http://developer.osdl.org/rddunlap/kconfig/kconfig-debug-268rc2bk2.patch

and I'll mail it to Andrew separately.
--

#1 lore raw
Quoted 4 lines · Randy.Dunlap

. localizes the following symbols in lib/Kconfig.debug:
DEBUG_KERNEL, MAGIC_SYSRQ, DEBUG_SLAB, DEBUG_SPINLOCK, DEBUG_SPINLOCK_SLEEP, DEBUG_HIGHMEM, DEBUG_BUGVERBOSE, DEBUG_INFO

Which architecture does _not_ use DEBUG_KERNEL or DEBUG_SLAB? The list is quite long... Aren't these generic?

Perhaps DEBUG_SPINLOCK can depend on just SMP only? Or do people want to debug spinlock code on machines that don't have SMP?

Perhaps DEBUG_HIGHMEM can depend on just HIGHMEM only?

(didn't check the whole list) Perhaps the first instance of DEBUG_INFO can depend on !SUPERH64 && !USERMODE only?

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds

#2 lore raw

On Tue, 27 Jul 2004 14:55:39 +0200 (MEST) Geert Uytterhoeven wrote:

| On Fri, 23 Jul 2004, Randy.Dunlap wrote:
| > . localizes the following symbols in lib/Kconfig.debug:
| >     DEBUG_KERNEL, MAGIC_SYSRQ, DEBUG_SLAB, DEBUG_SPINLOCK,
| >     DEBUG_SPINLOCK_SLEEP, DEBUG_HIGHMEM, DEBUG_BUGVERBOSE,
| >     DEBUG_INFO
| 
| Which architecture does _not_ use DEBUG_KERNEL or DEBUG_SLAB? The list is quite
| long... Aren't these generic?

Looks like all of them use DEBUG_KERNEL.

DEBUG_SLAB is not available in cris, h8300, m68knommu, sh, sh64, or v850 AFAICT. Yes/no ?

| Perhaps DEBUG_SPINLOCK can depend on just SMP only? Or do people want | to debug spinlock code on machines that don't have SMP?

Yes, sounds good, I'll change that.
|
| Perhaps DEBUG_HIGHMEM can depend on just HIGHMEM only?

Yes, will change that one also.

| (didn't check the whole list) Perhaps the first instance of DEBUG_INFO | can depend on !SUPERH64 && !USERMODE only?

It could. It depends on one's config (or code/patch) philosophy. I was trying to be explicit about which arches support a config option by including each arch in a list ("inclusion"). Or I could exclude certain arches from config options ("exclusion"). The inclusion method seems safer and more readable/maintainable to me, but that's just one opinion.

--
~Randy

#3 lore raw
Quoted 3 lines · Randy.Dunlap

DEBUG_SLAB is not available in cris, h8300, m68knommu, sh, sh64, or v850 AFAICT. Yes/no ?

This can be set for sh/sh64 just fine, it is pretty much generic anyways. So placing this in a common Kconfig seems reasonable.

Quoted 10 lines

| (didn't check the whole list) Perhaps the first instance of DEBUG_INFO | can depend on !SUPERH64 && !USERMODE only?

It could. It depends on one's config (or code/patch) philosophy. I was trying to be explicit about which arches support a config option by including each arch in a list ("inclusion"). Or I could exclude certain arches from config options ("exclusion"). The inclusion method seems safer and more readable/maintainable to me, but that's just one opinion.

There's no need for the !SUPERH64 dependancy for DEBUG_INFO either, so feel free to drop that if that's the way you end up going.

#4 lore raw

On Tue, 27 Jul 2004 15:02:11 -0400 Paul Mundt wrote:

| On Tue, Jul 27, 2004 at 10:47:37AM -0700, Randy.Dunlap wrote:
| > DEBUG_SLAB is not available in cris, h8300, m68knommu, sh, sh64,
| > or v850 AFAICT.  Yes/no ?
| > 
| This can be set for sh/sh64 just fine, it is pretty much generic anyways.
| So placing this in a common Kconfig seems reasonable.

Changed that, thanks.

| > | (didn't check the whole list) Perhaps the first instance of DEBUG_INFO
| > | can depend on !SUPERH64 && !USERMODE only?
| > 
| > It could.  It depends on one's config (or code/patch) philosophy.
| > I was trying to be explicit about which arches support a config option
| > by including each arch in a list ("inclusion").  Or I could exclude
| > certain arches from config options ("exclusion").  The inclusion
| > method seems safer and more readable/maintainable to me, but that's
| > just one opinion.
| > 
| There's no need for the !SUPERH64 dependancy for DEBUG_INFO either, so
| feel free to drop that if that's the way you end up going.

Changed that one also.

Along with 3 changes in response to Geert:
- DEBUG_KERNEL applies to all arch-es;
- DEBUG_SPINLOCK depends only on DEBUG_KERNEL && SMP;
- DEBUG_HIGHMEM depends only on DEBUG_KERNEL && HIGHMEM;

Updated patch (applies to 2.6.8-rc2-bk6) is now available at
http://developer.osdl.org/rddunlap/kconfig/kconfig-debug-268rc2bk6.patch

(approx. 133 KB)

---

Localize Kconfig debug options into one file (lib/Kconfig.debug) for easier maintenance and searching.

Summary of changes:

. localizes the following symbols in lib/Kconfig.debug:
DEBUG_KERNEL, MAGIC_SYSRQ, DEBUG_SLAB, DEBUG_SPINLOCK, DEBUG_SPINLOCK_SLEEP, DEBUG_HIGHMEM, DEBUG_BUGVERBOSE, DEBUG_INFO
and FRAME_POINTER for some instances of it (if it's freely user-selectable) but not for the cases where it's forced or it depends on some other options.
. adds DEBUG_KERNEL requirement to some DEBUG_vars;
. DEBUG_KERNEL applies to all arch-es;
. remove KALLSYMS from S390-specific kernel hacking menu;
use KALLSYMS in the EMBEDDED menu instead;
. add CRIS and M68KNOMMU symbols for use in lib/Kconfig.debug; . eliminate duplicate "General setup" labels in sparc64 config; . whitespace cleanup;
. fixed a few trival typos;

Portions of the original patch were also done by Bartlomiej Zolnierkiewicz <[email protected]>

--

#5 lore raw
In reply to Randy.Dunlap
Quoted 10 lines · Randy.Dunlap

On Tue, 27 Jul 2004 14:55:39 +0200 (MEST) Geert Uytterhoeven wrote:

| On Fri, 23 Jul 2004, Randy.Dunlap wrote:
| > . localizes the following symbols in lib/Kconfig.debug:
| >     DEBUG_KERNEL, MAGIC_SYSRQ, DEBUG_SLAB, DEBUG_SPINLOCK,
| >     DEBUG_SPINLOCK_SLEEP, DEBUG_HIGHMEM, DEBUG_BUGVERBOSE,
| >     DEBUG_INFO
|
| Which architecture does _not_ use DEBUG_KERNEL or DEBUG_SLAB? The list is quite
| long... Aren't these generic?
Quoted 4 lines

Looks like all of them use DEBUG_KERNEL.

DEBUG_SLAB is not available in cris, h8300, m68knommu, sh, sh64, or v850 AFAICT. Yes/no ?

Probably someone just forgot to add them. DEBUG_SLAB is used in arch-independent code only. So I guess it doesn't harm to allow DEBUG_SLAB for all archs.

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds

#6 lore raw

On Tue, 27 Jul 2004 23:29:43 +0200 (MEST) Geert Uytterhoeven wrote:

| > DEBUG_SLAB is not available in cris, h8300, m68knommu, sh, sh64,
| > or v850 AFAICT.  Yes/no ?
| 
| Probably someone just forgot to add them. DEBUG_SLAB is used in
| arch-independent code only. So I guess it doesn't harm to allow DEBUG_SLAB for
| all archs.

Patch updated for this and for 2.6.8-rc2-bk7.

http://developer.osdl.org/rddunlap/kconfig/kconfig-debug-268rc2bk7.patch

and sending directly to Andrew.

--
~Randy