summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Goodliffe <dan.goodliffe@octal.co.uk>2021-08-27 11:22:59 +0100
committerDan Goodliffe <dan.goodliffe@octal.co.uk>2021-08-27 11:22:59 +0100
commit7065b987d3ae4a4d9eaab177aba5edf82ffa1b93 (patch)
tree77d03171e85d4a717ce590156ba4c1588fc15395
parentLots of cd aliases (diff)
downloadutil-7065b987d3ae4a4d9eaab177aba5edf82ffa1b93.tar.bz2
util-7065b987d3ae4a4d9eaab177aba5edf82ffa1b93.tar.xz
util-7065b987d3ae4a4d9eaab177aba5edf82ffa1b93.zip
Add bloatysizes for finding code bloat
-rw-r--r--bashrc12
1 files changed, 10 insertions, 2 deletions
diff --git a/bashrc b/bashrc
index 3e62a7e..4ef2ce0 100644
--- a/bashrc
+++ b/bashrc
@@ -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)