Linux 5.17 Making It Easier To Build A Kernel With All The Shiny Debug Features

Written by Michael Larabel in Linux Kernel on 20 January 2022 at 06:19 AM EST. 6 Comments
LINUX KERNEL
Over the years the Linux kernel has picked up many different sanitizers, memory leak detectors, and other features for helping to diagnose and address deficiencies in the kernel. However, all of these debugging-optimized features aren't centrally located that can make it difficult for system administrators and developers to spot these numerous features when configuring a kernel build manually. Now with Linux 5.17 that is changing.

What is being done for Linux 5.17 is introducing debug.config as a default kernel build configuration that is optimized for debugging. The debug.config will enable by default various features like the Kernel Address Sanitizer, Undefined Behavior Sanitizer, KMemLeak, and many other kernel features added over time meant to assist in debugging or tracking down of kernel problems. Thus with one command there is an officially recommended kernel configuration with the many different debugging features enabled.

Qian Cai who submitted the debug.config noted in the commit, "Some general debugging features like kmemleak, KASAN, lockdep, UBSAN etc help fix many viruses like a microscope. On the other hand, those features are scatter around and mixed up with more situational debugging options making them difficult to consume properly. This cold help amplify the general debugging/testing efforts and help establish sensitive default values for those options across the broad. This could also help different distros to collaborate on maintaining debug-flavored kernels. The config is based on years' experiences running daily CI inside the largest enterprise Linux distro company to seek regressions on linux-next builds on different bare-metal and virtual platforms."


Linux 5.17's debug.config provides recommended defaults for generating a new kernel configuration with the shiny debug features enabled... For dealing with software problems at least.


The features flipped on by debug.config are outlined here. with the many obvious DEBUG_* options, FTrace, KASAN, panic on oops, the soft lock-up detector, bug on data corruption, UBSAN, printk enhancements, and more.

Separately but along similar interest levels, Linux 5.17 also adds make mod2noconfig. This mod2noconfig option is intended to be used when transitioning a modular kernel to monolithic. This mod2noconfig allows for quickly disabling all the modules to be built prior to turning off the kernel's module support entirely. Thus this can be used for helping to speed-up build/test iterations.
Related News
About The Author
Michael Larabel

Michael Larabel is the principal author of Phoronix.com and founded the site in 2004 with a focus on enriching the Linux hardware experience. Michael has written more than 20,000 articles covering the state of Linux hardware support, Linux performance, graphics drivers, and other topics. Michael is also the lead developer of the Phoronix Test Suite, Phoromatic, and OpenBenchmarking.org automated benchmarking software. He can be followed via Twitter, LinkedIn, or contacted via MichaelLarabel.com.

Popular News This Week