From patchwork Wed Jul 19 19:45:58 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Salyzyn X-Patchwork-Id: 9853163 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 675DC602BD for ; Wed, 19 Jul 2017 19:46:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 681C7285DD for ; Wed, 19 Jul 2017 19:46:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5CFA7285F0; Wed, 19 Jul 2017 19:46:23 +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=unavailable 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 DD154285DD for ; Wed, 19 Jul 2017 19:46:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934177AbdGSTqI (ORCPT ); Wed, 19 Jul 2017 15:46:08 -0400 Received: from mail-pg0-f41.google.com ([74.125.83.41]:37181 "EHLO mail-pg0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934159AbdGSTqF (ORCPT ); Wed, 19 Jul 2017 15:46:05 -0400 Received: by mail-pg0-f41.google.com with SMTP id y129so4410220pgy.4 for ; Wed, 19 Jul 2017 12:46:05 -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=hyvTl0XmBFIMUOcUvdONqqz6fJn4Q0EObN8J3FVKY2FJ1527g8/8foIVsLyz4yKm4C FMYMmOkeBpK+GLSNUtJQxiHdUDcvAa5LtpGs5JF3UP6R2hbwnfnFubjvvyn+eBqFKgrf DMFOOZPGovle2KZr5layKUosoMbvTnlpOh8FIdB4VQBorYUpU8LzPSFJMaXgiGw+MOS6 LqsHmo9TCx4Sa9PMBOJPkbVmxo483fBlXCTsWAAFrpHeRs4lqJrCn0upiT8JDMvO7PXe PKvClpl3a9EUni4aIFlpomQ7slIHMwlNlQBYEvqQEib8BB/aAZxrg+evXUel1Toee2/T T3Bw== 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=HcZBJGTx7ObKZE6i+rsY4IHnW7j1QzbNg2Fb0Zw9fO7tA6qnxa4MI39v9sy0O/7DCj jxQRfurtoFiX6f8GIXemn6sRkQPP8VJSA8jP4Gf6K6671qrr2n7Gu8M+59/dvtTl7Nbc s7q9rt/MN161O/N++F+VjPXIyX4wGhhfzoIsHGvEghRjHyj4ToIIAkZ6s1BHjbDTZppP ddf2s8WoyAbAiZvM1pP16B9sovo6KZHh64f82bFZLl+pNO427ynpBjMKKzCTiPj7Xo27 KXeyhDRWo420cMspEeNlfe1erxZy8e55b3gB4FckqGs6bH2XASM4H10j6+DK+RQ40FAG 7qgA== X-Gm-Message-State: AIVw111vB+pzVUvD/a1Bz5ASHquwBpGJQbP0lxy7J6AOUpgF4HwNT2CC yCJwVqjf6D8j9x9a X-Received: by 10.98.210.70 with SMTP id c67mr1279157pfg.6.1500493565460; Wed, 19 Jul 2017 12:46:05 -0700 (PDT) Received: from nebulus.mtv.corp.google.com ([100.98.120.17]) by smtp.gmail.com with ESMTPSA id r28sm1238760pfd.4.2017.07.19.12.46.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 19 Jul 2017 12:46:05 -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, Mark Salyzyn Subject: [PATCH v2 3/4] PM: Print wall time at suspend & hibernate entry and exit Date: Wed, 19 Jul 2017 12:45:58 -0700 Message-Id: <20170719194600.29210-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);