Skip to content

Commit a32fd51

Browse files
authored
Rollup merge of rust-lang#65402 - michaelwoerister:pgo-troubleshooting-docs, r=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
2 parents 2feabbb + f81b154 commit a32fd51

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/doc/rustc/src/profile-guided-optimization.md

+11
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,17 @@ RUSTFLAGS="-Cprofile-use=/tmp/pgo-data/merged.profdata" \
125125
cargo build --release --target=x86_64-unknown-linux-gnu
126126
```
127127

128+
### Troubleshooting
129+
130+
- It is recommended to pass `-Cllvm-args=-pgo-warn-missing-function` during the
131+
`-Cprofile-use` phase. LLVM by default does not warn if it cannot find
132+
profiling data for a given function. Enabling this warning will make it
133+
easier to spot errors in your setup.
134+
135+
- There is a [known issue](https://github.com/rust-lang/cargo/issues/7416) in
136+
Cargo prior to version 1.39 that will prevent PGO from working correctly. Be
137+
sure to use Cargo 1.39 or newer when doing PGO.
138+
128139
## Further Reading
129140

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

0 commit comments

Comments
 (0)