diff mbox series

[8/8] usb: musb: trace: reduce buffer usage of trace event

Message ID 20230914100302.30274-9-quic_linyyuan@quicinc.com
State New
Headers show
Series usb: gadget: reduce usb gadget trace event buffer usage | expand

Commit Message

Linyu Yuan Sept. 14, 2023, 10:03 a.m. UTC
Save u32 member into trace event ring buffer and parse it for possible
bit information.

Use DECLARE_EVENT_CLASS_PRINT_INIT() related macro for output stage.

Signed-off-by: Linyu Yuan <quic_linyyuan@quicinc.com>
---
 drivers/usb/musb/musb_trace.h | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)
diff mbox series

Patch

diff --git a/drivers/usb/musb/musb_trace.h b/drivers/usb/musb/musb_trace.h
index f246b14394c4..8add5e81ed8d 100644
--- a/drivers/usb/musb/musb_trace.h
+++ b/drivers/usb/musb/musb_trace.h
@@ -233,7 +233,7 @@  DEFINE_EVENT(musb_urb, musb_urb_deq,
 	TP_ARGS(musb, urb)
 );
 
-DECLARE_EVENT_CLASS(musb_req,
+DECLARE_EVENT_CLASS_PRINT_INIT(musb_req,
 	TP_PROTO(struct musb_request *req),
 	TP_ARGS(req),
 	TP_STRUCT__entry(
@@ -243,9 +243,7 @@  DECLARE_EVENT_CLASS(musb_req,
 		__field(int, status)
 		__field(unsigned int, buf_len)
 		__field(unsigned int, actual_len)
-		__field(unsigned int, zero)
-		__field(unsigned int, short_not_ok)
-		__field(unsigned int, no_interrupt)
+		__field(u32, rdw1)
 	),
 	TP_fast_assign(
 		__entry->req = &req->request;
@@ -254,18 +252,20 @@  DECLARE_EVENT_CLASS(musb_req,
 		__entry->status = req->request.status;
 		__entry->buf_len = req->request.length;
 		__entry->actual_len = req->request.actual;
-		__entry->zero = req->request.zero;
-		__entry->short_not_ok = req->request.short_not_ok;
-		__entry->no_interrupt = req->request.no_interrupt;
+		__entry->rdw1 = req->request.dw1;
 	),
 	TP_printk("%p, ep%d %s, %s%s%s, len %d/%d, status %d",
 			__entry->req, __entry->epnum,
 			__entry->is_tx ? "tx/IN" : "rx/OUT",
-			__entry->zero ? "Z" : "z",
-			__entry->short_not_ok ? "S" : "s",
-			__entry->no_interrupt ? "I" : "i",
+			tr.zero ? "Z" : "z",
+			tr.short_not_ok ? "S" : "s",
+			tr.no_interrupt ? "I" : "i",
 			__entry->actual_len, __entry->buf_len,
 			__entry->status
+	),
+	TP_printk_init(
+		struct usb_request tr;
+		tr.dw1 = __entry->rdw1;
 	)
 );