Skip to content

Commit

Permalink
Rollup merge of #65402 - michaelwoerister:pgo-troubleshooting-docs, r…
Browse files Browse the repository at this point in the history
…=alexcrichton

Add troubleshooting section to PGO chapter in rustc book.

- Adds a note about using `-pgo-warn-missing-function` in order to spot mistakes in PGO setup.
- Mentions cargo symbol name issue fixed in 1.39.

Nominating for backport.

r? @alexcrichton
  • Loading branch information
Centril authored Oct 15, 2019
2 parents 2feabbb + f81b154 commit a32fd51
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/doc/rustc/src/profile-guided-optimization.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,17 @@ RUSTFLAGS="-Cprofile-use=/tmp/pgo-data/merged.profdata" \
cargo build --release --target=x86_64-unknown-linux-gnu
```

### Troubleshooting

- It is recommended to pass `-Cllvm-args=-pgo-warn-missing-function` during the
`-Cprofile-use` phase. LLVM by default does not warn if it cannot find
profiling data for a given function. Enabling this warning will make it
easier to spot errors in your setup.

- There is a [known issue](https://github.com/rust-lang/cargo/issues/7416) in
Cargo prior to version 1.39 that will prevent PGO from working correctly. Be
sure to use Cargo 1.39 or newer when doing PGO.

## Further Reading

`rustc`'s PGO support relies entirely on LLVM's implementation of the feature
Expand Down

0 comments on commit a32fd51

Please sign in to comment.