[ovs-dev] [PATCH 1/2] ovs-ctl: Add support for glibc malloc debugging.

Ben Pfaff blp at nicira.com
Mon Oct 1 18:03:57 UTC 2012


Unlike valgrind, glibc's built-in features for malloc debugging are cheap
enough that one can run with them enabled all the time, at least in test
scenarios.

Signed-off-by: Ben Pfaff <blp at nicira.com>
---
 utilities/ovs-ctl.8  |    8 +++++++-
 utilities/ovs-lib.in |    3 +++
 2 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/utilities/ovs-ctl.8 b/utilities/ovs-ctl.8
index 22db06b..7bb8fa3 100644
--- a/utilities/ovs-ctl.8
+++ b/utilities/ovs-ctl.8
@@ -198,15 +198,21 @@ Run the daemon under \fBvalgrind\fR(1), if it is installed, logging to
 .IP "\fBstrace\fR"
 Run the daemon under \fBstrace\fR(1), if it is installed, logging to
 \fIdaemon\fB.strace.log.\fIpid\fR in the log directory.
+.
+.IP "\fBglibc\fR"
+Enable GNU C library features designed to find memory errors.
 .RE
 .
 .IP
 By default, no wrapper is used.
 .
 .IP
-Wrappers greatly slow daemon operations so they should not be used in
+The \fBvalgring\fR and \fBstrace\fR
+wrappers greatly slow daemon operations so they should not be used in
 production.  They also produce voluminous logs that can quickly fill
 small disk partitions.
+The \fBglibc\fR wrapper is less resource-intensive but still somewhat
+slows the daemons.
 .
 .PP
 The following options control file locations.  They should only be
diff --git a/utilities/ovs-lib.in b/utilities/ovs-lib.in
index 01f4ded..b787b1c 100644
--- a/utilities/ovs-lib.in
+++ b/utilities/ovs-lib.in
@@ -140,6 +140,9 @@ start_daemon () {
                 log_failure_msg "strace not installed, running $daemon without it"
             fi
             ;;
+        glibc)
+            set env MALLOC_CHECK_=2 MALLOC_PERTURB_=165 "$@"
+            ;;
         '')
             ;;
         *)
-- 
1.7.2.5




More information about the dev mailing list