From: Yonghong Song <yonghong.song@linux.dev>
To: Paul Menzel <pmenzel@molgen.mpg.de>,
Alexei Starovoitov <ast@kernel.org>,
Daniel Borkmann <daniel@iogearbox.net>,
Andrii Nakryiko <andrii@kernel.org>
Cc: bpf@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: How to deal with increased install size with `CONFIG_DEBUG_INFO_BTF=y`
Date: Mon, 25 Aug 2025 10:54:04 -0700 [thread overview]
Message-ID: <a2d8fba6-288c-4d2c-ac2c-d7a920c0cf39@linux.dev> (raw)
In-Reply-To: <15bcb208-3ccb-4d99-853b-545626914373@molgen.mpg.de>
On 8/25/25 8:42 AM, Paul Menzel wrote:
> Dear Linux folks,
>
>
> Trying to get ptcpdump [1] running, I needed to build Linux with BTF
> symbols.
>
> ```
> @@ -5985,11 +5986,22 @@
> #
> # Compile-time checks and compiler options
> #
> +CONFIG_DEBUG_INFO=y
> CONFIG_AS_HAS_NON_CONST_ULEB128=y
> -CONFIG_DEBUG_INFO_NONE=y
> +# CONFIG_DEBUG_INFO_NONE is not set
> # CONFIG_DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT is not set
> # CONFIG_DEBUG_INFO_DWARF4 is not set
> -# CONFIG_DEBUG_INFO_DWARF5 is not set
> +CONFIG_DEBUG_INFO_DWARF5=y
> +# CONFIG_DEBUG_INFO_REDUCED is not set
> +CONFIG_DEBUG_INFO_COMPRESSED_NONE=y
> +# CONFIG_DEBUG_INFO_COMPRESSED_ZLIB is not set
> +# CONFIG_DEBUG_INFO_SPLIT is not set
> +CONFIG_DEBUG_INFO_BTF=y
> +CONFIG_PAHOLE_HAS_SPLIT_BTF=y
> +CONFIG_PAHOLE_HAS_LANG_EXCLUDE=y
> +CONFIG_DEBUG_INFO_BTF_MODULES=y
> +# CONFIG_MODULE_ALLOW_BTF_MISMATCH is not set
> +# CONFIG_GDB_SCRIPTS is not set
> CONFIG_FRAME_WARN=2048
> # CONFIG_STRIP_ASM_SYMS is not set
> # CONFIG_READABLE_ASM is not set
> ```
>
> This increased the module size quite a bit:
>
> $ du -sh /lib/modules/6.12.4*
> 128M /lib/modules/6.12.40.mx64.484
> 1.9G /lib/modules/6.12.43.mx64.485
The increase is mostly due to dwarf. The BTF related sections should be just ~6M.
>
> Searching the WWW, it was suggested to run `INSTALL_MOD_STRIP=1` [2],
> bringing it down to 137 MB:
>
> 137M /lib/modules/6.12.43.mx64.486
>
> I was under the expression, that BTF symbols are small compared to the
> debug symbol types from the past. (Excuse my ignorance about the
> terminology and subject.) Is `INSTALL_MOD_STRIP=1` the “recommended”
> way to still use BPF/BTF on production systems.
You can use INSTALL_MOD_STRIP=1 to reduce kernel binary size in /lib/modules/... directory.
>
>
> Kind regards,
>
> Paul
>
>
> [1]: https://github.com/mozillazg/ptcpdump
> [2]:
> https://gitlab.alpinelinux.org/alpine/aports/-/merge_requests/28218/diffs
>
prev parent reply other threads:[~2025-08-25 17:54 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-25 15:42 How to deal with increased install size with `CONFIG_DEBUG_INFO_BTF=y` Paul Menzel
2025-08-25 17:54 ` Yonghong Song [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=a2d8fba6-288c-4d2c-ac2c-d7a920c0cf39@linux.dev \
--to=yonghong.song@linux.dev \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=linux-kernel@vger.kernel.org \
--cc=pmenzel@molgen.mpg.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.