Re: [PATCH v2] Export suspend statistics

2008-01-24 Thread Sarah Sharp
On Tue, Jan 22, 2008 at 10:21:34AM -0500, Alan Stern wrote: > On Tue, 22 Jan 2008, Oliver Neukum wrote: > > > Am Montag, 21. Januar 2008 22:43:25 schrieb Sarah Sharp: > > > +   dev->connect_time = jiffies; > > > +   dev->active_duration = -jiffies; > > >  #endif > > > if (root_hub)

Re: [PATCH v2] Export suspend statistics

2008-01-24 Thread Sarah Sharp
On Tue, Jan 22, 2008 at 09:34:56AM +0100, Oliver Neukum wrote: > Am Montag, 21. Januar 2008 22:43:25 schrieb Sarah Sharp: > > +   dev->connect_time = jiffies; > > +   dev->active_duration = -jiffies; > >  #endif > > if (root_hub)   /* Root hub always ok [and always wired] */ > >    

Re: [PATCH v2] Export suspend statistics

2008-01-22 Thread Alan Stern
On Tue, 22 Jan 2008, Oliver Neukum wrote: > Am Montag, 21. Januar 2008 22:43:25 schrieb Sarah Sharp: > > +   dev->connect_time = jiffies; > > +   dev->active_duration = -jiffies; > >  #endif > > if (root_hub)   /* Root hub always ok [and always wired] */ > > dev->au

Re: [PATCH v2] Export suspend statistics

2008-01-22 Thread Oliver Neukum
Am Montag, 21. Januar 2008 22:43:25 schrieb Sarah Sharp: > +   dev->connect_time = jiffies; > +   dev->active_duration = -jiffies; >  #endif > if (root_hub)   /* Root hub always ok [and always wired] */ > dev->authorized = 1; > diff --git a/include/linux/usb.h b/incl

[PATCH v2] Export suspend statistics

2008-01-21 Thread Sarah Sharp
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. W