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>
This commit is contained in:
parent
e77ee1d2a8
commit
7bf1158514
@ -1125,6 +1125,7 @@ void usb_gadget_set_state(struct usb_gadget *gadget,
|
||||
{
|
||||
gadget->state = state;
|
||||
schedule_work(&gadget->work);
|
||||
trace_usb_gadget_set_state(gadget, 0);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(usb_gadget_set_state);
|
||||
|
||||
|
||||
@ -81,6 +81,11 @@ DECLARE_EVENT_CLASS(udc_log_gadget,
|
||||
__entry->ret)
|
||||
);
|
||||
|
||||
DEFINE_EVENT(udc_log_gadget, usb_gadget_set_state,
|
||||
TP_PROTO(struct usb_gadget *g, int ret),
|
||||
TP_ARGS(g, ret)
|
||||
);
|
||||
|
||||
DEFINE_EVENT(udc_log_gadget, usb_gadget_frame_number,
|
||||
TP_PROTO(struct usb_gadget *g, int ret),
|
||||
TP_ARGS(g, ret)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user