From 141643cbf5810e329387648e1add98b851202b42 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Fri, 27 Aug 2021 11:16:55 +0100 Subject: Rewrite of sizes --- bashrc | 25 ++++++++++--------------- 1 file changed, 10 insertions(+), 15 deletions(-) diff --git a/bashrc b/bashrc index c8014dc..b7a6d47 100644 --- a/bashrc +++ b/bashrc @@ -54,21 +54,13 @@ cov() { fi echo "Using $gcov" - echo "Removing previous GC notes and runs" - lcov -z -d . - find -path */coverage/*.run -delete - echo "Building $@" - build $@ -q variant=coverage || return 2 - - echo "Extracting coverage data" mkdir -p $cov - lcov -d . -c -o $all --derive-func-data --no-external --rc geninfo_auto_base=1 -q --gcov-tool $gcov || return 3 - lcov --remove $all "*/bin/*" -o $key -q || return 4 + gcov=$gcov cov=$cov build testing.launcher=~/dev/util/diff.cov $@ -q variant=coverage || return 2 echo "Generating HTML" mkdir -p $html - genhtml $key -o $html -s -k -t . --demangle-cpp --sort --function-coverage -q --num-spaces=2 || return 5 + genhtml bin/*.info -o $html -s -k -t . --demangle-cpp --sort --function-coverage -q --num-spaces=2 || return 5 rsync -a --delete-after $html/ $htmlfin/ rm -rf $cov @@ -78,11 +70,14 @@ cov() { } sizes() { - find -path */release/* -type f -perm -111 -delete - build variant=release - find -path */release/* -type f -perm -111 | sort | xargs -r strip --strip-unneeded - find -path */release/* -type f -perm -111 -printf "%p\t%s\n" | sort -k1 | \ - column -N path,size -R path,size -t -s $'\t' | tee ~/new + MODE="variant=release strip=on" + TARGETS=$(build $MODE $@ -and1 | grep '^\(gcc\|clang-linux\)\.link' | cut -d ' ' -f 2) + if [[ -z $TARGETS ]] ; then return ; fi + build $MODE -d0 $@ + find $TARGETS -printf "./%p\t%s\n" | \ + sed "s|/bin/.*/\([^/]\+\s\)|\t\1|; s|^$(pwd)/||" | \ + sort -bk1,2 | \ + column -N module,binary,size -R module,binary,size -t -s $'\t' } PATH="/usr/lib/ccache/bin:$PATH" -- cgit v1.2.3