Merge pull request #268 from matthiaskrgr/times_sh
tools: times.sh: show more information in stdout (while still printing it to the log), compute averages of runs, automatically compile and run "times" binary after generating the log.
This commit is contained in:
commit
f277d5fb78
|
@ -2,26 +2,31 @@
|
||||||
#
|
#
|
||||||
# Simple script to generate times.log that contains timing information for the last 20 revisions
|
# Simple script to generate times.log that contains timing information for the last 20 revisions
|
||||||
# Typically these commands shall be used to get times.txt:
|
# Typically these commands shall be used to get times.txt:
|
||||||
# mkdir src
|
mkdir -p src
|
||||||
# cp lib/* src/ <- fill src/ with some source code
|
cp lib/* src/ # fill src/ with some source code
|
||||||
# tools/times.sh
|
#NOTE: also try with some files other then from cppcheck!
|
||||||
# gcc -o tools/times tools/times.c
|
|
||||||
# tools/times
|
|
||||||
|
|
||||||
git checkout -b old
|
|
||||||
|
|
||||||
|
# if "old" already exists for some reason, do NOT work on current branch but bail out
|
||||||
|
git checkout -b old || exit
|
||||||
|
|
||||||
make clean
|
make clean
|
||||||
|
|
||||||
git reset --hard HEAD > times.log
|
git reset --hard HEAD > times.log
|
||||||
|
|
||||||
for i in `seq 1 50`;
|
for i in `seq 1 50`; do
|
||||||
do
|
git_head=`git log -1 --format=%h`
|
||||||
make SRCDIR=build CXXFLAGS=-O2 -j4
|
# if build fails, make clean and try again
|
||||||
echo "$i"
|
make SRCDIR=build CXXFLAGS=-O2 -j4 || make clean ; make SRCDIR=build CXXFLAGS=-O2 -j4
|
||||||
./cppcheck -q --showtime=summary --enable=all --inconclusive src 2> /dev/null >> times.log
|
echo "Run number $i"
|
||||||
./cppcheck -q --showtime=summary --enable=all --inconclusive src 2> /dev/null >> times.log
|
./cppcheck -q --showtime=summary --enable=all --inconclusive src 2> /dev/null | tee -a times.log
|
||||||
./cppcheck -q --showtime=summary --enable=all --inconclusive src 2> /dev/null >> times.log
|
./cppcheck -q --showtime=summary --enable=all --inconclusive src 2> /dev/null | tee -a times.log
|
||||||
./cppcheck -q --showtime=summary --enable=all --inconclusive src 2> /dev/null >> times.log
|
./cppcheck -q --showtime=summary --enable=all --inconclusive src 2> /dev/null | tee -a times.log
|
||||||
git reset --hard HEAD^1 >> times.log
|
./cppcheck -q --showtime=summary --enable=all --inconclusive src 2> /dev/null | tee -a times.log
|
||||||
done
|
grep "Overall" times.log | tail -4 | sed s/s// | awk -v "i=$i" -v "git_head=$git_head" '{ sum+=$3} END {print "Run " i", "git_head " Average: " sum/4}' | tee -a times.log
|
||||||
|
git reset --hard HEAD^1 | tee -a times.log
|
||||||
|
done
|
||||||
|
|
||||||
|
gcc -o tools/times tools/times.c
|
||||||
|
tools/times
|
||||||
|
|
Loading…
Reference in New Issue