perf-test: initial support for talloc leak report in memory tests
authorDavid Bremner <bremner@debian.org>
Wed, 26 Dec 2012 16:29:45 +0000 (12:29 -0400)
committerDavid Bremner <bremner@debian.org>
Mon, 31 Dec 2012 01:12:11 +0000 (21:12 -0400)
As with the valgrind logs, we print a (very) brief summary and leave
the log for inspection.

performance-test/perf-test-lib.sh

index 10d05e070eab97e27f2f96f04a6095ff17e985e8..9ee76613414c269c629ce21ceb4a3d8e76f21459 100644 (file)
@@ -126,13 +126,16 @@ memory_run ()
     test_count=$(($test_count+1))
 
     log_file=$log_dir/$test_count.log
+    talloc_log=$log_dir/$test_count.talloc
 
     printf "[ %d ]\t%s\n" $test_count "$1"
 
-    valgrind --leak-check=full --log-file="$log_file" $2
+    NOTMUCH_TALLOC_REPORT="$talloc_log" valgrind --leak-check=full --log-file="$log_file" $2
 
     awk '/LEAK SUMMARY/,/suppressed/ { sub(/^==[0-9]*==/," "); print }' "$log_file"
     echo
+    sed -n -e 's/.*[(]total *\([^)]*\)[)]/talloced at exit: \1/p' $talloc_log
+    echo
 }
 
 memory_done ()