From: Arjan van de Ven <arjan@infradead.org>
To: Alan Stern <stern@rowland.harvard.edu>
Cc: linux-pm@lists.linux-foundation.org, <linux-kernel@vger.kernel.org>
Subject: Re: [linux-pm] [PATCH] pm: Add runtime PM statistics to sysfs
Date: Sat, 10 Jul 2010 09:00:55 -0700 [thread overview]
Message-ID: <20100710090055.119f77fd@infradead.org> (raw)
In-Reply-To: <Pine.LNX.4.44L0.1007091106070.1582-100000@iolanthe.rowland.org>
On Fri, 9 Jul 2010 11:11:06 -0400 (EDT)
Alan Stern <stern@rowland.harvard.edu> wrote:
> 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:
you are correct.
I'll fix it, I think I'll make a small helper that does the account and
assignment in one place, so that we then can have a rule that nobody
updates this field without calling the function
--
Arjan van de Ven Intel Open Source Technology Centre
For development, discussion and tips for power savings,
visit http://www.lesswatts.org
next prev parent reply other threads:[~2010-07-10 15:57 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-07-09 5:48 Arjan van de Ven
2010-07-09 7:04 ` Ming Lei
2010-07-09 11:22 ` Arjan van de Ven
2010-07-09 15:00 ` [linux-pm] " Alan Stern
2010-07-09 15:11 ` Alan Stern
2010-07-10 16:00 ` Arjan van de Ven [this message]
2010-07-10 16:29 ` Arjan van de Ven
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20100710090055.119f77fd@infradead.org \
--to=arjan@infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@lists.linux-foundation.org \
--cc=stern@rowland.harvard.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®