Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   Ubuntu Kernel Team (http://www.linux-archive.org/ubuntu-kernel-team/)
-   -   UBUNTU: SAUCE: PM: report resume time of each device (http://www.linux-archive.org/ubuntu-kernel-team/315279-ubuntu-sauce-pm-report-resume-time-each-device.html)

Manoj Iyer 01-26-2010 02:44 PM

UBUNTU: SAUCE: PM: report resume time of each device
 
Report the resume time of each device.

Signed-off-by: Manoj Iyer <manoj.iyer@canonical.com>
---
drivers/base/power/main.c | 23 +++++++++++++++++++++++
1 files changed, 23 insertions(+), 0 deletions(-)

diff --git a/drivers/base/power/main.c b/drivers/base/power/main.c
index d72d4b3..b4833d5 100644
--- a/drivers/base/power/main.c
+++ b/drivers/base/power/main.c
@@ -341,6 +341,25 @@ static void dpm_show_time(ktime_t starttime, pm_message_t state, char *info)
usecs / USEC_PER_MSEC, usecs % USEC_PER_MSEC);
}

+
+static void device_show_time(struct device *dev, ktime_t starttime, pm_message_t state, char *info)
+{
+ ktime_t calltime;
+ s64 usecs64;
+ int usecs;
+
+ calltime = ktime_get();
+ usecs64 = ktime_to_ns(ktime_sub(calltime, starttime));
+ do_div(usecs64, NSEC_PER_USEC);
+ usecs = usecs64;
+ if (usecs == 0)
+ usecs = 1;
+ pr_info("PM: %s%s%s of drv:%s dev:%s complete after %ld.%03ld msecs
",
+ info ?: "", info ? " " : "", pm_verb(state.event),
+ dev_driver_string(dev), dev_name(dev), usecs / USEC_PER_MSEC,
+ usecs % USEC_PER_MSEC);
+}
+
/*------------------------- Resume routines -------------------------*/

/**
@@ -354,6 +373,7 @@ static void dpm_show_time(ktime_t starttime, pm_message_t state, char *info)
static int device_resume_noirq(struct device *dev, pm_message_t state)
{
int error = 0;
+ ktime_t starttime = ktime_get();

TRACE_DEVICE(dev);
TRACE_RESUME(0);
@@ -364,6 +384,7 @@ static int device_resume_noirq(struct device *dev, pm_message_t state)
if (dev->bus->pm) {
pm_dev_dbg(dev, state, "EARLY ");
error = pm_noirq_op(dev, dev->bus->pm, state);
+ device_show_time(dev, starttime, state, "early");
}
End:
TRACE_RESUME(error);
@@ -407,6 +428,7 @@ EXPORT_SYMBOL_GPL(dpm_resume_noirq);
static int device_resume(struct device *dev, pm_message_t state)
{
int error = 0;
+ ktime_t starttime = ktime_get();

TRACE_DEVICE(dev);
TRACE_RESUME(0);
@@ -443,6 +465,7 @@ static int device_resume(struct device *dev, pm_message_t state)
error = dev->class->resume(dev);
}
}
+ device_show_time(dev, starttime, state, NULL);
End:
up(&dev->sem);

--
1.6.3.3



Cheers
--- manjo

--
kernel-team mailing list
kernel-team@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/kernel-team

Manoj Iyer 01-26-2010 02:52 PM

UBUNTU: SAUCE: PM: report resume time of each device
 
The following patch reports the resume time of each device. Not sure if we
want to submit this upstream because it will populate dmesg with lot of PM
messages. Probably need to filter all the PM messages to kern_resume.log
or some such file in /var/log.

The following changes since commit
5d4092811713de51759a9d194eb78e4eb1c48822:
Manoj Iyer (1):
UBUNTU: SAUCE: PM: report resume time of each device

are available in the git repository at:


ssh://zinc.canonical.com/srv/kernel.ubuntu.com/git/manjo/ubuntu-lucid.git
suspendresume2


All times are GMT. The time now is 07:58 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.