|
From: <sv...@va...> - 2005-12-13 21:55:21
|
Author: njn
Date: 2005-12-13 21:55:16 +0000 (Tue, 13 Dec 2005)
New Revision: 5336
Log:
Added a --reps option to control how many times each program is run.
Also added a better help message.
Modified:
trunk/perf/vg_perf.in
Modified: trunk/perf/vg_perf.in
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/perf/vg_perf.in 2005-12-13 21:53:39 UTC (rev 5335)
+++ trunk/perf/vg_perf.in 2005-12-13 21:55:16 UTC (rev 5336)
@@ -62,10 +62,17 @@
#-----------------------------------------------------------------------=
-----
# Global vars
#-----------------------------------------------------------------------=
-----
-my $usage=3D"vg_perf [--all, --valgrind]\n";
+my $usage =3D <<END
+usage: vg_perf [options] [files or dirs]
=20
-my $tmp=3D"vg_perf.tmp.$$";
+ options for the user, with defaults in [ ], are:
+ -h --help show this message
+ --all run all tests under this directory
+ --reps number of repeats for each program [3]
=20
+END
+;
+
# Test variables
my $vgopts; # valgrind options
my $prog; # test prog
@@ -83,7 +90,7 @@
);
=20
# We run each program this many times and choose the best time.
-my $n_runs =3D 3;
+my $n_reps =3D 3;
=20
my $num_tests_done =3D 0;
my $num_timings_done =3D 0;
@@ -144,6 +151,8 @@
$alldirs =3D 1;
} elsif ($arg =3D~ /^--valgrind=3D(.*)$/) {
$vg_dir =3D $1;
+ } elsif ($arg =3D~ /^--reps=3D(\d)+$/) {
+ $n_reps =3D $1;
} else {
die $usage;
}
@@ -266,7 +275,7 @@
# Do the native run(s).
printf("nt:");
my $cmd =3D "$timecmd $prog $args";
- my $tNative =3D time_prog($cmd, $n_runs);
+ my $tNative =3D time_prog($cmd, $n_reps);
printf("%4.1fs ", $tNative);
=20
foreach my $tool (@tools) {
@@ -283,7 +292,7 @@
. "--memcheck:leak-check=3Dno --addrcheck:leak-check=
=3Dno "
. "$vgopts ";
my $cmd =3D "$vgsetup $timecmd $vgcmd $prog $args";
- my $tTool =3D time_prog($cmd, $n_runs);
+ my $tTool =3D time_prog($cmd, $n_reps);
printf("%4.1fs (%4.1fx) ", $tTool, $tTool/$tNative);
=20
$num_timings_done++;
|