Re: [PATCH] Try 3: Export URB statistics for powertop.

Sarah Sharp <[email protected]>
Newsgroups gmane.linux.usb.devel
Message-ID <20071009171707.GB15681@localdomain>
On Tue, Oct 09, 2007 at 01:00:30AM +0200, Marcel Holtmann wrote:
> Hi Sarah,
> 
> > powertop currently tracks interrupts generated by uhci, ehci, and ohci,
> > but it has no way of telling which USB device to blame USB bus activity on.
> > This patch exports the number of URBs that are submitted for a given device.
> > Cat the file 'urbnum' in /sys/bus/usb/devices/.../
> 
> patch looks good to me. I would ack it, but that is not up to me.
>  
> > +static ssize_t
> > +show_urbnum(struct device *dev, struct device_attribute *attr, char *buf)
> > +{
> > +	struct usb_device *udev;
> > +
> > +	udev = to_usb_device(dev);
> > +	return sprintf(buf, "%d\n", atomic_read(&udev->urbnum));
> > +}
> > +static DEVICE_ATTR(urbnum, S_IRUGO, show_urbnum, NULL);
> > +
> 
> some small comment on this one. I would have written it this way:
> 
> 	struct usb_device *udev = to_usb_device(dev);
> 	return sprintf(....

I was following the coding style in the other functions in sysfs.c.
Otherwise I would have done it that way too. :)

On an unrelated note, aren't you the maintainer for the Linux bluetooth
stack?  I was wondering if the rework of that code included autosuspend
support for bluetooth devices.

Sarah Sharp

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
[email protected]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.