make conf=prof -j2
+if test "$?" != "0"; then
+ exit 2
+fi
depth=../..
resultdir=out/profile-results
cd $resultdir
-echo 'foo = \new Staff \new Voice \repeat unfold 50 \relative { c4 d8[ d16( e]~ e16[ e e) f] g8 }
-\new ChoirStaff <<
- \foo \foo \foo \foo
- \foo \foo \foo \foo
+cat > long-score.ly << EOF
+\version "2.10.0"
+foo = \new Staff \new Voice \repeat unfold 50 \relative { c4 d8[ d16( e]~ e16[ e e) f] g8 }
+\score {
+ \new ChoirStaff <<
+ \foo \foo \foo \foo
+ \foo \foo \foo \foo
->>' > long-score.ly
+ >>
+ \midi {}
+ \layout {}
+}
+EOF
rm gmon.sum
## todo: figure out representative sample.
files="wtk1-fugue2 wtk1-fugue2 wtk1-fugue2 wtk1-fugue2 mozart-hrn-3 mozart-hrn-3 long-score"
-for a in seq 1 3; do
- $exe -ddump-profile -I $depth/input/ -I $depth/input/mutopia/J.S.Bach/ \
- -I $depth/input/mutopia/W.A.Mozart/ \
- $files
-
- if test -f gmon.sum ; then
- gprof -s $exe gmon.out gmon.sum
- else
- mv gmon.out gmon.sum
- fi
-done
+
+
+$exe -ddump-profile --formats=ps -I $depth/input/ -I $depth/input/mutopia/J.S.Bach/ \
+ -I $depth/input/mutopia/W.A.Mozart/ \
+ $files
for a in *.profile; do
cat $a
done
+echo 'running gprof'
+gprof $exe > profile
+
+exit 0
+
+
+## gprof -s takes forever.
+for a in seq 1 3; do
+ for f in $files ; do
+ $exe -ddump-profile --formats=ps -I $depth/input/ -I $depth/input/mutopia/J.S.Bach/ \
+ -I $depth/input/mutopia/W.A.Mozart/ \
+ $f
+
+ echo 'running gprof'
+ if test -f gmon.sum ; then
+ gprof -s $exe gmon.out gmon.sum
+ else
+ mv gmon.out gmon.sum
+ fi
+ done
+done
+
gprof $exe gmon.sum > profile