Nishad Kamdar | b33f69f | 2020-03-28 15:34:46 +0530 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
Aditya Srivastava | 27088e00 | 2021-03-29 19:21:08 +0530 | [diff] [blame] | 2 | /* |
Felipe Balbi | 2c4cbe6e5 | 2014-04-30 17:45:10 -0500 | [diff] [blame] | 3 | * trace.h - DesignWare USB3 DRD Controller Trace Support |
| 4 | * |
Alexander A. Klimov | 10623b8 | 2020-07-11 15:58:04 +0200 | [diff] [blame] | 5 | * Copyright (C) 2014 Texas Instruments Incorporated - https://www.ti.com |
Felipe Balbi | 2c4cbe6e5 | 2014-04-30 17:45:10 -0500 | [diff] [blame] | 6 | * |
| 7 | * Author: Felipe Balbi <balbi@ti.com> |
Felipe Balbi | 2c4cbe6e5 | 2014-04-30 17:45:10 -0500 | [diff] [blame] | 8 | */ |
| 9 | |
| 10 | #undef TRACE_SYSTEM |
| 11 | #define TRACE_SYSTEM dwc3 |
| 12 | |
| 13 | #if !defined(__DWC3_TRACE_H) || defined(TRACE_HEADER_MULTI_READ) |
| 14 | #define __DWC3_TRACE_H |
| 15 | |
| 16 | #include <linux/types.h> |
| 17 | #include <linux/tracepoint.h> |
| 18 | #include <asm/byteorder.h> |
| 19 | #include "core.h" |
| 20 | #include "debug.h" |
| 21 | |
Felipe Balbi | 4dd5a69 | 2016-09-30 15:52:19 +0300 | [diff] [blame] | 22 | DECLARE_EVENT_CLASS(dwc3_log_io, |
| 23 | TP_PROTO(void *base, u32 offset, u32 value), |
| 24 | TP_ARGS(base, offset, value), |
| 25 | TP_STRUCT__entry( |
| 26 | __field(void *, base) |
| 27 | __field(u32, offset) |
| 28 | __field(u32, value) |
| 29 | ), |
| 30 | TP_fast_assign( |
| 31 | __entry->base = base; |
| 32 | __entry->offset = offset; |
| 33 | __entry->value = value; |
| 34 | ), |
Thinh Nguyen | 3fc63d0 | 2021-03-24 18:53:26 -0700 | [diff] [blame] | 35 | TP_printk("addr %p offset %04x value %08x", |
| 36 | __entry->base + __entry->offset, |
| 37 | __entry->offset, |
| 38 | __entry->value) |
Felipe Balbi | 4dd5a69 | 2016-09-30 15:52:19 +0300 | [diff] [blame] | 39 | ); |
| 40 | |
| 41 | DEFINE_EVENT(dwc3_log_io, dwc3_readl, |
Vincent Pelletier | 204ec1a | 2017-12-01 00:16:31 +0000 | [diff] [blame] | 42 | TP_PROTO(void __iomem *base, u32 offset, u32 value), |
Felipe Balbi | 4dd5a69 | 2016-09-30 15:52:19 +0300 | [diff] [blame] | 43 | TP_ARGS(base, offset, value) |
| 44 | ); |
| 45 | |
| 46 | DEFINE_EVENT(dwc3_log_io, dwc3_writel, |
Vincent Pelletier | 204ec1a | 2017-12-01 00:16:31 +0000 | [diff] [blame] | 47 | TP_PROTO(void __iomem *base, u32 offset, u32 value), |
Felipe Balbi | 4dd5a69 | 2016-09-30 15:52:19 +0300 | [diff] [blame] | 48 | TP_ARGS(base, offset, value) |
| 49 | ); |
| 50 | |
Felipe Balbi | 2c4cbe6e5 | 2014-04-30 17:45:10 -0500 | [diff] [blame] | 51 | DECLARE_EVENT_CLASS(dwc3_log_event, |
Felipe Balbi | 43c96be | 2016-09-26 13:23:34 +0300 | [diff] [blame] | 52 | TP_PROTO(u32 event, struct dwc3 *dwc), |
| 53 | TP_ARGS(event, dwc), |
Felipe Balbi | 2c4cbe6e5 | 2014-04-30 17:45:10 -0500 | [diff] [blame] | 54 | TP_STRUCT__entry( |
| 55 | __field(u32, event) |
Felipe Balbi | 43c96be | 2016-09-26 13:23:34 +0300 | [diff] [blame] | 56 | __field(u32, ep0state) |
Felipe Balbi | 3587f36 | 2017-04-28 11:28:35 +0300 | [diff] [blame] | 57 | __dynamic_array(char, str, DWC3_MSG_MAX) |
Felipe Balbi | 2c4cbe6e5 | 2014-04-30 17:45:10 -0500 | [diff] [blame] | 58 | ), |
| 59 | TP_fast_assign( |
| 60 | __entry->event = event; |
Felipe Balbi | 43c96be | 2016-09-26 13:23:34 +0300 | [diff] [blame] | 61 | __entry->ep0state = dwc->ep0state; |
Felipe Balbi | 2c4cbe6e5 | 2014-04-30 17:45:10 -0500 | [diff] [blame] | 62 | ), |
Felipe Balbi | f75cacc | 2016-05-23 11:10:08 +0300 | [diff] [blame] | 63 | TP_printk("event (%08x): %s", __entry->event, |
Felipe Balbi | 7790b35 | 2019-02-04 15:43:38 +0200 | [diff] [blame] | 64 | dwc3_decode_event(__get_str(str), DWC3_MSG_MAX, |
| 65 | __entry->event, __entry->ep0state)) |
Felipe Balbi | 2c4cbe6e5 | 2014-04-30 17:45:10 -0500 | [diff] [blame] | 66 | ); |
| 67 | |
| 68 | DEFINE_EVENT(dwc3_log_event, dwc3_event, |
Felipe Balbi | 43c96be | 2016-09-26 13:23:34 +0300 | [diff] [blame] | 69 | TP_PROTO(u32 event, struct dwc3 *dwc), |
| 70 | TP_ARGS(event, dwc) |
Felipe Balbi | 2c4cbe6e5 | 2014-04-30 17:45:10 -0500 | [diff] [blame] | 71 | ); |
| 72 | |
| 73 | DECLARE_EVENT_CLASS(dwc3_log_ctrl, |
| 74 | TP_PROTO(struct usb_ctrlrequest *ctrl), |
| 75 | TP_ARGS(ctrl), |
| 76 | TP_STRUCT__entry( |
Felipe Balbi | 4ac4fc9 | 2014-09-17 16:28:38 -0500 | [diff] [blame] | 77 | __field(__u8, bRequestType) |
| 78 | __field(__u8, bRequest) |
John Youn | 96bedb6 | 2016-05-23 11:32:47 -0700 | [diff] [blame] | 79 | __field(__u16, wValue) |
| 80 | __field(__u16, wIndex) |
| 81 | __field(__u16, wLength) |
Felipe Balbi | af32423 | 2017-04-26 16:09:09 +0300 | [diff] [blame] | 82 | __dynamic_array(char, str, DWC3_MSG_MAX) |
Felipe Balbi | 2c4cbe6e5 | 2014-04-30 17:45:10 -0500 | [diff] [blame] | 83 | ), |
| 84 | TP_fast_assign( |
Felipe Balbi | 4ac4fc9 | 2014-09-17 16:28:38 -0500 | [diff] [blame] | 85 | __entry->bRequestType = ctrl->bRequestType; |
| 86 | __entry->bRequest = ctrl->bRequest; |
John Youn | 96bedb6 | 2016-05-23 11:32:47 -0700 | [diff] [blame] | 87 | __entry->wValue = le16_to_cpu(ctrl->wValue); |
| 88 | __entry->wIndex = le16_to_cpu(ctrl->wIndex); |
| 89 | __entry->wLength = le16_to_cpu(ctrl->wLength); |
Felipe Balbi | 2c4cbe6e5 | 2014-04-30 17:45:10 -0500 | [diff] [blame] | 90 | ), |
Pawel Laszczak | 91f255a | 2019-08-26 12:19:27 +0100 | [diff] [blame] | 91 | TP_printk("%s", usb_decode_ctrl(__get_str(str), DWC3_MSG_MAX, |
Felipe Balbi | 7790b35 | 2019-02-04 15:43:38 +0200 | [diff] [blame] | 92 | __entry->bRequestType, |
Felipe Balbi | af32423 | 2017-04-26 16:09:09 +0300 | [diff] [blame] | 93 | __entry->bRequest, __entry->wValue, |
| 94 | __entry->wIndex, __entry->wLength) |
Felipe Balbi | 2c4cbe6e5 | 2014-04-30 17:45:10 -0500 | [diff] [blame] | 95 | ) |
| 96 | ); |
| 97 | |
| 98 | DEFINE_EVENT(dwc3_log_ctrl, dwc3_ctrl_req, |
| 99 | TP_PROTO(struct usb_ctrlrequest *ctrl), |
| 100 | TP_ARGS(ctrl) |
| 101 | ); |
| 102 | |
| 103 | DECLARE_EVENT_CLASS(dwc3_log_request, |
| 104 | TP_PROTO(struct dwc3_request *req), |
| 105 | TP_ARGS(req), |
| 106 | TP_STRUCT__entry( |
Felipe Balbi | e42f09b | 2017-04-28 12:54:52 +0300 | [diff] [blame] | 107 | __string(name, req->dep->name) |
Felipe Balbi | 2c4cbe6e5 | 2014-04-30 17:45:10 -0500 | [diff] [blame] | 108 | __field(struct dwc3_request *, req) |
Felipe Balbi | 159fdf2 | 2020-08-13 08:32:00 +0300 | [diff] [blame] | 109 | __field(unsigned int, actual) |
| 110 | __field(unsigned int, length) |
Felipe Balbi | 4ac4fc9 | 2014-09-17 16:28:38 -0500 | [diff] [blame] | 111 | __field(int, status) |
Felipe Balbi | 46a0142 | 2015-12-03 15:27:32 -0600 | [diff] [blame] | 112 | __field(int, zero) |
| 113 | __field(int, short_not_ok) |
| 114 | __field(int, no_interrupt) |
Felipe Balbi | 2c4cbe6e5 | 2014-04-30 17:45:10 -0500 | [diff] [blame] | 115 | ), |
| 116 | TP_fast_assign( |
Felipe Balbi | e42f09b | 2017-04-28 12:54:52 +0300 | [diff] [blame] | 117 | __assign_str(name, req->dep->name); |
Felipe Balbi | 2c4cbe6e5 | 2014-04-30 17:45:10 -0500 | [diff] [blame] | 118 | __entry->req = req; |
Felipe Balbi | 4ac4fc9 | 2014-09-17 16:28:38 -0500 | [diff] [blame] | 119 | __entry->actual = req->request.actual; |
| 120 | __entry->length = req->request.length; |
| 121 | __entry->status = req->request.status; |
Felipe Balbi | 46a0142 | 2015-12-03 15:27:32 -0600 | [diff] [blame] | 122 | __entry->zero = req->request.zero; |
| 123 | __entry->short_not_ok = req->request.short_not_ok; |
| 124 | __entry->no_interrupt = req->request.no_interrupt; |
Felipe Balbi | 2c4cbe6e5 | 2014-04-30 17:45:10 -0500 | [diff] [blame] | 125 | ), |
Felipe Balbi | 46a0142 | 2015-12-03 15:27:32 -0600 | [diff] [blame] | 126 | TP_printk("%s: req %p length %u/%u %s%s%s ==> %d", |
Felipe Balbi | 4ac4fc9 | 2014-09-17 16:28:38 -0500 | [diff] [blame] | 127 | __get_str(name), __entry->req, __entry->actual, __entry->length, |
Felipe Balbi | 46a0142 | 2015-12-03 15:27:32 -0600 | [diff] [blame] | 128 | __entry->zero ? "Z" : "z", |
| 129 | __entry->short_not_ok ? "S" : "s", |
| 130 | __entry->no_interrupt ? "i" : "I", |
Felipe Balbi | 4ac4fc9 | 2014-09-17 16:28:38 -0500 | [diff] [blame] | 131 | __entry->status |
Felipe Balbi | 2c4cbe6e5 | 2014-04-30 17:45:10 -0500 | [diff] [blame] | 132 | ) |
| 133 | ); |
| 134 | |
| 135 | DEFINE_EVENT(dwc3_log_request, dwc3_alloc_request, |
| 136 | TP_PROTO(struct dwc3_request *req), |
| 137 | TP_ARGS(req) |
| 138 | ); |
| 139 | |
| 140 | DEFINE_EVENT(dwc3_log_request, dwc3_free_request, |
| 141 | TP_PROTO(struct dwc3_request *req), |
| 142 | TP_ARGS(req) |
| 143 | ); |
| 144 | |
| 145 | DEFINE_EVENT(dwc3_log_request, dwc3_ep_queue, |
| 146 | TP_PROTO(struct dwc3_request *req), |
| 147 | TP_ARGS(req) |
| 148 | ); |
| 149 | |
| 150 | DEFINE_EVENT(dwc3_log_request, dwc3_ep_dequeue, |
| 151 | TP_PROTO(struct dwc3_request *req), |
| 152 | TP_ARGS(req) |
| 153 | ); |
| 154 | |
| 155 | DEFINE_EVENT(dwc3_log_request, dwc3_gadget_giveback, |
| 156 | TP_PROTO(struct dwc3_request *req), |
| 157 | TP_ARGS(req) |
| 158 | ); |
| 159 | |
| 160 | DECLARE_EVENT_CLASS(dwc3_log_generic_cmd, |
Felipe Balbi | 71f7e70 | 2016-05-23 14:16:19 +0300 | [diff] [blame] | 161 | TP_PROTO(unsigned int cmd, u32 param, int status), |
| 162 | TP_ARGS(cmd, param, status), |
Felipe Balbi | 2c4cbe6e5 | 2014-04-30 17:45:10 -0500 | [diff] [blame] | 163 | TP_STRUCT__entry( |
| 164 | __field(unsigned int, cmd) |
| 165 | __field(u32, param) |
Felipe Balbi | 71f7e70 | 2016-05-23 14:16:19 +0300 | [diff] [blame] | 166 | __field(int, status) |
Felipe Balbi | 2c4cbe6e5 | 2014-04-30 17:45:10 -0500 | [diff] [blame] | 167 | ), |
| 168 | TP_fast_assign( |
| 169 | __entry->cmd = cmd; |
| 170 | __entry->param = param; |
Felipe Balbi | 71f7e70 | 2016-05-23 14:16:19 +0300 | [diff] [blame] | 171 | __entry->status = status; |
Felipe Balbi | 2c4cbe6e5 | 2014-04-30 17:45:10 -0500 | [diff] [blame] | 172 | ), |
Felipe Balbi | aad7c25 | 2017-03-22 13:03:13 +0200 | [diff] [blame] | 173 | TP_printk("cmd '%s' [%x] param %08x --> status: %s", |
Felipe Balbi | 2c4cbe6e5 | 2014-04-30 17:45:10 -0500 | [diff] [blame] | 174 | dwc3_gadget_generic_cmd_string(__entry->cmd), |
Felipe Balbi | 71f7e70 | 2016-05-23 14:16:19 +0300 | [diff] [blame] | 175 | __entry->cmd, __entry->param, |
| 176 | dwc3_gadget_generic_cmd_status_string(__entry->status) |
Felipe Balbi | 2c4cbe6e5 | 2014-04-30 17:45:10 -0500 | [diff] [blame] | 177 | ) |
| 178 | ); |
| 179 | |
| 180 | DEFINE_EVENT(dwc3_log_generic_cmd, dwc3_gadget_generic_cmd, |
Felipe Balbi | 71f7e70 | 2016-05-23 14:16:19 +0300 | [diff] [blame] | 181 | TP_PROTO(unsigned int cmd, u32 param, int status), |
| 182 | TP_ARGS(cmd, param, status) |
Felipe Balbi | 2c4cbe6e5 | 2014-04-30 17:45:10 -0500 | [diff] [blame] | 183 | ); |
| 184 | |
| 185 | DECLARE_EVENT_CLASS(dwc3_log_gadget_ep_cmd, |
| 186 | TP_PROTO(struct dwc3_ep *dep, unsigned int cmd, |
Felipe Balbi | 0933df1 | 2016-05-23 14:02:33 +0300 | [diff] [blame] | 187 | struct dwc3_gadget_ep_cmd_params *params, int cmd_status), |
| 188 | TP_ARGS(dep, cmd, params, cmd_status), |
Felipe Balbi | 2c4cbe6e5 | 2014-04-30 17:45:10 -0500 | [diff] [blame] | 189 | TP_STRUCT__entry( |
Felipe Balbi | e42f09b | 2017-04-28 12:54:52 +0300 | [diff] [blame] | 190 | __string(name, dep->name) |
Felipe Balbi | 2c4cbe6e5 | 2014-04-30 17:45:10 -0500 | [diff] [blame] | 191 | __field(unsigned int, cmd) |
Felipe Balbi | a4722fd3 | 2014-11-20 10:12:32 -0600 | [diff] [blame] | 192 | __field(u32, param0) |
| 193 | __field(u32, param1) |
| 194 | __field(u32, param2) |
Felipe Balbi | 0933df1 | 2016-05-23 14:02:33 +0300 | [diff] [blame] | 195 | __field(int, cmd_status) |
Felipe Balbi | 2c4cbe6e5 | 2014-04-30 17:45:10 -0500 | [diff] [blame] | 196 | ), |
| 197 | TP_fast_assign( |
Felipe Balbi | e42f09b | 2017-04-28 12:54:52 +0300 | [diff] [blame] | 198 | __assign_str(name, dep->name); |
Felipe Balbi | 2c4cbe6e5 | 2014-04-30 17:45:10 -0500 | [diff] [blame] | 199 | __entry->cmd = cmd; |
Felipe Balbi | a4722fd3 | 2014-11-20 10:12:32 -0600 | [diff] [blame] | 200 | __entry->param0 = params->param0; |
| 201 | __entry->param1 = params->param1; |
| 202 | __entry->param2 = params->param2; |
Felipe Balbi | 0933df1 | 2016-05-23 14:02:33 +0300 | [diff] [blame] | 203 | __entry->cmd_status = cmd_status; |
Felipe Balbi | 2c4cbe6e5 | 2014-04-30 17:45:10 -0500 | [diff] [blame] | 204 | ), |
Felipe Balbi | 1517265 | 2018-08-15 08:30:59 +0300 | [diff] [blame] | 205 | TP_printk("%s: cmd '%s' [%x] params %08x %08x %08x --> status: %s", |
Felipe Balbi | 4ac4fc9 | 2014-09-17 16:28:38 -0500 | [diff] [blame] | 206 | __get_str(name), dwc3_gadget_ep_cmd_string(__entry->cmd), |
Felipe Balbi | a4722fd3 | 2014-11-20 10:12:32 -0600 | [diff] [blame] | 207 | __entry->cmd, __entry->param0, |
Felipe Balbi | 0933df1 | 2016-05-23 14:02:33 +0300 | [diff] [blame] | 208 | __entry->param1, __entry->param2, |
| 209 | dwc3_ep_cmd_status_string(__entry->cmd_status) |
Felipe Balbi | 2c4cbe6e5 | 2014-04-30 17:45:10 -0500 | [diff] [blame] | 210 | ) |
| 211 | ); |
| 212 | |
| 213 | DEFINE_EVENT(dwc3_log_gadget_ep_cmd, dwc3_gadget_ep_cmd, |
| 214 | TP_PROTO(struct dwc3_ep *dep, unsigned int cmd, |
Felipe Balbi | 0933df1 | 2016-05-23 14:02:33 +0300 | [diff] [blame] | 215 | struct dwc3_gadget_ep_cmd_params *params, int cmd_status), |
| 216 | TP_ARGS(dep, cmd, params, cmd_status) |
Felipe Balbi | 2c4cbe6e5 | 2014-04-30 17:45:10 -0500 | [diff] [blame] | 217 | ); |
| 218 | |
| 219 | DECLARE_EVENT_CLASS(dwc3_log_trb, |
| 220 | TP_PROTO(struct dwc3_ep *dep, struct dwc3_trb *trb), |
| 221 | TP_ARGS(dep, trb), |
| 222 | TP_STRUCT__entry( |
Felipe Balbi | e42f09b | 2017-04-28 12:54:52 +0300 | [diff] [blame] | 223 | __string(name, dep->name) |
Felipe Balbi | 2c4cbe6e5 | 2014-04-30 17:45:10 -0500 | [diff] [blame] | 224 | __field(struct dwc3_trb *, trb) |
Felipe Balbi | 4ac4fc9 | 2014-09-17 16:28:38 -0500 | [diff] [blame] | 225 | __field(u32, bpl) |
| 226 | __field(u32, bph) |
| 227 | __field(u32, size) |
| 228 | __field(u32, ctrl) |
Felipe Balbi | fa8d965 | 2016-09-28 14:58:33 +0300 | [diff] [blame] | 229 | __field(u32, type) |
Felipe Balbi | 30ad627 | 2020-01-29 09:20:19 +0200 | [diff] [blame] | 230 | __field(u32, enqueue) |
| 231 | __field(u32, dequeue) |
Felipe Balbi | 2c4cbe6e5 | 2014-04-30 17:45:10 -0500 | [diff] [blame] | 232 | ), |
| 233 | TP_fast_assign( |
Felipe Balbi | e42f09b | 2017-04-28 12:54:52 +0300 | [diff] [blame] | 234 | __assign_str(name, dep->name); |
Felipe Balbi | 2c4cbe6e5 | 2014-04-30 17:45:10 -0500 | [diff] [blame] | 235 | __entry->trb = trb; |
Felipe Balbi | 4ac4fc9 | 2014-09-17 16:28:38 -0500 | [diff] [blame] | 236 | __entry->bpl = trb->bpl; |
| 237 | __entry->bph = trb->bph; |
| 238 | __entry->size = trb->size; |
| 239 | __entry->ctrl = trb->ctrl; |
Felipe Balbi | fa8d965 | 2016-09-28 14:58:33 +0300 | [diff] [blame] | 240 | __entry->type = usb_endpoint_type(dep->endpoint.desc); |
Felipe Balbi | 30ad627 | 2020-01-29 09:20:19 +0200 | [diff] [blame] | 241 | __entry->enqueue = dep->trb_enqueue; |
| 242 | __entry->dequeue = dep->trb_dequeue; |
Felipe Balbi | 2c4cbe6e5 | 2014-04-30 17:45:10 -0500 | [diff] [blame] | 243 | ), |
Felipe Balbi | 30ad627 | 2020-01-29 09:20:19 +0200 | [diff] [blame] | 244 | TP_printk("%s: trb %p (E%d:D%d) buf %08x%08x size %s%d ctrl %08x (%c%c%c%c:%c%c:%s)", |
| 245 | __get_str(name), __entry->trb, __entry->enqueue, |
| 246 | __entry->dequeue, __entry->bph, __entry->bpl, |
Felipe Balbi | fa8d965 | 2016-09-28 14:58:33 +0300 | [diff] [blame] | 247 | ({char *s; |
| 248 | int pcm = ((__entry->size >> 24) & 3) + 1; |
Felipe Balbi | 159fdf2 | 2020-08-13 08:32:00 +0300 | [diff] [blame] | 249 | |
Felipe Balbi | fa8d965 | 2016-09-28 14:58:33 +0300 | [diff] [blame] | 250 | switch (__entry->type) { |
| 251 | case USB_ENDPOINT_XFER_INT: |
| 252 | case USB_ENDPOINT_XFER_ISOC: |
| 253 | switch (pcm) { |
| 254 | case 1: |
| 255 | s = "1x "; |
| 256 | break; |
| 257 | case 2: |
| 258 | s = "2x "; |
| 259 | break; |
| 260 | case 3: |
Andy Shevchenko | 54d4818 | 2018-12-03 11:28:47 +0200 | [diff] [blame] | 261 | default: |
Felipe Balbi | fa8d965 | 2016-09-28 14:58:33 +0300 | [diff] [blame] | 262 | s = "3x "; |
| 263 | break; |
| 264 | } |
Andy Shevchenko | 54d4818 | 2018-12-03 11:28:47 +0200 | [diff] [blame] | 265 | break; |
Felipe Balbi | fa8d965 | 2016-09-28 14:58:33 +0300 | [diff] [blame] | 266 | default: |
| 267 | s = ""; |
| 268 | } s; }), |
| 269 | DWC3_TRB_SIZE_LENGTH(__entry->size), __entry->ctrl, |
Janusz Dziedzic | 22f2c61 | 2016-05-20 10:37:13 +0200 | [diff] [blame] | 270 | __entry->ctrl & DWC3_TRB_CTRL_HWO ? 'H' : 'h', |
| 271 | __entry->ctrl & DWC3_TRB_CTRL_LST ? 'L' : 'l', |
| 272 | __entry->ctrl & DWC3_TRB_CTRL_CHN ? 'C' : 'c', |
| 273 | __entry->ctrl & DWC3_TRB_CTRL_CSP ? 'S' : 's', |
| 274 | __entry->ctrl & DWC3_TRB_CTRL_ISP_IMI ? 'S' : 's', |
| 275 | __entry->ctrl & DWC3_TRB_CTRL_IOC ? 'C' : 'c', |
Felipe Balbi | b5c7ed5 | 2017-03-31 14:44:09 +0300 | [diff] [blame] | 276 | dwc3_trb_type_string(DWC3_TRBCTL_TYPE(__entry->ctrl)) |
Felipe Balbi | 2c4cbe6e5 | 2014-04-30 17:45:10 -0500 | [diff] [blame] | 277 | ) |
| 278 | ); |
| 279 | |
| 280 | DEFINE_EVENT(dwc3_log_trb, dwc3_prepare_trb, |
| 281 | TP_PROTO(struct dwc3_ep *dep, struct dwc3_trb *trb), |
| 282 | TP_ARGS(dep, trb) |
| 283 | ); |
| 284 | |
| 285 | DEFINE_EVENT(dwc3_log_trb, dwc3_complete_trb, |
| 286 | TP_PROTO(struct dwc3_ep *dep, struct dwc3_trb *trb), |
| 287 | TP_ARGS(dep, trb) |
| 288 | ); |
| 289 | |
Felipe Balbi | 2870e50 | 2016-11-03 13:53:29 +0200 | [diff] [blame] | 290 | DECLARE_EVENT_CLASS(dwc3_log_ep, |
| 291 | TP_PROTO(struct dwc3_ep *dep), |
| 292 | TP_ARGS(dep), |
| 293 | TP_STRUCT__entry( |
Felipe Balbi | e42f09b | 2017-04-28 12:54:52 +0300 | [diff] [blame] | 294 | __string(name, dep->name) |
Felipe Balbi | 159fdf2 | 2020-08-13 08:32:00 +0300 | [diff] [blame] | 295 | __field(unsigned int, maxpacket) |
| 296 | __field(unsigned int, maxpacket_limit) |
| 297 | __field(unsigned int, max_streams) |
| 298 | __field(unsigned int, maxburst) |
| 299 | __field(unsigned int, flags) |
| 300 | __field(unsigned int, direction) |
Felipe Balbi | 2870e50 | 2016-11-03 13:53:29 +0200 | [diff] [blame] | 301 | __field(u8, trb_enqueue) |
| 302 | __field(u8, trb_dequeue) |
| 303 | ), |
| 304 | TP_fast_assign( |
Felipe Balbi | e42f09b | 2017-04-28 12:54:52 +0300 | [diff] [blame] | 305 | __assign_str(name, dep->name); |
Felipe Balbi | 2870e50 | 2016-11-03 13:53:29 +0200 | [diff] [blame] | 306 | __entry->maxpacket = dep->endpoint.maxpacket; |
| 307 | __entry->maxpacket_limit = dep->endpoint.maxpacket_limit; |
| 308 | __entry->max_streams = dep->endpoint.max_streams; |
| 309 | __entry->maxburst = dep->endpoint.maxburst; |
| 310 | __entry->flags = dep->flags; |
| 311 | __entry->direction = dep->direction; |
| 312 | __entry->trb_enqueue = dep->trb_enqueue; |
| 313 | __entry->trb_dequeue = dep->trb_dequeue; |
| 314 | ), |
Felipe Balbi | 3aec991 | 2019-01-21 13:08:44 +0200 | [diff] [blame] | 315 | TP_printk("%s: mps %d/%d streams %d burst %d ring %d/%d flags %c:%c%c%c%c:%c", |
Felipe Balbi | 2870e50 | 2016-11-03 13:53:29 +0200 | [diff] [blame] | 316 | __get_str(name), __entry->maxpacket, |
| 317 | __entry->maxpacket_limit, __entry->max_streams, |
| 318 | __entry->maxburst, __entry->trb_enqueue, |
| 319 | __entry->trb_dequeue, |
| 320 | __entry->flags & DWC3_EP_ENABLED ? 'E' : 'e', |
| 321 | __entry->flags & DWC3_EP_STALL ? 'S' : 's', |
| 322 | __entry->flags & DWC3_EP_WEDGE ? 'W' : 'w', |
Felipe Balbi | 5f2e797 | 2018-03-29 11:10:45 +0300 | [diff] [blame] | 323 | __entry->flags & DWC3_EP_TRANSFER_STARTED ? 'B' : 'b', |
Felipe Balbi | 2870e50 | 2016-11-03 13:53:29 +0200 | [diff] [blame] | 324 | __entry->flags & DWC3_EP_PENDING_REQUEST ? 'P' : 'p', |
Felipe Balbi | 2870e50 | 2016-11-03 13:53:29 +0200 | [diff] [blame] | 325 | __entry->direction ? '<' : '>' |
| 326 | ) |
| 327 | ); |
| 328 | |
| 329 | DEFINE_EVENT(dwc3_log_ep, dwc3_gadget_ep_enable, |
| 330 | TP_PROTO(struct dwc3_ep *dep), |
| 331 | TP_ARGS(dep) |
| 332 | ); |
| 333 | |
| 334 | DEFINE_EVENT(dwc3_log_ep, dwc3_gadget_ep_disable, |
| 335 | TP_PROTO(struct dwc3_ep *dep), |
| 336 | TP_ARGS(dep) |
| 337 | ); |
| 338 | |
Felipe Balbi | 2c4cbe6e5 | 2014-04-30 17:45:10 -0500 | [diff] [blame] | 339 | #endif /* __DWC3_TRACE_H */ |
| 340 | |
| 341 | /* this part has to be here */ |
| 342 | |
| 343 | #undef TRACE_INCLUDE_PATH |
| 344 | #define TRACE_INCLUDE_PATH . |
| 345 | |
| 346 | #undef TRACE_INCLUDE_FILE |
| 347 | #define TRACE_INCLUDE_FILE trace |
| 348 | |
| 349 | #include <trace/define_trace.h> |