|
From: <sv...@va...> - 2016-10-24 13:42:45
|
Author: philippe
Date: Mon Oct 24 14:42:37 2016
New Revision: 16104
Log:
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
Modified:
trunk/perf/vg_perf.in
Modified: trunk/perf/vg_perf.in
==============================================================================
--- trunk/perf/vg_perf.in (original)
+++ trunk/perf/vg_perf.in Mon Oct 24 14:42:37 2016
@@ -71,7 +71,8 @@
--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 @@
$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 @@
. " --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 @@
$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
|