| 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 = -j5 -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 reverse |
| 17 |
#all: reset random |
| 18 |
|
| 19 |
retry: |
| 20 |
rm -rf reports/`cat jobs | tail -n1`* |
| 21 |
make -f $(SELF) |
| 22 |
|
| 23 |
prepare: |
| 24 |
# uncomment these to make sure cpu is in high performance mode |
| 25 |
sudo sh -c 'echo powersave > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor || true' |
| 26 |
sudo sh -c 'echo powersave > /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor || true' |
| 27 |
sudo sh -c 'echo powersave > /sys/devices/system/cpu/cpu2/cpufreq/scaling_governor || true' |
| 28 |
sudo sh -c 'echo powersave > /sys/devices/system/cpu/cpu3/cpufreq/scaling_governor || true' |
| 29 |
sudo sh -c 'echo powersave > /sys/devices/system/cpu/cpu4/cpufreq/scaling_governor || true' |
| 30 |
sudo sh -c 'echo powersave > /sys/devices/system/cpu/cpu5/cpufreq/scaling_governor || true' |
| 31 |
sudo sh -c 'echo powersave > /sys/devices/system/cpu/cpu6/cpufreq/scaling_governor || true' |
| 32 |
sudo sh -c 'echo powersave > /sys/devices/system/cpu/cpu7/cpufreq/scaling_governor || true' |
| 33 |
|
| 34 |
reset: |
| 35 |
rm -rf jobs jobs |
| 36 |
# remove checkout dir to have a full reset on each invokation |
| 37 |
rm -rf checkout |
| 38 |
# create clone |
| 39 |
git clone -s $(PROJECT_PATH) checkout |
| 40 |
mkdir reports > /dev/null 2>&1 || true |
| 41 |
killall tail || true |
| 42 |
make -f $(SELF) jobs |
| 43 |
make -f $(SELF) prepare |
| 44 |
|
| 45 |
jobs: joblist |
| 46 |
./makejobs.rb joblist > jobs |
| 47 |
|
| 48 |
sequential: |
| 49 |
for a in `cat jobs`;do make -f $(SELF) reports/$$a;done |
| 50 |
|
| 51 |
reverse: |
| 52 |
for a in `tac jobs`;do make -f $(SELF) reports/$$a;done |
| 53 |
|
| 54 |
random: |
| 55 |
for a in `cat jobs|sort`;do make -f $(SELF) reports/$$a;done |
| 56 |
|
| 57 |
|
| 58 |
reports/%: |
| 59 |
(cd checkout; git checkout `echo $@|sed s:reports/::` || ( cd .. ; rm -rf checkout ; git clone -s $(PROJECT_PATH) checkout ; cd checkout; git checkout `echo $@|sed s:reports/::` )) |
| 60 |
# write header for report |
| 61 |
git log -1 `echo $@|sed s:reports/::` > $@ || true |
| 62 |
# make sure revision is built, and current prefix symlink |
| 63 |
./perf-build.sh `echo $@|sed s:reports/::` |
| 64 |
# run the Makefile for the tests |
| 65 |
tail -f $@ & \ |
| 66 |
make -f Makefile-tests clean;\ |
| 67 |
make -f Makefile-tests; sync;\ |
| 68 |
make -f Makefile-tests check >> $@ || true |
| 69 |
# update report.pdf / report.png |
| 70 |
./create-report.rb |
| 71 |
echo |
| 72 |
purge: |
| 73 |
(cd prefixes; for a in *;do grep $$a ../jobs || rm -rf $$a;done ) |
| 74 |
|
| 75 |
clean: |
| 76 |
rm -rf reports jobs report.pdf report.png checkout install |
| 77 |
make -f Makefile-tests clean |