From: Gabriel Corona Date: Tue, 18 Feb 2014 10:38:14 +0000 (+0100) Subject: [mc] Do not waste time calling libunwind get_proc_name in the hot spots X-Git-Tag: v3_11~199^2~2^2~24^2~6 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/6feb6e8bbb970e26a20a7c74234425bc7ebe0f6f?hp=6feb6e8bbb970e26a20a7c74234425bc7ebe0f6f [mc] Do not waste time calling libunwind get_proc_name in the hot spots In typical executions, nearly 50% of the time was spent in libunwind get_proc_name. The algorithm to find the function for a given IP (instruction pointer) was: (proc_name, offset) = get_proc_name(ip) // Slow! dwarf_ip = ip - offset function = functions_by_name[proc_name] We added a structure mapping IP ranges to functions and the algorithm is now: function = functions_by_ip[ip] Instead of relying on libunwind, we use the DWARF information to find the corresponding DWARF TAG_subprogram DIEs directly. The secution time on some MPICH tests is nearly halved. Notes: * It was necessary to disable the support for inlined_subprograms which was broken anyway: the inlined_subprogram entries should be stored as children of their parent subprogram (as a block). We need to add support for scope blocks inside a suprogram to handle this correctly. * Currently the translation between process virtual addresses and DWARF virtual addresses is handled in many different places. We should change this to process it only when parsing the DWARF DIEs and be done with it. ---