jrfonseca / drmingw

Postmortem debugging tools for MinGW.
GNU Lesser General Public License v2.1
279 stars 56 forks source link

Optimizations #50

Closed djdron closed 4 years ago

djdron commented 4 years ago

When profiling with Very Sleepy (it uses drmingw for determining functions names/code lines) i noticed huge memory allocation. First i think that problem was in libdwarf, but not. I found that memory was not deallocated after using some libdwarf functions. Also i separated functions getting dwarf info symbol/code lines to speed up profiler. And found that pe_find_symbol() got better functions names than from dwarf.

jrfonseca commented 4 years ago

using pe_find_symbol() first - more accurate names

I think https://ci.appveyor.com/project/jrfonseca/drmingw/builds/33620133/job/4ej9aa64jbi2rgn0 test failed because of this. The test expects WinMain but found WinMain@16. Anyway, it's trivial to fix the expected regex.

What worries me is that I'm not really confident that pe_find_symbol gives better symbols. I fear it might five the wrong symbol.

Could you please elaborate/exemplify why you think that pe_find_symbol is better?

Otherwise looks great! Thanks

djdron commented 4 years ago

What worries me is that I'm not really confident that pe_find_symbol gives better symbols. I fear it might five the wrong symbol.

Many template functions names are stripped with dwarf info, like push_back, allocate, etc. Also some system functions.

pe_names dwarf_names

jrfonseca commented 4 years ago

Merged. Thanks.