BPF List
 help / color / mirror / Atom feed
From: Alan Maguire <alan.maguire@oracle.com>
To: Dominique Martinet <asmadeus@codewreck.org>,
	Jiri Olsa <olsajiri@gmail.com>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>,
	dwarves@vger.kernel.org, bpf@vger.kernel.org
Subject: Re: ppc64le vmlinuz is huge when building with BTF
Date: Thu, 15 Jun 2023 15:31:49 +0100	[thread overview]
Message-ID: <6b26dfef-016c-43df-07f5-c2f88157d1dc@oracle.com> (raw)
In-Reply-To: <ZIr7aaVpOaP8HjbZ@codewreck.org>

On 15/06/2023 12:52, Dominique Martinet wrote:
> Jiri Olsa wrote on Thu, Jun 15, 2023 at 10:39:18AM +0200:
>>> coming from alpine: https://gitlab.alpinelinux.org/alpine/aports/-/issues/12563
>>
>> it's probably burried somewhere in that discussion, but do you have
>> kernel version (or commit) where that increase happened?
> 
> Unfortunately not -- we've just tried on the 6.1.33 that's the current
> alpine lts kernel, but I cannot say since when this started because
> we've just enabled BTF recently.
> 
> Alpine also doesn't seem to keep old versions of apk files on its
> mirrors so while it probably has been happening since it got enabled I
> don't know how to check, and the commit enabling BTF has been done
> without a MR so there's no test log that'd allow seeing the package size
> either :/
> 
>> also link for used config would be great
> 
> alpine has two configs which both exhibit the issue (raw file link on
> commit before removing BTF):
> https://gitlab.alpinelinux.org/alpine/aports/-/raw/749ee7117e1437b7ab3ef2590f7f2e3558fda3ef/main/linux-lts/virt.ppc64le.config
> Size difference for linux-virt: 219 MiB -> 47 MiB
> https://gitlab.alpinelinux.org/alpine/aports/-/raw/749ee7117e1437b7ab3ef2590f7f2e3558fda3ef/main/linux-lts/lts.ppc64le.config
> Size difference for linux-lts: 306 MiB -> 74 MiB
>

I took a look (gunzip'ed and tar-extracted the apk to get the
vmlinuz-lts file) and the BTF looks reasonable size-wise:

$ objdump -h vmlinuz-lts
...

 13 .BTF          003d64cc  c000000001400844  0000000001400844  01410844
 2**0
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
 14 .BTF_ids      00000248  c0000000017d6d10  00000000017d6d10  017e6d10
 2**0
                  CONTENTS, ALLOC, LOAD, READONLY, DATA

So BTF is ~4MB if I'm reading the above right.

However the problem I suspect is this:

 51 .debug_info   0a488b55  0000000000000000  0000000000000000  026f8d20
 2**0
                  CONTENTS, READONLY, DEBUGGING
 52 .debug_abbrev 004d66f0  0000000000000000  0000000000000000  0cb81875
 2**0
                  CONTENTS, READONLY, DEBUGGING
 53 .debug_line   019192f6  0000000000000000  0000000000000000  0d057f65
 2**0
                  CONTENTS, READONLY, DEBUGGING
 54 .debug_frame  002d4fe0  0000000000000000  0000000000000000  0e971260
 2**3
                  CONTENTS, READONLY, DEBUGGING
 55 .debug_str    00390822  0000000000000000  0000000000000000  0ec46240
 2**0
                  CONTENTS, READONLY, DEBUGGING
 56 .debug_line_str 00000445  0000000000000000  0000000000000000
0efd6a62  2**0
                  CONTENTS, READONLY, DEBUGGING
 57 .debug_loclists 0176a32c  0000000000000000  0000000000000000
0efd6ea7  2**0
                  CONTENTS, READONLY, DEBUGGING
 58 .debug_rnglists 00382d7a  0000000000000000  0000000000000000
107411d3  2**0
                  CONTENTS, READONLY, DEBUGGING

The debug info hasn't been stripped, so I suspect the packaging spec
file or equivalent - in perhaps trying to preserve the .BTF section -
is preserving debug info too. DWARF needs to be there at BTF
generation time in vmlinux but is usually stripped for non-debug
packages.

FYI we're aiming to make BTF module-loadable via CONFIG_DEBUG_INFO_BTF=m
in the future, I'm hoping to get an RFC patch out for that soon once
other BTF-related issues are sorted. Hope this helps

Alan

  reply	other threads:[~2023-06-15 14:32 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-15  3:32 ppc64le vmlinuz is huge when building with BTF Dominique Martinet
2023-06-15  8:39 ` Jiri Olsa
2023-06-15 11:52   ` Dominique Martinet
2023-06-15 14:31     ` Alan Maguire [this message]
2023-06-15 20:34       ` Dominique Martinet
2023-06-15 21:19         ` Andrii Nakryiko
2023-06-16 10:58         ` Naveen N Rao
2023-06-16 12:00           ` Dominique Martinet
2023-06-16 17:12             ` Naveen N Rao
2023-06-15 15:15 ` Eduard Zingerman
2023-06-15 15:21   ` Eduard Zingerman

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=6b26dfef-016c-43df-07f5-c2f88157d1dc@oracle.com \
    --to=alan.maguire@oracle.com \
    --cc=acme@kernel.org \
    --cc=asmadeus@codewreck.org \
    --cc=bpf@vger.kernel.org \
    --cc=dwarves@vger.kernel.org \
    --cc=olsajiri@gmail.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox