From patchwork Mon Jun 5 19:31:15 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Salyzyn X-Patchwork-Id: 9767343 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 084CC602BF for ; Mon, 5 Jun 2017 19:33:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EE1C3251F4 for ; Mon, 5 Jun 2017 19:33:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E2B1A283C4; Mon, 5 Jun 2017 19:33:48 +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 BC257251F4 for ; Mon, 5 Jun 2017 19:33:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751268AbdFETdq (ORCPT ); Mon, 5 Jun 2017 15:33:46 -0400 Received: from mail-pf0-f176.google.com ([209.85.192.176]:33360 "EHLO mail-pf0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751180AbdFETdq (ORCPT ); Mon, 5 Jun 2017 15:33:46 -0400 Received: by mail-pf0-f176.google.com with SMTP id 83so29755734pfr.0 for ; Mon, 05 Jun 2017 12:33:45 -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:in-reply-to:references; bh=L4KU4vdBxcfYuG1TOf1LIEZ0ji4+j4ScrKxcwKW7Jfc=; b=XT6/weGf2+5AGm1TVt92/m1z+aBy5787UCy4tKPLiEdrCxetXH4O79ZcbOHEIYrJTA 7WGiimh5tgNOTzq1Ro0ypU0DMISttIC8MziVZISn9ujTc2K1sYi83hGl0xnjBkYA7bit biYPjbJMdZETSy3llhS407pGc7D7CrXDf61X7wCByAinO69vznV+NW6bBK3WDagk7HL/ lQL6MDYcVFYrkxF5Nv6EIi0pxPoHOIv5GRQOChNgDkTn3Dhn3YIUFTQcstcgf7qYc342 zjO9bhMQQFcjpsaen8YP4Ywq1Rd+FaQes8ZhT1aNV/N3mVuODAJRkd3ACIIbiz6ZeHm4 zJhw== 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:in-reply-to :references; bh=L4KU4vdBxcfYuG1TOf1LIEZ0ji4+j4ScrKxcwKW7Jfc=; b=MW84bLv+e6NQzzsXdPG5LU7kmm2n0+iGAyTtYs6ogm1nedinFGZ0FKlYSGwrneMxo/ SNLRvYeqEVPkd+Vj+KlFhAa3b6qM3Ewz0zdHKloCJ7AeGu5AXhAVu4GUUoIW+74uyqoe llN96WVEgYwxYztQifGTkHlCyCpiX0us4V6Ew4v78k4GX4f50DfFgV/N8HJp96GY8Uq2 yAiZ1Qs0BSJPyTmErP62eN5Dgb049CjhyIkkqRvFjjaUHUU/msX7Mv2BTtTQpvSqQNr5 vZ/2Vo1ccYHwFV3a5Wd8UcHi5PmoYJOfsh23XASdpoGG3gz+AAfN/op9/q3n4Bz0JUeU ZA4w== X-Gm-Message-State: AODbwcADSYGw29TlLr9GxUnPXiycTHYgFVxdreZjJ4jx6B3cDNh47MhT ovcxJ9OQ3qP1eWzEmEhFKg== X-Received: by 10.99.116.74 with SMTP id e10mr22915422pgn.149.1496691225408; Mon, 05 Jun 2017 12:33:45 -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.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 05 Jun 2017 12:33:45 -0700 (PDT) From: Mark Salyzyn To: linux-kernel@vger.kernel.org Cc: linux-pm@vger.kernel.org, Mark Salyzyn , "Rafael J. Wysocki" , Pavel Machek , Len Brown Subject: PM / Hibernation: Print wall time at hibernation entry and exit Date: Mon, 5 Jun 2017 12:31:15 -0700 Message-Id: <20170605193157.59875-2-salyzyn@android.com> X-Mailer: git-send-email 2.13.0.506.g27d5fe0cd-goog In-Reply-To: <20170605193157.59875-1-salyzyn@android.com> References: <20170605193157.59875-1-salyzyn@android.com> 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: Mark Salyzyn --- kernel/power/hibernate.c | 2 ++ kernel/power/power.h | 1 + kernel/power/suspend.c | 2 +- 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/kernel/power/hibernate.c b/kernel/power/hibernate.c index a8b978c35a6a..0a8b7315d298 100644 --- a/kernel/power/hibernate.c +++ b/kernel/power/hibernate.c @@ -342,6 +342,7 @@ int hibernation_snapshot(int platform_mode) pm_message_t msg; int error; + pm_suspend_marker("entry hibernation"); 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(); + pm_suspend_marker("exit hibernation"); goto Close; } diff --git a/kernel/power/power.h b/kernel/power/power.h index 7fdc40d31b7d..08f63ae27a31 100644 --- a/kernel/power/power.h +++ b/kernel/power/power.h @@ -194,6 +194,7 @@ extern const char *pm_states[]; extern const char *mem_sleep_states[]; extern suspend_state_t mem_sleep_current; +extern void pm_suspend_marker(const char *annotation); extern int suspend_devices_and_enter(suspend_state_t state); #else /* !CONFIG_SUSPEND */ #define mem_sleep_current PM_SUSPEND_ON diff --git a/kernel/power/suspend.c b/kernel/power/suspend.c index 464175f04bc5..69da2b880bde 100644 --- a/kernel/power/suspend.c +++ b/kernel/power/suspend.c @@ -564,7 +564,7 @@ static int enter_state(suspend_state_t state) return error; } -static void pm_suspend_marker(char *annotation) +void pm_suspend_marker(const char *annotation) { struct timespec ts; struct rtc_time tm;