diff options
author | Xenia Ragiadakou <burzalodowa@gmail.com> | 2013-08-06 00:52:48 -0400 |
---|---|---|
committer | Sarah Sharp <sarah.a.sharp@linux.intel.com> | 2013-08-13 19:05:46 -0400 |
commit | 63a23b9a7451660525c90b08219e14e701e294f1 (patch) | |
tree | 7452bc6169dbb35906bfdcd7801b69d9ccc47c86 /drivers | |
parent | 1d27fabec068a204186c6af10e05f23911c0c902 (diff) |
xhci: add xhci_cmd_completion trace event
This patch creates a new event class, called xhci_log_event,
and defines the xhci_cmd_completion trace event used for
tracing the commands issued to xHC that generate a completion
event in the event ring.
This info can be used, later, to print, in a human readable
way, the completion status and flags as well as the command's
type and fields using the trace-cmd tool and the appropriate
plugin.
Also, a tracepoint is added in handle_cmd_completion().
Signed-off-by: Xenia Ragiadakou <burzalodowa@gmail.com>
Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/usb/host/xhci-ring.c | 3 | ||||
-rw-r--r-- | drivers/usb/host/xhci-trace.h | 30 |
2 files changed, 33 insertions, 0 deletions
diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c index 3393ce755b15..86971ac5851b 100644 --- a/drivers/usb/host/xhci-ring.c +++ b/drivers/usb/host/xhci-ring.c | |||
@@ -1380,6 +1380,9 @@ static void handle_cmd_completion(struct xhci_hcd *xhci, | |||
1380 | return; | 1380 | return; |
1381 | } | 1381 | } |
1382 | 1382 | ||
1383 | trace_xhci_cmd_completion(&xhci->cmd_ring->dequeue->generic, | ||
1384 | (struct xhci_generic_trb *) event); | ||
1385 | |||
1383 | if ((GET_COMP_CODE(le32_to_cpu(event->status)) == COMP_CMD_ABORT) || | 1386 | if ((GET_COMP_CODE(le32_to_cpu(event->status)) == COMP_CMD_ABORT) || |
1384 | (GET_COMP_CODE(le32_to_cpu(event->status)) == COMP_CMD_STOP)) { | 1387 | (GET_COMP_CODE(le32_to_cpu(event->status)) == COMP_CMD_STOP)) { |
1385 | /* If the return value is 0, we think the trb pointed by | 1388 | /* If the return value is 0, we think the trb pointed by |
diff --git a/drivers/usb/host/xhci-trace.h b/drivers/usb/host/xhci-trace.h index c653ddfc0211..d6c222916858 100644 --- a/drivers/usb/host/xhci-trace.h +++ b/drivers/usb/host/xhci-trace.h | |||
@@ -93,6 +93,36 @@ DEFINE_EVENT(xhci_log_ctx, xhci_address_ctx, | |||
93 | TP_ARGS(xhci, ctx, ep_num) | 93 | TP_ARGS(xhci, ctx, ep_num) |
94 | ); | 94 | ); |
95 | 95 | ||
96 | DECLARE_EVENT_CLASS(xhci_log_event, | ||
97 | TP_PROTO(void *trb_va, struct xhci_generic_trb *ev), | ||
98 | TP_ARGS(trb_va, ev), | ||
99 | TP_STRUCT__entry( | ||
100 | __field(void *, va) | ||
101 | __field(u64, dma) | ||
102 | __field(u32, status) | ||
103 | __field(u32, flags) | ||
104 | __dynamic_array(__le32, trb, 4) | ||
105 | ), | ||
106 | TP_fast_assign( | ||
107 | __entry->va = trb_va; | ||
108 | __entry->dma = le64_to_cpu(((u64)ev->field[1]) << 32 | | ||
109 | ev->field[0]); | ||
110 | __entry->status = le32_to_cpu(ev->field[2]); | ||
111 | __entry->flags = le32_to_cpu(ev->field[3]); | ||
112 | memcpy(__get_dynamic_array(trb), trb_va, | ||
113 | sizeof(struct xhci_generic_trb)); | ||
114 | ), | ||
115 | TP_printk("\ntrb_dma=@%llx, trb_va=@%p, status=%08x, flags=%08x", | ||
116 | (unsigned long long) __entry->dma, __entry->va, | ||
117 | __entry->status, __entry->flags | ||
118 | ) | ||
119 | ); | ||
120 | |||
121 | DEFINE_EVENT(xhci_log_event, xhci_cmd_completion, | ||
122 | TP_PROTO(void *trb_va, struct xhci_generic_trb *ev), | ||
123 | TP_ARGS(trb_va, ev) | ||
124 | ); | ||
125 | |||
96 | #endif /* __XHCI_TRACE_H */ | 126 | #endif /* __XHCI_TRACE_H */ |
97 | 127 | ||
98 | /* this part must be outside header guard */ | 128 | /* this part must be outside header guard */ |