Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Misc size regression script improvements. #16268

Merged
merged 2 commits into from
Feb 8, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
22 changes: 20 additions & 2 deletions util/size_regression.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ dest_ref="develop"
ignore_ref="master"
unset skip_zero

export SIZE_REGRESSION_EXECUTING=1

function usage() {
echo "Usage: $(basename "$0") [-h] [-j <jobs>] [-s <source>] [-d <dest>] [-n] planck/rev6:default"
echo " -h : Shows this usage page."
Expand All @@ -23,9 +25,24 @@ function usage() {
}

if [[ ${#} -eq 0 ]]; then
usage
usage
exit 0
fi

unset cleanup_completed
_internal_cleanup() {
if [[ -z "${cleanup_completed:-}" ]] ; then
echo
echo
echo 'Your git repository is in an indeterminate state!' >&2
echo 'Make sure you swap to your intended branch.' >&2
echo
unset SIZE_REGRESSION_EXECUTING
fi
cleanup_completed=1
}
trap _internal_cleanup EXIT HUP INT

while getopts "hj:s:d:i:n" opt "$@" ; do
case "$opt" in
h) usage; exit 0;;
Expand All @@ -49,7 +66,8 @@ function build_executor() {
revision=$(echo $line | cut -d' ' -f1)

make distclean >/dev/null 2>&1
git checkout $revision >/dev/null 2>&1 || { echo "Failed to check out revision ${revision}" >&2 ; exit 1 ; }

git checkout -f $revision >/dev/null 2>&1 || { echo "Failed to check out revision ${revision}" >&2 ; exit 1 ; }
make -j${job_count} $keyboard_target >/dev/null 2>&1 || true
file_size=$(arm-none-eabi-size .build/*.elf 2>/dev/null | awk '/elf/ {print $1}' 2>/dev/null || true)

Expand Down