Skip to content

Commit 6dfc066

Browse files
Dave Hansentorvalds
authored andcommitted
consolidate compilation option configs
Original Post: http://lkml.kernel.org/r/[email protected] Again, trying to come up with some common themes of the stuff in the kernel hacking menu... There are quite a few options to tweak compilation in some way, or perform extra compile-time checks. Give them their own menu. The diff here looks a bit funny... makes it look like I'm moving debugfs even though I'm actually moving the options on either side of it. Signed-off-by: Dave Hansen <[email protected]> Signed-off-by: Dave Hansen <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent 881c514 commit 6dfc066

File tree

1 file changed

+80
-76
lines changed

1 file changed

+80
-76
lines changed

lib/Kconfig.debug

Lines changed: 80 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,34 @@ config DEFAULT_MESSAGE_LOGLEVEL
2525
that are auditing their logs closely may want to set it to a lower
2626
priority.
2727

28+
menu "Compile-time checks and compiler options"
29+
30+
config DEBUG_INFO
31+
bool "Compile the kernel with debug info"
32+
depends on DEBUG_KERNEL
33+
help
34+
If you say Y here the resulting kernel image will include
35+
debugging info resulting in a larger kernel image.
36+
This adds debug symbols to the kernel and modules (gcc -g), and
37+
is needed if you intend to use kernel crashdump or binary object
38+
tools like crash, kgdb, LKCD, gdb, etc on the kernel.
39+
Say Y here only if you plan to debug the kernel.
40+
41+
If unsure, say N.
42+
43+
config DEBUG_INFO_REDUCED
44+
bool "Reduce debugging information"
45+
depends on DEBUG_INFO
46+
help
47+
If you say Y here gcc is instructed to generate less debugging
48+
information for structure types. This means that tools that
49+
need full debugging information (like kgdb or systemtap) won't
50+
be happy. But if you merely need debugging information to
51+
resolve line numbers there is no loss. Advantage is that
52+
build directory object sizes shrink dramatically over a full
53+
DEBUG_INFO build and compile times are reduced too.
54+
Only works with newer gcc versions.
55+
2856
config ENABLE_WARN_DEPRECATED
2957
bool "Enable __deprecated logic"
3058
default y
@@ -52,20 +80,6 @@ config FRAME_WARN
5280
Setting it to 0 disables the warning.
5381
Requires gcc 4.4
5482

55-
config MAGIC_SYSRQ
56-
bool "Magic SysRq key"
57-
depends on !UML
58-
help
59-
If you say Y here, you will have some control over the system even
60-
if the system crashes for example during kernel debugging (e.g., you
61-
will be able to flush the buffer cache to disk, reboot the system
62-
immediately or dump some status information). This is accomplished
63-
by pressing various keys while holding SysRq (Alt+PrintScreen). It
64-
also works on a serial console (on PC hardware at least), if you
65-
send a BREAK and then within 5 seconds a command keypress. The
66-
keys are documented in <file:Documentation/sysrq.txt>. Don't say Y
67-
unless you really know what this hack does.
68-
6983
config STRIP_ASM_SYMS
7084
bool "Strip assembler-generated symbols during link"
7185
default n
@@ -156,6 +170,58 @@ config DEBUG_SECTION_MISMATCH
156170
- Enable verbose reporting from modpost in order to help resolve
157171
the section mismatches that are reported.
158172

173+
#
174+
# Select this config option from the architecture Kconfig, if it
175+
# is preferred to always offer frame pointers as a config
176+
# option on the architecture (regardless of KERNEL_DEBUG):
177+
#
178+
config ARCH_WANT_FRAME_POINTERS
179+
bool
180+
help
181+
182+
config FRAME_POINTER
183+
bool "Compile the kernel with frame pointers"
184+
depends on DEBUG_KERNEL && \
185+
(CRIS || M68K || FRV || UML || \
186+
AVR32 || SUPERH || BLACKFIN || MN10300 || METAG) || \
187+
ARCH_WANT_FRAME_POINTERS
188+
default y if (DEBUG_INFO && UML) || ARCH_WANT_FRAME_POINTERS
189+
help
190+
If you say Y here the resulting kernel image will be slightly
191+
larger and slower, but it gives very useful debugging information
192+
in case of kernel bugs. (precise oopses/stacktraces/warnings)
193+
194+
config DEBUG_FORCE_WEAK_PER_CPU
195+
bool "Force weak per-cpu definitions"
196+
depends on DEBUG_KERNEL
197+
help
198+
s390 and alpha require percpu variables in modules to be
199+
defined weak to work around addressing range issue which
200+
puts the following two restrictions on percpu variable
201+
definitions.
202+
203+
1. percpu symbols must be unique whether static or not
204+
2. percpu variables can't be defined inside a function
205+
206+
To ensure that generic code follows the above rules, this
207+
option forces all percpu variables to be defined as weak.
208+
209+
endmenu # "Compiler options"
210+
211+
config MAGIC_SYSRQ
212+
bool "Magic SysRq key"
213+
depends on !UML
214+
help
215+
If you say Y here, you will have some control over the system even
216+
if the system crashes for example during kernel debugging (e.g., you
217+
will be able to flush the buffer cache to disk, reboot the system
218+
immediately or dump some status information). This is accomplished
219+
by pressing various keys while holding SysRq (Alt+PrintScreen). It
220+
also works on a serial console (on PC hardware at least), if you
221+
send a BREAK and then within 5 seconds a command keypress. The
222+
keys are documented in <file:Documentation/sysrq.txt>. Don't say Y
223+
unless you really know what this hack does.
224+
159225
config DEBUG_KERNEL
160226
bool "Kernel debugging"
161227
help
@@ -816,32 +882,6 @@ config DEBUG_BUGVERBOSE
816882
of the BUG call as well as the EIP and oops trace. This aids
817883
debugging but costs about 70-100K of memory.
818884

