From patchwork Wed Jul 19 19:48:13 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Salyzyn X-Patchwork-Id: 9853169 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 4AAE4602BD for ; Wed, 19 Jul 2017 19:48:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4AECF285DD for ; Wed, 19 Jul 2017 19:48:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3FB742861F; Wed, 19 Jul 2017 19:48:30 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B5A74285DD for ; Wed, 19 Jul 2017 19:48:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755303AbdGSTs2 (ORCPT ); Wed, 19 Jul 2017 15:48:28 -0400 Received: from mail-pg0-f41.google.com ([74.125.83.41]:36029 "EHLO mail-pg0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754316AbdGSTs1 (ORCPT ); Wed, 19 Jul 2017 15:48:27 -0400 Received: by mail-pg0-f41.google.com with SMTP id 125so4456568pgi.3 for ; Wed, 19 Jul 2017 12:48:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=android.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=Q1G1xoHAseAbEwrIeJw1iC9s51FrwHGyBuQ+pUqhOiw=; b=l4iN3z7Pp9RL19Gl+lJJbyPo8c3hm0oDlB+6Lf0xONk1v/vF20BjRO+q/bUpy0nShY ZkhbCsZY/XAg4EimazWnjJI9YVvT1nIj4j5x+Q3fp569lHvA4gOjz22AktMxqDQdwpqX NmBbqb449B2Ov1br2X1LunKkEBW3PJr2OUShBNAQOYsiQWmft0Yuui1wCEIwUeXnx+5R ZyRCDdI66mfGTN/p8LagYK1rtCeKderKGZeWoVRrsMerNwi05ORkGEGOI9rDPEIb8Oao c0QtIHh6fu6SR3cIFnhztpTCumXa9aE5IA+6YodFhZXjhj6XUId2+2CVjmAQKQI9G2xM Lvww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=Q1G1xoHAseAbEwrIeJw1iC9s51FrwHGyBuQ+pUqhOiw=; b=BYIlu6nqCdy43+zOCv1Q1znWhbXngQ6mOTqrQBKZROIzIVpiD+oUTCWHbVpjGZ3TGc 05v3Ah8FLiaLbTeQHzc+97TursAEmGgxd0pI/smdxKzBrreMs2Zmy2XW/K6HpmJVG4if O9b4bosRr9EQe7LFcIdK10fA13FNnZFrRdefSdvIFu3cPHpSlAenyDD5W8sNyHmtjIP8 Y3q/lWaXP2j2iEnVONxyuPxCUCQNcwi5Me+rcUYyCp4kxEcMHGg9RG1SkksqZjYU23oQ 9RogYIDuAX9Y63M/BpfupujNQSC1Io+IOi6tqhAHyp/KEyDS6gAnZsK2JDfDYamwRnlq a2wg== X-Gm-Message-State: AIVw113SEJ8JKyiI5k77CexTLQbackbAV6yaS1742gGeOvPv5O7BuTB1 RVpfPKuwU2/G+KDu X-Received: by 10.84.241.135 with SMTP id b7mr1317023pll.107.1500493706633; Wed, 19 Jul 2017 12:48:26 -0700 (PDT) Received: from nebulus.mtv.corp.google.com ([100.98.120.17]) by smtp.gmail.com with ESMTPSA id j20sm1217515pfk.73.2017.07.19.12.48.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 19 Jul 2017 12:48:26 -0700 (PDT) From: Mark Salyzyn To: linux-kernel@vger.kernel.org Cc: rjw@rjwysocki.net, len.brown@intel.com, pavel@ucw.cz, linux-pm@vger.kernel.org, a.zummo@towertech.it, alexandre.belloni@free-electrons.com, linux-rtc@vger.kernel.org, prarit@redhat.com, andy.shevchenko@gmail.com, Mark Salyzyn Subject: [PATCH v2 3/4] PM: Print wall time at suspend & hibernate entry and exit Date: Wed, 19 Jul 2017 12:48:13 -0700 Message-Id: <20170719194814.29920-1-salyzyn@android.com> X-Mailer: git-send-email 2.14.0.rc0.284.gd933b75aa4-goog Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Permits power state and battery life diagnosis. Since one is not guaranteed to have a persistent hardware clock to report Suspended for in milliseconds, we report at a higher level at just the entry and exit points for suspend and hibernate. Feature activated by CONFIG_RTC_SHOW_TIME_* Signed-off-by: Mark Salyzyn v2: - merge suspend and hibernate into a single patch --- kernel/power/hibernate.c | 4 +++- kernel/power/suspend.c | 3 +++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/kernel/power/hibernate.c b/kernel/power/hibernate.c index e1914c7b85b1..0b5460f9189b 100644 --- a/kernel/power/hibernate.c +++ b/kernel/power/hibernate.c @@ -32,11 +32,11 @@ #include #include #include +#include #include #include "power.h" - static int nocompress; static int noresume; static int nohibernate; @@ -342,6 +342,7 @@ int hibernation_snapshot(int platform_mode) pm_message_t msg; int error; + rtc_show_time("PM: hibernation entry"); pm_suspend_clear_flags(); error = platform_begin(platform_mode); if (error) @@ -409,6 +410,7 @@ int hibernation_snapshot(int platform_mode) thaw_kernel_threads(); Cleanup: swsusp_free(); + rtc_show_time("PM: hibernation exit"); goto Close; } diff --git a/kernel/power/suspend.c b/kernel/power/suspend.c index 3ecf275d7e44..f44d2152ab3f 100644 --- a/kernel/power/suspend.c +++ b/kernel/power/suspend.c @@ -26,6 +26,7 @@ #include #include #include +#include #include #include #include @@ -579,6 +580,7 @@ int pm_suspend(suspend_state_t state) if (state <= PM_SUSPEND_ON || state >= PM_SUSPEND_MAX) return -EINVAL; + rtc_show_time("PM: suspend entry"); error = enter_state(state); if (error) { suspend_stats.fail++; @@ -586,6 +588,7 @@ int pm_suspend(suspend_state_t state) } else { suspend_stats.success++; } + rtc_show_time("PM: suspend exit"); return error; } EXPORT_SYMBOL(pm_suspend);