Files
linux/drivers/usb/core/Makefile
Kuen-Han Tsai 071786e27d usb: core: Add tracepoints for device allocation and state changes
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>
2025-10-22 10:58:30 +02:00

26 lines
725 B
Makefile

# SPDX-License-Identifier: GPL-2.0
#
# Makefile for USB Core files and filesystem
#
# define_trace.h needs to know how to find our header
CFLAGS_trace.o := -I$(src)
usbcore-y := usb.o hub.o hcd.o urb.o message.o driver.o
usbcore-y += config.o file.o buffer.o sysfs.o endpoint.o
usbcore-y += devio.o notify.o generic.o quirks.o devices.o
usbcore-y += phy.o port.o trace.o
usbcore-$(CONFIG_OF) += of.o
usbcore-$(CONFIG_USB_XHCI_SIDEBAND) += offload.o
usbcore-$(CONFIG_USB_PCI) += hcd-pci.o
usbcore-$(CONFIG_ACPI) += usb-acpi.o
ifdef CONFIG_USB_ONBOARD_DEV
usbcore-y += ../misc/onboard_usb_dev_pdevs.o
endif
obj-$(CONFIG_USB) += usbcore.o
obj-$(CONFIG_USB_LEDS_TRIGGER_USBPORT) += ledtrig-usbport.o