2020#include "debug.h"
2121
2222DECLARE_EVENT_CLASS (dwc3_log_set_prtcap ,
23- TP_PROTO (u32 mode ),
24- TP_ARGS (mode ),
23+ TP_PROTO (struct dwc3 * dwc , u32 mode ),
24+ TP_ARGS (dwc , mode ),
2525 TP_STRUCT__entry (
26+ __field (phys_addr_t , base_address )
2627 __field (u32 , mode )
2728 ),
2829 TP_fast_assign (
30+ __entry -> base_address = dwc -> xhci_resources [0 ].start ;
2931 __entry -> mode = mode ;
3032 ),
31- TP_printk ("mode %s" , dwc3_mode_string (__entry -> mode ))
33+ TP_printk ("%pa: mode %s" , & __entry -> base_address , dwc3_mode_string (__entry -> mode ))
3234);
3335
3436DEFINE_EVENT (dwc3_log_set_prtcap , dwc3_set_prtcap ,
35- TP_PROTO (u32 mode ),
36- TP_ARGS (mode )
37+ TP_PROTO (struct dwc3 * dwc , u32 mode ),
38+ TP_ARGS (dwc , mode )
3739);
3840
3941DECLARE_EVENT_CLASS (dwc3_log_io ,
40- TP_PROTO (void * base , u32 offset , u32 value ),
41- TP_ARGS (base , offset , value ),
42+ TP_PROTO (struct dwc3 * dwc , void * base , u32 offset , u32 value ),
43+ TP_ARGS (dwc , base , offset , value ),
4244 TP_STRUCT__entry (
45+ __field (phys_addr_t , base_address )
4346 __field (void * , base )
4447 __field (u32 , offset )
4548 __field (u32 , value )
4649 ),
4750 TP_fast_assign (
51+ __entry -> base_address = dwc -> xhci_resources [0 ].start ;
4852 __entry -> base = base ;
4953 __entry -> offset = offset ;
5054 __entry -> value = value ;
5155 ),
52- TP_printk ("addr %p offset %04x value %08x" ,
56+ TP_printk ("%pa: addr %p offset %04x value %08x" ,
57+ & __entry -> base_address ,
5358 __entry -> base + __entry -> offset ,
5459 __entry -> offset ,
5560 __entry -> value )
5661);
5762
5863DEFINE_EVENT (dwc3_log_io , dwc3_readl ,
59- TP_PROTO (void __iomem * base , u32 offset , u32 value ),
60- TP_ARGS (base , offset , value )
64+ TP_PROTO (struct dwc3 * dwc , void __iomem * base , u32 offset , u32 value ),
65+ TP_ARGS (dwc , base , offset , value )
6166);
6267
6368DEFINE_EVENT (dwc3_log_io , dwc3_writel ,
64- TP_PROTO (void __iomem * base , u32 offset , u32 value ),
65- TP_ARGS (base , offset , value )
69+ TP_PROTO (struct dwc3 * dwc , void __iomem * base , u32 offset , u32 value ),
70+ TP_ARGS (dwc , base , offset , value )
6671);
6772
6873DECLARE_EVENT_CLASS (dwc3_log_event ,
6974 TP_PROTO (u32 event , struct dwc3 * dwc ),
7075 TP_ARGS (event , dwc ),
7176 TP_STRUCT__entry (
77+ __field (phys_addr_t , base_address )
7278 __field (u32 , event )
7379 __field (u32 , ep0state )
7480 ),
7581 TP_fast_assign (
82+ __entry -> base_address = dwc -> xhci_resources [0 ].start ;
7683 __entry -> event = event ;
7784 __entry -> ep0state = dwc -> ep0state ;
7885 ),
79- TP_printk ("event (%08x): %s" , __entry -> event ,
86+ TP_printk ("%pa: event (%08x): %s" , & __entry -> base_address , __entry -> event ,
8087 dwc3_decode_event (__get_buf (DWC3_MSG_MAX ), DWC3_MSG_MAX ,
8188 __entry -> event , __entry -> ep0state ))
8289);
@@ -87,38 +94,42 @@ DEFINE_EVENT(dwc3_log_event, dwc3_event,
8794);
8895
8996DECLARE_EVENT_CLASS (dwc3_log_ctrl ,
90- TP_PROTO (struct usb_ctrlrequest * ctrl ),
91- TP_ARGS (ctrl ),
97+ TP_PROTO (struct dwc3 * dwc , struct usb_ctrlrequest * ctrl ),
98+ TP_ARGS (dwc , ctrl ),
9299 TP_STRUCT__entry (
100+ __field (phys_addr_t , base_address )
93101 __field (__u8 , bRequestType )
94102 __field (__u8 , bRequest )
95103 __field (__u16 , wValue )
96104 __field (__u16 , wIndex )
97105 __field (__u16 , wLength )
98106 ),
99107 TP_fast_assign (
108+ __entry -> base_address = dwc -> xhci_resources [0 ].start ;
100109 __entry -> bRequestType = ctrl -> bRequestType ;
101110 __entry -> bRequest = ctrl -> bRequest ;
102111 __entry -> wValue = le16_to_cpu (ctrl -> wValue );
103112 __entry -> wIndex = le16_to_cpu (ctrl -> wIndex );
104113 __entry -> wLength = le16_to_cpu (ctrl -> wLength );
105114 ),
106- TP_printk ("%s" , usb_decode_ctrl (__get_buf (DWC3_MSG_MAX ), DWC3_MSG_MAX ,
115+ TP_printk ("%pa: %s" , & __entry -> base_address , usb_decode_ctrl (__get_buf (DWC3_MSG_MAX ),
116+ DWC3_MSG_MAX ,
107117 __entry -> bRequestType ,
108118 __entry -> bRequest , __entry -> wValue ,
109119 __entry -> wIndex , __entry -> wLength )
110120 )
111121);
112122
113123DEFINE_EVENT (dwc3_log_ctrl , dwc3_ctrl_req ,
114- TP_PROTO (struct usb_ctrlrequest * ctrl ),
115- TP_ARGS (ctrl )
124+ TP_PROTO (struct dwc3 * dwc , struct usb_ctrlrequest * ctrl ),
125+ TP_ARGS (dwc , ctrl )
116126);
117127
118128DECLARE_EVENT_CLASS (dwc3_log_request ,
119129 TP_PROTO (struct dwc3_request * req ),
120130 TP_ARGS (req ),
121131 TP_STRUCT__entry (
132+ __field (phys_addr_t , base_address )
122133 __string (name , req -> dep -> name )
123134 __field (struct dwc3_request * , req )
124135 __field (unsigned int , actual )
@@ -129,7 +140,7 @@ DECLARE_EVENT_CLASS(dwc3_log_request,
129140 __field (int , no_interrupt )
130141 ),
131142 TP_fast_assign (
132- __assign_str ( name ) ;
143+ __entry -> base_address = req -> dep -> dwc -> xhci_resources [ 0 ]. start ;
133144 __entry -> req = req ;
134145 __entry -> actual = req -> request .actual ;
135146 __entry -> length = req -> request .length ;
@@ -138,8 +149,10 @@ DECLARE_EVENT_CLASS(dwc3_log_request,
138149 __entry -> short_not_ok = req -> request .short_not_ok ;
139150 __entry -> no_interrupt = req -> request .no_interrupt ;
140151 ),
141- TP_printk ("%s: req %p length %u/%u %s%s%s ==> %d" ,
142- __get_str (name ), __entry -> req , __entry -> actual , __entry -> length ,
152+ TP_printk ("%pa: %s: req %p length %u/%u %s%s%s ==> %d" ,
153+ & __entry -> base_address ,
154+ __get_str (name ), __entry -> req ,
155+ __entry -> actual , __entry -> length ,
143156 __entry -> zero ? "Z" : "z" ,
144157 __entry -> short_not_ok ? "S" : "s" ,
145158 __entry -> no_interrupt ? "i" : "I" ,
@@ -173,35 +186,38 @@ DEFINE_EVENT(dwc3_log_request, dwc3_gadget_giveback,
173186);
174187
175188DECLARE_EVENT_CLASS (dwc3_log_generic_cmd ,
176- TP_PROTO (unsigned int cmd , u32 param , int status ),
177- TP_ARGS (cmd , param , status ),
189+ TP_PROTO (struct dwc3 * dwc , unsigned int cmd , u32 param , int status ),
190+ TP_ARGS (dwc , cmd , param , status ),
178191 TP_STRUCT__entry (
192+ __field (phys_addr_t , base_address )
179193 __field (unsigned int , cmd )
180194 __field (u32 , param )
181195 __field (int , status )
182196 ),
183197 TP_fast_assign (
198+ __entry -> base_address = dwc -> xhci_resources [0 ].start ;
184199 __entry -> cmd = cmd ;
185200 __entry -> param = param ;
186201 __entry -> status = status ;
187202 ),
188- TP_printk ("cmd '%s' [%x] param %08x --> status: %s" ,
189- dwc3_gadget_generic_cmd_string (__entry -> cmd ),
203+ TP_printk ("%pa: cmd '%s' [%x] param %08x --> status: %s" ,
204+ & __entry -> base_address , dwc3_gadget_generic_cmd_string (__entry -> cmd ),
190205 __entry -> cmd , __entry -> param ,
191206 dwc3_gadget_generic_cmd_status_string (__entry -> status )
192207 )
193208);
194209
195210DEFINE_EVENT (dwc3_log_generic_cmd , dwc3_gadget_generic_cmd ,
196- TP_PROTO (unsigned int cmd , u32 param , int status ),
197- TP_ARGS (cmd , param , status )
211+ TP_PROTO (struct dwc3 * dwc , unsigned int cmd , u32 param , int status ),
212+ TP_ARGS (dwc , cmd , param , status )
198213);
199214
200215DECLARE_EVENT_CLASS (dwc3_log_gadget_ep_cmd ,
201216 TP_PROTO (struct dwc3_ep * dep , unsigned int cmd ,
202217 struct dwc3_gadget_ep_cmd_params * params , int cmd_status ),
203218 TP_ARGS (dep , cmd , params , cmd_status ),
204219 TP_STRUCT__entry (
220+ __field (phys_addr_t , base_address )
205221 __string (name , dep -> name )
206222 __field (unsigned int , cmd )
207223 __field (u32 , param0 )
@@ -210,15 +226,17 @@ DECLARE_EVENT_CLASS(dwc3_log_gadget_ep_cmd,
210226 __field (int , cmd_status )
211227 ),
212228 TP_fast_assign (
229+ __entry -> base_address = dep -> dwc -> xhci_resources [0 ].start ;
213230 __assign_str (name );
214231 __entry -> cmd = cmd ;
215232 __entry -> param0 = params -> param0 ;
216233 __entry -> param1 = params -> param1 ;
217234 __entry -> param2 = params -> param2 ;
218235 __entry -> cmd_status = cmd_status ;
219236 ),
220- TP_printk ("%s: cmd '%s' [%x] params %08x %08x %08x --> status: %s" ,
221- __get_str (name ), dwc3_gadget_ep_cmd_string (__entry -> cmd ),
237+ TP_printk ("%pa: %s: cmd '%s' [%x] params %08x %08x %08x --> status: %s" ,
238+ & __entry -> base_address , __get_str (name ),
239+ dwc3_gadget_ep_cmd_string (__entry -> cmd ),
222240 __entry -> cmd , __entry -> param0 ,
223241 __entry -> param1 , __entry -> param2 ,
224242 dwc3_ep_cmd_status_string (__entry -> cmd_status )
@@ -235,6 +253,7 @@ DECLARE_EVENT_CLASS(dwc3_log_trb,
235253 TP_PROTO (struct dwc3_ep * dep , struct dwc3_trb * trb ),
236254 TP_ARGS (dep , trb ),
237255 TP_STRUCT__entry (
256+ __field (phys_addr_t , base_address )
238257 __string (name , dep -> name )
239258 __field (struct dwc3_trb * , trb )
240259 __field (u32 , bpl )
@@ -246,6 +265,7 @@ DECLARE_EVENT_CLASS(dwc3_log_trb,
246265 __field (u32 , dequeue )
247266 ),
248267 TP_fast_assign (
268+ __entry -> base_address = dep -> dwc -> xhci_resources [0 ].start ;
249269 __assign_str (name );
250270 __entry -> trb = trb ;
251271 __entry -> bpl = trb -> bpl ;
@@ -256,8 +276,8 @@ DECLARE_EVENT_CLASS(dwc3_log_trb,
256276 __entry -> enqueue = dep -> trb_enqueue ;
257277 __entry -> dequeue = dep -> trb_dequeue ;
258278 ),
259- TP_printk ("%s: trb %p (E%d:D%d) buf %08x%08x size %s%d ctrl %08x sofn %08x (%c%c%c%c:%c%c:%s)" ,
260- __get_str (name ), __entry -> trb , __entry -> enqueue ,
279+ TP_printk ("%pa: % s: trb %p (E%d:D%d) buf %08x%08x size %s%d ctrl %08x sofn %08x (%c%c%c%c:%c%c:%s)" ,
280+ & __entry -> base_address , __get_str (name ), __entry -> trb , __entry -> enqueue ,
261281 __entry -> dequeue , __entry -> bph , __entry -> bpl ,
262282 ({char * s ;
263283 int pcm = ((__entry -> size >> 24 ) & 3 ) + 1 ;
@@ -307,6 +327,7 @@ DECLARE_EVENT_CLASS(dwc3_log_ep,
307327 TP_PROTO (struct dwc3_ep * dep ),
308328 TP_ARGS (dep ),
309329 TP_STRUCT__entry (
330+ __field (phys_addr_t , base_address )
310331 __string (name , dep -> name )
311332 __field (unsigned int , maxpacket )
312333 __field (unsigned int , maxpacket_limit )
@@ -318,6 +339,7 @@ DECLARE_EVENT_CLASS(dwc3_log_ep,
318339 __field (u8 , trb_dequeue )
319340 ),
320341 TP_fast_assign (
342+ __entry -> base_address = dep -> dwc -> xhci_resources [0 ].start ;
321343 __assign_str (name );
322344 __entry -> maxpacket = dep -> endpoint .maxpacket ;
323345 __entry -> maxpacket_limit = dep -> endpoint .maxpacket_limit ;
@@ -328,8 +350,8 @@ DECLARE_EVENT_CLASS(dwc3_log_ep,
328350 __entry -> trb_enqueue = dep -> trb_enqueue ;
329351 __entry -> trb_dequeue = dep -> trb_dequeue ;
330352 ),
331- TP_printk ("%s: mps %d/%d streams %d burst %d ring %d/%d flags %c:%c%c%c%c:%c" ,
332- __get_str (name ), __entry -> maxpacket ,
353+ TP_printk ("%pa: % s: mps %d/%d streams %d burst %d ring %d/%d flags %c:%c%c%c%c:%c" ,
354+ & __entry -> base_address , __get_str (name ), __entry -> maxpacket ,
333355 __entry -> maxpacket_limit , __entry -> max_streams ,
334356 __entry -> maxburst , __entry -> trb_enqueue ,
335357 __entry -> trb_dequeue ,
0 commit comments