My system is Ubuntu 18.04. How do I install a Linux kernel with debug symbols and without optimizations? I would like to trace it with SystemTap.
1 Answer
Ubuntu provides per-compiled kernels but these kernels won't have any debugging features you need. Here's a link to a quick guide to compiling the Ubuntu release of Linux.
There's a section for enabling debug symbols at the bottom of the guide.
Regarding the compiling of the kernel without optimization -- that can be done for certain features within the kernel, but the kernel as a whole requires the -O2 flag to compile. See discussion here.
-
The provided guide does not work because rules does not have the recipies used by the tutorial. Commented Sep 4, 2018 at 15:44