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 ??

codingfreak
  • 4,467
  • 11
  • 48
  • 60

5 Answers5

6

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
  • 5,712
  • 3
  • 36
  • 54
2

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
  • 233,326
  • 40
  • 323
  • 462
1

In RHEL 5 you can also check all the drivers that are installed into server via the kernel by:

gunzip -c  /boot/symvers-2.6.18-274.3.1.el5.gz | less

Note, you can get the full path by:

rpm -ql kernel | grep -i symver*

Also lsmod | more should do as well. Hope this will help.

Sicco
  • 6,167
  • 5
  • 45
  • 61
1

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.

mikemaccana
  • 110,530
  • 99
  • 389
  • 494
0

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
  • 14,808
  • 4
  • 33
  • 50
  • `lsmod` lists modules currently loaded into the kernel. this includes modules compiled as dynamically-loaded modules. – quack quixote Nov 26 '09 at 07:08
  • 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 Nov 26 '09 at 07:34
  • @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 Nov 27 '09 at 12:56