summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Goodliffe <dan.goodliffe@octal.co.uk>2021-08-27 11:16:55 +0100
committerDan Goodliffe <dan.goodliffe@octal.co.uk>2021-08-27 11:16:55 +0100
commit141643cbf5810e329387648e1add98b851202b42 (patch)
tree52240f018b1d32835bd43b4f2889eb8b87e5cc42
parentShow image in PORTAGE_TMPDIR, not /var/tmp (diff)
downloadutil-141643cbf5810e329387648e1add98b851202b42.tar.bz2
util-141643cbf5810e329387648e1add98b851202b42.tar.xz
util-141643cbf5810e329387648e1add98b851202b42.zip
Rewrite of sizes
-rw-r--r--bashrc25
1 files 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"