lkml.org 
[lkml]   [2010]   [Jul]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [linux-pm] [PATCH] pm: Add runtime PM statistics to sysfs
On Fri, 9 Jul 2010, Alan Stern wrote:

> On Thu, 8 Jul 2010, Arjan van de Ven wrote:
>
> > From: Arjan van de Ven <arjan@linux.intel.com>
> > Subject: pm: Add runtime PM statistics to sysfs
> >
> > In order for PowerTOP to be able to report how well the new runtime PM is working
> > for the various drivers, the kernel needs to export some basic statistics in sysfs.
> >
> > This patch adds two sysfs files in the runtime PM domain that expose the
> > total time a device has been active, and the time a device has been suspended.
> >
> > With this PowerTOP can compute the activity percentage
> >
> > Active %age = 100 * (delta active) / (delta active + delta suspended)
> >
> > and present the information to the user.
> >
> > I've written the PowerTOP code (slated for version 1.12) already, and the output looks
> > like this:
> >
> > Runtime Device Power Management statistics
> > Active Device name
> > 10.0% 06:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8101E/RTL8102E
>
>
> > @@ -411,6 +433,7 @@ int __pm_runtime_resume(struct device *dev, bool from_wq)
> > }
> >
> > if (retval) {
> > + update_pm_runtime_accounting(dev);
> > dev->power.runtime_status = RPM_SUSPENDED;
> > pm_runtime_cancel_pending(dev);
> > } else {
>
> This line was added in the wrong place. It belongs either before the
> "if (retval) {" or after the "} else {".

Whoops, sorry, my mistake. It doesn't belong here at all. It belongs
considerably earlier in the function, before the line:

dev->power.runtime_status = RPM_RESUMING;

This is because update_pm_runtime_accounting() doesn't take into
account the existence of the RPM_RESUMING and RPM_SUSPENDING states; it
treats them all the same as RPM_ACTIVE.

Also, it looks like you forgot to add a call in
__pm_runtime_set_status().

Alan Stern



\
 
 \ /
  Last update: 2010-07-09 17:13    [W:0.649 / U:0.304 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site