]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
perf/vg_perf --outer-args: either replace the predefined outer args, or append to it.
authorPhilippe Waroquiers <philippe.waroquiers@skynet.be>
Mon, 24 Oct 2016 13:42:37 +0000 (13:42 +0000)
committerPhilippe Waroquiers <philippe.waroquiers@skynet.be>
Mon, 24 Oct 2016 13:42:37 +0000 (13:42 +0000)
Currently, vg_perf predefines a set of standard outer tool args according to the tool.
These predefined args can be replaced by another set using "--outer-args=xxx yyy zzzz".
But often, we want to add (or override) only a few args.
So, modify vg_perf so that if the first letter of --outer-args is a + character, then
the provided args are appended to the predefined args

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16104

perf/vg_perf.in

index 7a80cb0afad072c2d2d4b8bc5af6f5cb84c8f055..009ce3ce36cab248773f23877e829efcf2454bca 100644 (file)
@@ -71,7 +71,8 @@ usage: vg_perf [options] [files or dirs]
     --outer-valgrind: run these Valgrind(s) under the given outer valgrind.
       These Valgrind(s) must be configured with --enable-inner.
     --outer-tool: tool to use by the outer valgrind (default cachegrind).
-    --outer-args: use this as outer tool args.
+    --outer-args: use this as outer tool args. If the outer args are starting with +,
+      the given outer args are appended to the outer args predefined by vg_perf.
 
   Any tools named in --tools must be present in all directories specified
   with --vg.  (This is not checked.)
@@ -321,7 +322,7 @@ sub do_one_test($$)
             $tool_abbrev =~ s/(..).*/$1/;
             printf("  %s:", $tool_abbrev);
             my $run_outer_args = "";
-            if (not defined $outer_args) {
+            if ((not defined $outer_args) || ($outer_args =~ /^\+/)) {
                 $run_outer_args = 
                       " -v --command-line-only=yes"
                     . " --run-libc-freeres=no --sim-hints=enable-outer"
@@ -335,6 +336,10 @@ sub do_one_test($$)
                     . " --callgrind:dump-instr=yes --callgrind:collect-jumps=yes"
                     . " --callgrind:callgrind-out-file=callgrind.out.$vgdirname.$tool_abbrev.$name.%p"
                     . " ";
+                 if (defined $outer_args) {
+                    $outer_args =~ s/^\+(.*)/$1/;
+                    $run_outer_args = $run_outer_args . $outer_args;
+                 }
             } else {
                 $run_outer_args = $outer_args;
             }
@@ -351,8 +356,8 @@ sub do_one_test($$)
                 $vgsetup = "VALGRIND_LIB_INNER=$vgdir/.in_place ";
                 $vgcmd   = "$outer_valgrind "
                          . "--tool=" . $outer_tool . " "
-                         . "$run_outer_args "
                          . "--log-file=" . "$outer_tool.outer.log.$vgdirname.$tool_abbrev.$name.%p "
+                         . "$run_outer_args "
                          . $vgcmd;
             } else {
                 # Set both VALGRIND_LIB and VALGRIND_LIB_INNER