From b050d7e4bf2cdbd04e980511635687f1114035e0 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Mon, 1 Apr 2013 11:35:26 +0100 Subject: [PATCH] valgrind: Write separate log files in tmp/valgrind--.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. --- .gitignore | 1 - configure.ac | 2 +- run.in | 4 ++++ tmp/.gitignore | 1 + 4 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 7c0e238bd..4145a7a82 100644 --- a/.gitignore +++ b/.gitignore @@ -470,4 +470,3 @@ Makefile.in /tools/test.img /tools/virt-*.1 /tools/virt-*.pl -/valgrind.log* diff --git a/configure.ac b/configure.ac index 6bace0756..2fdf66ec0 100644 --- a/configure.ac +++ b/configure.ac @@ -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 diff --git a/run.in b/run.in index b978a17db..d7d4800e3 100755 --- a/run.in +++ b/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. # diff --git a/tmp/.gitignore b/tmp/.gitignore index 27dc5056a..28ac388f3 100644 --- a/tmp/.gitignore +++ b/tmp/.gitignore @@ -2,3 +2,4 @@ /guestfs.* /libguestfs??????/ /run-* +/valgrind-*.log