Re: [PATCH v2 0/2] usb: core: Improve device lifecycle debuggability

From: Alan Stern

Date: Tue Oct 14 2025 - 16:53:11 EST


On Wed, Oct 15, 2025 at 03:50:50AM +0800, Kuen-Han Tsai wrote:
> This series enhances USB core debuggability. The first patch refactors
> device state updates into a new update_usb_device_state() helper
> function, centralizing logic and preparing for tracing.
>
> The second patch adds tracepoints for USB device allocation and state
> changes, providing better visibility into the device lifecycle.
>
> Signed-off-by: Kuen-Han Tsai <khtsai@xxxxxxxxxx>
> ---

For both patches:

Reviewed-by: Alan Stern <stern@xxxxxxxxxxxxxxxxxxx>


> Changes in v2:
> - hub.c: Changed the inline function to a standard one.
> - Makefile: Moved trace.o to the preceding line.
> - trace.h: Changed the speed and state into strings.
> - Link to v1: https://lore.kernel.org/r/20251013-usbcore-tracing-v1-0-b885a3121b09@xxxxxxxxxx
>
> ---
> Kuen-Han Tsai (2):
> usb: core: Centralize device state update logic
> usb: core: Add tracepoints for device allocation and state changes
>
> drivers/usb/core/Makefile | 5 +++-
> drivers/usb/core/hub.c | 30 +++++++++++++----------
> drivers/usb/core/trace.c | 6 +++++
> drivers/usb/core/trace.h | 61 +++++++++++++++++++++++++++++++++++++++++++++++
> drivers/usb/core/usb.c | 2 ++
> 5 files changed, 91 insertions(+), 13 deletions(-)
> ---
> base-commit: 5472d60c129f75282d94ae5ad072ee6dfb7c7246
> change-id: 20251012-usbcore-tracing-76f00c9b2b3e
>
> Best regards,
> --
> Kuen-Han Tsai <khtsai@xxxxxxxxxx>
>