Re: [PATCH] Try 3: Export URB statistics for powertop.
Marcel Holtmann <[email protected]>
| Newsgroups | gmane.linux.usb.devel |
|---|---|
| Message-ID | <[email protected]> |
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(....
Regards
Marcel
-------------------------------------------------------------------------
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