views:

255

answers:

4

How can I know if the standard kernel provided in my linux flavour has got DEBUG KERNEL ENABLED flags selected or not ??

I think DEBUG option should be enabled inorder to use tools like kprobe, systemtap ??

A: 

The standard kernel would probably NOT have been compiled with those flags enabled, since this would increase the size of the kernel. The overhead would be a disadvantage to most users.

You always have the option of recompiling your own custom version of the kernel, in which case you may select your own set of options.

You can list the modules compiled into the kernel with the lsmod command.

pavium
`lsmod` lists modules currently loaded into the kernel. this includes modules compiled as dynamically-loaded modules.
quack quixote
So inorder to debug the kernel I should again build a new kernel with all kernel debugging flags enabled ?? Is there any other way to enable them ??
codingfreak
@codingfreak,I dont think any other way to get kernel debugging flag enabled.You must rebuild the kernel if it does not have debugging options enabled.
kumar
A: 

To find out how your kernel was configured, check in the /boot/ directory. Depending on how your distro does things, there might be a config-* file, which shows the kernel configuration options that were used to build the kernel. Look for the debug settings (eg CONFIG_DEBUG_KERNEL).

caf
+3  A: 

Assuming the kernel has the "provide config via proc" you can check the configuration of the running kernel by looking at /proc/config.gz

gunzip -c /proc/config.gz | less
stsquad
A: 

If it's RHEL / CentOS / Fedora:

Kernel configuration is inside the kernel-devel package.

The specific configuration used by Red Hat to build your distro's kernel is stored in /usr/src/kernels/version/.config.

nailer