An extension of the previous commit:  the vg_perf --tools option is so useful
that I got rid of the "tools:" line in the .vg_perf files.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6364 a5019735-40e9-0310-863c-91ae7b9d1cf9
diff --git a/perf/vg_perf.in b/perf/vg_perf.in
index c9d6d95..b4625ec 100644
--- a/perf/vg_perf.in
+++ b/perf/vg_perf.in
@@ -41,7 +41,6 @@
 # Each test is defined in a file <test>.vgperf, containing one or more of the
 # following lines, in any order:
 #   - prog:   <prog to run>                         (compulsory)
-#   - tools:  <Valgrind tools>                      (compulsory)
 #   - args:   <args for prog>                       (default: none)
 #   - vgopts: <Valgrind options>                    (default: none)
 #   - prereq: <prerequisite command>                (default: none)
@@ -64,10 +63,13 @@
     -h --help             show this message
     --all                 run all tests under this directory
     --reps=<n>            number of repeats for each program [1]
-    --tools=<t1,t2,t3>    tools to run (overrides .vgperf "tools" line)
+    --tools=<t1,t2,t3>    tools to run [Nulgrind and Memcheck]
     --vg                  Valgrind(s) to measure (can be specified multiple
                             times).  The "in-place" build is used.
                             [Valgrind in the current directory]
+
+  Any tools named in --tools must be present in all directories specified
+  with --vg.  (This is not checked.)
 END
 ;
 
@@ -77,12 +79,11 @@
 my $args;               # test prog args
 my $prereq;             # prerequisite test to satisfy before running test
 my $cleanup;            # cleanup command to run
-my @tools;              # which tools are we measuring the program with
 
 # Command line options
 my $n_reps = 1;         # Run each test $n_reps times and choose the best one.
 my @vgdirs;             # Dirs of the various Valgrinds being measured.
-my $tools_specified = 0; # Indicates if --tools was given.
+my @tools = ("none", "memcheck");   # tools being measured
 
 my $num_tests_done   = 0;
 my $num_timings_done = 0;
@@ -120,14 +121,6 @@
     return $prog;
 }
 
-sub validate_tools($)
-{
-    # XXX: should check they exist!
-    my ($toolnames) = @_;
-    my @t = split(/\s+/, $toolnames);
-    return @t;
-}
-
 sub add_vgdir($)
 {
     my ($vgdir) = @_;
@@ -153,7 +146,6 @@
                 add_vgdir($1);
             } elsif ($arg =~ /^--tools=(.+)$/) {
                 @tools = split(/,/, $1);
-                $tools_specified = 1
             } else {
                 die $usage;
             }
@@ -199,11 +191,6 @@
             $vgopts = $1;
         } elsif ($line =~ /^\s*prog:\s*(.*)$/) {
             $prog = validate_program(".", $1, 1, 1);
-        } elsif ($line =~ /^\s*tools:\s*(.*)$/) {
-            # Only use the "tools:" line if --tools wasn't specified.
-            if ($tools_specified == 0) {
-                @tools = validate_tools($1);
-            }
         } elsif ($line =~ /^\s*args:\s*(.*)$/) {
             $args = $1;
         } elsif ($line =~ /^\s*prereq:\s*(.*)$/) {