-
Notifications
You must be signed in to change notification settings - Fork 0
/
performance.am
64 lines (60 loc) · 3.34 KB
/
performance.am
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# vi: set ft=automake:
PROF_BENCH = \
"$(MAKE) -C $(top_srcdir)/benchmarks/code joplift.prep":"$(top_srcdir)/benchmarks/code/joplift/lift_control.c $(top_srcdir)/benchmarks/code/joplift/lift_io.c $(top_srcdir)/benchmarks/code/joplift/main.c --unwind 1 --partial-loops --function ctrl_loop":"set no_zero_init":"cover @basicblockentry" \
"$(MAKE) -C $(top_srcdir)/benchmarks/code ase-examples.prep":"$(top_srcdir)/benchmarks/code/ase-examples/list2.c --unwind 3":"":"cover @BASICBLOCKENTRY->@BASICBLOCKENTRY->@BASICBLOCKENTRY->@BASICBLOCKENTRY->@BASICBLOCKENTRY" \
"$(MAKE) -C $(top_srcdir)/benchmarks/code picosat-913.prep":"$(top_srcdir)/benchmarks/code/picosat-913/*.c --unwind 2 --no-unwinding-assertions":"":"cover @BASICBLOCKENTRY->@BASICBLOCKENTRY"
PROF_CLIENT = $(top_builddir)/fshell2/main/fshell
PROF_CLIENT_OPTS = --verbosity 9 --statistics --outfile /dev/null
# -fno-inline avoids any inlining, -finline-limit=4 allows for inlining very
# small functions
profile: CXXFLAGS := $(filter-out -O1 -O2 -O3 -Os,$(CXXFLAGS)) -O2 -finline-limit=4 -pg
profile:
mkdir -p benchmarks/profiling
[ -n "$(no_clean)" ] || $(MAKE) $(AM_MAKEFLAGS) -C $(top_builddir) clean
$(MAKE) $(AM_MAKEFLAGS) -C $(top_builddir) CXXFLAGS="$(CXXFLAGS)"
if [ -d $(top_srcdir)/.svn ] ; then \
rev="SVN.`svn info | grep ^Revision | cut -f2 -d" "`" ; \
elif [ -d $(top_srcdir)/.git ] ; then \
rev="GIT.`git show --pretty=format:%H | head -n1`" ; \
else \
echo "Could not determine revision" 1>&2 ; \
exit 1 ; \
fi ; \
for i in $(PROF_BENCH) ; do \
sleep 1 ; \
ident=`date +%Y-%m-%d_%H%M%S` ; \
echo "PROFILE: profiling/$$rev.$$ident.gz" >> benchmarks/profiling/NOTES ; \
echo "REV: $$rev" >> benchmarks/profiling/NOTES ; \
printf "HOST: " >> benchmarks/profiling/NOTES ; \
hostname >> benchmarks/profiling/NOTES ; \
printf "CXX: " >> benchmarks/profiling/NOTES ; \
$(CXX) --version | head -n1 >> benchmarks/profiling/NOTES ; \
echo "MAKE: $(MAKE) $(MAKEFLAGS) -C $(top_srcdir) CXXFLAGS=\"$(CXXFLAGS)\"" >> benchmarks/profiling/NOTES ; \
prep="`echo $$i | cut -f1 -d:`" ; \
cmdline="`echo $$i | cut -f2 -d:`" ; \
prolog="`echo $$i | cut -f3 -d:`" ; \
query="`echo $$i | cut -f4 -d:`" ; \
echo "CMDLINE: $(PROF_CLIENT) $(PROF_CLIENT_OPTS) $$cmdline" >> benchmarks/profiling/NOTES ; \
echo "PREPARE: $$prolog" >> benchmarks/profiling/NOTES ; \
echo "QUERY: $$query" >> benchmarks/profiling/NOTES ; \
echo >> benchmarks/profiling/NOTES ; \
$$prep && \
time ( printf "$$prolog\\n$$query\\nquit\\n" | $(PROF_CLIENT) $(PROF_CLIENT_OPTS) $$cmdline ) && \
gprof $(PROF_CLIENT) > benchmarks/profiling/$$rev.$$ident && \
gzip benchmarks/profiling/$$rev.$$ident || exit 1 ; \
done
benchmark-%:
@echo "Running benchmarking script: `echo $@ | tr 'a-z' 'A-Z'`"
$(MAKE) $(AM_MAKEFLAGS) -C $(top_builddir)
if [ -d $(top_srcdir)/.svn ] ; then \
rev="SVN.`svn info | grep ^Revision | cut -f2 -d" "`" ; \
elif [ -d $(top_srcdir)/.git ] ; then \
rev="GIT.`git show --pretty=format:%H | head -n1`" ; \
else \
echo "Could not determine revision" 1>&2 ; \
exit 1 ; \
fi ; \
ident=`date +%Y-%m-%d_%H%M%S` ; \
hname=`hostname` ; \
fname="$$rev.$$ident.$$hname" ; \
$(MAKE) $(AM_MAKEFLAGS) -C $(top_srcdir)/benchmarks $(subst benchmark-,,$@) top_builddir=`pwd`/$(top_builddir) top_srcdir=`pwd`/$(top_srcdir) LOG=$$fname EXEEXT=$(EXEEXT)