2023-10-27 17:21:24

by Stephen Brennan

[permalink] [raw]
Subject: [PATCH v3 0/1] Introduce CONFIG_DEBUG_INFO_IKCONFIG

Hello All,

This adds an alternative for CONFIG_IKCONFIG, which nearly all Linux
distributions disable (probably due to memory considerations). It adds the
section ".debug_linux_ikconfig" to the vmlinux ELF file, which is stripped
out for final images, but retained for debuginfo (objcopy detects the ".debug"
prefix). It is enabled by default whenever IKCONFIG is disabled, so that
debuggers can rely on having the kernel config available.

v1: https://lore.kernel.org/linux-debuggers/[email protected]/T/#t
v2: https://lore.kernel.org/linux-debuggers/[email protected]/T/#t

Changes v2-v3:

* Added missing dependency on kernel/config_data.gz in kernel/Makefile.

Changes v1-v2:

* I added "default y if IKCONFIG!=y". The result is that whenever DEBUG_INFO=y
is enabled, and IKCONFIG is not built-in, then DEBUG_INFO_IKCONFIG will get
enabled automatically. The whole point of this patch is for kernel debuggers
to be able to rely on having kernel configuration information. The IKCONFIG
data is quite small compared to kernel debuginfo, and it doesn't change
anything at runtime. It's safe to enable this automatically, and it's
important so that distributions (who create debuginfo explicitly to allow
kernel debugging) will automatically begin creating this info for debuggers.

* Randy Dunlap did review this, but I didn't apply that tag with the update,
since I understand changing defaults is a major update, and it's a small patch
to begin with, so I didn't want to misrepresent the review.

Stephen Brennan (1):
kernel/config: Introduce CONFIG_DEBUG_INFO_IKCONFIG

include/asm-generic/vmlinux.lds.h | 3 ++-
kernel/Makefile | 2 ++
kernel/configs-debug.S | 18 ++++++++++++++++++
lib/Kconfig.debug | 15 +++++++++++++++
4 files changed, 37 insertions(+), 1 deletion(-)
create mode 100644 kernel/configs-debug.S

--
2.39.3