OpenCloudOS-Kernel/drivers/base/power
Arjan van de Ven 8d4b9d1bfe PM / Runtime: Add runtime PM statistics (v3)
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 PCI Express Fast Ethernet controller

[version 2: fix stat update bugs noticed by Alan Stern]
[version 3: rebase to -next and move the sysfs declaration]

Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
2010-07-19 02:01:06 +02:00
..
Makefile PM: Make it possible to avoid races between wakeup and system sleep 2010-07-19 01:58:48 +02:00
generic_ops.c PM: Provide generic subsystem-level callbacks 2010-03-06 21:28:37 +01:00
main.c PM: Make it possible to avoid races between wakeup and system sleep 2010-07-19 01:58:48 +02:00
power.h PM: Add a switch for disabling/enabling asynchronous suspend/resume 2010-02-26 20:39:10 +01:00
runtime.c PM / Runtime: Add runtime PM statistics (v3) 2010-07-19 02:01:06 +02:00
sysfs.c PM / Runtime: Add runtime PM statistics (v3) 2010-07-19 02:01:06 +02:00
trace.c driver core: struct device - replace bus_id with dev_name(), dev_set_name() 2009-01-06 10:44:31 -08:00
wakeup.c PM: Do not use dynamically allocated objects in pm_wakeup_event() 2010-07-19 02:00:35 +02:00