-
Notifications
You must be signed in to change notification settings - Fork 64
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Promote the speed of Gimli-based addr2line #308
Comments
Thanks for the feedback. We used to do a benchmark comparison (there's still a benchmark script in the repository). However, keeping that up to date is additional maintenance effort that I didn't want to spend, and promoting old information feels wrong. Another reason was that the bin application isn't as polished as it could be (although I have done some work on that recently). |
Regarding the benchmarking effort: Is there anything I can help you with? It seems to me the existing Rust bench infrastructure already contains a way to get a random selection of addresses: Lines 50 to 66 in db88c5a
which can be easily transformed into something that would run various binaries for a selection of non-trivial ELF binaries with debug info. If you're willing to guide me, I can help you. What kind of polishing do you mean? Generally speaking, for a non-trivial binaries (medium to big applications), the performance is so outstanding to Binutils that I would not hesitate to mention it 🎉 |
@marxin You can also use |
The main problem with running the benchmarks is having a reproducible environment containing recent versions of the tools. I don't think this is a hard problem, it just hasn't been a priority. For polishing, the main thing lacking is in locating the various places where the debug info needs to be loaded from. #296 and #298 contained some improvements for this, but there's still more to be done. There's maybe other minor things, e.g. some unwraps in the cli code. There's also wholesym-addr2line (part of samply) which probably does all the debug info locating correctly, and handles pdb as well. |
Yep. I might offer a rolling Linux distribution like openSUSE Tumbleweed, which can be run in a container with something like: FROM opensuse/tumbleweed
RUN zypper addrepo http://download.opensuse.org/debug/tumbleweed/repo/oss/ debug
RUN zypper in -y MozillaFirefox-debuginfo binutils time llvm The simplest testing approach can be something like:
Is it feasible for the benchmarking?
@mstange Is the ambition to have |
I'm not familiar with openSUSE. If you think it's a good choice then I'll accept it. I'll accept a PR for something that will have low ongoing maintenance, but I don't want to spend much time thinking about it myself.
I don't think llvm-nm is a good source of addresses, since it will only give the start address of each function, but we want addresses in the middle too where inlining is more likely. You could use the You'll need to specify a random source for |
I've just made a #315 where I added a benchmarking script, please take a look. |
I've added a plot for those benchmark results to the readme in #322, so I'm going to close this as done. Thanks for your work on this, and I'm happy to accept further PRs to expand on this if you see the need. |
The plotting output is a great idea and I've just improved it a bit in #325. |
First of all, thank you for the tool!
Let me explain how I discovered your tool. I was watching one of @jonhoo's videos about Inferno and I was curious how it works. I had a fuzzy memory (from the time I used FlameGraph) that the Perf scripts are slow so I tried to use Inferno for 2 projects: mold and MozillaFirefox. I collected a small profile for both of them and quickly realized the binutils'
addr2line
is really slow. My experiment just runs Firefox, opens https://html5test.com/ and finishes.If I run
perf report
or (perf script
), the loading in perf (mostly dominated withaddr2line
calls) takes >5 minutes. If I replace the binutils'addr2line
with your implementation, I get down to 10 seconds which is an incredible improvement.Based on strace profile, it seems
addr2line
is called about 20K x for the biggest Firefox' librarylibxul.so
. If I take first 1000 address queries and run them among the variousaddr2line
implementations, I get the following numbers:From the visual inspection of the output (I've just compared Gimpli and Binutils), the results are pretty much the same! That being said, I think you should bravely promote your tool in the README.md file. Good job!
Note the slowness of Binutils' perf has new implications related to newer perf releases as the tool newly applies a timeout which can make the situation even worse: https://bugzilla.kernel.org/show_bug.cgi?id=218996.
The text was updated successfully, but these errors were encountered: