| 1 |
# A makefile based framework for testing performance commits in retrospect, |
| 2 |
# based on work done by [email protected] done for GEGL, original code placed in the public domain. |
| 3 |
|
| 4 |
SELF = Makefile-retrospect |
| 5 |
|
| 6 |
MAKE_FLAGS = -j3 -k |
| 7 |
CC = "ccache gcc" # if you do not have ccache replace with just gcc |
| 8 |
|
| 9 |
PROJECT_PATH = ../../ |
| 10 |
|
| 11 |
# mute makes echoing of commands |
| 12 |
.SILENT: |
| 13 |
|
| 14 |
# replace sequential with random to build a random subset |
| 15 |
all: reset sequential |
| 16 |
#all: reset random |
| 17 |
|
| 18 |
retry: |
| 19 |
rm -rf reports/`cat jobs | tail -n1`* |
| 20 |
make -f $(SELF) |
| 21 |
|
| 22 |
prepare: |
| 23 |
# uncomment these to make sure cpu is in high performance mode |
| 24 |
#sudo sh -c 'echo performance > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor || true' |
| 25 |
#sudo sh -c 'echo performance > /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor || true' |
| 26 |
|
| 27 |
reset: |
| 28 |
rm -rf jobs jobs |
| 29 |
# remove checkout dir to have a full reset on each invokation |
| 30 |
rm -rf checkout |
| 31 |
# create clone |
| 32 |
git clone -s $(PROJECT_PATH) checkout |
| 33 |
mkdir reports > /dev/null 2>&1 || true |
| 34 |
make -f $(SELF) jobs |
| 35 |
make -f $(SELF) prepare |
| 36 |
|
| 37 |
jobs: joblist |
| 38 |
./makejobs.rb joblist > jobs |
| 39 |
|
| 40 |
sequential: |
| 41 |
for a in `cat jobs`;do make -f $(SELF) reports/$$a;done |
| 42 |
|
| 43 |
random: |
| 44 |
for a in `cat jobs|sort`;do make -f $(SELF) reports/$$a;done |
| 45 |
|
| 46 |
reports/%: |
| 47 |
# check out revision |
| 48 |
(cd checkout; git checkout `echo $@|sed s:reports/::`) |
| 49 |
# write header for report |
| 50 |
git log -1 `echo $@|sed s:reports/::` > $@ || true |
| 51 |
# clean previous build |
| 52 |
rm -rf install; mkdir install |
| 53 |
# build revision |
| 54 |
(cd checkout; if [ ! -f Makefile ]; then CC=$(CC) ./autogen.sh --disable-introspection --prefix=`pwd`/../install; fi ; \ |
| 55 |
make $(MAKE_FLAGS) ; make -k install ) > [email protected] 2>&1 || true |
| 56 |
# testing |
| 57 |
make -f Makefile-tests clean;\ |
| 58 |
make -f Makefile-tests; sync;\ |
| 59 |
make -f Makefile-tests check >> $@ || true |
| 60 |
# update report.pdf / report.png |
| 61 |
./create-report.rb |
| 62 |
echo |
| 63 |
|
| 64 |
clean: |
| 65 |
rm -rf reports jobs report.pdf report.png checkout install |
| 66 |
make -f Makefile-tests clean |