From 4138aabee6488b39d2427e8b4f2efe9a956b7dc3 Mon Sep 17 00:00:00 2001 From: Philippe Waroquiers Date: Mon, 24 Oct 2016 13:42:37 +0000 Subject: [PATCH] perf/vg_perf --outer-args: either replace the predefined outer args, or append to it. 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 | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/perf/vg_perf.in b/perf/vg_perf.in index 7a80cb0afa..009ce3ce36 100644 --- a/perf/vg_perf.in +++ b/perf/vg_perf.in @@ -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 -- 2.47.2