From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1161295AbbBDTv1 (ORCPT ); Wed, 4 Feb 2015 14:51:27 -0500 Received: from cdptpa-outbound-snat.email.rr.com ([107.14.166.231]:13237 "EHLO cdptpa-oedge-vip.email.rr.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752519AbbBDTvY (ORCPT ); Wed, 4 Feb 2015 14:51:24 -0500 Message-Id: <20150204195122.929881666@goodmis.org> User-Agent: quilt/0.61-1 Date: Wed, 04 Feb 2015 14:50:48 -0500 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Andrew Morton Subject: [for-next][PATCH 1/9] ktest: Add timings for commands References: <20150204195047.818126814@goodmis.org> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15 Content-Disposition: inline; filename=0001-ktest-Add-timings-for-commands.patch X-RR-Connecting-IP: 107.14.168.142:25 X-Cloudmark-Score: 0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: "Steven Rostedt (Red Hat)" 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: Steven Rostedt --- tools/testing/ktest/ktest.pl | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tools/testing/ktest/ktest.pl b/tools/testing/ktest/ktest.pl index b9cd036f0442..27273c228d92 100755 --- a/tools/testing/ktest/ktest.pl +++ b/tools/testing/ktest/ktest.pl @@ -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 { -- 2.1.4