Skip to content
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

Fix documentation example for gcov profiling #72615

Merged
merged 2 commits into from
Jun 8, 2020
Merged

Fix documentation example for gcov profiling #72615

merged 2 commits into from
Jun 8, 2020

Conversation

jschwe
Copy link
Contributor

@jschwe jschwe commented May 26, 2020

closes #72546
Improves the documentation for the unstable Rustflag -Zprofile by:

  • stating that Incremental compilation must be turned off.
  • Adding the other RUSTFLAGS that should/need to be turned on (taken from grcov documentation)
  • Mentioning RUSTC_WRAPPER to prevent everything getting instrumented.

r? @steveklabnik

Incremental compilation needs to be turned off. Also added the other RUSTFLAGS that should/need to be turned on.
@rust-highfive
Copy link
Collaborator

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @steveklabnik (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see the contribution instructions for more information.

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label May 26, 2020
@jschwe
Copy link
Contributor Author

jschwe commented Jun 2, 2020

r?

Comment on lines 24 to 26
Please note that `RUSTFLAGS` apply to everything that cargo builds and runs during a build, including build scripts!
To avoid this, pass a `RUSTC_WRAPPER` program to cargo that only adds the profiling flags to rustc for the specific
crates you want to profile.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When --target flag is passed to cargo, the RUSTFLAGS no longer apply to build scripts and procedural macros. This could be more convenient to use than a wrapper.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the feedback. I added a sentence regarding --target and mentioned RUSTC_WRAPPER as an option if one wants more control over which crates get instrumented.

- mention `--target` flag excludes RUSTFLAGS passing to build scripts and proc macros
@steveklabnik
Copy link
Member

@bors: r+ rollup

thanks so much!

@bors
Copy link
Contributor

bors commented Jun 8, 2020

📌 Commit 7bf026e has been approved by steveklabnik

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jun 8, 2020
bors added a commit to rust-lang-ci/rust that referenced this pull request Jun 8, 2020
Rollup of 10 pull requests

Successful merges:

 - rust-lang#72026 (Update annotate-snippets-rs to 0.8.0)
 - rust-lang#72583 (impl AsRef<[T]> for vec::IntoIter<T>)
 - rust-lang#72615 (Fix documentation example for gcov profiling)
 - rust-lang#72761 (Added the documentation for the 'use' keyword)
 - rust-lang#72799 (Add `-Z span-debug` to allow for easier debugging of proc macros)
 - rust-lang#72811 (Liballoc impl)
 - rust-lang#72963 (Cstring `from_raw` and `into_raw` safety precisions)
 - rust-lang#73001 (Free `default()` forwarding to `Default::default()`)
 - rust-lang#73075 (Add comments to `Resolve::get_module`)
 - rust-lang#73092 (Clean up E0646)

Failed merges:

r? @ghost
@bors bors merged commit e8bb4c7 into rust-lang:master Jun 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Documentation for Rustflag -Zprofile outdated.
5 participants