diff options
| author | Marco Castelluccio <mcastelluccio@mozilla.com> | 2017-06-06 00:39:07 +0100 |
|---|---|---|
| committer | Marco Castelluccio <mcastelluccio@mozilla.com> | 2017-06-06 00:39:07 +0100 |
| commit | 84d1626e517346e2a603788b8026c17e754f4144 (patch) | |
| tree | b70ad4ec258b0808f4f4b79452f11031eb25064f | |
| parent | 26ad8d4ad304a4aaaeab4bbc51ed5cbd733d13ba (diff) | |
| download | rust-84d1626e517346e2a603788b8026c17e754f4144.tar.gz rust-84d1626e517346e2a603788b8026c17e754f4144.zip | |
Add basic documentation for the profile feature
| -rw-r--r-- | src/doc/unstable-book/src/compiler-flags/profile.md | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/doc/unstable-book/src/compiler-flags/profile.md b/src/doc/unstable-book/src/compiler-flags/profile.md index f9634c55c96..1c4ae5207ff 100644 --- a/src/doc/unstable-book/src/compiler-flags/profile.md +++ b/src/doc/unstable-book/src/compiler-flags/profile.md @@ -3,3 +3,19 @@ The tracking issue for this feature is: None ------------------------ + +This feature allows the generation of code coverage reports. + +Set the compiler flags `-Ccodegen-units=1 -Clink-dead-code -Cpasses=insert-gcov-profiling -Zno-landing-pads` to enable gcov profiling. + +For example: +```Bash +cargo new testgcov --bin +cd testgcov +export RUSTFLAGS="-Ccodegen-units=1 -Clink-dead-code -Cpasses=insert-gcov-profiling -Zno-landing-pads" +cargo build +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](http://llvm.org/docs/CommandGuide/llvm-cov.html#llvm-cov-gcov) or [grcov](https://github.com/marco-c/grcov). |
