git.openpandora.org
/
pandora-kernel.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
ktest: Add timings for commands
[pandora-kernel.git]
/
tools
/
testing
/
ktest
/
ktest.pl
diff --git
a/tools/testing/ktest/ktest.pl
b/tools/testing/ktest/ktest.pl
index
b9cd036
..
27273c2
100755
(executable)
--- a/
tools/testing/ktest/ktest.pl
+++ b/
tools/testing/ktest/ktest.pl
@@
-1534,10
+1534,14
@@
sub fail {
sub run_command {
my ($command, $redirect) = @_;
sub run_command {
my ($command, $redirect) = @_;
+ my $start_time;
+ my $end_time;
my $dolog = 0;
my $dord = 0;
my $pid;
my $dolog = 0;
my $dord = 0;
my $pid;
+ $start_time = time;
+
$command =~ s/\$SSH_USER/$ssh_user/g;
$command =~ s/\$MACHINE/$machine/g;
$command =~ s/\$SSH_USER/$ssh_user/g;
$command =~ s/\$MACHINE/$machine/g;
@@
-1570,6
+1574,15
@@
sub run_command {
close(LOG) if ($dolog);
close(RD) if ($dord);
close(LOG) if ($dolog);
close(RD) if ($dord);
+ $end_time = time;
+ my $delta = $end_time - $start_time;
+
+ if ($delta == 1) {
+ doprint "[1 second] ";
+ } else {
+ doprint "[$delta seconds] ";
+ }
+
if ($failed) {
doprint "FAILED!\n";
} else {
if ($failed) {
doprint "FAILED!\n";
} else {