]> git.donarmstrong.com Git - lilypond.git/blob - buildscripts/build-profile.sh
Merge branch 'master' of git://git.sv.gnu.org/lilypond
[lilypond.git] / buildscripts / build-profile.sh
1 #!/bin/sh
2
3 if test "$1" == "--fresh"; then
4   fresh=yes
5 fi
6
7 if test ! -f config-prof.make; then
8   fresh=yes
9 fi
10
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
16 fi
17
18 make conf=prof -j2
19
20 if test "$?" != "0"; then
21   exit 2
22 fi
23
24 depth=../..
25 resultdir=out/profile-results
26
27 rm -rf $resultdir
28 mkdir $resultdir
29 cd $resultdir
30
31
32 echo 'foo = \new Staff \new Voice \repeat unfold 50 \relative { c4 d8[ d16( e]~ e16[ e e) f] g8  }
33 \new ChoirStaff << 
34   \foo \foo \foo \foo 
35   \foo \foo \foo \foo 
36
37 >>' > long-score.ly
38
39 rm gmon.sum
40
41 exe=$depth/out-prof/bin/lilypond
42
43 ## todo: figure out representative sample.
44 files="wtk1-fugue2 wtk1-fugue2 wtk1-fugue2 wtk1-fugue2 mozart-hrn-3  mozart-hrn-3  long-score"
45
46 for a in seq 1 3; do
47   $exe -ddump-profile -I $depth/input/ -I  $depth/input/mutopia/J.S.Bach/ \
48      -I $depth/input/mutopia/W.A.Mozart/ \
49      $files 
50
51   if test -f gmon.sum ; then
52     gprof -s $exe gmon.out gmon.sum
53   else
54     mv gmon.out gmon.sum
55   fi 
56 done
57
58
59 for a in *.profile; do
60   echo $a
61   cat $a
62 done
63
64 gprof $exe gmon.sum > profile