linux/drivers/usb/core
Sarah Sharp 1512300689 USB: Export suspend statistics
This patch exports two statistics to userspace:
/sys/bus/usb/device/.../power/connected_duration
/sys/bus/usb/device/.../power/active_duration

connected_duration is the total time (in msec) that the device has
been connected.  active_duration is the total time the device has not
been suspended.  With these two statistics, tools like PowerTOP can
calculate the percentage time that a device is active, i.e. not
suspended or auto-suspended.

Users can also use the active_duration to check if a device is actually
autosuspended.  Currently, they can set power/level to auto and
power/autosuspend to a positive timeout, but there's no way to know from
userspace if a device was actually autosuspended without looking at the
dmesg output.  These statistics will be useful in creating an automated
userspace script to test autosuspend for USB devices.

Signed-off-by: Sarah Sharp <sarah.a.sharp@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-02-01 14:35:00 -08:00
..
buffer.c cleanup asm/scatterlist.h includes 2007-11-02 08:47:06 +01:00
config.c usb: usb_get_configuration() obeys authorization 2007-10-12 14:55:06 -07:00
devices.c USB: add IAD support to usbfs and sysfs 2007-07-12 16:34:40 -07:00
devio.c USB: add usbfs stubs for suspend and resume 2008-02-01 14:34:54 -08:00
driver.c USB: handle idVendor of 0x0000 2008-02-01 14:34:46 -08:00
endpoint.c Add missing newlines to some uses of dev_<level> messages 2007-10-18 14:37:28 -07:00
file.c USB: prevent char device open/deregister race 2007-07-12 16:29:48 -07:00
generic.c USB: move decision to ignore FREEZE events 2007-10-12 14:55:26 -07:00
hcd-pci.c USB: don't change HC power state for a FREEZE 2008-02-01 14:34:51 -08:00
hcd.c USB: Convert from class_device to device for USB core 2008-02-01 14:34:46 -08:00
hcd.h USB: force handover port to companion when hub_port_connect_change fails 2008-02-01 14:34:52 -08:00
hub.c USB: Export suspend statistics 2008-02-01 14:35:00 -08:00
hub.h
inode.c
Kconfig USB: always announce a device has been added to the system 2008-02-01 14:34:52 -08:00
Makefile
message.c USB: uevent environment key fix 2007-11-28 13:58:35 -08:00
notify.c USB : correct comments in usb/core/notify.c 2008-02-01 14:34:44 -08:00
otg_whitelist.h
quirks.c USB: remove USB_QUIRK_NO_AUTOSUSPEND 2007-10-12 14:55:28 -07:00
sysfs.c USB: Export suspend statistics 2008-02-01 14:35:00 -08:00
urb.c USB: add URB_FREE_BUFFER to permissible flags 2007-10-25 12:18:43 -07:00
usb.c USB: Export suspend statistics 2008-02-01 14:35:00 -08:00
usb.h USB: rename choose_configuration 2007-10-12 14:55:08 -07:00