public inbox for dwarves@vger.kernel.org
 help / color / mirror / Atom feed
From: Nick Alcock <nick.alcock@oracle.com>
To: Sam James <sam@gentoo.org>
Cc: <nick.alcock@oracle.com>, <acme@kernel.org>,
	<alan.maguire@oracle.com>, <andrii@kernel.org>, <ast@kernel.org>,
	<bruce.mcculloch@oracle.com>, <david.faust@oracle.com>,
	<dwarves@vger.kernel.org>, <elena.zannoni@oracle.com>,
	<jose.marchesi@oracle.com>, <stephen.brennan@oracle.com>
Subject: Re: Proof-of-concept GCC/GNU ld toolchain-driven BTF generation/deduplication
Date: Mon, 09 Jun 2025 13:22:31 +0100	[thread overview]
Message-ID: <878qm1je9k.fsf@esperi.org.uk> (raw)
In-Reply-To: <874iwqvfeb.fsf@gentoo.org> (Sam James's message of "Sun, 8 Jun 2025 08:52:44 +0100")

On 8 Jun 2025, Sam James outgrape:

> Thanks for this, I'm really excited to see it. The disk space (and time
> needed) for DWARF has been a problem for us especially as a source-based
> distribution because we can't assume all builds are done on some beefy
> centralised builder ;)

That probably affects userspace, mostly, since most packages are
userspace packages -- but then, almost all the remaining differences
between BTF and CTFv4 are driven by the needs of userspace
usage.

Ideally I want it to be fast enough that it can be used for real-time
ABI checking in places like ld.so (I have an improvement coming up
suggested by Dodji that might reduce the time needed for such checks of
public symbol type-compat to nearly unit time with minimal space
reqirements).

> Have you got a list of what's left to do and also what you need from the
> community? Or is this a preview of what you're working on and not
> expecting much discussion yet?

Oh, discussion is welcome! If this whole thing is a disaster that nobody
will ever accept, I want to know *now* before I spend more time on it.


My todo list before I try for upstreaming this immensity is here:
<https://sourceware.org/binutils/wiki/CTF/Todo/CTFv4>.  Most of the
really big stuff on that list is done, but there's some things that must
be done for robustness, some that are known regressions from CTFv3, one
that is critical for anything at all (back-compatibility reading) and
some things that we should do anyway as long as we're changing the
format and libctf API and ABI like this. The API breaks are small, but
they're there...

(None of these changes affect anything in the BTF subset, so all the
stuff the kernel build process needs should just keep working
unchanged.)

It's probably three weeks' to a month's work, I guess.

What I need from the community?

Once back-compat reading is in place and the libctf testsuite starts
working properly again, I'll have to start seeing about getting people
to review the libctf series before upstreaming into binutils, and that's
a big thing to ask of anyone. It's cut into smallish pieces but it's
still 12,000 lines or so... not quite ready for that yet though.

A smaller but perhaps harder and more important job: the public API as a
whole could do with review -- it's possible there are changes that don't
require existing users to make more than small mods, but that *also*
make it much simpler and/or more expressive... also, we've added a lot
of new functions in this series, and I'd like to make sure they make
some sort of coherent sense.  API review from unbiased external API
users (or want-to-be-users) is probably the most important thing people
could do to help here, really.  The public API of the new release is
here:

https://sourceware.org/git/?p=binutils-gdb.git;a=blob;f=include/ctf-api.h;;hb=refs/heads/users/nalcock/road-to-ctfv4

It's big, but much of the size is CTF/BTF dict creation or linking stuff
that can be ignored if you're only a consumer. However, the query side
is still quite big, and some of the function names around things like
symbol lookup are... not good (speaking as the guy who made them
up). Improved names and/or better ways to do this by combining some of
these functions into one would be nice :)

An .org file briefly listing all the changes is here:

https://sourceware.org/git/?p=binutils-gdb.git;a=blob;f=libctf/api.org;;hb=refs/heads/users/nalcock/road-to-ctfv4

      reply	other threads:[~2025-06-09 12:22 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-29 16:46 Proof-of-concept GCC/GNU ld toolchain-driven BTF generation/deduplication Nick Alcock
2025-06-08  7:52 ` Sam James
2025-06-09 12:22   ` Nick Alcock [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=878qm1je9k.fsf@esperi.org.uk \
    --to=nick.alcock@oracle.com \
    --cc=acme@kernel.org \
    --cc=alan.maguire@oracle.com \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bruce.mcculloch@oracle.com \
    --cc=david.faust@oracle.com \
    --cc=dwarves@vger.kernel.org \
    --cc=elena.zannoni@oracle.com \
    --cc=jose.marchesi@oracle.com \
    --cc=sam@gentoo.org \
    --cc=stephen.brennan@oracle.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