提交 b53486e0 编写于 作者: S Steven Rostedt (Red Hat) 提交者: Steven Rostedt

ktest: Add timings for commands

I find that I usually like to see how long a make or other command takes,
and adding a start and end time and reporting how long each command runs
(in seconds) is helpful.
Signed-off-by: NSteven Rostedt <rostedt@goodmis.org>
上级 97bf6af1
......@@ -1534,10 +1534,14 @@ sub fail {
sub run_command {
my ($command, $redirect) = @_;
my $start_time;
my $end_time;
my $dolog = 0;
my $dord = 0;
my $pid;
$start_time = time;
$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);
$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 {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册