Patchwork [2/4] kernel: oops: also check for WARN_ON messages found

login
register
mail settings
Submitter Colin King
Date Nov. 15, 2012, 12:05 p.m.
Message ID <1352981144-3586-3-git-send-email-colin.king@canonical.com>
Download mbox | patch
Permalink /patch/199264/
State Accepted
Headers show

Comments

Colin King - Nov. 15, 2012, 12:05 p.m.
From: Colin Ian King <colin.king@canonical.com>

The oops test may as well test for any WARN_ON messages we find while
scanning for oops messages since these need to be checked too.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 src/kernel/oops/oops.c |    9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
Alex Hung - Nov. 22, 2012, 2:26 a.m.
On 11/15/2012 08:05 PM, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> The oops test may as well test for any WARN_ON messages we find while
> scanning for oops messages since these need to be checked too.
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>   src/kernel/oops/oops.c |    9 ++++++++-
>   1 file changed, 8 insertions(+), 1 deletion(-)
>
> diff --git a/src/kernel/oops/oops.c b/src/kernel/oops/oops.c
> index 33ae5ae..81691c0 100644
> --- a/src/kernel/oops/oops.c
> +++ b/src/kernel/oops/oops.c
> @@ -52,8 +52,9 @@ static int oops_deinit(fwts_framework *fw)
>   static int oops_test1(fwts_framework *fw)
>   {
>   	int oopses = 0;
> +	int warn_ons = 0;
>
> -	if (fwts_oops_check(fw, klog, &oopses) != FWTS_OK) {
> +	if (fwts_oops_check(fw, klog, &oopses, &warn_ons) != FWTS_OK) {
>   		fwts_log_error(fw, "Error parsing kernel log.");
>   		return FWTS_ERROR;
>   	}
> @@ -64,6 +65,12 @@ static int oops_test1(fwts_framework *fw)
>   	else
>   		fwts_passed(fw, "Found no oopses in kernel log.");
>
> +	if (warn_ons > 0)
> +		fwts_failed(fw, LOG_LEVEL_HIGH,
> +			"KernelWarnOns", "Found %d WARN_ON warnings in kernel log.", warn_ons);
> +	else
> +		fwts_passed(fw, "Found no WARN_ON warnings in kernel log.");
> +
>   	return FWTS_OK;
>   }
>
>
Acked-by: Alex Hung <alex.hung@canonical.com>
Keng-Yu Lin - Nov. 22, 2012, 5:56 a.m.
On Thu, Nov 15, 2012 at 8:05 PM, Colin King <colin.king@canonical.com> wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> The oops test may as well test for any WARN_ON messages we find while
> scanning for oops messages since these need to be checked too.
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>  src/kernel/oops/oops.c |    9 ++++++++-
>  1 file changed, 8 insertions(+), 1 deletion(-)
>
> diff --git a/src/kernel/oops/oops.c b/src/kernel/oops/oops.c
> index 33ae5ae..81691c0 100644
> --- a/src/kernel/oops/oops.c
> +++ b/src/kernel/oops/oops.c
> @@ -52,8 +52,9 @@ static int oops_deinit(fwts_framework *fw)
>  static int oops_test1(fwts_framework *fw)
>  {
>         int oopses = 0;
> +       int warn_ons = 0;
>
> -       if (fwts_oops_check(fw, klog, &oopses) != FWTS_OK) {
> +       if (fwts_oops_check(fw, klog, &oopses, &warn_ons) != FWTS_OK) {
>                 fwts_log_error(fw, "Error parsing kernel log.");
>                 return FWTS_ERROR;
>         }
> @@ -64,6 +65,12 @@ static int oops_test1(fwts_framework *fw)
>         else
>                 fwts_passed(fw, "Found no oopses in kernel log.");
>
> +       if (warn_ons > 0)
> +               fwts_failed(fw, LOG_LEVEL_HIGH,
> +                       "KernelWarnOns", "Found %d WARN_ON warnings in kernel log.", warn_ons);
> +       else
> +               fwts_passed(fw, "Found no WARN_ON warnings in kernel log.");
> +
>         return FWTS_OK;
>  }
>
> --
> 1.7.10.4
>

This will be interesting data to know.

Acked-by: Keng-Yu Lin <kengyu@canonical.com>

Patch

diff --git a/src/kernel/oops/oops.c b/src/kernel/oops/oops.c
index 33ae5ae..81691c0 100644
--- a/src/kernel/oops/oops.c
+++ b/src/kernel/oops/oops.c
@@ -52,8 +52,9 @@  static int oops_deinit(fwts_framework *fw)
 static int oops_test1(fwts_framework *fw)
 {
 	int oopses = 0;
+	int warn_ons = 0;
 
-	if (fwts_oops_check(fw, klog, &oopses) != FWTS_OK) {
+	if (fwts_oops_check(fw, klog, &oopses, &warn_ons) != FWTS_OK) {
 		fwts_log_error(fw, "Error parsing kernel log.");
 		return FWTS_ERROR;
 	}
@@ -64,6 +65,12 @@  static int oops_test1(fwts_framework *fw)
 	else
 		fwts_passed(fw, "Found no oopses in kernel log.");
 
+	if (warn_ons > 0)
+		fwts_failed(fw, LOG_LEVEL_HIGH,
+			"KernelWarnOns", "Found %d WARN_ON warnings in kernel log.", warn_ons);
+	else
+		fwts_passed(fw, "Found no WARN_ON warnings in kernel log.");
+
 	return FWTS_OK;
 }