summaryrefslogtreecommitdiff
path: root/drivers/usb/core/trace.c
AgeCommit message (Collapse)Author
2025-10-22usb: core: Add tracepoints for device allocation and state changesKuen-Han Tsai
Introduce new tracepoints to the USB core to improve debuggability of USB device lifecycle events. The following tracepoints are added: - usb_alloc_dev: Triggered when a new USB device structure is allocated, providing insights into early device setup. - usb_set_device_state: Triggered when the USB device state changes, allowing observation of the device's state transitions. These tracepoints capture detailed information about the USB device, including its name, speed, state, bus current value, and authorized flag. This will aid developers in diagnosing issues related to device enumeration within the USB subsystem. Examples: usb_alloc_dev: usb 1-1 speed UNKNOWN state attached 0mA [authorized] usb_set_device_state: usb 1-1 speed UNKNOWN state powered 0mA [authorized] usb_set_device_state: usb 1-1 speed full-speed state default 500mA [authorized] usb_set_device_state: usb 1-1 speed full-speed state default 500mA [authorized] usb_set_device_state: usb 1-1 speed full-speed state addressed 500mA [authorized] usb_set_device_state: usb 1-1 speed full-speed state configured 500mA [authorized] usb_set_device_state: usb 1-1 speed full-speed state suspended 500mA [authorized] usb_set_device_state: usb 1-1 speed full-speed state not attached 500mA [authorized] Signed-off-by: Kuen-Han Tsai <khtsai@google.com> Reviewed-by: Alan Stern <stern@rowland.harvard.edu> Link: https://patch.msgid.link/20251015-usbcore-tracing-v2-2-5a14b5b9d4e0@google.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>