linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] PM: Show how long dpm_suspend_start() and dpm_suspend_end() take
@ 2019-06-05 16:12 Bart Van Assche
  2019-06-18 22:54 ` Bart Van Assche
  0 siblings, 1 reply; 3+ messages in thread
From: Bart Van Assche @ 2019-06-05 16:12 UTC (permalink / raw)
  To: Rafael J . Wysocki; +Cc: Pavel Machek, linux-pm, Bart Van Assche

When debugging device driver power management code it is convenient to
know how much time is spent in the "suspend start" and "suspend end"
phases. Hence log the time spent in these phases.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
---
 drivers/base/power/main.c | 17 +++++++++++------
 1 file changed, 11 insertions(+), 6 deletions(-)

diff --git a/drivers/base/power/main.c b/drivers/base/power/main.c
index dcfc0a36c8f7..1e84b8aa220f 100644
--- a/drivers/base/power/main.c
+++ b/drivers/base/power/main.c
@@ -1631,17 +1631,20 @@ int dpm_suspend_late(pm_message_t state)
  */
 int dpm_suspend_end(pm_message_t state)
 {
-	int error = dpm_suspend_late(state);
+	ktime_t starttime = ktime_get();
+	int error;
+
+	error = dpm_suspend_late(state);
 	if (error)
-		return error;
+		goto out;
 
 	error = dpm_suspend_noirq(state);
-	if (error) {
+	if (error)
 		dpm_resume_early(resume_event(state));
-		return error;
-	}
 
-	return 0;
+out:
+	dpm_show_time(starttime, state, error, "end");
+	return error;
 }
 EXPORT_SYMBOL_GPL(dpm_suspend_end);
 
@@ -2034,6 +2037,7 @@ int dpm_prepare(pm_message_t state)
  */
 int dpm_suspend_start(pm_message_t state)
 {
+	ktime_t starttime = ktime_get();
 	int error;
 
 	error = dpm_prepare(state);
@@ -2042,6 +2046,7 @@ int dpm_suspend_start(pm_message_t state)
 		dpm_save_failed_step(SUSPEND_PREPARE);
 	} else
 		error = dpm_suspend(state);
+	dpm_show_time(starttime, state, error, "start");
 	return error;
 }
 EXPORT_SYMBOL_GPL(dpm_suspend_start);
-- 
2.22.0.rc3


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] PM: Show how long dpm_suspend_start() and dpm_suspend_end() take
  2019-06-05 16:12 [PATCH] PM: Show how long dpm_suspend_start() and dpm_suspend_end() take Bart Van Assche
@ 2019-06-18 22:54 ` Bart Van Assche
  2019-06-18 22:56   ` Rafael J. Wysocki
  0 siblings, 1 reply; 3+ messages in thread
From: Bart Van Assche @ 2019-06-18 22:54 UTC (permalink / raw)
  To: Rafael J . Wysocki; +Cc: Pavel Machek, linux-pm

On 6/5/19 9:12 AM, Bart Van Assche wrote:
> When debugging device driver power management code it is convenient to
> know how much time is spent in the "suspend start" and "suspend end"
> phases. Hence log the time spent in these phases.

Ping?



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] PM: Show how long dpm_suspend_start() and dpm_suspend_end() take
  2019-06-18 22:54 ` Bart Van Assche
@ 2019-06-18 22:56   ` Rafael J. Wysocki
  0 siblings, 0 replies; 3+ messages in thread
From: Rafael J. Wysocki @ 2019-06-18 22:56 UTC (permalink / raw)
  To: Bart Van Assche; +Cc: Rafael J . Wysocki, Pavel Machek, Linux PM

On Wed, Jun 19, 2019 at 12:54 AM Bart Van Assche <bvanassche@acm.org> wrote:
>
> On 6/5/19 9:12 AM, Bart Van Assche wrote:
> > When debugging device driver power management code it is convenient to
> > know how much time is spent in the "suspend start" and "suspend end"
> > phases. Hence log the time spent in these phases.
>
> Ping?

Already applied.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-06-18 22:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-05 16:12 [PATCH] PM: Show how long dpm_suspend_start() and dpm_suspend_end() take Bart Van Assche
2019-06-18 22:54 ` Bart Van Assche
2019-06-18 22:56   ` Rafael J. Wysocki

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).