bpf.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* How to deal with increased install size with `CONFIG_DEBUG_INFO_BTF=y`
@ 2025-08-25 15:42 Paul Menzel
  2025-08-25 17:54 ` Yonghong Song
  0 siblings, 1 reply; 2+ messages in thread
From: Paul Menzel @ 2025-08-25 15:42 UTC (permalink / raw)
  To: Alexei Starovoitov, Daniel Borkmann, Andrii Nakryiko; +Cc: bpf, linux-kernel

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

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.


Kind regards,

Paul


[1]: https://github.com/mozillazg/ptcpdump
[2]: 
https://gitlab.alpinelinux.org/alpine/aports/-/merge_requests/28218/diffs

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: How to deal with increased install size with `CONFIG_DEBUG_INFO_BTF=y`
  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
  0 siblings, 0 replies; 2+ messages in thread
From: Yonghong Song @ 2025-08-25 17:54 UTC (permalink / raw)
  To: Paul Menzel, Alexei Starovoitov, Daniel Borkmann, Andrii Nakryiko
  Cc: bpf, linux-kernel



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
>


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-08-25 17:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).