diff options
author | Dan Goodliffe <dan.goodliffe@octal.co.uk> | 2021-08-27 11:22:59 +0100 |
---|---|---|
committer | Dan Goodliffe <dan.goodliffe@octal.co.uk> | 2021-08-27 11:22:59 +0100 |
commit | 7065b987d3ae4a4d9eaab177aba5edf82ffa1b93 (patch) | |
tree | 77d03171e85d4a717ce590156ba4c1588fc15395 | |
parent | Lots of cd aliases (diff) | |
download | util-7065b987d3ae4a4d9eaab177aba5edf82ffa1b93.tar.bz2 util-7065b987d3ae4a4d9eaab177aba5edf82ffa1b93.tar.xz util-7065b987d3ae4a4d9eaab177aba5edf82ffa1b93.zip |
Add bloatysizes for finding code bloat
-rw-r--r-- | bashrc | 12 |
1 files changed, 10 insertions, 2 deletions
@@ -80,8 +80,16 @@ sizes() { column -N module,binary,size -R module,binary,size -t -s $'\t' } -PATH="/usr/lib/ccache/bin:$PATH" -CORES=$(grep core\ id /proc/cpuinfo | sort -u | wc -l) +bloatysizes() { + MODE="variant=release strip=off debug-symbols=on testing.execute=off" + TARGETS=$(build $MODE $@ -and1 | grep '^\(gcc\|clang-linux\)\.link' | cut -d ' ' -f 2) + TARGET="$(echo ${TARGETS} | awk '{ print $NF }')" + if [[ -z $TARGETS ]] ; then return ; fi + build $MODE -d1 $@ + ls -lh $TARGET + bloaty -s vm --domain=vm -d symbols -C full -n 0 $TARGET | tee /var/tmp/bloaty +} + CPUS=$(grep core\ id /proc/cpuinfo -c) if [ -n "$DISTCC_HOSTS" ] ; then TASKS=$(echo $DISTCC_HOSTS | tr ' ' '\n' | cut -d / -f2 | paste -s -d+ | bc) |