From ae88a2c6775f68948c07c1c6351da7048d471885 Mon Sep 17 00:00:00 2001 From: Yakun Xu Date: Sat, 20 Mar 2021 04:20:38 +0800 Subject: [PATCH] [test] print size diff symbol by symbol (#6305) This commit enhances the size check by printing size diff symbol by symbol, which can help us better analyze size changes. --- script/check-size | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/script/check-size b/script/check-size index bf9f2345b..004e08510 100755 --- a/script/check-size +++ b/script/check-size @@ -104,6 +104,13 @@ markdown() esac } +nm_size() +{ + arm-none-eabi-nm --print-size --defined-only -C "$1" | cut -d' ' -f2- >nmsize_old + arm-none-eabi-nm --print-size --defined-only -C "$2" | cut -d' ' -f2- >nmsize_new + diff -Nuar nmsize_old nmsize_new || true +} + size_nrf52840_version() { local options=( @@ -212,10 +219,14 @@ size_nrf52840_version() for file in "${bins[@]}"; do "${reporter}" size "${OT_TMP_DIR}"/a/"${build_dir}"/bin/"${file}"_"${thread_version}" "${OT_TMP_DIR}"/b/"${build_dir}"/bin/"${file}"_"${thread_version}" + echo nm_size "${OT_TMP_DIR}"/a/"${build_dir}"/bin/"${file}"_"${thread_version}" "${OT_TMP_DIR}"/b/"${build_dir}"/bin/"${file}"_"${thread_version}" + nm_size "${OT_TMP_DIR}"/a/"${build_dir}"/bin/"${file}"_"${thread_version}" "${OT_TMP_DIR}"/b/"${build_dir}"/bin/"${file}"_"${thread_version}" done for file in "${libs[@]}"; do "${reporter}" size "${OT_TMP_DIR}"/a/"${build_dir}"/lib/"${file}"_"${thread_version}" "${OT_TMP_DIR}"/b/"${build_dir}"/lib/"${file}"_"${thread_version}" + echo nm_size "${OT_TMP_DIR}"/a/"${build_dir}"/lib/"${file}"_"${thread_version}" "${OT_TMP_DIR}"/b/"${build_dir}"/lib/"${file}"_"${thread_version}" + nm_size "${OT_TMP_DIR}"/a/"${build_dir}"/lib/"${file}"_"${thread_version}" "${OT_TMP_DIR}"/b/"${build_dir}"/lib/"${file}"_"${thread_version}" done }