Received: by 2002:a05:7412:a9a2:b0:e2:908c:2ebd with SMTP id o34csp1857497rdh; Sat, 28 Oct 2023 09:48:55 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFb6zXyMPtrKP5u7guPo4deQ0lFjaFvedfmPoz52e/vuGmeWgXeybWZPOTJamCaOhcl71HO X-Received: by 2002:a05:6808:13d1:b0:3a1:db18:401e with SMTP id d17-20020a05680813d100b003a1db18401emr7889230oiw.1.1698511735490; Sat, 28 Oct 2023 09:48:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698511735; cv=none; d=google.com; s=arc-20160816; b=Z6SkS9/u+tkCy/Wu6++PE43fScMgDPMCNj+AT2zcNNeyNGlikpuMA2tceJfj0KELmY z49arsy4MYyTxDTvV0+kpICw9yi5k/T6cJK+vWGYAVzsmwbYy86a9qM3li7kUJzAk1pw qB6ah6aRZRSc2WG4Dpu6Hm3FES2yO4RJNy05DIYqacTpBKUgyq2Q7XyQTHgkjPNjeW2l 6pnBsRAuYQtJhuRJTv3FTtRp4hBCSnYQOrd42WSiAwgIvb5+xz9GEfJdwFm1KOLx/qWO h6jW7DLvWpdopoBjUojtOr1JqmvPYiJhbgP/l7Y2B/ghTcC8vYK7ndY9tYy9Gbkz+y4+ n1ng== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=pKU+y/cebogC5d3kvaZU4QNtM5iPWmgULniCim14DXE=; fh=HBZYxut8YXYc05qtNuAo/26o+g0MC9zNei+NXSguEM4=; b=clOKKdBuEFNCcFEr3UtNOOFCHF5JcsxXHuHcGdbcLnCfu6z5K0RkWDEO+dKWbIViqS beQlSWI2lfJ58HoWHFXq/yIhKZy0uzazOJINzj4bSRZhgkFcb9R86lZATjcEMvd0Zc9U nlnXSuUyuIx0kJLsfH44m5xSz9c6EiX4O50vPwcFx7AA5SdE4NfNQsXmdVsfHcG4r7Bw cCpdsafD0bu86jczdkj1LVonakJQYItR5S/cv9pSb/J8nUOhzbCaexX8wne/7So5K0We nyxSBcQKH3VrjX6p/3M69nhUBBnfgTiTH66OSD5vErjLmj6gNCd9P2WnYuv6v3kCoM1B QNhw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b="p805N/GI"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id z3-20020aa78883000000b0069025078128si2654476pfe.240.2023.10.28.09.48.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 28 Oct 2023 09:48:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b="p805N/GI"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id EC4A88089E71; Sat, 28 Oct 2023 09:48:52 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229475AbjJ1Qsq (ORCPT + 99 others); Sat, 28 Oct 2023 12:48:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41900 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229448AbjJ1Qsp (ORCPT ); Sat, 28 Oct 2023 12:48:45 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A0440CE; Sat, 28 Oct 2023 09:48:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: Content-Type:In-Reply-To:From:References:Cc:To:Subject:MIME-Version:Date: Message-ID:Sender:Reply-To:Content-ID:Content-Description; bh=pKU+y/cebogC5d3kvaZU4QNtM5iPWmgULniCim14DXE=; b=p805N/GI2MB9BwL30W+TUfq3QF wYsC9exlj0h3hK3wKSfpRj+ysoaKR6GZTJWOrbiWDKsWOLCzlvMsVltIryEyee53u4n/YeGkqdkET Dq0iOZCCfOjfwSaAYK6bmLiFX23KS5yD24dL1QlASXec9rVRK4WcHrqg3BihlweDNFLvbEe2q6pNB zf1Z2inuml9rtCZbwGVzfSsjUePbosZUSQPo7zZ5bQtAdPzEcqfdTSOU6n6l3zki5DH8wc4xGe1rf OQabisFkg/0q5eNS3l6lLVz0qhNNxYr5Sw8hiIz/ViHP9cV1xiqxjQjQgVxGZjorPEd1gc1GB6JP4 H4dgR40g==; Received: from [50.53.46.231] (helo=[192.168.254.15]) by bombadil.infradead.org with esmtpsa (Exim 4.96 #2 (Red Hat Linux)) id 1qwmUG-000f7k-2t; Sat, 28 Oct 2023 16:48:36 +0000 Message-ID: Date: Sat, 28 Oct 2023 09:48:36 -0700 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v3] PM: sleep: Expose last succeeded resumed timestamp in sysfs Content-Language: en-US To: "Masami Hiramatsu (Google)" , "Rafael J . Wysocki" , Pavel Machek , Len Brown Cc: suleiman@google.com, briannorris@google.com, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org References: <169849758243.1357961.4105003693126485611.stgit@mhiramat.roam.corp.google.com> From: Randy Dunlap In-Reply-To: <169849758243.1357961.4105003693126485611.stgit@mhiramat.roam.corp.google.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Sat, 28 Oct 2023 09:48:53 -0700 (PDT) Hi, On 10/28/23 05:53, Masami Hiramatsu (Google) wrote: > From: Masami Hiramatsu > > Expose last succeeded resumed timestamp as last_success_resume_time > attribute of suspend_stats in sysfs. This timestamp is recorded in > CLOCK_MONOTONIC. So user can find the actual resumed time and > measure the elapsed time from the time when the kernel finished > the resume to the user-space action (e.g. display the UI). Can you go into the use-case a bit more, please? You have said "what", but not "why". What do you (or google) plan to do with this? > > Signed-off-by: Masami Hiramatsu (Google) > --- > Changes in v3: > - Add (unsigned long long) casting for %llu. > - Add a line after last_success_resume_time_show(). > Changes in v2: > - Use %llu instead of %lu for printing u64 value. > - Remove unneeded indent spaces from the last_success_resume_time > line in the debugfs suspend_stat file. > --- > Documentation/ABI/testing/sysfs-power | 10 ++++++++++ > include/linux/suspend.h | 2 ++ > kernel/power/main.c | 15 +++++++++++++++ > kernel/power/suspend.c | 1 + > 4 files changed, 28 insertions(+) > > diff --git a/Documentation/ABI/testing/sysfs-power b/Documentation/ABI/testing/sysfs-power > index a3942b1036e2..63659765dee1 100644 > --- a/Documentation/ABI/testing/sysfs-power > +++ b/Documentation/ABI/testing/sysfs-power > @@ -442,6 +442,16 @@ Description: > 'total_hw_sleep' and 'last_hw_sleep' may not be accurate. > This number is measured in microseconds. > > +What: /sys/power/suspend_stats/last_success_resume_time > +Date: Oct 2023 > +Contact: Masami Hiramatsu > +Description: > + The /sys/power/suspend_stats/last_success_resume_time file > + contains the timestamp of when the kernel successfully > + resumed from suspend/hibernate. > + This floating number is measured in seconds by monotonic What does "floating" mean here? Not floating point... > + clock. > + > What: /sys/power/sync_on_suspend > Date: October 2019 > Contact: Jonas Meurer [snip] Thanks. -- ~Randy