On Mon, 2020-06-15 at 09:54 -0700, Josh Stone via Elfutils-devel wrote: > On 6/13/20 10:40 AM, Milian Wolff wrote: > > Has anyone an idea on how to to post-process the DWARF data to > > optimize the > > lookup of inlined frames? > > SystemTap implements its own cache for repeated lookups -- see > dwflpp::get_die_parents().
Right, libabigail does something similar. The issue is indeed that we don't have a parent DIE chain/cache. So each call of dwarf_getscopes[_die] first goes down the CU die tree to build up the parent chain on each call... It would probably make sense to build a parent DIE chain cache for a CU. The question is when/how we build the cache. There are also lots of programs that won't need it, or only for some, but not all CUs. It will take space and time to create. The dwarf_getscopes[_die] calls might be a good trigger to create/keep them. And/or have some explicit way to create them, maybe triggered by some helper function to get at the parent of a DIE. Cheers, Mark