summaryrefslogtreecommitdiffstats
path: root/src/ci/pgo.sh
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:11:38 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:12:43 +0000
commitcf94bdc0742c13e2a0cac864c478b8626b266e1b (patch)
tree044670aa50cc5e2b4229aa0b6b3df6676730c0a6 /src/ci/pgo.sh
parentAdding debian version 1.65.0+dfsg1-2. (diff)
downloadrustc-cf94bdc0742c13e2a0cac864c478b8626b266e1b.tar.xz
rustc-cf94bdc0742c13e2a0cac864c478b8626b266e1b.zip
Merging upstream version 1.66.0+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/ci/pgo.sh')
-rwxr-xr-xsrc/ci/pgo.sh39
1 files changed, 34 insertions, 5 deletions
diff --git a/src/ci/pgo.sh b/src/ci/pgo.sh
index b60b7868d..cbe32920a 100755
--- a/src/ci/pgo.sh
+++ b/src/ci/pgo.sh
@@ -190,11 +190,40 @@ rm -r $RUSTC_PROFILE_DIRECTORY_ROOT
# directories ourselves.
rm -r $BUILD_ARTIFACTS/llvm $BUILD_ARTIFACTS/lld
-# This produces the actual final set of artifacts, using both the LLVM and rustc
-# collected profiling data.
-$@ \
- --rust-profile-use=${RUSTC_PROFILE_MERGED_FILE} \
- --llvm-profile-use=${LLVM_PROFILE_MERGED_FILE}
+if isLinux; then
+ # Gather BOLT profile (BOLT is currently only available on Linux)
+ python3 ../x.py build --target=$PGO_HOST --host=$PGO_HOST \
+ --stage 2 library/std \
+ --llvm-profile-use=${LLVM_PROFILE_MERGED_FILE} \
+ --llvm-bolt-profile-generate
+
+ BOLT_PROFILE_MERGED_FILE=/tmp/bolt.profdata
+
+ # Here we're profiling Bolt.
+ gather_profiles "Check,Debug,Opt" "Full" \
+ "syn-1.0.89,serde-1.0.136,ripgrep-13.0.0,regex-1.5.5,clap-3.1.6,hyper-0.14.18"
+
+ merge-fdata /tmp/prof.fdata* > ${BOLT_PROFILE_MERGED_FILE}
+
+ echo "BOLT statistics"
+ du -sh /tmp/prof.fdata*
+ du -sh ${BOLT_PROFILE_MERGED_FILE}
+ echo "Profile file count"
+ find /tmp/prof.fdata* -type f | wc -l
+
+ rm -r $BUILD_ARTIFACTS/llvm $BUILD_ARTIFACTS/lld
+
+ # This produces the actual final set of artifacts, using both the LLVM and rustc
+ # collected profiling data.
+ $@ \
+ --rust-profile-use=${RUSTC_PROFILE_MERGED_FILE} \
+ --llvm-profile-use=${LLVM_PROFILE_MERGED_FILE} \
+ --llvm-bolt-profile-use=${BOLT_PROFILE_MERGED_FILE}
+else
+ $@ \
+ --rust-profile-use=${RUSTC_PROFILE_MERGED_FILE} \
+ --llvm-profile-use=${LLVM_PROFILE_MERGED_FILE}
+fi
echo "Rustc binary size"
ls -la ./build/$PGO_HOST/stage2/bin