Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Make it easier to run valgrind/umem/watchmalloc on memcached

Change-Id: Iabb747987df6b02059036cd0fba4406ad44a032b
Reviewed-on: http://review.couchbase.org/12431
Tested-by: Trond Norbye <trond.norbye@gmail.com>
Reviewed-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
  • Loading branch information...
commit 34df5fdfd01eee9cc9b7c59add04d02a0dda9051 1 parent e737e5e
@trondn trondn authored alk committed
Showing with 27 additions and 0 deletions.
  1. +27 −0 memcached-wrapper.in
View
27 memcached-wrapper.in
@@ -2,4 +2,31 @@
PREFIX="@PREFIX@"
+if [ "x$MEMCACHED_UMEM" = "xyes" ]
+then
+ export UMEM_DEBUG=default
+ export UMEM_LOGGING=transaction,contents,fail
+ export LD_PRELOAD=libumem.so.1
+ exec "$PREFIX/bin/memcached" -u `whoami` "$@"
+
+elif [ "x$MEMCACHED_WATCHMALLOC" = "xyes" ]
+then
+ export MALLOC_DEBUG=WATCH,RW,STOP
+ export LD_PRELOAD=watchmalloc.so.1
+ exec "$PREFIX/bin/memcached" -u `whoami` "$@"
+
+elif [ "x$MEMCACHED_VALGRIND" = "xyes" ]
+then
+ exec valgrind \
+ --time-stamp=yes \
+ --log-file=/tmp/memcached.%p.valgrind \
+ --leak-check=yes \
+ --track-origins=yes \
+ --read-var-info=yes \
+ --malloc-fill=55 \
+ --free-fill=aa \
+ --show-reachable=yes \
+ "$PREFIX/bin/memcached" -u `whoami` "$@"
+fi
+
exec "$PREFIX/bin/memcached" -u `whoami` "$@"
Please sign in to comment.
Something went wrong with that request. Please try again.