Section #11. Kernel Hacking Config Options

Several options exist under Kernel hacking in the kernel configuration menu that can emit valuable debug information. If you enable an option, corresponding debug code compile when you build the kernel.[10] Here are a few examples:

[10] Some kernel hacking options are architecture-dependent.

  1. Show Timing information on printks (CONFIG_PRINTK_TIME) adds timing instrumentation to printk() output, so you can use printks as checkpoints for measuring execution times and identifying slow code regions.
  2. Using freed memory results in memory poisoning. Debug slab memory allocations (CONFIG_DEBUG_SLAB) helps you detect such problems.
  3. Spinlock and rw-lock debugging: basic checks (CONFIG_DEBUG_SPINLOCK ...

Get Debugging Linux Systems now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.