Skip to content

Commit 19a3558

Browse files
committed
Add PID to rustc PGO profiles generated in CI
1 parent 7355d97 commit 19a3558

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/ci/pgo.sh

+5-1
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,11 @@ python3 ../x.py build --target=$PGO_HOST --host=$PGO_HOST \
8282

8383
# Here we're profiling the `rustc` frontend, so we also include `Check`.
8484
# The benchmark set includes various stress tests that put the frontend under pressure.
85-
gather_profiles "Check,Debug,Opt" "All" \
85+
# The profile data is written into a single filepath that is being repeatedly merged when each
86+
# rustc invocation ends. Empirically, this can result in some profiling data being lost.
87+
# That's why we override the profile path to include the PID. This will produce many more profiling
88+
# files, but the resulting profile will produce a slightly faster rustc binary.
89+
LLVM_PROFILE_FILE=/tmp/rustc-pgo/default_%m_%p.profraw gather_profiles "Check,Debug,Opt" "All" \
8690
"externs,ctfe-stress-4,cargo-0.60.0,token-stream-stress,match-stress,tuple-stress"
8791

8892
# Merge the profile data we gathered

0 commit comments

Comments
 (0)