ctf: automate away the deduplication blacklist
The deduplication blacklist in scripts/dwarf2ctf/dedup.blacklist is a
great bit kludge. It contains a list of modules that cannot be
deduplicated because they contain structures which are defined in the
same location in different ways different kernel modules (usually
because the structure is modified by preprocessor conditionals). But
augmenting the blacklist is a pig, involving lots of poring over
debugging output to find the structure to focus on.
So automate the problem away, by augmenting type IDs for structures with
the sizeof() the structure in a new component (separated from the others
by //, a component invalid in POSIX pathnames, as usual). Helpfully
this is made available to us in the DW_AT_byte_size attribute, so it's
fast to obtain. (The component is optional because opaque structure
declarations obviously cannot include it.)
We adjust the one place that transforms transparent structure IDs into
opaque ones to take this tag into account.
This will still break for structures that are modified by preprocessor
conditionals in such a way that one member is replaced by another with a
different type but which has the same size as the one it replaces
(perhaps one pointer to a structure being replaced by a pointer to a
different structure), but in the interests of dwarf2ctf performance I'm
avoiding solving this for now, since we are not hitting it, and solving
it would require annotating structure IDs with some sort of hash of
their member names: the overhead of recursing over all members every
time we get an ID for a structure seems likely to be quite high, given
how often we look up type_id()s.
This change has no detectable effect on dwarf2ctf runtime, and shrinks
the CTF output by about 40KiB.
Signed-off-by: Nick Alcock <nick.alcock@oracle.com>
Reviewed-by: Tomas Jedlicka <tomas.jedlicka@oracle.com>
Orabug:
26765112