Kernel Configuration Options

Configure these options in "kernel hacking " column

 

CONFIG_DEBUG_KERNEL
This option just makes other debugging options available ; it should be turned on
but does not, by itself, enable any features.


CONFIG_DEBUG_SLAB
This crucial option turns on several types of checks in the k ernel memory allocation
functions; with these checks enabled, it is possible to detect a number of
memory overrun and missing initialization errors. Each byte of allocated memory

is set to 0xa5 before being handed to the caller and then set to 0x6b when it is
freed. If you ever see either of those “poison” patterns repeating in output from
your driver (or often in an oops listing), you’ll know exactly what sort of error to
look for. When debugging is enabled, the kernel also places special guard values
before and after every allocated memory object; if those values ever get changed,
the kernel knows that somebody has overrun a memory allocation, and it complains
loudly. Various checks for more obscure errors are enabled as well.


CONFIG_DEBUG_PAGEALLOC
Full pages are removed from the kernel address space when freed . This option
can slow things down significantly, but it can also quickly point out certain
kinds of memory corruption errors.


CONFIG_DEBUG_SPINLOCK
With this option enabled, the kernel catches operations on uninitialized spinlocks
and various other errors (such as unlocking a lock twice).


CONFIG_DEBUG_SPINLOCK_SLEEP
This option enables a check for attempts to sleep while holding a spinlock . In
fact, it complains if you call a function that could potentially sleep, even if the
call in question would not sleep.


CONFIG_INIT_DEBUG
Items marked with __init (or __initdata) are discarded after system initialization
or module load time. This option enables checks for code that attempts to
access initialization-time memory after initialization is complete.


C ONFIG_DEBUG_INFO
This option causes the kernel to be built with full debugging information
included
. You’ll need that information if you want to debug the kernel with gdb .
You may also want to enable CONFIG_FRAME_POINTER if you plan to use gdb .


CONFIG_MAGIC_SYSRQ
Enables the “magic SysRq ” key. We look at this key in the section “System
Hangs
,
” later in this chapter.


CONFIG_DEBUG_STACKOVERFLOW
CONFIG_DEBUG_STACK_USAGE

These options can help track down kernel stack overflows . A sure sign of a stack
overflow is an oops listing without any sort of reasonable back trace. The first
option adds explicit overflow checks to the kernel; the second causes the kernel
to monitor stack usage and make some statistics available via the magic SysRq
key.


CONFIG_KALLSYMS
This option (under “General setup/Standard features ”) causes kernel symbol
information to be built into the kernel
;
it is enabled by default. The symbol
information is used in debugging contexts; without it, an oops listing can give
you a kernel traceback only in hexadecimal, which is not very useful.

 

CONFIG_IKCONFIG
CONFIG_IKCONFIG_PROC

These options (found in the “General setup ” menu) cause the full kernel configuration
state to be built into the kernel and to be made available via /proc.
Most
kernel developers know which configuration they used and do not need these
options (which make the kernel bigger). They can be useful, though, if you are
trying to debug a problem in a kernel built by somebody else.


CONFIG_ACPI_DEBUG
Under “Power management/ACPI. ” This option turns on verbose ACPI
(Advanced Configuration and Power Interface) debugging information
,
which
can be useful if you suspect a problem related to ACPI.


CONFIG_DEBUG_DRIVER
Under “Device drivers .” Turns on debugging information in the driver core ,
which can be useful for tracking down problems in the low-level support code.
We’ll look at the driver core in Chapter 14.


CONFIG_SCSI_CONSTANTS
This option, found under “Device drivers/SCSI device support, ” builds in information
for v erbose SCSI error messages . If you are working on a SCSI driver, you
probably want this option.


CONFIG_INPUT_EVBUG
This option (under “Device drivers/Input device support ”) turns on verbose logging
of input events
.
If you are working on a driver for an input device, this
option may be helpful. Be aware of the security implications of this option, however:
it logs everything you type, including your passwords
.
CONFIG_PROFILING
This option is found under “Profiling support .” Profiling is normally used for
system performance tuning,
but it can also be useful for tracking down some
kernel hangs and related problems .

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值