Re: [PATCH 1/1] kernel/config: Introduce CONFIG_DEBUG_INFO_IKCONFIG

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

 



Randy Dunlap <rdunlap@xxxxxxxxxxxxx> writes:
> Hi,
>
> On 10/4/23 09:58, Stephen Brennan wrote:
>> The option CONFIG_IKCONFIG allows the gzip compressed kernel
>> configuration to be included into vmlinux or a module. In these cases,
>> debuggers can access the config data and use it to adjust their behavior
>> according to the configuration. However, distributions rarely enable
>> this, likely because it uses a fair bit of kernel memory which cannot be
>> swapped out.
>
> x86_64 allmodconfig is 91 KB gzipped... oh well.

Yeah, and info like BTF is much larger, yet this is the config setting
that gets trimmed out by distros :(

(This is not a criticism of BTF, just an observation)

Unfortunately I don't control it and am just trying to work around it :)

> Reviewed-by: Randy Dunlap <rdunlap@xxxxxxxxxxxxx>

Thanks!
Stephen

>> This means that in practice, the kernel configuration is rarely
>> available to debuggers.
>> 
>> So, introduce an alternative, CONFIG_DEBUG_INFO_IKCONFIG. This strategy,
>> which is only available if IKCONFIG is not already built-in, adds a
>> section ".debug_linux_ikconfig", to the vmlinux ELF. It will be stripped
>> out of the final images, but will remain in the debuginfo files. So
>> debuggers which rely on vmlinux debuginfo can have access to the kernel
>> configuration, without incurring a cost to the kernel at runtime.
>> 
>> Signed-off-by: Stephen Brennan <stephen.s.brennan@xxxxxxxxxx>
>> ---
>>  include/asm-generic/vmlinux.lds.h |  3 ++-
>>  kernel/Makefile                   |  1 +
>>  kernel/configs-debug.S            | 18 ++++++++++++++++++
>>  lib/Kconfig.debug                 | 14 ++++++++++++++
>>  4 files changed, 35 insertions(+), 1 deletion(-)
>>  create mode 100644 kernel/configs-debug.S
>
>
> -- 
> ~Randy



[Index of Archives]     [Linux Kernel]     [Kernel Newbies]     [x86 Platform Driver]     [Netdev]     [Linux Wireless]     [Netfilter]     [Bugtraq]     [Linux Filesystems]     [Yosemite Discussion]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]

  Powered by Linux