-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
-Z profile fails to produce any .gcno/.gcda files for bench target #72974
Comments
Tracking issue for the feature: #42524 |
I think profiling requires debuginfo. Try setting this in [profile.bench]
debug = true
[profile.release]
debug = true I'm not sure how well it will work with an optimized build, though. You may want to consider using the dev profile instead (and setting incremental=0). |
The compiler could have put out a warning about the options being incompatible. |
An option Had to add it here: chatmail/core#3546 |
Adds coverage.yaml and ads coverage shell to flake. also adds code-coverage command to justfile. NOTE: for rational of `-Cdebuginfo=2` see: rust-lang/rust#72974 Closes #683
Adds coverage.yaml and ads coverage shell to flake. also adds code-coverage command to justfile. NOTE: for rational of `-Cdebuginfo=2` see: rust-lang/rust#72974 Closes #683
Add coverage workflow * Adds coverage.yaml * adds coverage shell to flake. also * adds code-coverage command (for local output to HTML) to justfile. NOTE: for rational of `-Cdebuginfo=2` see: rust-lang/rust#72974 Closes #683 --------- Co-authored-by: tbro <[email protected]> Co-authored-by: sveitser <[email protected]>
We no longer support gcov-based profiling. |
I want to generate profiling coverage information for a benchmark in my project. I run this command:
RUSTFLAGS='-Z profile=yes -Z profile-emit=/tmp/myproject-profile -C codegen-units=1' cargo build --benches -Z unstable-options --profile=bench --target=x86_64-unknown-linux-gnu
Neither the build nor running the bench executable creates
.gcno
/.gcda
files with the coverage information. Also tried withoutprofile-emit
.Tried to instrument
cargo test
for comparison, thatresults in a build failure:The-C incremental=...
option cannot be suppressed by disablingincremental
in the test profile in.cargo/config.toml
.Edit: the cargo test failure was solved, I used a custom target to which config did not apply. That build does try to produce GCDAs and fails in some build script executable, but I guess it's a subject for a different issue.
Meta
rustc --version --verbose
:The text was updated successfully, but these errors were encountered: