|
From: <sv...@va...> - 2006-10-17 02:30:20
|
Author: sewardj
Date: 2006-10-17 03:30:17 +0100 (Tue, 17 Oct 2006)
New Revision: 6304
Log:
Merge r6207:=20
Make vg_perf work on AIX, by using the POSIX-portability flag for
/usr/bin/time.
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 2006-10-17 02:28:53 UTC (rev 6303)
+++ trunk/perf/vg_perf.in 2006-10-17 02:30:17 UTC (rev 6304)
@@ -240,7 +240,8 @@
}
}
=20
-# Run program N times, return the best user time.
+# Run program N times, return the best user time. Use the POSIX
+# -p flag on /usr/bin/time so as to get something parseable on AIX.
sub time_prog($$)
{
my ($cmd, $n) =3D @_;
@@ -252,9 +253,9 @@
die "\n*** Command returned non-zero ($retval)"
. "\n*** See perf.{cmd,stdout,stderr} to determine what we=
nt wrong.\n";
my $out =3D `cat perf.stderr`;
- ($out =3D~ /usertime: ([\d\.]+)s/) or=20
+ ($out =3D~ /[Uu]ser([ ]+)([\d\.]+)/) or=20
die "\n*** missing usertime in perf.stderr\n";
- $tmin =3D $1 if ($1 < $tmin);
+ $tmin =3D $2 if ($2 < $tmin);
}
# Avoid divisions by zero!
return (0 =3D=3D $tmin ? 0.01 : $tmin);
@@ -277,7 +278,7 @@
}
}
=20
- my $timecmd =3D "/usr/bin/time -f 'usertime: %Us'";
+ my $timecmd =3D "/usr/bin/time -p";
=20
# Do the native run(s).
printf("-- $name --\n") if (@vgdirs > 1);
|