put them into a special directory since there will be LOTS of log files.
{verbatim}
-valgrind --tool=memcheck --leak-check=yes --show-reachable=yes --leak-resolution=high --log-file=/tmp/valgrind.%p --trace-children=yes --num-callers=16 ./batch_test.pl -b -c
+valgrind --tool=memcheck --leak-check=yes --show-reachable=yes --leak-resolution=high --log-file=/tmp/tests.%p --trace-children=yes --num-callers=16 ./batch_test.pl -b -c
{endverbatim}
+Then, in the same directory as the pile of =tests.*= files, run this script,
+which will collate the =tests.*= files associated with Condor daemons and
+tools into directories.
+
+{code}
+#! /usr/bin/env perl
+
+use warnings;
+use strict;
+use File::Basename;
+use File::Path;
+
+sub collate_valgrind_logs
+{
+ my $prefix = shift @_;
+ my @files;
+ my $file;
+ my @lines;
+ my $line;
+ my @pieces;
+
+ @files = `/bin/ls -1 $prefix*`;
+ map {chomp $_} @files;
+
+ # foreach file which has a pattern of ^$prefix[0-9]+$ (some corefiles might
+ # exist which could have that prefix which we don't want to process) we
+ # figure out the command associated with it
+ foreach $file (@files) {
+ next if ($file !~ /^\Q$prefix\E[0-9]+$/);
+
+ # Get the line out of the file which represents the command that
+ # the file is valgrinding.
+ @lines = `egrep -e '== Command:' $file`;
+ next if ((scalar @lines) == 0);
+ map {chomp $_} @lines;
+
+ # figure out the actual command
+ @pieces = split / /, $lines[0];
+ map {s/^\s+//; chomp $_} @pieces;
+
+ # make sure I have something to work with.
+ next if (!defined($pieces[2]));
+
+ # get rid of an easy set of commands that aren't condor processes.
+ next if ($pieces[2] !~ m:condor_\w+$:);
+
+ # get rid of any condor process that appears to be a test suite
+ # executable
+ next if ($pieces[2] =~ m:condor_exec:);
+
+ # get the basename of the file
+ $pieces[2] = basename($pieces[2]);
+
+ # Now, mkdir the basename and copy the file into it.
+ mkpath($pieces[2]);
+ if (-d $pieces[2]) {
+ system("cp $file $pieces[2]");
+ }
+
+ print "$file, $pieces[2]\n";
+
+ }
+}
+
+sub main
+{
+ collate_valgrind_logs("tests.");
+}
+
+exit main();
+
+{endcode}
+
{section: How to use the google heap profiler}
The google heap profiler is part of the google-perftools package, which may be easily downloaded and compiled. This example used version 0.98.