Permalink
Browse files

valgrind: Write separate log files in tmp/valgrind-<DATE>-<PID>.log

Current code wrote a single valgrind.log in the top-level directory.
This was overwritten with each valgrinded program, which wasn't much
use.  The new version writes multiple separate valgrind-*.log files
containing the date and PID (so each is unique).

It would nice if valgrind could delete log files that don't contain
errors, but this doesn't appear to be possible.
  • Loading branch information...
1 parent 6899084 commit b050d7e4bf2cdbd04e980511635687f1114035e0 @rwmjones rwmjones committed Apr 1, 2013
Showing with 6 additions and 2 deletions.
  1. +0 −1 .gitignore
  2. +1 −1 configure.ac
  3. +4 −0 run.in
  4. +1 −0 tmp/.gitignore
View
@@ -470,4 +470,3 @@ Makefile.in
/tools/test.img
/tools/virt-*.1
/tools/virt-*.pl
-/valgrind.log*
View
@@ -919,7 +919,7 @@ AS_IF([test "x$VALGRIND" != "xno"],[
fi
# Substitute the whole valgrind command.
- VG='$(VALGRIND) $(VALGRIND_NO_VGDB) --log-file=$(abs_top_builddir)/valgrind.log --leak-check=full --error-exitcode=119 --suppressions=$(abs_top_srcdir)/valgrind-suppressions'
+ VG='$(VALGRIND) $(VALGRIND_NO_VGDB) --log-file=$(abs_top_builddir)/tmp/valgrind-%q{T}-%p.log --leak-check=full --error-exitcode=119 --suppressions=$(abs_top_srcdir)/valgrind-suppressions'
],[
# No valgrind, so substitute VG with something that will break.
VG=VALGRIND_IS_NOT_INSTALLED
View
4 run.in
@@ -44,6 +44,10 @@ fi
# Find this script.
b=@abs_builddir@
+# Set T to current date & time (mainly for valgrind logfile name).
+T=`date +%Y%m%d.%H.%M.%S`
+export T
+
# Set tmpdir and cachedir so the appliance doesn't conflict with
# globally installed libguestfs.
#
View
@@ -2,3 +2,4 @@
/guestfs.*
/libguestfs??????/
/run-*
+/valgrind-*.log

0 comments on commit b050d7e

Please sign in to comment.