0d0f5f2fdc04bc43586317766499fa8e0fb00cb0
[ardour.git] / gtk2_ardour / arprof
1 #!/bin/sh
2
3 # Ardour profiler using callgrind
4 # intended for use with the 'Dummy' backend engine.
5 #
6 # inspect data with kcachegrind
7 # see http://valgrind.org/docs/manual/cl-manual.html and
8 # http://log.fundamental-code.com/2013/09/07/profiling-realtime-code
9
10 . `dirname "$0"`/../build/gtk2_ardour/ardev_common_waf.sh
11 LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
12 export ARDOUR_RUNNING_UNDER_VALGRIND=TRUE
13
14
15 # depending on options, there can be many files (one per thread,
16 # one per process cycle,..) dump them in a dedicated place.
17 mkdir -p /tmp/ardour_profile/
18
19 ## some options to drop in
20 #  --zero-before="ARDOUR::AudioEngine::process_callback*" \
21 #  --dump-after="ARDOUR::AudioEngine::process_callback*" \
22 ## and/or
23 #  --toggle-collect="ARDOUR::AudioEngine::process_callback*" \
24
25 exec valgrind --tool=callgrind \
26   --dump-instr=yes --collect-jumps=yes\
27   --separate-threads=yes \
28   --collect-systime=yes --collect-bus=yes \
29   --callgrind-out-file=/tmp/ardour_profile/ardour-%p.log \
30         --toggle-collect="ARDOUR::AudioEngine::process_callback*" \
31   $TOP/$EXECUTABLE --novst "$@"