[DTrace-devel] [PATCH 1/8] btf: Fix BTF lookups

Nick Alcock nick.alcock at oracle.com
Thu Apr 4 19:50:27 UTC 2024


On 3 Apr 2024, Kris Van Hees via DTrace-devel verbalised:

> BTF lookups need to account for the possiblity that a BTF string lookup
> might return NULL.

It should return "", surely, not NULL? (Where "" == strtab offset 0.)
But checking for NULL is probably good armouring anyway.

>                     Also, if a type/kind is not found in a module's BTF,
> look in the shared BTF next.
>
> Signed-off-by: Kris Van Hees <kris.van.hees at oracle.com>

Probably (as a future enhancement) this "look in the parent" should be
generalized for everything, not just type kind lookups? Repeating that
over and over again feels unpleasant. (e.g. libctf has an internal
ctf_lookup_by_id() function to do this: hand it a type ID, get back a
dict pointer and a pointer to the internal datastructure representing
that ID.)

Reviewed-by: Nick Alcock <nick.alcock at oracle.com> nonetheless



More information about the DTrace-devel mailing list