From: Eduard Zingerman <eddyz87@gmail.com>
To: Alexei Starovoitov <alexei.starovoitov@gmail.com>,
Arnaldo Carvalho de Melo <acme@kernel.org>,
nick.alcock@oracle.com, Alan Maguire <alan.maguire@oracle.com>
Cc: Jiri Olsa <jolsa@kernel.org>,
Clark Williams <williams@redhat.com>,
Kate Carcia <kcarcia@redhat.com>,
dwarves <dwarves@vger.kernel.org>,
Arnaldo Carvalho de Melo <acme@redhat.com>,
Andrii Nakryiko <andrii.nakryiko@gmail.com>,
Yonghong Song <yonghong.song@linux.dev>,
"Jose E. Marchesi" <jose.marchesi@oracle.com>,
Nick Alcock <nick.alcock@oracle.com>,
Namhyung Kim <namhyung@kernel.org>, bpf <bpf@vger.kernel.org>
Subject: Re: [RFC 0/4] BTF archive with unmodified pahole+toolchain
Date: Fri, 08 Aug 2025 11:28:13 -0700 [thread overview]
Message-ID: <b297444e23c42caeab254c90fa91f46f75212e29.camel@gmail.com> (raw)
In-Reply-To: <CAADnVQ+cvvHN9CunLP03yRFKz2YJirmF0j80-fZ0A-8aVVopPg@mail.gmail.com>
On Thu, 2025-08-07 at 19:09 -0700, Alexei Starovoitov wrote:
[...]
> Before you jump into 1,2,3 let's discuss the end goal.
> I think the assumption here is that this btf-for-each-.o approach
> is supposed to speed up the build, right ?
> pahole step on vmlinux is noticeable, but it's still a fraction
> of three vmlinux linking steps.
> How much are we realistically thinking to shave off of that pahole dedup time?
Hi Alan, Arnaldo, Nick,
I'd like to second Alexei's question.
In the cover letter Arnaldo points out that un-deduplicated BTF
amounts for 325Mb, while total DWARF size is 365Mb.
I tried measuring total amount of DWARF in my kernel building directory:
for f in $(find . -name "*.o" | grep -Ev '(scripts|vmlinux|tools|module-common)'); do \
readelf -SW $f | grep "\.debug";
done \
| awk 'BEGIN {val=0} {val += strtonum("0x"$6)} END {printf("%d", val)}' \
| numfmt --to=si
And it says 845M.
The size of DWARF sections in the final vmlinux is comparable to yours: 307Mb.
The total size of the generated binaries is 905Mb.
So, unless the above calculations are messed up, the total gain here is:
- save ~500Mb generated during build
- save some time on pahole not needing to parse/convert DWARF
Is this is what you are trying to achieve?
In theory, having BTF handled completely by compiler and linker makes
sense to me. However, pahole is already here and it does the job.
So, I see several drawbacks:
- As you note, there would be two avenues to generate BTF now:
- DWARF + pahole
- BTF + pahole (replaced by BTF + ld at some point?)
This is a potential source of bugs.
Is the goal to forgo DWARF+pahole at some point in the future?
- I assume that it is much faster to land changes in pahole compared
to changes in gcc, so future btf modifications/features might be a
bit harder to execute. Wdyt?
Thanks,
Eduard
next prev parent reply other threads:[~2025-08-08 18:28 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-07 18:25 [RFC 0/4] BTF archive with unmodified pahole+toolchain Arnaldo Carvalho de Melo
2025-08-07 18:25 ` [PATCH 1/4] libbpf: Simplify error handling removing needless repeated err checks Arnaldo Carvalho de Melo
2025-08-07 18:25 ` [PATCH 2/4] libbpf: Check if there is extra data at the end of a BTF Arnaldo Carvalho de Melo
2025-08-07 18:25 ` [PATCH 3/4] libbpf: Add support for detecting and dedup'ing a BTF archive Arnaldo Carvalho de Melo
2025-08-07 18:25 ` [PATCH 4/4] libbpf: Check if an ELF .BTF section is an archive and combine/dedup Arnaldo Carvalho de Melo
2025-08-07 18:46 ` [RFC 0/4] BTF archive with unmodified pahole+toolchain Arnaldo Carvalho de Melo
2025-08-07 20:23 ` Arnaldo Carvalho de Melo
2025-08-08 2:09 ` Alexei Starovoitov
[not found] ` <CA+JHD92DODDESCfwiiCs_ZQ5bGesK5NC+xe5EvONF5g+-Bg+9Q@mail.gmail.com>
2025-08-08 2:52 ` Alexei Starovoitov
2025-08-08 3:25 ` Arnaldo Carvalho de Melo
2025-08-08 3:33 ` Sam James
2025-08-08 3:54 ` Arnaldo Carvalho de Melo
2025-08-08 14:45 ` Nick Alcock
2025-08-08 15:15 ` Nick Alcock
2025-08-08 18:28 ` Eduard Zingerman [this message]
2025-08-08 19:10 ` Arnaldo Carvalho de Melo
2025-08-08 20:15 ` Eduard Zingerman
2025-08-08 20:59 ` Arnaldo Carvalho de Melo
2025-08-21 21:35 ` Nick Alcock
2025-08-27 0:14 ` Alexei Starovoitov
2025-09-15 10:11 ` Nick Alcock
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=b297444e23c42caeab254c90fa91f46f75212e29.camel@gmail.com \
--to=eddyz87@gmail.com \
--cc=acme@kernel.org \
--cc=acme@redhat.com \
--cc=alan.maguire@oracle.com \
--cc=alexei.starovoitov@gmail.com \
--cc=andrii.nakryiko@gmail.com \
--cc=bpf@vger.kernel.org \
--cc=dwarves@vger.kernel.org \
--cc=jolsa@kernel.org \
--cc=jose.marchesi@oracle.com \
--cc=kcarcia@redhat.com \
--cc=namhyung@kernel.org \
--cc=nick.alcock@oracle.com \
--cc=williams@redhat.com \
--cc=yonghong.song@linux.dev \
/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