Patchwork [3/4] acpi: s3: 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-4-git-send-email-colin.king@canonical.com>
Download mbox | patch
Permalink /patch/199265/
State Accepted
Headers show

Comments

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

The s3 test should 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/acpi/s3/s3.c |   14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)
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 s3 test should 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/acpi/s3/s3.c |   14 +++++++++++---
>   1 file changed, 11 insertions(+), 3 deletions(-)
>
> diff --git a/src/acpi/s3/s3.c b/src/acpi/s3/s3.c
> index 326f639..c651cfd 100644
> --- a/src/acpi/s3/s3.c
> +++ b/src/acpi/s3/s3.c
> @@ -186,11 +186,12 @@ static int s3_do_suspend_resume(fwts_framework *fw,
>   	return FWTS_OK;
>   }
>
> -static int s3_check_log(fwts_framework *fw, int *errors, int *oopses)
> +static int s3_check_log(fwts_framework *fw, int *errors, int *oopses, int *warn_ons)
>   {
>   	fwts_list *klog;
>   	int error;
>   	int oops;
> +	int warn_on;
>
>   	if ((klog = fwts_klog_read()) == NULL) {
>   		fwts_log_error(fw, "Cannot read kernel log.");
> @@ -211,10 +212,11 @@ static int s3_check_log(fwts_framework *fw, int *errors, int *oopses)
>   		fwts_log_error(fw, "Error parsing kernel log.");
>   	*errors += error;
>
> -	if (fwts_oops_check(fw, klog, &oops))
> +	if (fwts_oops_check(fw, klog, &oops, &warn_on))
>   		fwts_log_error(fw, "Error parsing kernel log.");
>
>   	*oopses += oops;
> +	*warn_ons += warn_on;
>
>   	fwts_klog_free(klog);
>
> @@ -228,6 +230,7 @@ static int s3_test_multiple(fwts_framework *fw)
>   	int hw_errors = 0;
>   	int pm_errors = 0;
>   	int klog_oopses = 0;
> +	int klog_warn_ons = 0;
>   	int awake_delay = s3_min_delay * 1000;
>   	int delta = (int)(s3_delay_delta * 1000.0);
>
> @@ -245,7 +248,7 @@ static int s3_test_multiple(fwts_framework *fw)
>   			break;
>   		}
>   		fwts_progress_message(fw, percent, "(Checking logs for errors)");
> -		s3_check_log(fw, &klog_errors, &klog_oopses);
> +		s3_check_log(fw, &klog_errors, &klog_oopses, &klog_warn_ons);
>
>   		if (!s3_device_check) {
>   			char buffer[80];
> @@ -289,6 +292,11 @@ static int s3_test_multiple(fwts_framework *fw)
>   	else
>   		fwts_passed(fw, "No kernel oopses detected.");
>
> +	if (klog_warn_ons > 0)
> +		fwts_log_info(fw, "Found %d kernel WARN_ON warnings.", klog_warn_ons);
> +	else
> +		fwts_passed(fw, "No kernel WARN_ON warnings detected.");
> +
>
>   	if ((klog_errors + pm_errors + hw_errors + klog_oopses) > 0) {
>   		fwts_log_info(fw, "Found %d errors and %d oopses doing %d suspend/resume cycle(s).",
>
Acked-by: Alex Hung <alex.hung@canonical.com>
Keng-Yu Lin - Nov. 22, 2012, 5:57 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 s3 test should 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/acpi/s3/s3.c |   14 +++++++++++---
>  1 file changed, 11 insertions(+), 3 deletions(-)
>
> diff --git a/src/acpi/s3/s3.c b/src/acpi/s3/s3.c
> index 326f639..c651cfd 100644
> --- a/src/acpi/s3/s3.c
> +++ b/src/acpi/s3/s3.c
> @@ -186,11 +186,12 @@ static int s3_do_suspend_resume(fwts_framework *fw,
>         return FWTS_OK;
>  }
>
> -static int s3_check_log(fwts_framework *fw, int *errors, int *oopses)
> +static int s3_check_log(fwts_framework *fw, int *errors, int *oopses, int *warn_ons)
>  {
>         fwts_list *klog;
>         int error;
>         int oops;
> +       int warn_on;
>
>         if ((klog = fwts_klog_read()) == NULL) {
>                 fwts_log_error(fw, "Cannot read kernel log.");
> @@ -211,10 +212,11 @@ static int s3_check_log(fwts_framework *fw, int *errors, int *oopses)
>                 fwts_log_error(fw, "Error parsing kernel log.");
>         *errors += error;
>
> -       if (fwts_oops_check(fw, klog, &oops))
> +       if (fwts_oops_check(fw, klog, &oops, &warn_on))
>                 fwts_log_error(fw, "Error parsing kernel log.");
>
>         *oopses += oops;
> +       *warn_ons += warn_on;
>
>         fwts_klog_free(klog);
>
> @@ -228,6 +230,7 @@ static int s3_test_multiple(fwts_framework *fw)
>         int hw_errors = 0;
>         int pm_errors = 0;
>         int klog_oopses = 0;
> +       int klog_warn_ons = 0;
>         int awake_delay = s3_min_delay * 1000;
>         int delta = (int)(s3_delay_delta * 1000.0);
>
> @@ -245,7 +248,7 @@ static int s3_test_multiple(fwts_framework *fw)
>                         break;
>                 }
>                 fwts_progress_message(fw, percent, "(Checking logs for errors)");
> -               s3_check_log(fw, &klog_errors, &klog_oopses);
> +               s3_check_log(fw, &klog_errors, &klog_oopses, &klog_warn_ons);
>
>                 if (!s3_device_check) {
>                         char buffer[80];
> @@ -289,6 +292,11 @@ static int s3_test_multiple(fwts_framework *fw)
>         else
>                 fwts_passed(fw, "No kernel oopses detected.");
>
> +       if (klog_warn_ons > 0)
> +               fwts_log_info(fw, "Found %d kernel WARN_ON warnings.", klog_warn_ons);
> +       else
> +               fwts_passed(fw, "No kernel WARN_ON warnings detected.");
> +
>
>         if ((klog_errors + pm_errors + hw_errors + klog_oopses) > 0) {
>                 fwts_log_info(fw, "Found %d errors and %d oopses doing %d suspend/resume cycle(s).",
> --
> 1.7.10.4
>
Acked-by: Keng-Yu Lin <kengyu@canonical.com>

Patch

diff --git a/src/acpi/s3/s3.c b/src/acpi/s3/s3.c
index 326f639..c651cfd 100644
--- a/src/acpi/s3/s3.c
+++ b/src/acpi/s3/s3.c
@@ -186,11 +186,12 @@  static int s3_do_suspend_resume(fwts_framework *fw,
 	return FWTS_OK;
 }
 
-static int s3_check_log(fwts_framework *fw, int *errors, int *oopses)
+static int s3_check_log(fwts_framework *fw, int *errors, int *oopses, int *warn_ons)
 {
 	fwts_list *klog;
 	int error;
 	int oops;
+	int warn_on;
 
 	if ((klog = fwts_klog_read()) == NULL) {
 		fwts_log_error(fw, "Cannot read kernel log.");
@@ -211,10 +212,11 @@  static int s3_check_log(fwts_framework *fw, int *errors, int *oopses)
 		fwts_log_error(fw, "Error parsing kernel log.");
 	*errors += error;
 
-	if (fwts_oops_check(fw, klog, &oops))
+	if (fwts_oops_check(fw, klog, &oops, &warn_on))
 		fwts_log_error(fw, "Error parsing kernel log.");
 
 	*oopses += oops;
+	*warn_ons += warn_on;
 
 	fwts_klog_free(klog);
 
@@ -228,6 +230,7 @@  static int s3_test_multiple(fwts_framework *fw)
 	int hw_errors = 0;
 	int pm_errors = 0;
 	int klog_oopses = 0;
+	int klog_warn_ons = 0;
 	int awake_delay = s3_min_delay * 1000;
 	int delta = (int)(s3_delay_delta * 1000.0);
 
@@ -245,7 +248,7 @@  static int s3_test_multiple(fwts_framework *fw)
 			break;
 		}
 		fwts_progress_message(fw, percent, "(Checking logs for errors)");
-		s3_check_log(fw, &klog_errors, &klog_oopses);
+		s3_check_log(fw, &klog_errors, &klog_oopses, &klog_warn_ons);
 
 		if (!s3_device_check) {
 			char buffer[80];
@@ -289,6 +292,11 @@  static int s3_test_multiple(fwts_framework *fw)
 	else
 		fwts_passed(fw, "No kernel oopses detected.");
 
+	if (klog_warn_ons > 0)
+		fwts_log_info(fw, "Found %d kernel WARN_ON warnings.", klog_warn_ons);
+	else
+		fwts_passed(fw, "No kernel WARN_ON warnings detected.");
+
 
 	if ((klog_errors + pm_errors + hw_errors + klog_oopses) > 0) {
 		fwts_log_info(fw, "Found %d errors and %d oopses doing %d suspend/resume cycle(s).",