-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Allow profiles to set -Cforce-frame-pointers #15333
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
Comments
Note that these config settings don’t have to be global, you can add a |
The cargo team briefly discussed this, and agreed that it seemed like a reasonable thing to add. It was also asked whether or not this would need to be unstable or not, though a small change it probable isn't needed. |
Alright, so what should be the valid options ? Should it accept just booleans, or something else ? I feel like the only value worth handling is And even if it's not the case, users wanting more control could as well use the unstable |
The fact that the compiler has a Overall, I'd find it confusing that If |
Yes, exactly
I can understand that, and that's true. But I thought it would be a bit of a duplicate with the
You're right. I will quickly look at |
|
The |
I meant to parse (or rather, deserialize) the Also there is apparently an unstable (now I feel like I got a little bit too excited and I should have waited for more input) Tell me when you all agree on something and want me to rewrite the PR (and also feel free to close it if you instead prefer to do it). In the meantime I'm going to keep it as a draft |
Problem
When profiling Rust code on Linux using
perf
, I can either useperf record
with--call-graph=dwarf
or I can enable frame pointers during the build by passing-Cforce-frame-pointers
to rustc. With frame pointers, a perf run is substantially faster to process. My understanding is that this is because stack traces can be captured in the kernel with eBPF, which can follow the frame pointers, whereas with debug info it's all done by callingaddr2line
after the fact.For a profiling run I just did, it took more than 8 minutes to process the perf data when using debug info and less than a second when using frame pointers.
I'd like to be able to turn on frame pointers for a particular profile in my
Cargo.toml
. Currently, I instead turn it on globally in my~/.cargo/config.toml
.Proposed Solution
Add
force-frame-pointers
as an option in cargo profiles. e.g.Notes
If it's agreed that this is a reasonable feature to add, I'm happy to implement it.
The text was updated successfully, but these errors were encountered: