-
Notifications
You must be signed in to change notification settings - Fork 154
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
Incorrect or partial flamegraph output on MacOS #113
Comments
Are you running version 0.4? Earlier versions had some issues. The information provided is necessarily different on macOS, where we use dtrace compared to Linux, where we use perf. I'm not sure there's much about that we can do inside the flamegraph codebase, although maybe we can pass options to dtrace to make its output more comprehensive. |
$ cargo flamegraph --version
cargo-flamegraph-flamegraph 0.4.0
The MacOS version is definitely missing a lot of information, and sometimes it is even misleading because some of the program's internal functions are replaced with the names of "more internal" (read: deeper into the stack trace) functions; furthermore, the stack trace on MacOS is much more shallow than the one from Linux, it looks more like a "streetgraph" than a "flamegraph" because so many internal calls are missing. The situation is such that i cannot rely on the MacOS flamegraph, and without the linux version i would not have been able to accurately profile and optimise my program. I suspect the Mac version has optimised a lot of debug info out of the binary, so perhaps a few dtrace options can do the trick here indeed. I can share the flamegraphs if need be, but first i would need to change all the function names, as well as those of some internal libraries... |
I understand that part. It's just that this project is merely a convenient abstraction over running perf or dtrace (as appropriate for the host platform) and generating flamegraphs from it. As far as I know we run a pretty minimal perf or dtrace command, so while I'd be okay with extending that if it substantially improves the results, it's not really within my expertise, and it's also somewhat at the scope of what this project is about IMO (but maybe @spacejam thinks differently). |
Yup, I've also seen similar results in my own projects. Still not sure what we could do to tune dtrace to do better. |
I hacked things up to use |
I suspect the issue is missing resolution of inline frames. I ran into this yesterday, comparing the output of |
It's definitely inline frames that are missing but it makes me wonder how inline frames are actually working on other platforms. The output from dtrace's I'm guessing it's dtrace itself that is supposed to produce that, so I wonder if what dtrace uses for symbol resolution fails now. I tried to use other values for split-debuginfo but changing that didn't improve anything. |
@hanayashiki it looks like there has been some progress in jonhoo/inferno#246, but not much. |
I have recently run cargo flamegraph on MacOS and Linux, and realised that the MacOS svg-output variant is missing a lot of important contextual information. Is there a way to solve this? The package seems quite unreliable or even broken on Macs....
The text was updated successfully, but these errors were encountered: