[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Enabling CONFIG_KALLSYMS_ALL



On 01/29/2012 12:16 AM, Ben Hutchings wrote:
On Thu, 2012-01-26 at 12:31 -0500, Tim Abbott wrote:
Hello,

Would it be possible to turn on CONFIG_KALLSYMS_ALL in the Debian kernel
for Wheezy?  It's a useful debugging option, and makes it easier to
implement useful tools like Ksplice that inspect the code and data
structures of the running kernel, in particular in relation to operating
on modules (one can use System.map to look up addresses for data
structures in the core kernel).  Most other major Linux distributions
have had CONFIG_KALLSYMS_ALL enabled in their kernels for some time now
(RHEL, Fedora, Ubuntu, etc.).
Isn't this redundant with the linux-image-*-dbg packages?  Though those
are much larger.
Not entirely. You're right that those packages are huge, which makes them unwieldy. But there are other advantages of using kallsyms for symbol information: (1) kallsyms symbol information is available for out-of-tree modules, which don't always build/distribute the analogue of the linux-image-*-dbg packages. (2) With CONFIG_KALLSYMS_ALL, full symbol information is always available on the machine you're looking to debug. So you don't have to deal with tracking down the right version of the debug package (If you want to work with Debian systems that may have been up for a long time, you need a database of the mapping between `uname -a` and package version numbers in order to figure out which version of the linux-image-*-dbg package actually goes with the running kernel's vmlinux. And it's even harder to figure out which version of the linux-image-*-dbg package to use for an in-tree module, since it's possible that the linux-image-* package was upgraded on disk after boot, but before the kernel module of interest was loaded, and so the module isn't the one that "goes with" the vmlinux). (3) kallsyms provides a uniform interface across all the different Linux distributions for getting symbol information, that can be used directly by both kernel code and userspace code that's doing debugging, tracing, or patching.

        -Tim Abbott


Reply to: