From patchwork Wed Dec 18 14:19:17 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Colin Ian King X-Patchwork-Id: 302904 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) by ozlabs.org (Postfix) with ESMTP id 381022C00B5 for ; Thu, 19 Dec 2013 01:45:33 +1100 (EST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.76) (envelope-from ) id 1VtINQ-0000Jn-5h; Wed, 18 Dec 2013 14:45:32 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtp (Exim 4.76) (envelope-from ) id 1VtHy5-0005b8-UW for fwts-devel@lists.ubuntu.com; Wed, 18 Dec 2013 14:19:21 +0000 Received: from cpc3-craw6-2-0-cust180.croy.cable.virginm.net ([77.100.248.181] helo=localhost) by youngberry.canonical.com with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1VtHy5-0000bB-RT for fwts-devel@lists.ubuntu.com; Wed, 18 Dec 2013 14:19:21 +0000 From: Colin King To: fwts-devel@lists.ubuntu.com Subject: [PATCH 2/3] acpi: s3: do kernel log comparisons without destroying klog (LP: #1262208) Date: Wed, 18 Dec 2013 14:19:17 +0000 Message-Id: <1387376358-24508-3-git-send-email-colin.king@canonical.com> X-Mailer: git-send-email 1.8.5.1 In-Reply-To: <1387376358-24508-1-git-send-email-colin.king@canonical.com> References: <1387376358-24508-1-git-send-email-colin.king@canonical.com> X-BeenThere: fwts-devel@lists.ubuntu.com X-Mailman-Version: 2.1.14 Precedence: list List-Id: Firmware Test Suite Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: fwts-devel-bounces@lists.ubuntu.com Sender: fwts-devel-bounces@lists.ubuntu.com From: Colin Ian King Use the new kernel log comapring helper to compare old vs new kernel logs and remove the need to clear the kernel log before each S3 iteration. Signed-off-by: Colin Ian King Acked-by: Ivan Hu Acked-by: Keng-Yu Lin --- src/acpi/s3/s3.c | 36 +++++++++++++++++------------------- 1 file changed, 17 insertions(+), 19 deletions(-) diff --git a/src/acpi/s3/s3.c b/src/acpi/s3/s3.c index 27a5af0..7a86641 100644 --- a/src/acpi/s3/s3.c +++ b/src/acpi/s3/s3.c @@ -29,7 +29,7 @@ #include #include -#define PM_SUSPEND "pm-suspend" +#define PM_SUSPEND "pm-suspend" #define FWTS_SUSPEND "FWTS_SUSPEND" #define FWTS_RESUME "FWTS_RESUME" @@ -50,10 +50,6 @@ static int s3_init(fwts_framework *fw) int ret; /* Pre-init - make sure wakealarm works so that we can wake up after suspend */ - if (fwts_klog_clear()) { - fwts_log_error(fw, "Cannot clear kernel log."); - return FWTS_ERROR; - } if ((ret = fwts_wakealarm_test_firing(fw, 1))) { fwts_log_error(fw, "Cannot automatically wake machine up - aborting S3 test."); fwts_failed(fw, LOG_LEVEL_MEDIUM, "BadWakeAlarmS3", @@ -81,8 +77,6 @@ static int s3_do_suspend_resume(fwts_framework *fw, char *quirks; char buffer[80]; - fwts_klog_clear(); - if (s3_device_check) fwts_hwinfo_get(fw, &hwinfo1); @@ -271,24 +265,17 @@ static int s3_scan_times( static int s3_check_log( fwts_framework *fw, + fwts_list *klog, int *errors, int *oopses, int *warn_ons, int *suspend_too_long, int *resume_too_long) { - fwts_list *klog; int error; int oops; int warn_on; - if ((klog = fwts_klog_read()) == NULL) { - fwts_log_error(fw, "Cannot read kernel log."); - fwts_failed(fw, LOG_LEVEL_MEDIUM, "KlogCheckS3", - "Unable to check kernel log for S3 suspend/resume test."); - return FWTS_ERROR; - } - if (fwts_klog_pm_check(fw, NULL, klog, &error)) fwts_log_error(fw, "Error parsing kernel log."); *errors += error; @@ -305,8 +292,6 @@ static int s3_check_log( s3_scan_times(fw, klog, suspend_too_long, resume_too_long); - fwts_klog_free(klog); - return FWTS_OK; } @@ -329,17 +314,30 @@ static int s3_test_multiple(fwts_framework *fw) for (i=0; i