[Devel] [PATCH hci-8.1 v2 4/6] configs: build the User Mode Linux KUnit kernel without debug info

Konstantin Khorenko khorenko at virtuozzo.com
Tue Oct 27 01:34:22 MSK 2026


kernel.spec strips the UML binary and deletes the debug info it
extracts, as for the selftests. Every build generated DWARF and BTF for
the whole image only to throw them away.

Nothing that reads a run needs them:

- WARN and BUG reports carry file:line (DEBUG_BUGVERBOSE)
- UBSAN reports carry file:line of the check
- KASAN reports and stack traces name the functions through kallsyms

For line numbers in a KASAN stack, rebuild the same source with debug
info: the config is in the binary (IKCONFIG), and gcc generates the
same code with and without -g. BTF has no user at all, nothing runs
BPF in the UML kernel.

https://virtuozzo.atlassian.net/browse/VSTOR-143636

Feature: KUnit tests on User Mode Linux
Signed-off-by: Konstantin Khorenko <khorenko at virtuozzo.com>
---
 redhat/configs/custom-overrides/generic/um/CONFIG_DEBUG_INFO             | 1 +
 .../generic/um/CONFIG_DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT                 | 1 +
 redhat/configs/custom-overrides/generic/um/CONFIG_DEBUG_INFO_NONE        | 1 +
 3 files changed, 3 insertions(+)

diff --git a/redhat/configs/custom-overrides/generic/um/CONFIG_DEBUG_INFO b/redhat/configs/custom-overrides/generic/um/CONFIG_DEBUG_INFO
new file mode 100644
index 0000000000000..ba6c41346853e
--- /dev/null
+++ b/redhat/configs/custom-overrides/generic/um/CONFIG_DEBUG_INFO
@@ -0,0 +1 @@
+# CONFIG_DEBUG_INFO is not set
diff --git a/redhat/configs/custom-overrides/generic/um/CONFIG_DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT b/redhat/configs/custom-overrides/generic/um/CONFIG_DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT
new file mode 100644
index 0000000000000..62eed21ca3053
--- /dev/null
+++ b/redhat/configs/custom-overrides/generic/um/CONFIG_DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT
@@ -0,0 +1 @@
+# CONFIG_DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT is not set
diff --git a/redhat/configs/custom-overrides/generic/um/CONFIG_DEBUG_INFO_NONE b/redhat/configs/custom-overrides/generic/um/CONFIG_DEBUG_INFO_NONE
new file mode 100644
index 0000000000000..e37e387af671b
--- /dev/null
+++ b/redhat/configs/custom-overrides/generic/um/CONFIG_DEBUG_INFO_NONE
@@ -0,0 +1 @@
+CONFIG_DEBUG_INFO_NONE=y

-- 
2.43.0



More information about the Devel mailing list