[DTrace-devel] [PATCH 06/20] btf: convert kernel types to CTF on demand

Kris Van Hees kris.van.hees at oracle.com
Sat Nov 7 15:45:09 UTC 2026


On Fri, Nov 06, 2026 at 12:53:06PM +0000, Nix wrote:
> On 30 Oct 2026, Kris Van Hees said:
> 
> > Index BTF type names while decoding, and initialize CTF dictionaries without
> > converting every BTF type.  Materialize requested named types and their
> > reachable dependencies through a common CTF lookup helper, including direct
> > compiler and provider lookups of shared kernel types.
> 
> Nice speedup!
> 
> > Reserve aggregate shells before converting references so recursive typedefs
> 
> Maybe 'wrappers'? 'Skeletons'? Shells seems a bit... strange to me,
> terminology-wise. (Also, 'shell' is rather overloaded in Unix already.)

I will go with "werappers".

> > and callback prototypes work regardless of the requested root.  Grow the
> > shared parent dictionary lazily for split BTF, and roll back newly added
> > CTF types and cache entries when conversion fails.  Prefer available
> > aggregate definitions over forward references.
> >
> > Advance the BTF function parameter iterator and preserve packed member
> > offsets so converted prototypes and conversion retries retain their BTF
> > information.
> >
> > Reject split conversion when archive-backed shared CTF has no matching
> > BTF-to-CTF parent mapping, leaving the module to the existing CTF fallback.
> > Keep this guard with lazy conversion so provider header generation also
> > works when the kernel CTF archive is present.
> >
> > Add synthetic coverage for lazy conversion, recursive graphs, pointer
> > lookups, bitfields, forwards, split and parent-only BTF, failure recovery,
> > and ordinary CTF dictionaries.
> 
> There doesn't seem to be any attempt to preserve IDs here -- I guess we
> don't care? (In particular, aggregate types end up in a completely
> different place in the type ID space than they did before, before
> everything else... which makes me worry slightly, though it *should*
> work.)

As far as I can see, preserving IDs is not really needed, because the
BTF is of course the authoritative source in this case, and we construct
the CTF from it.  The construction process is, as far as I can see, safe
and ensures that IDs are as they ought to be.

I honestly cannot see any way this can go wrong, even thugh things are
going to be in a different order.  We never actually care about the
order, right?



More information about the DTrace-devel mailing list