wolfpld / tracy

Frame profiler
https://tracy.nereid.pl/
Other
9.89k stars 658 forks source link

Add image cache to avoid calling dladdr() and add libbacktrace elf image list refresh #674

Closed tiago-rodrigues closed 9 months ago

tiago-rodrigues commented 10 months ago

On glibc platforms, add an image cache to avoid calling dladdr() when doing offline symbol resolution, as dladdr() can cause contention with other dl* calls (see: https://github.com/wolfpld/tracy/pull/665#issuecomment-1817363122).

Add support for libbacktrace to detect new elfs have been dynamically loaded after backtrace_initialize() has been called, and consider them for further symbol resolution.

YaLTeR commented 10 months ago

Gave this a try and it seems to work very well! I am able to record GNOME Shell with offline symbol resolving without much extra lag seemingly.

YaLTeR commented 9 months ago

I'm testing libunwind bt + dynload and I'm getting funny strings in the backtrace occasionally, could be memory corruption?

image

YaLTeR commented 9 months ago

Okay, I get this without dynload too, so I'll make an issue instead.

YaLTeR commented 9 months ago

Made an issue at #684; I somewhat suspect the latter changes in this PR though, because when I tested it in the beginning it seemed to work fine.