From d088b27ebd93248f7ec02b3767701f3e09365144 Mon Sep 17 00:00:00 2001 From: Daniel Walton Date: Wed, 3 May 2017 13:18:20 +0000 Subject: [PATCH] Add valgrind_enable option to /etc/frr/debian.conf Signed-off-by: Daniel Walton This allows you to start all daemons via valgrind so you can catch memory leaks, etc. --- cumulus/etc/frr/debian.conf | 1 + tools/frr | 11 ++++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/cumulus/etc/frr/debian.conf b/cumulus/etc/frr/debian.conf index eed8379e8c..7b9b20bd5b 100644 --- a/cumulus/etc/frr/debian.conf +++ b/cumulus/etc/frr/debian.conf @@ -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" diff --git a/tools/frr b/tools/frr index 1906b4ad15..4902b8c9a9 100755 --- 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 } -- 2.39.5