xhci: trace debug statements related to ring expansion
authorXenia Ragiadakou <burzalodowa@gmail.com>
Wed, 14 Aug 2013 03:33:56 +0000 (06:33 +0300)
committerSarah Sharp <sarah.a.sharp@linux.intel.com>
Wed, 14 Aug 2013 04:14:44 +0000 (21:14 -0700)
This patch defines a new trace event, which is called xhci_dbg_ring_expansion
and belongs to the event class xhci_log_msg, and adds tracepoints that trace
the debug messages associated with the expansion of endpoint ring when there
is not enough space allocated to hold all pending TRBs.

Signed-off-by: Xenia Ragiadakou <burzalodowa@gmail.com>
Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
drivers/usb/host/xhci-mem.c
drivers/usb/host/xhci-ring.c
drivers/usb/host/xhci-trace.h

index ef27470b99e318f9a8666edad52030e70a3fce8c..b150360d1e784936afbb3c5d28e2ca327c554a2d 100644 (file)
@@ -348,7 +348,8 @@ int xhci_ring_expansion(struct xhci_hcd *xhci, struct xhci_ring *ring,
                return -ENOMEM;
 
        xhci_link_rings(xhci, ring, first, last, num_segs);
-       xhci_dbg(xhci, "ring expansion succeed, now has %d segments\n",
+       xhci_dbg_trace(xhci, trace_xhci_dbg_ring_expansion,
+                       "ring expansion succeed, now has %d segments",
                        ring->num_segs);
 
        return 0;
index f908e205f7d561330805bc5a8e5f31eb7023c343..7b35af167e554ab1f9f3cf297d644427f25db6b7 100644 (file)
@@ -2904,8 +2904,8 @@ static int prepare_ring(struct xhci_hcd *xhci, struct xhci_ring *ep_ring,
                        return -ENOMEM;
                }
 
-               xhci_dbg(xhci, "ERROR no room on ep ring, "
-                                       "try ring expansion\n");
+               xhci_dbg_trace(xhci, trace_xhci_dbg_ring_expansion,
+                               "ERROR no room on ep ring, try ring expansion");
                num_trbs_needed = num_trbs - ep_ring->num_trbs_free;
                if (xhci_ring_expansion(xhci, ep_ring, num_trbs_needed,
                                        mem_flags)) {
index 11025fe6ebba29788ba82af75a804c84f5b4bbb0..20364cc8d2fb92d7e81f6ccdb50526cad2105608 100644 (file)
@@ -62,6 +62,11 @@ DEFINE_EVENT(xhci_log_msg, xhci_dbg_init,
        TP_ARGS(vaf)
 );
 
+DEFINE_EVENT(xhci_log_msg, xhci_dbg_ring_expansion,
+       TP_PROTO(struct va_format *vaf),
+       TP_ARGS(vaf)
+);
+
 DECLARE_EVENT_CLASS(xhci_log_ctx,
        TP_PROTO(struct xhci_hcd *xhci, struct xhci_container_ctx *ctx,
                 unsigned int ep_num),