summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaxim Kuvyrkov <maxim.kuvyrkov@linaro.org>2021-09-17 08:58:28 +0000
committerMaxim Kuvyrkov <maxim.kuvyrkov@linaro.org>2021-09-17 08:58:28 +0000
commit11ac5cf2154ee6778759a1c97355786ae305ef2f (patch)
tree58b82e96ffbb652227d334b1de59b7a6ed6acc8d
parent1af2c6048922a9517c9294e707265ee6ec3a5926 (diff)
tcwg_bmk-build.sh: Cleanup and simplify email generation code
Change-Id: Iaccc8d0e5d37f825b28313b4f5749a6246cf5146
-rwxr-xr-xtcwg_bmk-build.sh64
1 files changed, 40 insertions, 24 deletions
diff --git a/tcwg_bmk-build.sh b/tcwg_bmk-build.sh
index 787d8825..e2c5700d 100755
--- a/tcwg_bmk-build.sh
+++ b/tcwg_bmk-build.sh
@@ -365,7 +365,9 @@ compare_results_perf ()
esac
local -a arr
- local metric bmk symbol rtime rsize time1 time2 size1 size2 regression result prev_bmk
+ local metric bmk symbol rtime rsize time1 time2 size1 size2
+ local regression short_symbol short_regression
+ local result prev_bmk
echo "bmk,symbol,result" > $run_step_artifacts/results-compare.csv
printf "extra_build_params=" > $run_step_artifacts/extra-bisect-params
@@ -408,7 +410,6 @@ compare_results_perf ()
metric=$(($metric - 100))
# Remove padding from the tail of $symbol (padding is added by
# csvs2table.py for better formatting).
- local short_symbol
short_symbol="$(echo "$symbol" | sed -e "s/ *\$//")"
local bmk_exe
@@ -429,20 +430,35 @@ compare_results_perf ()
result=100
case $metric_id in
- size) regression="$regressed_by ${metric}% from $size1 to $size2 bytes" ;;
- time) regression="$regressed_by ${metric}% from $time1 to $time2 perf samples" ;;
+ size)
+ short_regression="$regressed_by ${metric}%"
+ regression="$short_regression from $size1 to $size2 bytes"
+ ;;
+ time)
+ short_regression="$regressed_by ${metric}%"
+ regression="$short_regression from $time1 to $time2 perf samples" ;;
*) assert false ;;
esac
if $bmk_exe; then
+ short_regression="$bmk $short_regression"
+ regression="$bmk $regression"
# Detect magic sample counts that indicate failure to build
# and failure to run
case "$time2" in
- 888888888) regression="failed to run correctly" ;;
- 999999999) regression="failed to build" ;;
+ 888888888)
+ short_regression="$bmk failed to run correctly"
+ regression="$short_regression"
+ ;;
+ 999999999)
+ short_regression="$bmk failed to build"
+ regression="$short_regression"
+ ;;
esac
- echo "$metric,$bmk,$symbol,$regression" >> $run_step_artifacts/exe.regressions
+ echo "$metric,$bmk,$symbol,$short_regression,$regression" >> $run_step_artifacts/exe.regressions
else
- echo "$metric,$bmk,$symbol,$regression" >> $run_step_artifacts/$bmk.regression
+ short_regression="$bmk,$short_symbol $short_regression"
+ regression="$bmk,$symbol $regression"
+ echo "$metric,$bmk,$symbol,$short_regression,$regression" >> $run_step_artifacts/$bmk.regression
fi
if [ x"$bmk" != x"$prev_bmk" ]; then
printf "++benchmarks %s " $bmk >> $run_step_artifacts/extra-bisect-params
@@ -468,14 +484,14 @@ EOF
the following benchmarks $regressed_by more than ${exe_threshold}%:
EOF
- while IFS=, read metric bmk symbol regression; do
+ while IFS=, read metric bmk symbol short_regression regression; do
cat >> $run_step_artifacts/jira-body.txt <<EOF
-- $bmk $regression
+- $regression
EOF
if [ -f $run_step_artifacts/$bmk.regression ]; then
- while IFS=, read metric bmk symbol regression; do
+ while IFS=, read metric bmk symbol short_regression regression; do
cat >> $run_step_artifacts/jira-body.txt <<EOF
- - $bmk,$symbol $regression
+ - $regression
EOF
done < $run_step_artifacts/$bmk.regression
# Delete $bmk.regressions so that it doesn't show up
@@ -497,9 +513,9 @@ EOF
the following hot functions $regressed_by more than ${symbol_threshold}% (but their benchmarks $regressed_by less than ${exe_threshold}%):
EOF
- while IFS=, read metric bmk symbol regression; do
+ while IFS=, read metric bmk symbol short_regression regression; do
cat >> $run_step_artifacts/jira-body.txt <<EOF
-- $bmk,$symbol $regression
+- $regression
EOF
done < $run_step_artifacts/symbol.regressions
fi
@@ -589,27 +605,27 @@ Configuration:
- Compiler flags: $bmk_flags
- Hardware: $hw
-This benchmarking CI is work-in-progress, and we welcome feedback and suggestions at linaro-toolchain@lists.linaro.org . In our improvement plans is to add support for SPEC CPU2017 benchmarks and provide "perf report/annotate" data that these reports are generated from.
+This benchmarking CI is work-in-progress, and we welcome feedback and suggestions at linaro-toolchain@lists.linaro.org . In our improvement plans is to add support for SPEC CPU2017 benchmarks and provide "perf report/annotate" data behind these reports.
EOF
+ # Generate mail subject
if [ -f $run_step_artifacts/exe.regressions ]; then
- IFS=, read metric bmk symbol regression < <(head -n1 $run_step_artifacts/exe.regressions)
- cat > $run_step_artifacts/mail-subject.txt <<EOF
-[TCWG CI] $bmk $regression after \$COMMIT_COMPONENT: \$COMMIT_SUBJECT
-EOF
+ IFS=, read metric bmk symbol short_regression regression \
+ < <(head -n1 $run_step_artifacts/exe.regressions)
elif [ -f $run_step_artifacts/symbol.regressions ]; then
- IFS=, read metric bmk symbol regression < <(head -n1 $run_step_artifacts/symbol.regressions)
- symbol="${symbol%%[ ]*}"
- cat > $run_step_artifacts/mail-subject.txt <<EOF
-[TCWG CI] $bmk,$symbol $regression after \$COMMIT_COMPONENT: \$COMMIT_SUBJECT
-EOF
+ IFS=, read metric bmk symbol short_regression regression \
+ < <(head -n1 $run_step_artifacts/symbol.regressions)
else
# Exit with no regressions
return 0
fi
+ cat > $run_step_artifacts/mail-subject.txt <<EOF
+[TCWG CI] $short_regression after \$COMMIT_COMPONENT: \$COMMIT_SUBJECT
+EOF
cat $run_step_artifacts/jira-body.txt \
| sed -e "s/^/# /" > $run_step_artifacts/results.regressions
+ echo "# $short_regression" >> $run_step_artifacts/results.regressions
)
}