-
Notifications
You must be signed in to change notification settings - Fork 153
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
Flamegraph doesn't seem to display user-defined functions #341
Comments
Sorry, I don't know enough about the underlying functionality in |
I was just experiencing the same issue where my flamegraph generated through To gather the data, I ran: perf record -g --call-graph dwarf <repo-path>/target/debug/<bin-name> <my-parameters> Setting the call graph type to dwarf seemed to be important, and as you can see from the binary path above, I was using a debug build. I am still playing around with things to see what works and what doesn't, but I just wanted to share what I found works so you can play around from a (hopefully) starting point that works and peel back some of the debug pieces that are not necessary. |
@gth828r you can run |
@djc This was actually user-error on my part. Others might be having the same self-inflicted issue as me, so I'll write it up for posterity. In particular, when running the manual steps with perf to generate a flamegraph, I noticed that running It turned out that what was happening is that I was sending SIGTERM to terminate my application, and I would get impatient thinking it was still running and send SIGTERM a few more times. That was killing the flamegraph generation process ( This is pretty minor, but it might make sense to have some type of animated indicator in the terminal to show that work is being done to generate the flamegraph given that the steps can take quite a while (on the order of minutes). For the record, things ran fine both with a custom command specifying |
Just an FYI, a slow addr2line seems to be the problem as noted here addr2line. Normally I would profile my program for 5 minutes with |
Interesting context, thanks for sharing! |
I'm working on a project using flamegraph and for some reason I can't get flamegraph to display user-defined functions. These are my configs
I tried running it on my project and I obtain this graph. The code is over 1k lines of code and have many different function calls so I don't know why no functions would show up
This is what I run, I increased the frequency but it doesn't seem to do much.
I tried creating a random test file to see if I could get a flamegraph non-related to my project. And the flamegraph still doesn't really show the function names. It was suggested on a rust discord to try and use std::hint::black_box to block optimizations and it still doesn't really seem to work.
Is there some setting I'm missing? Right now I want to have a test file that produces a flamegraph with user def functions because I can't seem to do that so unrelated to my project I can't get flamegraph to work
The text was updated successfully, but these errors were encountered: