Profile of duplicating lots of regions.
[ardour.git] / libs / ardour / run-profiling.sh
1 #!/bin/bash
2 #
3 # Run libardour profiling tests.
4 #
5
6 if [ ! -f './tempo.cc' ]; then
7     echo "This script must be run from within the libs/ardour directory";
8     exit 1;
9 fi
10
11 if [ "$1" == "" ]; then
12    echo "Syntax: run-profiling.sh [flag] <test> [<args>]"
13    exit 1;
14 fi
15
16 cd ../..
17 top=`pwd`
18 cd build
19
20 libs='libs'
21
22 export LD_LIBRARY_PATH=$libs/audiographer:$libs/vamp-sdk:$libs/surfaces:$libs/surfaces/control_protocol:$libs/ardour:$libs/midi++2:$libs/pbd:$libs/rubberband:$libs/soundtouch:$libs/gtkmm2ext:$libs/appleutility:$libs/taglib:$libs/evoral:$libs/evoral/src/libsmf:$libs/timecode:/usr/local/lib:/usr/local/lib64:$LD_LIBRARY_PATH
23
24 export ARDOUR_CONFIG_PATH=$top:$top/gtk2_ardour:$libs/..:$libs/../gtk2_ardour
25 export ARDOUR_PANNER_PATH=$libs/panners/2in2out:$libs/panners/1in2out:$libs/panners/vbap
26 export ARDOUR_SURFACES_PATH=$libs/surfaces/osc:$libs/surfaces/generic_midi:$libs/surfaces/tranzport:$libs/surfaces/powermate:$libs/surfaces/mackie
27 export ARDOUR_MCP_PATH="../mcp"
28 export ARDOUR_DLL_PATH=$libs
29 export ARDOUR_DATA_PATH=$top/gtk2_ardour:$top/build/gtk2_ardour:.
30
31 export LD_PRELOAD=/home/carl/src/libfakejack/libjack.so
32 # session='32tracks'
33
34 p=$1
35 if [ "$p" == "--debug" -o "$p" == "--valgrind" -o "$p" == "--callgrind" ]; then
36   f=$p
37   p=$2
38   shift 1
39 fi
40 shift 1
41
42 if [ "$f" == "--debug" ]; then
43         gdb --args ./libs/ardour/$p $*
44 elif [ "$f" == "--valgrind" ]; then
45         valgrind ./libs/ardour/$p $*
46 elif [ "$f" == "--callgrind" ]; then
47         valgrind --tool=callgrind ./libs/ardour/$p $*
48 else
49         ./libs/ardour/$p $*
50 fi