usb: dwc3: trace: add a proper tracepoint for reg accessors
authorFelipe Balbi <felipe.balbi@linux.intel.com>
Fri, 30 Sep 2016 12:52:19 +0000 (15:52 +0300)
committerFelipe Balbi <felipe.balbi@linux.intel.com>
Thu, 3 Nov 2016 08:38:30 +0000 (10:38 +0200)
We want to reduce the usage of dwc3_trace() in favor
of proper tracepoints which can be enabled/disabled
by the user. Let's start with our register
accessors.

Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
drivers/usb/dwc3/io.h
drivers/usb/dwc3/trace.h

index a06f9a8..c69b066 100644 (file)
@@ -40,8 +40,7 @@ static inline u32 dwc3_readl(void __iomem *base, u32 offset)
         * documentation, so we revert it back to the proper addresses, the
         * same way they are described on SNPS documentation
         */
-       dwc3_trace(trace_dwc3_readl, "addr %p value %08x",
-                       base - DWC3_GLOBALS_REGS_START + offset, value);
+       trace_dwc3_readl(base - DWC3_GLOBALS_REGS_START, offset, value);
 
        return value;
 }
@@ -60,8 +59,7 @@ static inline void dwc3_writel(void __iomem *base, u32 offset, u32 value)
         * documentation, so we revert it back to the proper addresses, the
         * same way they are described on SNPS documentation
         */
-       dwc3_trace(trace_dwc3_writel, "addr %p value %08x",
-                       base - DWC3_GLOBALS_REGS_START + offset, value);
+       trace_dwc3_writel(base - DWC3_GLOBALS_REGS_START, offset, value);
 }
 
 #endif /* __DRIVERS_USB_DWC3_IO_H */
index 88ddd01..b2153f2 100644 (file)
@@ -37,29 +37,46 @@ DECLARE_EVENT_CLASS(dwc3_log_msg,
        TP_printk("%s", __get_str(msg))
 );
 
-DEFINE_EVENT(dwc3_log_msg, dwc3_readl,
+DEFINE_EVENT(dwc3_log_msg, dwc3_gadget,
        TP_PROTO(struct va_format *vaf),
        TP_ARGS(vaf)
 );
 
-DEFINE_EVENT(dwc3_log_msg, dwc3_writel,
+DEFINE_EVENT(dwc3_log_msg, dwc3_core,
        TP_PROTO(struct va_format *vaf),
        TP_ARGS(vaf)
 );
 
-DEFINE_EVENT(dwc3_log_msg, dwc3_gadget,
+DEFINE_EVENT(dwc3_log_msg, dwc3_ep0,
        TP_PROTO(struct va_format *vaf),
        TP_ARGS(vaf)
 );
 
-DEFINE_EVENT(dwc3_log_msg, dwc3_core,
-       TP_PROTO(struct va_format *vaf),
-       TP_ARGS(vaf)
+DECLARE_EVENT_CLASS(dwc3_log_io,
+       TP_PROTO(void *base, u32 offset, u32 value),
+       TP_ARGS(base, offset, value),
+       TP_STRUCT__entry(
+               __field(void *, base)
+               __field(u32, offset)
+               __field(u32, value)
+       ),
+       TP_fast_assign(
+               __entry->base = base;
+               __entry->offset = offset;
+               __entry->value = value;
+       ),
+       TP_printk("addr %p value %08x", __entry->base + __entry->offset,
+                       __entry->value)
 );
 
-DEFINE_EVENT(dwc3_log_msg, dwc3_ep0,
-       TP_PROTO(struct va_format *vaf),
-       TP_ARGS(vaf)
+DEFINE_EVENT(dwc3_log_io, dwc3_readl,
+       TP_PROTO(void *base, u32 offset, u32 value),
+       TP_ARGS(base, offset, value)
+);
+
+DEFINE_EVENT(dwc3_log_io, dwc3_writel,
+       TP_PROTO(void *base, u32 offset, u32 value),
+       TP_ARGS(base, offset, value)
 );
 
 DECLARE_EVENT_CLASS(dwc3_log_event,