Markup command name changes.
[lilypond.git] / buildscripts / build-profile.sh
blob072cf64520c2fab1640a4e10502f833651bd370e
1 #!/bin/sh
3 if test "$1" == "--fresh"; then
4 fresh=yes
5 fi
7 if test ! -f config-prof.make; then
8 fresh=yes
9 fi
11 if test "$fresh" = "yes";
12 then
13 ./configure --enable-config=prof --enable-optimising \
14 && perl -i~ -pe 's/-pipe /-pg -pipe /g' config-prof.make \
15 && perl -i~ -pe 's/ -ldl / -pg -ldl /g' config-prof.make
18 make conf=prof -j2
20 if test "$?" != "0"; then
21 exit 2
24 depth=../..
25 resultdir=out/profile-results
27 rm -rf $resultdir
28 mkdir $resultdir
29 cd $resultdir
32 cat > long-score.ly << EOF
33 \version "2.10.0"
34 foo = \new Staff \new Voice \repeat unfold 50 \relative { c4 d8[ d16( e]~ e16[ e e) f] g8 }
35 \score {
36 \new ChoirStaff <<
37 \foo \foo \foo \foo
38 \foo \foo \foo \foo
41 \midi {}
42 \layout {}
44 EOF
46 rm gmon.sum
48 exe=$depth/out-prof/bin/lilypond
50 ## todo: figure out representative sample.
51 files="wtk1-fugue2 wtk1-fugue2 wtk1-fugue2 wtk1-fugue2 mozart-hrn-3 mozart-hrn-3 long-score"
55 $exe -ddump-profile --formats=ps -I $depth/input/ -I $depth/input/mutopia/J.S.Bach/ \
56 -I $depth/input/mutopia/W.A.Mozart/ \
57 $files
60 for a in *.profile; do
61 echo $a
62 cat $a
63 done
65 echo 'running gprof'
66 gprof $exe > profile
68 exit 0
71 ## gprof -s takes forever.
72 for a in seq 1 3; do
73 for f in $files ; do
74 $exe -ddump-profile --formats=ps -I $depth/input/ -I $depth/input/mutopia/J.S.Bach/ \
75 -I $depth/input/mutopia/W.A.Mozart/ \
78 echo 'running gprof'
79 if test -f gmon.sum ; then
80 gprof -s $exe gmon.out gmon.sum
81 else
82 mv gmon.out gmon.sum
84 done
85 done
87 gprof $exe gmon.sum > profile