From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754950Ab2G3T1z (ORCPT ); Mon, 30 Jul 2012 15:27:55 -0400 Received: from hrndva-omtalb.mail.rr.com ([71.74.56.122]:29027 "EHLO hrndva-omtalb.mail.rr.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753976Ab2G3T07 (ORCPT ); Mon, 30 Jul 2012 15:26:59 -0400 X-Authority-Analysis: v=2.0 cv=ZuBv2qHG c=1 sm=0 a=s5Htg7xnQOKvHEu9STBOug==:17 a=OpT9cpI26MMA:10 a=Ciwy3NGCPMMA:10 a=4Q4lzaYKvL0A:10 a=5SG0PmZfjMsA:10 a=bbbx4UPp9XUA:10 a=meVymXHHAAAA:8 a=20KFwNOVAAAA:8 a=lHnMgbS3arOmqo24c3QA:9 a=QEXdDO2ut3YA:10 a=jEp0ucaQiEUA:10 a=jeBq3FmKZ4MA:10 a=pz6oROQOoV1ohSg0HxwA:9 a=s5Htg7xnQOKvHEu9STBOug==:117 X-Cloudmark-Score: 0 X-Originating-IP: 72.230.195.127 Message-Id: <20120730192657.468497891@goodmis.org> User-Agent: quilt/0.60-1 Date: Mon, 30 Jul 2012 15:23:21 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Linus Torvalds Subject: [PATCH 07/10] ktest: Add check for bug or panic during reboot References: <20120730192314.144253843@goodmis.org> Content-Disposition: inline; filename=0007-ktest-Add-check-for-bug-or-panic-during-reboot.patch Content-Type: multipart/signed; micalg="pgp-sha1"; protocol="application/pgp-signature"; boundary="00GvhwF7k39YY" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --00GvhwF7k39YY Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable From: Steven Rostedt Usually the target is booted into a dependable kernel when a test starts. The test will install the test kernel and reboot the box. But there may be a time that the kernel is running an unreliable kernel and the reboot may crash. Have ktest detect crashes on a reboot and force a power-cycle instead. This can usually happen if a test kernel was installed to run manual tests, but the user forgot to reboot to the known good kernel. Signed-off-by: Steven Rostedt --- tools/testing/ktest/ktest.pl | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/tools/testing/ktest/ktest.pl b/tools/testing/ktest/ktest.pl index d10fff1..c8a42d5 100755 --- a/tools/testing/ktest/ktest.pl +++ b/tools/testing/ktest/ktest.pl @@ -1138,6 +1138,7 @@ sub reboot { if (defined($time)) { if (wait_for_monitor($time, $reboot_success_line)) { # reboot got stuck? + doprint "Reboot did not finish. Forcing power cycle\n"; run_command "$power_cycle"; } end_monitor; @@ -1235,6 +1236,9 @@ sub wait_for_monitor { my $line; my $booted =3D 0; my $start_time =3D time; + my $skip_call_trace =3D 0; + my $bug =3D 0; + my $bug_ignored =3D 0; my $now; =20 doprint "** Wait for monitor to settle down **\n"; @@ -1251,6 +1255,28 @@ sub wait_for_monitor { $booted =3D 1; } =20 + if ($full_line =3D~ /\[ backtrace testing \]/) { + $skip_call_trace =3D 1; + } + + if ($full_line =3D~ /call trace:/i) { + if (!$bug && !$skip_call_trace) { + if ($ignore_errors) { + $bug_ignored =3D 1; + } else { + $bug =3D 1; + } + } + } + + if ($full_line =3D~ /\[ end of backtrace testing \]/) { + $skip_call_trace =3D 0; + } + + if ($full_line =3D~ /Kernel panic -/) { + $bug =3D 1; + } + if ($line =3D~ /\n/) { $full_line =3D ""; } @@ -1261,7 +1287,7 @@ sub wait_for_monitor { } } print "** Monitor flushed **\n"; - return 0; + return $bug; } =20 sub save_logs { --=20 1.7.10.4 --00GvhwF7k39YY Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) iQIcBAABAgAGBQJQFuABAAoJEIy3vGnGbaoAxzQP/1hAkBOdzGrwuyE1dTrfSNIv mIo6vmJ2ekPQTdnbNRD5degwpJFda+QTG74BF+QRo9huXG/UtmpaNNOc0T7R6ZKk 26mCfcljJTq7EZqaqUaSo1PHC/xFxVds9tpY6Sp/Yblh4TUd93wP92ZaHpXU8m0F it0caNhB6JwskfT6w7sFJkyFZHBtcQVNCBzerBXqFW304m29HQDh9MKXet/4FQM6 0oqPBiyU/7tM81S63qPZKHS5RcmPwoQfUIpGpFI5t0lDoddBaswMR70T/dTGnDg2 4bkhf7YNU4MD2JLANL0llcQg/ehvEteLXQzMPyvj1EORzJZzTc40t8nn+NgxuCmE R8W+c34jSBAFKz6nsWQdDwcW4rqBdrmjm323E4zIHV/FTR+eF5rFAhJKVI6VTR5d xZDQk1ybezMCBAoTg4pi/UgxqLug3CJaoe5wKfZb0EDFVcfNZtYLJ76JwyyraDd3 AdwxrZkV+RwJKufVOetdXXRTEsGWUEeerRPk4P6ZFj15tFAe3lnA+frgm38uTMWO CylE9rwEpCKsru2uxe9r6TtsC2S9LqQsq39kWMXbYYRVoXVZhKo2SBlIJ6H0u0Q7 txNsFv8r+3d/d1htydO4/OgNGov5aytzmZjQEUWrm5kxp+etE9iInWjk1Z/VkABW 39OFaXH3pK+ggptvt4y3 =cHLZ -----END PGP SIGNATURE----- --00GvhwF7k39YY--