Received: by 2002:a05:7412:a9a2:b0:e2:908c:2ebd with SMTP id o34csp2039521rdh; Sat, 28 Oct 2023 19:55:15 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG2NTM7rvMUZNwF9jqE3R88HEpf2FnZCJ8/PJrwWBJNkalsoc91yEP6DytyQVv4pWvwzZU3 X-Received: by 2002:a05:6a20:9189:b0:17b:5cbb:b874 with SMTP id v9-20020a056a20918900b0017b5cbbb874mr11264551pzd.15.1698548115114; Sat, 28 Oct 2023 19:55:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698548115; cv=none; d=google.com; s=arc-20160816; b=IgHILFtVimiSEWdOpZ/fB/3hxIb3C6XVCDweY9O/1mGVqy7vzjdPLVQ3Q14b3PqPLG YpicJnpw78mPZyWSm9GRo9/25R8r4R2O2+Kw3qLqkgoIMGlSfYJR2qy6FRgnG4o/MMPB X7oYILyN6s3DKFpx3VfoHw4a5Qp+LNmSlZDDMu5DKabQiZLz1q9TquP9iwl5RbQjsCAN 6VX80bsYkJaT9aswW3OigWMvyR+TcDRJ/GTkzWBhsAQM4aK6mo/JeO0LmyYcvFmaex0u SKFo6lgnMxKxZOMMzM39U+uyourA7neZXJhAzeMehPqyRz1SJqFZYkRc1ZWKi0uHyRx+ 2F7g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=W6M2Aj6jv5za8UKueyyHBBLNcT5stkDLhyhvdSRHLCc=; fh=wZTHUQZMCbjsZLZNE0ThFy5fpzknZUk0xLL1XlpKyi8=; b=tQBooPUvQPapG8pBwHDwGqAF5WcLY592Z/U6pwqi7N3tCA3iYoYHHI1B/JTzFt/mO9 4fcLu1Uff7CqSy3+bufeY0Lp+4HbGZy0XTX9LZ/R7X0S3XFFJWlZ0T7zRFZRY3xALwEA k3uH+zCwyWWrna7tXp/1EMarCIQ/2082D6eDuPx44BAQQKz8ubySkiL8gJ2t2EAoDPLa 70obPx2Nnf0NO6jf3pxyWoxSuYtnckVdUPYFCPj5i4bR/0DLmRfj8CTR3KOb57RqvPJg ikE1mjbbhBE/wXHqkPbXgTrvroUzpJHh//LsFlCVD3jnxmW+4FmLuaLMqRsCPnPHe57z J7gQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=PkFdZLt+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id e12-20020a65688c000000b0056959099f46si3101929pgt.856.2023.10.28.19.55.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 28 Oct 2023 19:55:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=PkFdZLt+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 37D798095814; Sat, 28 Oct 2023 19:55:12 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229908AbjJ2Cy5 (ORCPT + 99 others); Sat, 28 Oct 2023 22:54:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58844 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229446AbjJ2Cy4 (ORCPT ); Sat, 28 Oct 2023 22:54:56 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8A58ECC; Sat, 28 Oct 2023 19:54:54 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 15A4DC433C8; Sun, 29 Oct 2023 02:54:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1698548094; bh=RlNnNHHg3zRkH0P4DdOqNoxHNDzPt997A9kWx4EOy2U=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=PkFdZLt+Z30Qeqi8MWYZD+cvxIxKF1wHGbjVs6fEo/KOjmoMLe+FA5SdAJOXTo+Ue 1MEEZrhmot6/KaGa01niJaSzan2FkmIiTdnCnhAV6AAo1g2CpaXL7A5z+pf6q62wJC 1TNn4y9TLnaOlRTnjx5eODYidMsl8OF2ZjnuGKQByK1wWJVZJE0LCvsiGlxY93HFiv JcYBUqcuC7NE5+b37DgPSEH7UCrIXIgxD1mVbYiDubcwq9aOHDY8DXK6uJ86GYZ+Pt 4Qo7VhTnwcJfN6MCNSGJ60s8NdRJHxvgWIfnm/SszxEIkJwzrQaBFhq8CbD99vfqaI TrD2LnnAGsDpQ== Date: Sun, 29 Oct 2023 11:54:49 +0900 From: Masami Hiramatsu (Google) To: Randy Dunlap Cc: "Rafael J . Wysocki" , Pavel Machek , Len Brown , suleiman@google.com, briannorris@google.com, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org Subject: Re: [PATCH v3] PM: sleep: Expose last succeeded resumed timestamp in sysfs Message-Id: <20231029115449.8c942b131312c2464eda6970@kernel.org> In-Reply-To: References: <169849758243.1357961.4105003693126485611.stgit@mhiramat.roam.corp.google.com> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.33; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.5 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI,NICE_REPLY_A, 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 fry.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 (fry.vger.email [0.0.0.0]); Sat, 28 Oct 2023 19:55:12 -0700 (PDT) On Sat, 28 Oct 2023 09:48:36 -0700 Randy Dunlap wrote: > 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... Oops, it should be "floating point number". Thank you! > > > > + clock. > > + > > What: /sys/power/sync_on_suspend > > Date: October 2019 > > Contact: Jonas Meurer > > [snip] > > Thanks. > -- > ~Randy -- Masami Hiramatsu (Google)