From patchwork Wed Oct 30 17:44:01 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Hung X-Patchwork-Id: 1186891 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=fwts-devel-bounces@lists.ubuntu.com; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=canonical.com Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 473G6Q57KFz9sPh; Thu, 31 Oct 2019 04:44:12 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1iPs0t-00056n-Iv; Wed, 30 Oct 2019 17:44:07 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1iPs0s-00056e-Ic for fwts-devel@lists.ubuntu.com; Wed, 30 Oct 2019 17:44:06 +0000 Received: from 2.general.alexhung.us.vpn ([10.172.65.255] helo=canonical.com) by youngberry.canonical.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1iPs0s-0000oB-13; Wed, 30 Oct 2019 17:44:06 +0000 From: Alex Hung To: fwts-devel@lists.ubuntu.com Subject: [PATCH] acpi/s3: fine-tune measure of suspend time Date: Wed, 30 Oct 2019 11:44:01 -0600 Message-Id: <20191030174401.10926-1-alex.hung@canonical.com> X-Mailer: git-send-email 2.17.1 X-BeenThere: fwts-devel@lists.ubuntu.com X-Mailman-Version: 2.1.20 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" The time variation can be reduced. For example, the original suspend time: Suspend: 3.966 seconds. Suspend: 0.539 seconds. Suspend: 1.156 seconds. After patched: Suspend: 0.486 seconds. Suspend: 0.508 seconds. Suspend: 0.528 seconds. This is especially true for 1st suspend when kernel is busy with other kernel modules such as [ 120.123903] fwts: Suspend [ 120.162215] wlp60s0: deauthenticating from ... [ 123.726367] PM: suspend entry (deep) Signed-off-by: Alex Hung Acked-by: Colin Ian King Acked-by: Anthony Wong --- src/acpi/s3/s3.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/acpi/s3/s3.c b/src/acpi/s3/s3.c index 6664db2c..5ec8d5c8 100644 --- a/src/acpi/s3/s3.c +++ b/src/acpi/s3/s3.c @@ -411,6 +411,13 @@ static int s3_scan_times( s3_suspend_start = ts; continue; } + + /* Update log time if this is available */ + if (strstr(txt, "PM: suspend entry")) { + s3_suspend_start = ts; + continue; + } + if (strstr(txt, FWTS_RESUME)) { s3_resume_finish = ts; continue;