X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=gtk2_ardour%2Farprof;h=1b66a856efad327c462e26fbd58c4b0bebdfdfa6;hb=03c4335c1e20311fedd2c61c96a01d34447bf692;hp=47c11cdb992a11ebd951521512599347b5deb533;hpb=f7f9d6fdc40248b190ec9c6e1a886261d55777ae;p=ardour.git diff --git a/gtk2_ardour/arprof b/gtk2_ardour/arprof index 47c11cdb99..1b66a856ef 100755 --- a/gtk2_ardour/arprof +++ b/gtk2_ardour/arprof @@ -1,9 +1,32 @@ #!/bin/sh -if [ gprofhelper.c -nt gprofhelper.so ] ; then - echo "Recompiling gprof helper ..." - gcc -shared -nostdlib -fPIC gprofhelper.c -o gprofhelper.so -lpthread -ldl || exit 1 -fi +# Ardour profiler using callgrind +# intended for use with the 'Dummy' backend engine. +# +# inspect data with kcachegrind +# see http://valgrind.org/docs/manual/cl-manual.html and +# http://log.fundamental-code.com/2013/09/07/profiling-realtime-code -. ardev_common.sh -LDPRELOAD=./gprofhelper.so $EXECUTABLE "$@" +TOP=`dirname "$0"`/.. +. $TOP/build/gtk2_ardour/ardev_common_waf.sh +LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH +export ARDOUR_RUNNING_UNDER_VALGRIND=TRUE + + +# depending on options, there can be many files (one per thread, +# one per process cycle,..) dump them in a dedicated place. +mkdir -p /tmp/ardour_profile/ + +## some options to drop in +# --zero-before="ARDOUR::AudioEngine::process_callback*" \ +# --dump-after="ARDOUR::AudioEngine::process_callback*" \ +## and/or +# --toggle-collect="ARDOUR::AudioEngine::process_callback*" \ + +exec valgrind --tool=callgrind \ + --dump-instr=yes --collect-jumps=yes\ + --separate-threads=yes \ + --collect-systime=yes --collect-bus=yes \ + --callgrind-out-file=/tmp/ardour_profile/ardour-%p.log \ + --toggle-collect="ARDOUR::AudioEngine::process_callback*" \ + $TOP/$EXECUTABLE --novst "$@"