]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Outer/inner setup : allow append to outer args, use a bigger --num-callers
authorPhilippe Waroquiers <philippe.waroquiers@skynet.be>
Sat, 12 Nov 2016 11:22:50 +0000 (11:22 +0000)
committerPhilippe Waroquiers <philippe.waroquiers@skynet.be>
Sat, 12 Nov 2016 11:22:50 +0000 (11:22 +0000)
* Similarly to what was done in revision r16104 for vg_perf, have a way
  to append to predefined vg_regtest outer args, rather than only be able
  to replace them.
* increase the num callers for outer tool to 40.
  (This is in preparation of a future commit, that will allow outer tool
  to append the inner guest stack trace to reported errors in the inner)

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

perf/vg_perf.in
tests/vg_regtest.in

index 009ce3ce36cab248773f23877e829efcf2454bca..380dda43d8c41cd10612ab927c796a7c8bc2f93c 100644 (file)
@@ -71,8 +71,9 @@ 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. If the outer args are starting with +,
-      the given outer args are appended to the outer args predefined by vg_perf.
+    --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.)
index a441f424c6ef30e34cdb097b370f3e46a8e22424..0b1061c8aa3b24fc02c1fbe8adf4342279d36514 100755 (executable)
@@ -43,7 +43,9 @@
 #   --outer-valgrind: run this valgrind under the given outer valgrind.
 #     This valgrind must be configured with --enable-inner.
 #   --outer-tool: tool to use by the outer valgrind (default memcheck).
-#   --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_regtest.
 #   --loop-till-fail: loops on the test(s) till one fail, then exit
 #              This is useful to obtain detailed trace or --keep-unfiltered
 #              output of a non deterministic test failure
@@ -182,6 +184,7 @@ chomp(my $tests_dir = `pwd`);
 my $outer_valgrind;
 my $outer_tool = "memcheck";
 my $outer_args;
+my $run_outer_args = "";
 
 my $valgrind_lib = "$tests_dir/.in_place";
 my $keepunfiltered = 0;
@@ -255,8 +258,8 @@ sub process_command_line()
     
     if (defined $outer_valgrind) {
       $outer_valgrind = validate_program($tests_dir, $outer_valgrind, 1, 1);
-      if (not defined $outer_args) {
-          $outer_args = 
+      if ((not defined $outer_args)  || ($outer_args =~ /^\+/)) {
+          $run_outer_args = 
                 " --command-line-only=yes"
               . " --run-libc-freeres=no --sim-hints=enable-outer"
               . " --smc-check=all-non-file"
@@ -265,7 +268,16 @@ sub process_command_line()
               . " --suppressions=" 
               . validate_program($tests_dir,"./tests/outer_inner.supp",1,0)
               . " --memcheck:leak-check=full --memcheck:show-reachable=no"
+              . " --num-callers=40"
               . " ";
+              # we use a (relatively) big --num-callers, to allow the outer to report
+              # also the inner guest stack trace, when reporting an error.
+          if (defined $outer_args) {
+             $outer_args =~ s/^\+(.*)/$1/;
+             $run_outer_args = $run_outer_args . $outer_args;
+          }
+      } else {
+          $run_outer_args = $outer_args;
       }
     }
 
@@ -505,8 +517,8 @@ sub do_one_test($$)
         mysystem(   "$envvars VALGRIND_LIB_INNER=$valgrind_lib "
                   . "$outer_valgrind "
                   . "--tool=" . $outer_tool . " "
-                  . "$outer_args "
                   . "--log-file=" . "$name.outer.log "
+                  . "$run_outer_args "
                   . "$valgrind --command-line-only=yes --memcheck:leak-check=no "
                   . "--sim-hints=no-inner-prefix "
                   . "--tool=$tool $extraopts $vgopts "