| 1 |
/* SPDX-License-Identifier: GPL-2.0 */ |
| 2 |
/* |
| 3 |
* USBSS device controller driver. |
| 4 |
* Trace support header file. |
| 5 |
* |
| 6 |
* Copyright (C) 2018-2019 Cadence. |
| 7 |
* |
| 8 |
* Author: Pawel Laszczak <[email protected]> |
| 9 |
*/ |
| 10 |
|
| 11 |
#undef TRACE_SYSTEM |
| 12 |
#define TRACE_SYSTEM cdns3 |
| 13 |
|
| 14 |
#if !defined(__LINUX_CDNS3_TRACE) || defined(TRACE_HEADER_MULTI_READ) |
| 15 |
#define __LINUX_CDNS3_TRACE |
| 16 |
|
| 17 |
#include <linux/types.h> |
| 18 |
#include <linux/tracepoint.h> |
| 19 |
#include <asm/byteorder.h> |
| 20 |
#include <linux/usb/ch9.h> |
| 21 |
#include "core.h" |
| 22 |
#include "cdns3-gadget.h" |
| 23 |
#include "cdns3-debug.h" |
| 24 |
|
| 25 |
#define CDNS3_MSG_MAX 500 |
| 26 |
|
| 27 |
TRACE_EVENT(cdns3_halt, |
| 28 |
TP_PROTO(struct cdns3_endpoint *ep_priv, u8 halt, u8 flush), |
| 29 |
TP_ARGS(ep_priv, halt, flush), |
| 30 |
TP_STRUCT__entry( |
| 31 |
__string(name, ep_priv->name) |
| 32 |
__field(u8, halt) |
| 33 |
__field(u8, flush) |
| 34 |
), |
| 35 |
TP_fast_assign( |
| 36 |
__assign_str(name); |
| 37 |
__entry->halt = halt; |
| 38 |
__entry->flush = flush; |
| 39 |
), |
| 40 |
TP_printk("Halt %s for %s: %s", __entry->flush ? " and flush" : "", |
| 41 |
__get_str(name), __entry->halt ? "set" : "cleared") |
| 42 |
); |
| 43 |
|
| 44 |
TRACE_EVENT(cdns3_wa1, |
| 45 |
TP_PROTO(struct cdns3_endpoint *ep_priv, char *msg), |
| 46 |
TP_ARGS(ep_priv, msg), |
| 47 |
TP_STRUCT__entry( |
| 48 |
__string(ep_name, ep_priv->name) |
| 49 |
__string(msg, msg) |
| 50 |
), |
| 51 |
TP_fast_assign( |
| 52 |
__assign_str(ep_name); |
| 53 |
__assign_str(msg); |
| 54 |
), |
| 55 |
TP_printk("WA1: %s %s", __get_str(ep_name), __get_str(msg)) |
| 56 |
); |
| 57 |
|
| 58 |
TRACE_EVENT(cdns3_wa2, |
| 59 |
TP_PROTO(struct cdns3_endpoint *ep_priv, char *msg), |
| 60 |
TP_ARGS(ep_priv, msg), |
| 61 |
TP_STRUCT__entry( |
| 62 |
__string(ep_name, ep_priv->name) |
| 63 |
__string(msg, msg) |
| 64 |
), |
| 65 |
TP_fast_assign( |
| 66 |
__assign_str(ep_name); |
| 67 |
__assign_str(msg); |
| 68 |
), |
| 69 |
TP_printk("WA2: %s %s", __get_str(ep_name), __get_str(msg)) |
| 70 |
); |
| 71 |
|
| 72 |
DECLARE_EVENT_CLASS(cdns3_log_doorbell, |
| 73 |
TP_PROTO(const char *ep_name, u32 ep_trbaddr), |
| 74 |
TP_ARGS(ep_name, ep_trbaddr), |
| 75 |
TP_STRUCT__entry( |
| 76 |
__string(name, ep_name) |
| 77 |
__field(u32, ep_trbaddr) |
| 78 |
), |
| 79 |
TP_fast_assign( |
| 80 |
__assign_str(name); |
| 81 |
__entry->ep_trbaddr = ep_trbaddr; |
| 82 |
), |
| 83 |
TP_printk("%s, ep_trbaddr %08x", __get_str(name), |
| 84 |
__entry->ep_trbaddr) |
| 85 |
); |
| 86 |
|
| 87 |
DEFINE_EVENT(cdns3_log_doorbell, cdns3_doorbell_ep0, |
| 88 |
TP_PROTO(const char *ep_name, u32 ep_trbaddr), |
| 89 |
TP_ARGS(ep_name, ep_trbaddr) |
| 90 |
); |
| 91 |
|
| 92 |
DEFINE_EVENT(cdns3_log_doorbell, cdns3_doorbell_epx, |
| 93 |
TP_PROTO(const char *ep_name, u32 ep_trbaddr), |
| 94 |
TP_ARGS(ep_name, ep_trbaddr) |
| 95 |
); |
| 96 |
|
| 97 |
DECLARE_EVENT_CLASS(cdns3_log_usb_irq, |
| 98 |
TP_PROTO(struct cdns3_device *priv_dev, u32 usb_ists), |
| 99 |
TP_ARGS(priv_dev, usb_ists), |
| 100 |
TP_STRUCT__entry( |
| 101 |
__field(enum usb_device_speed, speed) |
| 102 |
__field(u32, usb_ists) |
| 103 |
), |
| 104 |
TP_fast_assign( |
| 105 |
__entry->speed = cdns3_get_speed(priv_dev); |
| 106 |
__entry->usb_ists = usb_ists; |
| 107 |
), |
| 108 |
TP_printk("%s", cdns3_decode_usb_irq(__get_buf(CDNS3_MSG_MAX), __entry->speed, |
| 109 |
__entry->usb_ists)) |
| 110 |
); |
| 111 |
|
| 112 |
DEFINE_EVENT(cdns3_log_usb_irq, cdns3_usb_irq, |
| 113 |
TP_PROTO(struct cdns3_device *priv_dev, u32 usb_ists), |
| 114 |
TP_ARGS(priv_dev, usb_ists) |
| 115 |
); |
| 116 |
|
| 117 |
DECLARE_EVENT_CLASS(cdns3_log_epx_irq, |
| 118 |
TP_PROTO(struct cdns3_device *priv_dev, struct cdns3_endpoint *priv_ep), |
| 119 |
TP_ARGS(priv_dev, priv_ep), |
| 120 |
TP_STRUCT__entry( |
| 121 |
__string(ep_name, priv_ep->name) |
| 122 |
__field(u32, ep_sts) |
| 123 |
__field(u32, ep_traddr) |
| 124 |
__field(u32, ep_last_sid) |
| 125 |
__field(u32, use_streams) |
| 126 |
), |
| 127 |
TP_fast_assign( |
| 128 |
__assign_str(ep_name); |
| 129 |
__entry->ep_sts = readl(&priv_dev->regs->ep_sts); |
| 130 |
__entry->ep_traddr = readl(&priv_dev->regs->ep_traddr); |
| 131 |
__entry->ep_last_sid = priv_ep->last_stream_id; |
| 132 |
__entry->use_streams = priv_ep->use_streams; |
| 133 |
), |
| 134 |
TP_printk("%s, ep_traddr: %08x ep_last_sid: %08x use_streams: %d", |
| 135 |
cdns3_decode_epx_irq(__get_buf(CDNS3_MSG_MAX), |
| 136 |
__get_str(ep_name), |
| 137 |
__entry->ep_sts), |
| 138 |
__entry->ep_traddr, |
| 139 |
__entry->ep_last_sid, |
| 140 |
__entry->use_streams) |
| 141 |
); |
| 142 |
|
| 143 |
DEFINE_EVENT(cdns3_log_epx_irq, cdns3_epx_irq, |
| 144 |
TP_PROTO(struct cdns3_device *priv_dev, struct cdns3_endpoint *priv_ep), |
| 145 |
TP_ARGS(priv_dev, priv_ep) |
| 146 |
); |
| 147 |
|
| 148 |
DECLARE_EVENT_CLASS(cdns3_log_ep0_irq, |
| 149 |
TP_PROTO(struct cdns3_device *priv_dev, u32 ep_sts), |
| 150 |
TP_ARGS(priv_dev, ep_sts), |
| 151 |
TP_STRUCT__entry( |
| 152 |
__field(int, ep_dir) |
| 153 |
__field(u32, ep_sts) |
| 154 |
), |
| 155 |
TP_fast_assign( |
| 156 |
__entry->ep_dir = priv_dev->selected_ep; |
| 157 |
__entry->ep_sts = ep_sts; |
| 158 |
), |
| 159 |
TP_printk("%s", cdns3_decode_ep0_irq(__get_buf(CDNS3_MSG_MAX), |
| 160 |
__entry->ep_dir, |
| 161 |
__entry->ep_sts)) |
| 162 |
); |
| 163 |
|
| 164 |
DEFINE_EVENT(cdns3_log_ep0_irq, cdns3_ep0_irq, |
| 165 |
TP_PROTO(struct cdns3_device *priv_dev, u32 ep_sts), |
| 166 |
TP_ARGS(priv_dev, ep_sts) |
| 167 |
); |
| 168 |
|
| 169 |
DECLARE_EVENT_CLASS(cdns3_log_ctrl, |
| 170 |
TP_PROTO(struct usb_ctrlrequest *ctrl), |
| 171 |
TP_ARGS(ctrl), |
| 172 |
TP_STRUCT__entry( |
| 173 |
__field(u8, bRequestType) |
| 174 |
__field(u8, bRequest) |
| 175 |
__field(u16, wValue) |
| 176 |
__field(u16, wIndex) |
| 177 |
__field(u16, wLength) |
| 178 |
), |
| 179 |
TP_fast_assign( |
| 180 |
__entry->bRequestType = ctrl->bRequestType; |
| 181 |
__entry->bRequest = ctrl->bRequest; |
| 182 |
__entry->wValue = le16_to_cpu(ctrl->wValue); |
| 183 |
__entry->wIndex = le16_to_cpu(ctrl->wIndex); |
| 184 |
__entry->wLength = le16_to_cpu(ctrl->wLength); |
| 185 |
), |
| 186 |
TP_printk("%s", usb_decode_ctrl(__get_buf(CDNS3_MSG_MAX), CDNS3_MSG_MAX, |
| 187 |
__entry->bRequestType, |
| 188 |
__entry->bRequest, __entry->wValue, |
| 189 |
__entry->wIndex, __entry->wLength) |
| 190 |
) |
| 191 |
); |
| 192 |
|
| 193 |
DEFINE_EVENT(cdns3_log_ctrl, cdns3_ctrl_req, |
| 194 |
TP_PROTO(struct usb_ctrlrequest *ctrl), |
| 195 |
TP_ARGS(ctrl) |
| 196 |
); |
| 197 |
|
| 198 |
DECLARE_EVENT_CLASS(cdns3_log_request, |
| 199 |
TP_PROTO(struct cdns3_request *req), |
| 200 |
TP_ARGS(req), |
| 201 |
TP_STRUCT__entry( |
| 202 |
__string(name, req->priv_ep->name) |
| 203 |
__field(struct cdns3_request *, req) |
| 204 |
__field(void *, buf) |
| 205 |
__field(unsigned int, actual) |
| 206 |
__field(unsigned int, length) |
| 207 |
__field(int, status) |
| 208 |
__field(int, zero) |
| 209 |
__field(int, short_not_ok) |
| 210 |
__field(int, no_interrupt) |
| 211 |
__field(int, start_trb) |
| 212 |
__field(int, end_trb) |
| 213 |
__field(int, flags) |
| 214 |
__field(unsigned int, stream_id) |
| 215 |
), |
| 216 |
TP_fast_assign( |
| 217 |
__assign_str(name); |
| 218 |
__entry->req = req; |
| 219 |
__entry->buf = req->request.buf; |
| 220 |
__entry->actual = req->request.actual; |
| 221 |
__entry->length = req->request.length; |
| 222 |
__entry->status = req->request.status; |
| 223 |
__entry->zero = req->request.zero; |
| 224 |
__entry->short_not_ok = req->request.short_not_ok; |
| 225 |
__entry->no_interrupt = req->request.no_interrupt; |
| 226 |
__entry->start_trb = req->start_trb; |
| 227 |
__entry->end_trb = req->end_trb; |
| 228 |
__entry->flags = req->flags; |
| 229 |
__entry->stream_id = req->request.stream_id; |
| 230 |
), |
| 231 |
TP_printk("%s: req: %p, req buff %p, length: %u/%u %s%s%s, status: %d," |
| 232 |
" trb: [start:%d, end:%d], flags:%x SID: %u", |
| 233 |
__get_str(name), __entry->req, __entry->buf, __entry->actual, |
| 234 |
__entry->length, |
| 235 |
__entry->zero ? "Z" : "z", |
| 236 |
__entry->short_not_ok ? "S" : "s", |
| 237 |
__entry->no_interrupt ? "I" : "i", |
| 238 |
__entry->status, |
| 239 |
__entry->start_trb, |
| 240 |
__entry->end_trb, |
| 241 |
__entry->flags, |
| 242 |
__entry->stream_id |
| 243 |
) |
| 244 |
); |
| 245 |
|
| 246 |
DEFINE_EVENT(cdns3_log_request, cdns3_alloc_request, |
| 247 |
TP_PROTO(struct cdns3_request *req), |
| 248 |
TP_ARGS(req) |
| 249 |
); |
| 250 |
|
| 251 |
DEFINE_EVENT(cdns3_log_request, cdns3_free_request, |
| 252 |
TP_PROTO(struct cdns3_request *req), |
| 253 |
TP_ARGS(req) |
| 254 |
); |
| 255 |
|
| 256 |
DEFINE_EVENT(cdns3_log_request, cdns3_ep_queue, |
| 257 |
TP_PROTO(struct cdns3_request *req), |
| 258 |
TP_ARGS(req) |
| 259 |
); |
| 260 |
|
| 261 |
DEFINE_EVENT(cdns3_log_request, cdns3_ep_dequeue, |
| 262 |
TP_PROTO(struct cdns3_request *req), |
| 263 |
TP_ARGS(req) |
| 264 |
); |
| 265 |
|
| 266 |
DEFINE_EVENT(cdns3_log_request, cdns3_gadget_giveback, |
| 267 |
TP_PROTO(struct cdns3_request *req), |
| 268 |
TP_ARGS(req) |
| 269 |
); |
| 270 |
|
| 271 |
TRACE_EVENT(cdns3_ep0_queue, |
| 272 |
TP_PROTO(struct cdns3_device *dev_priv, struct usb_request *request), |
| 273 |
TP_ARGS(dev_priv, request), |
| 274 |
TP_STRUCT__entry( |
| 275 |
__field(int, dir) |
| 276 |
__field(int, length) |
| 277 |
), |
| 278 |
TP_fast_assign( |
| 279 |
__entry->dir = dev_priv->ep0_data_dir; |
| 280 |
__entry->length = request->length; |
| 281 |
), |
| 282 |
TP_printk("Queue to ep0%s length: %u", __entry->dir ? "in" : "out", |
| 283 |
__entry->length) |
| 284 |
); |
| 285 |
|
| 286 |
DECLARE_EVENT_CLASS(cdns3_log_aligned_request, |
| 287 |
TP_PROTO(struct cdns3_request *priv_req), |
| 288 |
TP_ARGS(priv_req), |
| 289 |
TP_STRUCT__entry( |
| 290 |
__string(name, priv_req->priv_ep->name) |
| 291 |
__field(struct usb_request *, req) |
| 292 |
__field(void *, buf) |
| 293 |
__field(dma_addr_t, dma) |
| 294 |
__field(void *, aligned_buf) |
| 295 |
__field(dma_addr_t, aligned_dma) |
| 296 |
__field(u32, aligned_buf_size) |
| 297 |
), |
| 298 |
TP_fast_assign( |
| 299 |
__assign_str(name); |
| 300 |
__entry->req = &priv_req->request; |
| 301 |
__entry->buf = priv_req->request.buf; |
| 302 |
__entry->dma = priv_req->request.dma; |
| 303 |
__entry->aligned_buf = priv_req->aligned_buf->buf; |
| 304 |
__entry->aligned_dma = priv_req->aligned_buf->dma; |
| 305 |
__entry->aligned_buf_size = priv_req->aligned_buf->size; |
| 306 |
), |
| 307 |
TP_printk("%s: req: %p, req buf %p, dma %pad a_buf %p a_dma %pad, size %d", |
| 308 |
__get_str(name), __entry->req, __entry->buf, &__entry->dma, |
| 309 |
__entry->aligned_buf, &__entry->aligned_dma, |
| 310 |
__entry->aligned_buf_size |
| 311 |
) |
| 312 |
); |
| 313 |
|
| 314 |
DEFINE_EVENT(cdns3_log_aligned_request, cdns3_free_aligned_request, |
| 315 |
TP_PROTO(struct cdns3_request *req), |
| 316 |
TP_ARGS(req) |
| 317 |
); |
| 318 |
|
| 319 |
DEFINE_EVENT(cdns3_log_aligned_request, cdns3_prepare_aligned_request, |
| 320 |
TP_PROTO(struct cdns3_request *req), |
| 321 |
TP_ARGS(req) |
| 322 |
); |
| 323 |
|
| 324 |
DECLARE_EVENT_CLASS(cdns3_log_trb, |
| 325 |
TP_PROTO(struct cdns3_endpoint *priv_ep, struct cdns3_trb *trb), |
| 326 |
TP_ARGS(priv_ep, trb), |
| 327 |
TP_STRUCT__entry( |
| 328 |
__string(name, priv_ep->name) |
| 329 |
__field(struct cdns3_trb *, trb) |
| 330 |
__field(u32, buffer) |
| 331 |
__field(u32, length) |
| 332 |
__field(u32, control) |
| 333 |
__field(u32, type) |
| 334 |
__field(unsigned int, last_stream_id) |
| 335 |
), |
| 336 |
TP_fast_assign( |
| 337 |
__assign_str(name); |
| 338 |
__entry->trb = trb; |
| 339 |
__entry->buffer = le32_to_cpu(trb->buffer); |
| 340 |
__entry->length = le32_to_cpu(trb->length); |
| 341 |
__entry->control = le32_to_cpu(trb->control); |
| 342 |
__entry->type = usb_endpoint_type(priv_ep->endpoint.desc); |
| 343 |
__entry->last_stream_id = priv_ep->last_stream_id; |
| 344 |
), |
| 345 |
TP_printk("%s: trb %p, dma buf: 0x%08x, size: %ld, burst: %d ctrl: 0x%08x (%s%s%s%s%s%s%s) SID:%lu LAST_SID:%u", |
| 346 |
__get_str(name), __entry->trb, __entry->buffer, |
| 347 |
TRB_LEN(__entry->length), |
| 348 |
(u8)TRB_BURST_LEN_GET(__entry->length), |
| 349 |
__entry->control, |
| 350 |
__entry->control & TRB_CYCLE ? "C=1, " : "C=0, ", |
| 351 |
__entry->control & TRB_TOGGLE ? "T=1, " : "T=0, ", |
| 352 |
__entry->control & TRB_ISP ? "ISP, " : "", |
| 353 |
__entry->control & TRB_FIFO_MODE ? "FIFO, " : "", |
| 354 |
__entry->control & TRB_CHAIN ? "CHAIN, " : "", |
| 355 |
__entry->control & TRB_IOC ? "IOC, " : "", |
| 356 |
TRB_FIELD_TO_TYPE(__entry->control) == TRB_NORMAL ? "Normal" : "LINK", |
| 357 |
TRB_FIELD_TO_STREAMID(__entry->control), |
| 358 |
__entry->last_stream_id |
| 359 |
) |
| 360 |
); |
| 361 |
|
| 362 |
DEFINE_EVENT(cdns3_log_trb, cdns3_prepare_trb, |
| 363 |
TP_PROTO(struct cdns3_endpoint *priv_ep, struct cdns3_trb *trb), |
| 364 |
TP_ARGS(priv_ep, trb) |
| 365 |
); |
| 366 |
|
| 367 |
DEFINE_EVENT(cdns3_log_trb, cdns3_complete_trb, |
| 368 |
TP_PROTO(struct cdns3_endpoint *priv_ep, struct cdns3_trb *trb), |
| 369 |
TP_ARGS(priv_ep, trb) |
| 370 |
); |
| 371 |
|
| 372 |
DECLARE_EVENT_CLASS(cdns3_log_ring, |
| 373 |
TP_PROTO(struct cdns3_endpoint *priv_ep), |
| 374 |
TP_ARGS(priv_ep), |
| 375 |
TP_STRUCT__entry( |
| 376 |
__dynamic_array(char, buffer, |
| 377 |
GET_TRBS_PER_SEGMENT(priv_ep->type) > TRBS_PER_SEGMENT ? |
| 378 |
CDNS3_MSG_MAX : |
| 379 |
(GET_TRBS_PER_SEGMENT(priv_ep->type) * 65) + CDNS3_MSG_MAX) |
| 380 |
), |
| 381 |
TP_fast_assign( |
| 382 |
cdns3_dbg_ring(priv_ep, __get_str(buffer)); |
| 383 |
), |
| 384 |
|
| 385 |
TP_printk("%s", __get_str(buffer)) |
| 386 |
); |
| 387 |
|
| 388 |
DEFINE_EVENT(cdns3_log_ring, cdns3_ring, |
| 389 |
TP_PROTO(struct cdns3_endpoint *priv_ep), |
| 390 |
TP_ARGS(priv_ep) |
| 391 |
); |
| 392 |
|
| 393 |
DECLARE_EVENT_CLASS(cdns3_log_ep, |
| 394 |
TP_PROTO(struct cdns3_endpoint *priv_ep), |
| 395 |
TP_ARGS(priv_ep), |
| 396 |
TP_STRUCT__entry( |
| 397 |
__string(name, priv_ep->name) |
| 398 |
__field(unsigned int, maxpacket) |
| 399 |
__field(unsigned int, maxpacket_limit) |
| 400 |
__field(unsigned int, max_streams) |
| 401 |
__field(unsigned int, use_streams) |
| 402 |
__field(unsigned int, maxburst) |
| 403 |
__field(unsigned int, flags) |
| 404 |
__field(unsigned int, dir) |
| 405 |
__field(u8, enqueue) |
| 406 |
__field(u8, dequeue) |
| 407 |
), |
| 408 |
TP_fast_assign( |
| 409 |
__assign_str(name); |
| 410 |
__entry->maxpacket = priv_ep->endpoint.maxpacket; |
| 411 |
__entry->maxpacket_limit = priv_ep->endpoint.maxpacket_limit; |
| 412 |
__entry->max_streams = priv_ep->endpoint.max_streams; |
| 413 |
__entry->use_streams = priv_ep->use_streams; |
| 414 |
__entry->maxburst = priv_ep->endpoint.maxburst; |
| 415 |
__entry->flags = priv_ep->flags; |
| 416 |
__entry->dir = priv_ep->dir; |
| 417 |
__entry->enqueue = priv_ep->enqueue; |
| 418 |
__entry->dequeue = priv_ep->dequeue; |
| 419 |
), |
| 420 |
TP_printk("%s: mps: %d/%d. streams: %d, stream enable: %d, burst: %d, " |
| 421 |
"enq idx: %d, deq idx: %d, flags %s%s%s%s%s%s%s%s, dir: %s", |
| 422 |
__get_str(name), __entry->maxpacket, |
| 423 |
__entry->maxpacket_limit, __entry->max_streams, |
| 424 |
__entry->use_streams, |
| 425 |
__entry->maxburst, __entry->enqueue, |
| 426 |
__entry->dequeue, |
| 427 |
__entry->flags & EP_ENABLED ? "EN | " : "", |
| 428 |
__entry->flags & EP_STALLED ? "STALLED | " : "", |
| 429 |
__entry->flags & EP_WEDGE ? "WEDGE | " : "", |
| 430 |
__entry->flags & EP_TRANSFER_STARTED ? "STARTED | " : "", |
| 431 |
__entry->flags & EP_UPDATE_EP_TRBADDR ? "UPD TRB | " : "", |
| 432 |
__entry->flags & EP_PENDING_REQUEST ? "REQ PEN | " : "", |
| 433 |
__entry->flags & EP_RING_FULL ? "RING FULL |" : "", |
| 434 |
__entry->flags & EP_CLAIMED ? "CLAIMED " : "", |
| 435 |
__entry->dir ? "IN" : "OUT" |
| 436 |
) |
| 437 |
); |
| 438 |
|
| 439 |
DEFINE_EVENT(cdns3_log_ep, cdns3_gadget_ep_enable, |
| 440 |
TP_PROTO(struct cdns3_endpoint *priv_ep), |
| 441 |
TP_ARGS(priv_ep) |
| 442 |
); |
| 443 |
|
| 444 |
DEFINE_EVENT(cdns3_log_ep, cdns3_gadget_ep_disable, |
| 445 |
TP_PROTO(struct cdns3_endpoint *priv_ep), |
| 446 |
TP_ARGS(priv_ep) |
| 447 |
); |
| 448 |
|
| 449 |
DECLARE_EVENT_CLASS(cdns3_log_request_handled, |
| 450 |
TP_PROTO(struct cdns3_request *priv_req, int current_index, |
| 451 |
int handled), |
| 452 |
TP_ARGS(priv_req, current_index, handled), |
| 453 |
TP_STRUCT__entry( |
| 454 |
__field(struct cdns3_request *, priv_req) |
| 455 |
__field(unsigned int, dma_position) |
| 456 |
__field(unsigned int, handled) |
| 457 |
__field(unsigned int, dequeue_idx) |
| 458 |
__field(unsigned int, enqueue_idx) |
| 459 |
__field(unsigned int, start_trb) |
| 460 |
__field(unsigned int, end_trb) |
| 461 |
), |
| 462 |
TP_fast_assign( |
| 463 |
__entry->priv_req = priv_req; |
| 464 |
__entry->dma_position = current_index; |
| 465 |
__entry->handled = handled; |
| 466 |
__entry->dequeue_idx = priv_req->priv_ep->dequeue; |
| 467 |
__entry->enqueue_idx = priv_req->priv_ep->enqueue; |
| 468 |
__entry->start_trb = priv_req->start_trb; |
| 469 |
__entry->end_trb = priv_req->end_trb; |
| 470 |
), |
| 471 |
TP_printk("Req: %p %s, DMA pos: %d, ep deq: %d, ep enq: %d," |
| 472 |
" start trb: %d, end trb: %d", |
| 473 |
__entry->priv_req, |
| 474 |
__entry->handled ? "handled" : "not handled", |
| 475 |
__entry->dma_position, __entry->dequeue_idx, |
| 476 |
__entry->enqueue_idx, __entry->start_trb, |
| 477 |
__entry->end_trb |
| 478 |
) |
| 479 |
); |
| 480 |
|
| 481 |
DEFINE_EVENT(cdns3_log_request_handled, cdns3_request_handled, |
| 482 |
TP_PROTO(struct cdns3_request *priv_req, int current_index, |
| 483 |
int handled), |
| 484 |
TP_ARGS(priv_req, current_index, handled) |
| 485 |
); |
| 486 |
#endif /* __LINUX_CDNS3_TRACE */ |
| 487 |
|
| 488 |
/* this part must be outside header guard */ |
| 489 |
|
| 490 |
#undef TRACE_INCLUDE_PATH |
| 491 |
#define TRACE_INCLUDE_PATH . |
| 492 |
|
| 493 |
#undef TRACE_INCLUDE_FILE |
| 494 |
#define TRACE_INCLUDE_FILE cdns3-trace |
| 495 |
|
| 496 |
#include <trace/define_trace.h> |