]> www.infradead.org Git - users/jedix/linux-maple.git/commit
ctf: automate away the deduplication blacklist
authorNick Alcock <nick.alcock@oracle.com>
Wed, 6 Sep 2017 10:45:51 +0000 (11:45 +0100)
committerNick Alcock <nick.alcock@oracle.com>
Tue, 19 Sep 2017 08:34:06 +0000 (09:34 +0100)
commit3152b8356bf4cc82f4eab768a627e851c39bf893
tree62ff78504c6842b9d73770c391d771878ba71b1f
parent2ee70803b36a13ad2a99ffd008f0554f24b2ce30
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
scripts/dwarf2ctf/dedup.blacklist [deleted file]
scripts/dwarf2ctf/dwarf2ctf.c