From patchwork Mon Jun 5 19:31:14 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Salyzyn X-Patchwork-Id: 9767339 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 06BA6602BF for ; Mon, 5 Jun 2017 19:33:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E9F7B283C0 for ; Mon, 5 Jun 2017 19:33:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DCAED251F4; Mon, 5 Jun 2017 19:33: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=-7.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_HI 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 54FC1251F4 for ; Mon, 5 Jun 2017 19:33:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751183AbdFETd3 (ORCPT ); Mon, 5 Jun 2017 15:33:29 -0400 Received: from mail-pg0-f53.google.com ([74.125.83.53]:33370 "EHLO mail-pg0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751178AbdFETd2 (ORCPT ); Mon, 5 Jun 2017 15:33:28 -0400 Received: by mail-pg0-f53.google.com with SMTP id f185so24530675pgc.0 for ; Mon, 05 Jun 2017 12:33:28 -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=g4IYQvqg0B4pGVE2JcsU9C69Do58MXZSbjGsyT9b2AA=; b=k0rxoB9Pr4gpicyqeVSvscdQEKkBzIrsidOLdm2fEfM+fAo10cAW5fJAc0Nouj8awd ZWZ9bU7R2b30SleR1aGvmOWJG/vYZUxf+iMjpwgFU94leF3N+AeElf6jpcm4BaVsYtYR sQ8fzwuwc2h1qwE2S91AoFEe/cCt+4synx+X2RBDrxXyGNkAU2vedHK8c3fYZr1OOqI5 IbP6etfIlwlH/OOMW4tsuo2G5p36G7S9h6SMvVMmy4WvbWbutQ6wj7cM9Fe2QvdHqm1y GK94BofOGVMLSC6PeNC/rS9/qrbk+znLoUU9Svg8aBCGf806plVxnaLBqlJgLFCDhrgz pJSw== 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=g4IYQvqg0B4pGVE2JcsU9C69Do58MXZSbjGsyT9b2AA=; b=L8v6jnzZT9zY2kyZYU1ohJYR1c5Q2QDkzw8UiqA89kufePVSzP1BEZbxzBUW8CHZJk nbGqOeROgc9JLJNCsbXi8ITAOkiOQC8PetUT8/qHdauOymzIwlmAL44ZT+Ea45STnogc P9jlyMw3lfwla3VzJkwLVAcokN7I0fLZpCAJipMnXzOGyh+6WG/wFyitzR7miQdeltOb Jbu2h9qvGKPfLTmPZvJdu6r7YIj/wlC9+hUpIBkZw6JemTAn1//1KVx6pFT93zxADz1G +WzaE/5fMxvxAQlYzXRc9Fry0W2FiRsGKuJpdEYjojAL94Gq0OluI99dM32NLWGe7+Yg 3D6Q== X-Gm-Message-State: AODbwcCQCqNIT31sMaCpw9rkeGsZ0FCTQmdnBlsnI5DpwBOuLxYDcgqK Uu75l+waNa/8XyDz X-Received: by 10.98.34.8 with SMTP id i8mr9375747pfi.194.1496691207522; Mon, 05 Jun 2017 12:33:27 -0700 (PDT) Received: from nebulus.mtv.corp.google.com ([100.98.120.17]) by smtp.gmail.com with ESMTPSA id f71sm59090872pfd.98.2017.06.05.12.33.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 05 Jun 2017 12:33:26 -0700 (PDT) From: Mark Salyzyn To: linux-kernel@vger.kernel.org Cc: linux-pm@vger.kernel.org, Mark Salyzyn , Todd Poynor , "Rafael J. Wysocki" , Len Brown , Pavel Machek Subject: PM / Suspend: Print wall time at suspend entry and exit Date: Mon, 5 Jun 2017 12:31:14 -0700 Message-Id: <20170605193157.59875-1-salyzyn@android.com> X-Mailer: git-send-email 2.13.0.506.g27d5fe0cd-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. Signed-off-by: Todd Poynor Signed-off-by: Mark Salyzyn Acked-by: Pavel Machek --- kernel/power/suspend.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/kernel/power/suspend.c b/kernel/power/suspend.c index c0248c74d6d4..464175f04bc5 100644 --- a/kernel/power/suspend.c +++ b/kernel/power/suspend.c @@ -26,6 +26,7 @@ #include #include #include +#include #include #include #include @@ -563,6 +564,18 @@ static int enter_state(suspend_state_t state) return error; } +static void pm_suspend_marker(char *annotation) +{ + struct timespec ts; + struct rtc_time tm; + + getnstimeofday(&ts); + rtc_time_to_tm(ts.tv_sec, &tm); + pr_info("PM: suspend %s %d-%02d-%02d %02d:%02d:%02d.%09lu UTC\n", + annotation, tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday, + tm.tm_hour, tm.tm_min, tm.tm_sec, ts.tv_nsec); +} + /** * pm_suspend - Externally visible function for suspending the system. * @state: System sleep state to enter. @@ -577,6 +590,7 @@ int pm_suspend(suspend_state_t state) if (state <= PM_SUSPEND_ON || state >= PM_SUSPEND_MAX) return -EINVAL; + pm_suspend_marker("entry"); error = enter_state(state); if (error) { suspend_stats.fail++; @@ -584,6 +598,7 @@ int pm_suspend(suspend_state_t state) } else { suspend_stats.success++; } + pm_suspend_marker("exit"); return error; } EXPORT_SYMBOL(pm_suspend);