2424
2525# TODO: Do not instrument 3rd party librairies to save space and performance
2626
27- set -ux
27+ # Exit the script if an unexpected error arise
28+ set -e
29+ # Treat unset variables as errors
30+ set -u
31+ # Print expanded commands to stdout before running them
32+ set -x
2833
2934ME=" ${0} "
3035ME_dir=" $( dirname -- " $( readlink -fm -- " ${ME} " ) " ) "
@@ -33,8 +38,7 @@ REPO_main_dir="$(dirname -- "${ME_dir}")"
3338FEATURES_OPTION=${FEATURES_OPTION:- " --features feat_os_unix" }
3439COVERAGE_DIR=${COVERAGE_DIR:- " ${REPO_main_dir} /coverage" }
3540
36- LLVM_BIN_PATH=" $( rustc --print sysroot) /lib/rustlib/x86_64-unknown-linux-gnu/bin"
37- LLVM_PROFDATA=" ${LLVM_BIN_PATH} /llvm-profdata"
41+ LLVM_PROFDATA=" $( find $( rustc --print sysroot) -name llvm-profdata) "
3842
3943PROFRAW_DIR=" ${COVERAGE_DIR} /traces"
4044PROFDATA_DIR=" ${COVERAGE_DIR} /data"
@@ -68,13 +72,15 @@ for UTIL in ${UTIL_LIST}; do
6872 | grep -v ' SKIP'
6973 # Note: Do not print the skipped tests on the output as there will be many.
7074
71- echo -e " ${UTIL} trace generation: $( du -h -d1 ${PROFRAW_DIR} ) " >> " ${REPORT_DIR} /usage"
75+ echo -e " ${UTIL} trace generation: $( du -h -d1 ${PROFRAW_DIR} | cut -f 1 ) " >> " ${REPORT_DIR} /usage"
7276
7377 # Aggregate all the profraw files into a profdata file
7478 " ${LLVM_PROFDATA} " merge \
7579 -sparse \
7680 -o " ${PROFDATA_DIR} /${UTIL} .profdata" \
77- ${PROFRAW_DIR} /* .profraw
81+ ${PROFRAW_DIR} /* .profraw \
82+ || true
83+ # We don't want an error in `llvm-profdata` to abort the whole program
7884
7985 # Clear the trace directory to free up space
8086 rm -rf " ${PROFRAW_DIR} " && mkdir -p " ${PROFRAW_DIR} "
0 commit comments