Skip to content

Commit

Permalink
Doc: unstable book - profile.md: improve wording
Browse files Browse the repository at this point in the history
- mention `--target` flag excludes RUSTFLAGS passing to build scripts and proc macros
  • Loading branch information
jschwe committed Jun 3, 2020
1 parent 2b26b8b commit 7bf026e
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/doc/unstable-book/src/compiler-flags/profile.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ cargo run
Once you've built and run your program, files with the `gcno` (after build) and `gcda` (after execution) extensions will be created.
You can parse them with [llvm-cov gcov](https://llvm.org/docs/CommandGuide/llvm-cov.html#llvm-cov-gcov) or [grcov](https://github.com/mozilla/grcov).

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.
Please note that `RUSTFLAGS` by default applies to everything that cargo builds and runs during a build!
When the `--target` flag is explicitly passed to cargo, the `RUSTFLAGS` no longer apply to build scripts and procedural macros.
For more fine-grained control consider passing a `RUSTC_WRAPPER` program to cargo that only adds the profiling flags to
rustc for the specific crates you want to profile.

0 comments on commit 7bf026e

Please sign in to comment.