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.
This commit is contained in:
Richard W.M. Jones
2013-04-01 11:35:26 +01:00
parent 68990840b6
commit b050d7e4bf
4 changed files with 6 additions and 2 deletions

1
.gitignore vendored
View File

@@ -470,4 +470,3 @@ Makefile.in
/tools/test.img
/tools/virt-*.1
/tools/virt-*.pl
/valgrind.log*

View File

@@ -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

4
run.in
View File

@@ -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.
#

1
tmp/.gitignore vendored
View File

@@ -2,3 +2,4 @@
/guestfs.*
/libguestfs??????/
/run-*
/valgrind-*.log