|
From: <sv...@va...> - 2012-07-24 19:47:54
|
philippe 2012-07-24 20:47:46 +0100 (Tue, 24 Jul 2012)
New Revision: 12777
Log:
Have perf/vg_perf handling EXTRA_REGTEST_OPTS
Similarly to tests/vg_regtest, allow to run all perf tests with extra options.
(note: it was preferred to use the same env var name).
Modified files:
trunk/perf/vg_perf.in
Modified: trunk/perf/vg_perf.in (+28 -1)
===================================================================
--- trunk/perf/vg_perf.in 2012-07-23 19:05:52 +01:00 (rev 12776)
+++ trunk/perf/vg_perf.in 2012-07-24 20:47:46 +01:00 (rev 12777)
@@ -43,6 +43,11 @@
#
# The prerequisite command, if present, must return 0 otherwise the test is
# skipped.
+# Sometimes it is useful to run all the tests at a high sanity check
+# level or with arbitrary other flags. To make this simple, extra
+# options, applied to all tests run, are read from $EXTRA_REGTEST_OPTS,
+# and handed to valgrind prior to any other flags specified by the
+# .vgperf file. Note: the env var is the same as vg_regtest.
#----------------------------------------------------------------------------
use warnings;
@@ -69,6 +74,7 @@
Any tools named in --tools must be present in all directories specified
with --vg. (This is not checked.)
+ Use EXTRA_REGTEST_OPTS to supply extra args for all tests
END
;
@@ -285,6 +291,11 @@
}
}
+ # Pull any extra options (for example, --sanity-level=4)
+ # from $EXTRA_REGTEST_OPTS.
+ my $maybe_extraopts = $ENV{"EXTRA_REGTEST_OPTS"};
+ my $extraopts = $maybe_extraopts ? $maybe_extraopts : "";
+
foreach my $vgdir (@vgdirs) {
# Benchmark name
printf("%-8s ", $name);
@@ -323,7 +334,7 @@
my $vgsetup = "";
my $vgcmd = "$vgdir/coregrind/valgrind "
- . "--command-line-only=yes --tool=$tool -q "
+ . "--command-line-only=yes --tool=$tool $extraopts -q "
. "--memcheck:leak-check=no "
. "--trace-children=yes "
. "$vgopts ";
@@ -427,10 +438,22 @@
#----------------------------------------------------------------------------
# main()
#----------------------------------------------------------------------------
+sub warn_about_EXTRA_REGTEST_OPTS()
+{
+ print "WARNING: \$EXTRA_REGTEST_OPTS is set. You probably don't want\n";
+ print "to run the perf tests with it set, unless you are doing some\n";
+ print "strange experiment, and/or you really know what you are doing.\n";
+ print "\n";
+}
# nuke VALGRIND_OPTS
$ENV{"VALGRIND_OPTS"} = "";
+if ($ENV{"EXTRA_REGTEST_OPTS"}) {
+ print "\n";
+ warn_about_EXTRA_REGTEST_OPTS();
+}
+
my @fs = process_command_line();
foreach my $f (@fs) {
if (-d $f) {
@@ -453,6 +476,10 @@
}
summarise_results();
+if ($ENV{"EXTRA_REGTEST_OPTS"}) {
+ warn_about_EXTRA_REGTEST_OPTS();
+}
+
##--------------------------------------------------------------------##
##--- end ---##
##--------------------------------------------------------------------##
|