819-
config DEBUG_INFO
820-
bool "Compile the kernel with debug info"
821-
depends on DEBUG_KERNEL
822-
help
823-
If you say Y here the resulting kernel image will include
824-
debugging info resulting in a larger kernel image.
825-
This adds debug symbols to the kernel and modules (gcc -g), and
826-
is needed if you intend to use kernel crashdump or binary object
827-
tools like crash, kgdb, LKCD, gdb, etc on the kernel.
828-
Say Y here only if you plan to debug the kernel.
829-
830-
If unsure, say N.
831-
832-
config DEBUG_INFO_REDUCED
833-
bool "Reduce debugging information"
834-
depends on DEBUG_INFO
835-
help
836-
If you say Y here gcc is instructed to generate less debugging
837-
information for structure types. This means that tools that
838-
need full debugging information (like kgdb or systemtap) won't
839-
be happy. But if you merely need debugging information to
840-
resolve line numbers there is no loss. Advantage is that
841-
build directory object sizes shrink dramatically over a full
842-
DEBUG_INFO build and compile times are reduced too.
843-
Only works with newer gcc versions.
844-
845885
config DEBUG_WRITECOUNT
846886
bool "Debug filesystem writers count"
847887
depends on DEBUG_KERNEL
@@ -896,27 +936,6 @@ config DEBUG_CREDENTIALS
896936

897937
If unsure, say N.
898938

899-
#
900-
# Select this config option from the architecture Kconfig, if it
901-
# is preferred to always offer frame pointers as a config
902-
# option on the architecture (regardless of KERNEL_DEBUG):
903-
#
904-
config ARCH_WANT_FRAME_POINTERS
905-
bool
906-
help
907-
908-
config FRAME_POINTER
909-
bool "Compile the kernel with frame pointers"
910-
depends on DEBUG_KERNEL && \
911-
(CRIS || M68K || FRV || UML || \
912-
AVR32 || SUPERH || BLACKFIN || MN10300 || METAG) || \
913-
ARCH_WANT_FRAME_POINTERS
914-
default y if (DEBUG_INFO && UML) || ARCH_WANT_FRAME_POINTERS
915-
help
916-
If you say Y here the resulting kernel image will be slightly
917-
larger and slower, but it gives very useful debugging information
918-
in case of kernel bugs. (precise oopses/stacktraces/warnings)
919-
920939
config BOOT_PRINTK_DELAY
921940
bool "Delay each boot printk message by N milliseconds"
922941
depends on DEBUG_KERNEL && PRINTK && GENERIC_CALIBRATE_DELAY
@@ -1100,21 +1119,6 @@ config DEBUG_BLOCK_EXT_DEVT
11001119

11011120
Say N if you are unsure.
11021121

1103-
config DEBUG_FORCE_WEAK_PER_CPU
1104-
bool "Force weak per-cpu definitions"
1105-
depends on DEBUG_KERNEL
1106-
help
1107-
s390 and alpha require percpu variables in modules to be
1108-
defined weak to work around addressing range issue which
1109-
puts the following two restrictions on percpu variable
1110-
definitions.
1111-
1112-
1. percpu symbols must be unique whether static or not
1113-
2. percpu variables can't be defined inside a function
1114-
1115-
To ensure that generic code follows the above rules, this
1116-
option forces all percpu variables to be defined as weak.
1117-
11181122
config NOTIFIER_ERROR_INJECTION
11191123
tristate "Notifier error injection"
11201124
depends on DEBUG_KERNEL

0 commit comments

Comments
 (0)