]>
Commit | Line | Data |
---|---|---|
84a99f6f XR |
1 | /* |
2 | * xHCI host controller driver | |
3 | * | |
4 | * Copyright (C) 2013 Xenia Ragiadakou | |
5 | * | |
6 | * Author: Xenia Ragiadakou | |
7 | * Email : burzalodowa@gmail.com | |
8 | * | |
9 | * This program is free software; you can redistribute it and/or modify | |
10 | * it under the terms of the GNU General Public License version 2 as | |
11 | * published by the Free Software Foundation. | |
12 | */ | |
13 | ||
14 | #undef TRACE_SYSTEM | |
15 | #define TRACE_SYSTEM xhci-hcd | |
16 | ||
17 | #if !defined(__XHCI_TRACE_H) || defined(TRACE_HEADER_MULTI_READ) | |
18 | #define __XHCI_TRACE_H | |
19 | ||
20 | #include <linux/tracepoint.h> | |
1d27fabe | 21 | #include "xhci.h" |
84a99f6f XR |
22 | |
23 | #define XHCI_MSG_MAX 500 | |
24 | ||
25 | DECLARE_EVENT_CLASS(xhci_log_msg, | |
26 | TP_PROTO(struct va_format *vaf), | |
27 | TP_ARGS(vaf), | |
28 | TP_STRUCT__entry(__dynamic_array(char, msg, XHCI_MSG_MAX)), | |
29 | TP_fast_assign( | |
30 | vsnprintf(__get_str(msg), XHCI_MSG_MAX, vaf->fmt, *vaf->va); | |
31 | ), | |
32 | TP_printk("%s", __get_str(msg)) | |
33 | ); | |
34 | ||
35 | DEFINE_EVENT(xhci_log_msg, xhci_dbg_address, | |
36 | TP_PROTO(struct va_format *vaf), | |
37 | TP_ARGS(vaf) | |
38 | ); | |
39 | ||
3a7fa5be XR |
40 | DEFINE_EVENT(xhci_log_msg, xhci_dbg_context_change, |
41 | TP_PROTO(struct va_format *vaf), | |
42 | TP_ARGS(vaf) | |
43 | ); | |
44 | ||
4bdfe4c3 XR |
45 | DEFINE_EVENT(xhci_log_msg, xhci_dbg_quirks, |
46 | TP_PROTO(struct va_format *vaf), | |
47 | TP_ARGS(vaf) | |
48 | ); | |
49 | ||
a0254324 XR |
50 | DEFINE_EVENT(xhci_log_msg, xhci_dbg_reset_ep, |
51 | TP_PROTO(struct va_format *vaf), | |
52 | TP_ARGS(vaf) | |
53 | ); | |
54 | ||
aa50b290 XR |
55 | DEFINE_EVENT(xhci_log_msg, xhci_dbg_cancel_urb, |
56 | TP_PROTO(struct va_format *vaf), | |
57 | TP_ARGS(vaf) | |
58 | ); | |
59 | ||
d195fcff XR |
60 | DEFINE_EVENT(xhci_log_msg, xhci_dbg_init, |
61 | TP_PROTO(struct va_format *vaf), | |
62 | TP_ARGS(vaf) | |
63 | ); | |
64 | ||
1d27fabe XR |
65 | DECLARE_EVENT_CLASS(xhci_log_ctx, |
66 | TP_PROTO(struct xhci_hcd *xhci, struct xhci_container_ctx *ctx, | |
67 | unsigned int ep_num), | |
68 | TP_ARGS(xhci, ctx, ep_num), | |
69 | TP_STRUCT__entry( | |
70 | __field(int, ctx_64) | |
71 | __field(unsigned, ctx_type) | |
72 | __field(dma_addr_t, ctx_dma) | |
73 | __field(u8 *, ctx_va) | |
74 | __field(unsigned, ctx_ep_num) | |
75 | __field(int, slot_id) | |
76 | __dynamic_array(u32, ctx_data, | |
77 | ((HCC_64BYTE_CONTEXT(xhci->hcc_params) + 1) * 8) * | |
78 | ((ctx->type == XHCI_CTX_TYPE_INPUT) + ep_num + 1)) | |
79 | ), | |
80 | TP_fast_assign( | |
81 | struct usb_device *udev; | |
82 | ||
83 | udev = to_usb_device(xhci_to_hcd(xhci)->self.controller); | |
84 | __entry->ctx_64 = HCC_64BYTE_CONTEXT(xhci->hcc_params); | |
85 | __entry->ctx_type = ctx->type; | |
86 | __entry->ctx_dma = ctx->dma; | |
87 | __entry->ctx_va = ctx->bytes; | |
88 | __entry->slot_id = udev->slot_id; | |
89 | __entry->ctx_ep_num = ep_num; | |
90 | memcpy(__get_dynamic_array(ctx_data), ctx->bytes, | |
91 | ((HCC_64BYTE_CONTEXT(xhci->hcc_params) + 1) * 32) * | |
92 | ((ctx->type == XHCI_CTX_TYPE_INPUT) + ep_num + 1)); | |
93 | ), | |
94 | TP_printk("\nctx_64=%d, ctx_type=%u, ctx_dma=@%llx, ctx_va=@%p", | |
95 | __entry->ctx_64, __entry->ctx_type, | |
96 | (unsigned long long) __entry->ctx_dma, __entry->ctx_va | |
97 | ) | |
98 | ); | |
99 | ||
100 | DEFINE_EVENT(xhci_log_ctx, xhci_address_ctx, | |
101 | TP_PROTO(struct xhci_hcd *xhci, struct xhci_container_ctx *ctx, | |
102 | unsigned int ep_num), | |
103 | TP_ARGS(xhci, ctx, ep_num) | |
104 | ); | |
105 | ||
63a23b9a XR |
106 | DECLARE_EVENT_CLASS(xhci_log_event, |
107 | TP_PROTO(void *trb_va, struct xhci_generic_trb *ev), | |
108 | TP_ARGS(trb_va, ev), | |
109 | TP_STRUCT__entry( | |
110 | __field(void *, va) | |
111 | __field(u64, dma) | |
112 | __field(u32, status) | |
113 | __field(u32, flags) | |
114 | __dynamic_array(__le32, trb, 4) | |
115 | ), | |
116 | TP_fast_assign( | |
117 | __entry->va = trb_va; | |
118 | __entry->dma = le64_to_cpu(((u64)ev->field[1]) << 32 | | |
119 | ev->field[0]); | |
120 | __entry->status = le32_to_cpu(ev->field[2]); | |
121 | __entry->flags = le32_to_cpu(ev->field[3]); | |
122 | memcpy(__get_dynamic_array(trb), trb_va, | |
123 | sizeof(struct xhci_generic_trb)); | |
124 | ), | |
125 | TP_printk("\ntrb_dma=@%llx, trb_va=@%p, status=%08x, flags=%08x", | |
126 | (unsigned long long) __entry->dma, __entry->va, | |
127 | __entry->status, __entry->flags | |
128 | ) | |
129 | ); | |
130 | ||
131 | DEFINE_EVENT(xhci_log_event, xhci_cmd_completion, | |
132 | TP_PROTO(void *trb_va, struct xhci_generic_trb *ev), | |
133 | TP_ARGS(trb_va, ev) | |
134 | ); | |
135 | ||
84a99f6f XR |
136 | #endif /* __XHCI_TRACE_H */ |
137 | ||
138 | /* this part must be outside header guard */ | |
139 | ||
140 | #undef TRACE_INCLUDE_PATH | |
141 | #define TRACE_INCLUDE_PATH . | |
142 | ||
143 | #undef TRACE_INCLUDE_FILE | |
144 | #define TRACE_INCLUDE_FILE xhci-trace | |
145 | ||
146 | #include <trace/define_trace.h> |