]> git.puffer.fish Git - matthieu/frr.git/commitdiff
Add valgrind_enable option to /etc/frr/debian.conf
authorDaniel Walton <dwalton@cumulusnetworks.com>
Wed, 3 May 2017 13:18:20 +0000 (13:18 +0000)
committerDaniel Walton <dwalton@cumulusnetworks.com>
Wed, 3 May 2017 13:18:20 +0000 (13:18 +0000)
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
This allows you to start all daemons via valgrind so you can catch
memory leaks, etc.

cumulus/etc/frr/debian.conf
tools/frr

index eed8379e8c2c7f52ab29746ab507ddb403c69617..7b9b20bd5bed509d2bd5a43b11c359e178b0d4c8 100644 (file)
@@ -4,6 +4,7 @@
 # Check /etc/pam.d/frr if you intend to use "vtysh"!
 #
 vtysh_enable=yes
+valgrind_enable=no
 zebra_options="  -s 90000000 --daemon -A 127.0.0.1"
 bgpd_options="   --daemon -A 127.0.0.1"
 ospfd_options="  --daemon -A 127.0.0.1"
index 1906b4ad1543b3b572df059c2882f92e33edc27b..4902b8c9a90871cd74690799c18b27acace5ff74 100755 (executable)
--- a/tools/frr
+++ b/tools/frr
@@ -150,12 +150,21 @@ start()
                return;
            fi
 
-           ${SSD} \
+           if [ $valgrind_enable = "yes" ]; then
+              ${SSD} \
+               --start \
+               --pidfile=`pidfile $1` \
+               --exec "/usr/bin/valgrind" \
+               -- --trace-children=no --leak-check=full --log-file=/var/log/frr/$1-valgrind.log $D_PATH/$1 \
+               `eval echo "$""$1""_options"`
+           else
+              ${SSD} \
                --start \
                --pidfile=`pidfile $1` \
                --exec "$D_PATH/$1" \
                -- \
                `eval echo "$""$1""_options"`
+           fi
         fi
 }