Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

usb: udc: Add trace event for usb_gadget_set_state

While the userspace program can be notified of gadget state changes,
timing issue can lead to missed transitions when reading the state
value.

Introduce a trace event for usb_gadget_set_state to reliably track state
transitions.

Signed-off-by: Kuen-Han Tsai <khtsai@google.com>
Link: https://lore.kernel.org/r/20250818082722.2952867-1-khtsai@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Kuen-Han Tsai and committed by
Greg Kroah-Hartman
7bf11585 e77ee1d2

+6
+1
drivers/usb/gadget/udc/core.c
··· 1125 1125 { 1126 1126 gadget->state = state; 1127 1127 schedule_work(&gadget->work); 1128 + trace_usb_gadget_set_state(gadget, 0); 1128 1129 } 1129 1130 EXPORT_SYMBOL_GPL(usb_gadget_set_state); 1130 1131
+5
drivers/usb/gadget/udc/trace.h
··· 81 81 __entry->ret) 82 82 ); 83 83 84 + DEFINE_EVENT(udc_log_gadget, usb_gadget_set_state, 85 + TP_PROTO(struct usb_gadget *g, int ret), 86 + TP_ARGS(g, ret) 87 + ); 88 + 84 89 DEFINE_EVENT(udc_log_gadget, usb_gadget_frame_number, 85 90 TP_PROTO(struct usb_gadget *g, int ret), 86 91 TP_ARGS(g, ret)