Bug 22252 - Parallel parsing of CU's DIEs from libdw
Summary: Parallel parsing of CU's DIEs from libdw
Status: RESOLVED FIXED
Alias: None
Product: elfutils
Classification: Unclassified
Component: libdw (show other bugs)
Version: unspecified
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-10-04 18:22 UTC by Ben Woodard
Modified: 2020-11-13 00:00 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ben Woodard 2017-10-04 18:22:55 UTC
To speed up the processing of large ELF files which are common in HPC please resolve the data races which prevent parallel parsing of CU's DIEs within ELF files. We'd like to do something like:

 for(Dwarf_Off cu_off = 0;
            dwarf_next_unit(dbg(), cu_off, &next_cu_header, &cu_header_length,
                NULL, &abbrev_offset, &addr_size, &offset_size,
                &type_signaturep, NULL) == 0;
            cu_off = next_cu_header)
    {
        if(!dwarf_offdie_types(dbg(), cu_off + cu_header_length, &current_cu_die))
            continue;
// Modified for parallelism: rather than a single DwarfWalker holding state,
// create a new context and clone before we spawn a thread
        push();
        DwarfWalker mod_walker(*this);
        pop();
        bool ret = cilk_spawn mod_walker.parseModule(false, fixUnknownMod);
//        bool ret = parseModule(false, fixUnknownMod);
        if(!ret) {
            cilk_sync;
            return false;
        }
        compile_offset = next_cu_header;
    }
    cilk_sync;

Code similar to this is being worked on for dyninst http://www.dyninst.org/
Comment 1 Mark Wielaard 2020-09-09 13:38:07 UTC
I believe this has been resolved since elfutils Version 0.178

libdw: Abbrevs and DIEs can now be read concurrently by multiple
       threads through the same Dwarf handle.
Comment 2 Ben Woodard 2020-11-13 00:00:13 UTC
Yea done.