1 /* SPDX-License-Identifier: GPL-2.0 */
3 * Cadence CDNSP DRD Driver.
4 * Trace support header file
6 * Copyright (C) 2020 Cadence.
13 #define TRACE_SYSTEM cdnsp-dev
16 * The TRACE_SYSTEM_VAR defaults to TRACE_SYSTEM, but must be a
17 * legitimate C variable. It is not exported to user space.
19 #undef TRACE_SYSTEM_VAR
20 #define TRACE_SYSTEM_VAR cdnsp_dev
22 #if !defined(__CDNSP_DEV_TRACE_H) || defined(TRACE_HEADER_MULTI_READ)
23 #define __CDNSP_DEV_TRACE_H
25 #include <linux/tracepoint.h>
26 #include "cdnsp-gadget.h"
27 #include "cdnsp-debug.h"
30 * There is limitation for single buffer size in TRACEPOINT subsystem.
31 * By default TRACE_BUF_SIZE is 1024, so no all data will be logged.
32 * To show more data this must be increased. In most cases the default
33 * value is sufficient.
35 #define CDNSP_MSG_MAX 500
37 DECLARE_EVENT_CLASS(cdnsp_log_ep,
38 TP_PROTO(struct cdnsp_ep *pep, u32 stream_id),
39 TP_ARGS(pep, stream_id),
41 __string(name, pep->name)
42 __field(unsigned int, state)
43 __field(u32, stream_id)
45 __field(unsigned int, num_streams)
46 __field(int, td_count)
47 __field(u8, first_prime_det)
48 __field(u8, drbls_count)
51 __assign_str(name, pep->name);
52 __entry->state = pep->ep_state;
53 __entry->stream_id = stream_id;
54 __entry->enabled = pep->ep_state & EP_HAS_STREAMS;
55 __entry->num_streams = pep->stream_info.num_streams;
56 __entry->td_count = pep->stream_info.td_count;
57 __entry->first_prime_det = pep->stream_info.first_prime_det;
58 __entry->drbls_count = pep->stream_info.drbls_count;
60 TP_printk("%s: SID: %08x ep state: %x stream: enabled: %d num %d "
61 "tds %d, first prime: %d drbls %d",
62 __get_str(name), __entry->state, __entry->stream_id,
63 __entry->enabled, __entry->num_streams, __entry->td_count,
64 __entry->first_prime_det, __entry->drbls_count)
67 DEFINE_EVENT(cdnsp_log_ep, cdnsp_tr_drbl,
68 TP_PROTO(struct cdnsp_ep *pep, u32 stream_id),
69 TP_ARGS(pep, stream_id)
72 DEFINE_EVENT(cdnsp_log_ep, cdnsp_wait_for_prime,
73 TP_PROTO(struct cdnsp_ep *pep, u32 stream_id),
74 TP_ARGS(pep, stream_id)
77 DEFINE_EVENT(cdnsp_log_ep, cdnsp_ep_list_empty_with_skip,
78 TP_PROTO(struct cdnsp_ep *pep, u32 stream_id),
79 TP_ARGS(pep, stream_id)
82 DEFINE_EVENT(cdnsp_log_ep, cdnsp_ep_enable_end,
83 TP_PROTO(struct cdnsp_ep *pep, u32 stream_id),
84 TP_ARGS(pep, stream_id)
87 DEFINE_EVENT(cdnsp_log_ep, cdnsp_ep_disable_end,
88 TP_PROTO(struct cdnsp_ep *pep, u32 stream_id),
89 TP_ARGS(pep, stream_id)
92 DEFINE_EVENT(cdnsp_log_ep, cdnsp_ep_busy_try_halt_again,
93 TP_PROTO(struct cdnsp_ep *pep, u32 stream_id),
94 TP_ARGS(pep, stream_id)
97 DECLARE_EVENT_CLASS(cdnsp_log_enable_disable,
106 TP_printk("%s", __entry->set ? "enabled" : "disabled")
109 DEFINE_EVENT(cdnsp_log_enable_disable, cdnsp_pullup,
114 DEFINE_EVENT(cdnsp_log_enable_disable, cdnsp_u1,
119 DEFINE_EVENT(cdnsp_log_enable_disable, cdnsp_u2,
124 DEFINE_EVENT(cdnsp_log_enable_disable, cdnsp_lpm,
129 DEFINE_EVENT(cdnsp_log_enable_disable, cdnsp_may_wakeup,
134 DECLARE_EVENT_CLASS(cdnsp_log_simple,
141 __assign_str(text, msg)
143 TP_printk("%s", __get_str(text))
146 DEFINE_EVENT(cdnsp_log_simple, cdnsp_exit,
151 DEFINE_EVENT(cdnsp_log_simple, cdnsp_init,
156 DEFINE_EVENT(cdnsp_log_simple, cdnsp_slot_id,
161 DEFINE_EVENT(cdnsp_log_simple, cdnsp_no_room_on_ring,
166 DEFINE_EVENT(cdnsp_log_simple, cdnsp_ep0_status_stage,
171 DEFINE_EVENT(cdnsp_log_simple, cdnsp_ep0_request,
176 DEFINE_EVENT(cdnsp_log_simple, cdnsp_ep0_set_config,
181 DEFINE_EVENT(cdnsp_log_simple, cdnsp_ep0_halted,
186 DEFINE_EVENT(cdnsp_log_simple, cdnsp_ep_halt,
191 TRACE_EVENT(cdnsp_looking_trb_in_td,
192 TP_PROTO(dma_addr_t suspect, dma_addr_t trb_start, dma_addr_t trb_end,
193 dma_addr_t curr_seg, dma_addr_t end_seg),
194 TP_ARGS(suspect, trb_start, trb_end, curr_seg, end_seg),
196 __field(dma_addr_t, suspect)
197 __field(dma_addr_t, trb_start)
198 __field(dma_addr_t, trb_end)
199 __field(dma_addr_t, curr_seg)
200 __field(dma_addr_t, end_seg)
203 __entry->suspect = suspect;
204 __entry->trb_start = trb_start;
205 __entry->trb_end = trb_end;
206 __entry->curr_seg = curr_seg;
207 __entry->end_seg = end_seg;
209 TP_printk("DMA: suspect event: %pad, trb-start: %pad, trb-end %pad, "
210 "seg-start %pad, seg-end %pad",
211 &__entry->suspect, &__entry->trb_start, &__entry->trb_end,
212 &__entry->curr_seg, &__entry->end_seg)
215 TRACE_EVENT(cdnsp_port_info,
216 TP_PROTO(__le32 __iomem *addr, u32 offset, u32 count, u32 rev),
217 TP_ARGS(addr, offset, count, rev),
219 __field(__le32 __iomem *, addr)
225 __entry->addr = addr;
226 __entry->offset = offset;
227 __entry->count = count;
230 TP_printk("Ext Cap %p, port offset = %u, count = %u, rev = 0x%x",
231 __entry->addr, __entry->offset, __entry->count, __entry->rev)
234 DECLARE_EVENT_CLASS(cdnsp_log_deq_state,
235 TP_PROTO(struct cdnsp_dequeue_state *state),
238 __field(int, new_cycle_state)
239 __field(struct cdnsp_segment *, new_deq_seg)
240 __field(dma_addr_t, deq_seg_dma)
241 __field(union cdnsp_trb *, new_deq_ptr)
242 __field(dma_addr_t, deq_ptr_dma)
245 __entry->new_cycle_state = state->new_cycle_state;
246 __entry->new_deq_seg = state->new_deq_seg;
247 __entry->deq_seg_dma = state->new_deq_seg->dma;
248 __entry->new_deq_ptr = state->new_deq_ptr,
249 __entry->deq_ptr_dma = cdnsp_trb_virt_to_dma(state->new_deq_seg,
252 TP_printk("New cycle state = 0x%x, New dequeue segment = %p (0x%pad dma), "
253 "New dequeue pointer = %p (0x%pad dma)",
254 __entry->new_cycle_state, __entry->new_deq_seg,
255 &__entry->deq_seg_dma, __entry->new_deq_ptr,
256 &__entry->deq_ptr_dma
260 DEFINE_EVENT(cdnsp_log_deq_state, cdnsp_new_deq_state,
261 TP_PROTO(struct cdnsp_dequeue_state *state),
265 DECLARE_EVENT_CLASS(cdnsp_log_ctrl,
266 TP_PROTO(struct usb_ctrlrequest *ctrl),
269 __field(u8, bRequestType)
270 __field(u8, bRequest)
273 __field(u16, wLength)
274 __dynamic_array(char, str, CDNSP_MSG_MAX)
277 __entry->bRequestType = ctrl->bRequestType;
278 __entry->bRequest = ctrl->bRequest;
279 __entry->wValue = le16_to_cpu(ctrl->wValue);
280 __entry->wIndex = le16_to_cpu(ctrl->wIndex);
281 __entry->wLength = le16_to_cpu(ctrl->wLength);
283 TP_printk("%s", usb_decode_ctrl(__get_str(str), CDNSP_MSG_MAX,
284 __entry->bRequestType,
285 __entry->bRequest, __entry->wValue,
286 __entry->wIndex, __entry->wLength)
290 DEFINE_EVENT(cdnsp_log_ctrl, cdnsp_ctrl_req,
291 TP_PROTO(struct usb_ctrlrequest *ctrl),
295 DECLARE_EVENT_CLASS(cdnsp_log_bounce,
296 TP_PROTO(struct cdnsp_request *preq, u32 new_buf_len, u32 offset,
297 dma_addr_t dma, unsigned int unalign),
298 TP_ARGS(preq, new_buf_len, offset, dma, unalign),
300 __string(name, preq->pep->name)
301 __field(u32, new_buf_len)
303 __field(dma_addr_t, dma)
304 __field(unsigned int, unalign)
307 __assign_str(name, preq->pep->name);
308 __entry->new_buf_len = new_buf_len;
309 __entry->offset = offset;
311 __entry->unalign = unalign;
313 TP_printk("%s buf len %d, offset %d, dma %pad, unalign %d",
314 __get_str(name), __entry->new_buf_len,
315 __entry->offset, &__entry->dma, __entry->unalign
319 DEFINE_EVENT(cdnsp_log_bounce, cdnsp_bounce_align_td_split,
320 TP_PROTO(struct cdnsp_request *preq, u32 new_buf_len, u32 offset,
321 dma_addr_t dma, unsigned int unalign),
322 TP_ARGS(preq, new_buf_len, offset, dma, unalign)
325 DEFINE_EVENT(cdnsp_log_bounce, cdnsp_bounce_map,
326 TP_PROTO(struct cdnsp_request *preq, u32 new_buf_len, u32 offset,
327 dma_addr_t dma, unsigned int unalign),
328 TP_ARGS(preq, new_buf_len, offset, dma, unalign)
331 DEFINE_EVENT(cdnsp_log_bounce, cdnsp_bounce_unmap,
332 TP_PROTO(struct cdnsp_request *preq, u32 new_buf_len, u32 offset,
333 dma_addr_t dma, unsigned int unalign),
334 TP_ARGS(preq, new_buf_len, offset, dma, unalign)
337 DECLARE_EVENT_CLASS(cdnsp_log_trb,
338 TP_PROTO(struct cdnsp_ring *ring, struct cdnsp_generic_trb *trb),
346 __field(union cdnsp_trb *, trb)
347 __field(dma_addr_t, trb_dma)
348 __dynamic_array(char, str, CDNSP_MSG_MAX)
351 __entry->type = ring->type;
352 __entry->field0 = le32_to_cpu(trb->field[0]);
353 __entry->field1 = le32_to_cpu(trb->field[1]);
354 __entry->field2 = le32_to_cpu(trb->field[2]);
355 __entry->field3 = le32_to_cpu(trb->field[3]);
356 __entry->trb = (union cdnsp_trb *)trb;
357 __entry->trb_dma = cdnsp_trb_virt_to_dma(ring->deq_seg,
358 (union cdnsp_trb *)trb);
361 TP_printk("%s: %s trb: %p(%pad)", cdnsp_ring_type_string(__entry->type),
362 cdnsp_decode_trb(__get_str(str), CDNSP_MSG_MAX,
363 __entry->field0, __entry->field1,
364 __entry->field2, __entry->field3),
365 __entry->trb, &__entry->trb_dma
369 DEFINE_EVENT(cdnsp_log_trb, cdnsp_handle_event,
370 TP_PROTO(struct cdnsp_ring *ring, struct cdnsp_generic_trb *trb),
374 DEFINE_EVENT(cdnsp_log_trb, cdnsp_trb_without_td,
375 TP_PROTO(struct cdnsp_ring *ring, struct cdnsp_generic_trb *trb),
379 DEFINE_EVENT(cdnsp_log_trb, cdnsp_handle_command,
380 TP_PROTO(struct cdnsp_ring *ring, struct cdnsp_generic_trb *trb),
384 DEFINE_EVENT(cdnsp_log_trb, cdnsp_handle_transfer,
385 TP_PROTO(struct cdnsp_ring *ring, struct cdnsp_generic_trb *trb),
389 DEFINE_EVENT(cdnsp_log_trb, cdnsp_queue_trb,
390 TP_PROTO(struct cdnsp_ring *ring, struct cdnsp_generic_trb *trb),
394 DEFINE_EVENT(cdnsp_log_trb, cdnsp_cmd_wait_for_compl,
395 TP_PROTO(struct cdnsp_ring *ring, struct cdnsp_generic_trb *trb),
399 DEFINE_EVENT(cdnsp_log_trb, cdnsp_cmd_timeout,
400 TP_PROTO(struct cdnsp_ring *ring, struct cdnsp_generic_trb *trb),
404 DEFINE_EVENT(cdnsp_log_trb, cdnsp_defered_event,
405 TP_PROTO(struct cdnsp_ring *ring, struct cdnsp_generic_trb *trb),
409 DECLARE_EVENT_CLASS(cdnsp_log_pdev,
410 TP_PROTO(struct cdnsp_device *pdev),
413 __field(struct cdnsp_device *, pdev)
414 __field(struct usb_gadget *, gadget)
415 __field(dma_addr_t, out_ctx)
416 __field(dma_addr_t, in_ctx)
417 __field(u8, port_num)
420 __entry->pdev = pdev;
421 __entry->gadget = &pdev->gadget;
422 __entry->in_ctx = pdev->in_ctx.dma;
423 __entry->out_ctx = pdev->out_ctx.dma;
424 __entry->port_num = pdev->active_port ?
425 pdev->active_port->port_num : 0xFF;
427 TP_printk("pdev %p gadget %p ctx %pad | %pad, port %d ",
428 __entry->pdev, __entry->gadget, &__entry->in_ctx,
429 &__entry->out_ctx, __entry->port_num
433 DEFINE_EVENT(cdnsp_log_pdev, cdnsp_alloc_priv_device,
434 TP_PROTO(struct cdnsp_device *vdev),
438 DEFINE_EVENT(cdnsp_log_pdev, cdnsp_free_priv_device,
439 TP_PROTO(struct cdnsp_device *vdev),
443 DEFINE_EVENT(cdnsp_log_pdev, cdnsp_setup_device,
444 TP_PROTO(struct cdnsp_device *vdev),
448 DEFINE_EVENT(cdnsp_log_pdev, cdnsp_setup_addressable_priv_device,
449 TP_PROTO(struct cdnsp_device *vdev),
453 DECLARE_EVENT_CLASS(cdnsp_log_request,
454 TP_PROTO(struct cdnsp_request *req),
457 __string(name, req->pep->name)
458 __field(struct usb_request *, request)
459 __field(struct cdnsp_request *, preq)
461 __field(unsigned int, actual)
462 __field(unsigned int, length)
464 __field(dma_addr_t, dma)
465 __field(unsigned int, stream_id)
466 __field(unsigned int, zero)
467 __field(unsigned int, short_not_ok)
468 __field(unsigned int, no_interrupt)
469 __field(struct scatterlist*, sg)
470 __field(unsigned int, num_sgs)
471 __field(unsigned int, num_mapped_sgs)
475 __assign_str(name, req->pep->name);
476 __entry->request = &req->request;
478 __entry->buf = req->request.buf;
479 __entry->actual = req->request.actual;
480 __entry->length = req->request.length;
481 __entry->status = req->request.status;
482 __entry->dma = req->request.dma;
483 __entry->stream_id = req->request.stream_id;
484 __entry->zero = req->request.zero;
485 __entry->short_not_ok = req->request.short_not_ok;
486 __entry->no_interrupt = req->request.no_interrupt;
487 __entry->sg = req->request.sg;
488 __entry->num_sgs = req->request.num_sgs;
489 __entry->num_mapped_sgs = req->request.num_mapped_sgs;
491 TP_printk("%s; req U:%p/P:%p, req buf %p, length %u/%u, status %d, "
492 "buf dma (%pad), SID %u, %s%s%s, sg %p, num_sg %d,"
494 __get_str(name), __entry->request, __entry->preq,
495 __entry->buf, __entry->actual, __entry->length,
496 __entry->status, &__entry->dma,
497 __entry->stream_id, __entry->zero ? "Z" : "z",
498 __entry->short_not_ok ? "S" : "s",
499 __entry->no_interrupt ? "I" : "i",
500 __entry->sg, __entry->num_sgs, __entry->num_mapped_sgs
504 DEFINE_EVENT(cdnsp_log_request, cdnsp_request_enqueue,
505 TP_PROTO(struct cdnsp_request *req),
509 DEFINE_EVENT(cdnsp_log_request, cdnsp_request_enqueue_busy,
510 TP_PROTO(struct cdnsp_request *req),
514 DEFINE_EVENT(cdnsp_log_request, cdnsp_request_enqueue_error,
515 TP_PROTO(struct cdnsp_request *req),
519 DEFINE_EVENT(cdnsp_log_request, cdnsp_request_dequeue,
520 TP_PROTO(struct cdnsp_request *req),
524 DEFINE_EVENT(cdnsp_log_request, cdnsp_request_giveback,
525 TP_PROTO(struct cdnsp_request *req),
529 DEFINE_EVENT(cdnsp_log_request, cdnsp_alloc_request,
530 TP_PROTO(struct cdnsp_request *req),
534 DEFINE_EVENT(cdnsp_log_request, cdnsp_free_request,
535 TP_PROTO(struct cdnsp_request *req),
539 DECLARE_EVENT_CLASS(cdnsp_log_ep_ctx,
540 TP_PROTO(struct cdnsp_ep_ctx *ctx),
546 __field(u32, tx_info)
547 __dynamic_array(char, str, CDNSP_MSG_MAX)
550 __entry->info = le32_to_cpu(ctx->ep_info);
551 __entry->info2 = le32_to_cpu(ctx->ep_info2);
552 __entry->deq = le64_to_cpu(ctx->deq);
553 __entry->tx_info = le32_to_cpu(ctx->tx_info);
555 TP_printk("%s", cdnsp_decode_ep_context(__get_str(str), CDNSP_MSG_MAX,
556 __entry->info, __entry->info2,
557 __entry->deq, __entry->tx_info)
561 DEFINE_EVENT(cdnsp_log_ep_ctx, cdnsp_ep_disabled,
562 TP_PROTO(struct cdnsp_ep_ctx *ctx),
566 DEFINE_EVENT(cdnsp_log_ep_ctx, cdnsp_ep_stopped_or_disabled,
567 TP_PROTO(struct cdnsp_ep_ctx *ctx),
571 DEFINE_EVENT(cdnsp_log_ep_ctx, cdnsp_remove_request,
572 TP_PROTO(struct cdnsp_ep_ctx *ctx),
576 DEFINE_EVENT(cdnsp_log_ep_ctx, cdnsp_handle_cmd_stop_ep,
577 TP_PROTO(struct cdnsp_ep_ctx *ctx),
581 DEFINE_EVENT(cdnsp_log_ep_ctx, cdnsp_handle_cmd_flush_ep,
582 TP_PROTO(struct cdnsp_ep_ctx *ctx),
586 DEFINE_EVENT(cdnsp_log_ep_ctx, cdnsp_handle_cmd_set_deq_ep,
587 TP_PROTO(struct cdnsp_ep_ctx *ctx),
591 DEFINE_EVENT(cdnsp_log_ep_ctx, cdnsp_handle_cmd_reset_ep,
592 TP_PROTO(struct cdnsp_ep_ctx *ctx),
596 DEFINE_EVENT(cdnsp_log_ep_ctx, cdnsp_handle_cmd_config_ep,
597 TP_PROTO(struct cdnsp_ep_ctx *ctx),
601 DECLARE_EVENT_CLASS(cdnsp_log_slot_ctx,
602 TP_PROTO(struct cdnsp_slot_ctx *ctx),
607 __field(u32, int_target)
611 __entry->info = le32_to_cpu(ctx->dev_info);
612 __entry->info2 = le32_to_cpu(ctx->dev_port);
613 __entry->int_target = le32_to_cpu(ctx->int_target);
614 __entry->state = le32_to_cpu(ctx->dev_state);
616 TP_printk("%s", cdnsp_decode_slot_context(__entry->info,
623 DEFINE_EVENT(cdnsp_log_slot_ctx, cdnsp_slot_already_in_default,
624 TP_PROTO(struct cdnsp_slot_ctx *ctx),
628 DEFINE_EVENT(cdnsp_log_slot_ctx, cdnsp_handle_cmd_enable_slot,
629 TP_PROTO(struct cdnsp_slot_ctx *ctx),
633 DEFINE_EVENT(cdnsp_log_slot_ctx, cdnsp_handle_cmd_disable_slot,
634 TP_PROTO(struct cdnsp_slot_ctx *ctx),
638 DEFINE_EVENT(cdnsp_log_slot_ctx, cdnsp_reset_device,
639 TP_PROTO(struct cdnsp_slot_ctx *ctx),
643 DEFINE_EVENT(cdnsp_log_slot_ctx, cdnsp_setup_device_slot,
644 TP_PROTO(struct cdnsp_slot_ctx *ctx),
648 DEFINE_EVENT(cdnsp_log_slot_ctx, cdnsp_handle_cmd_addr_dev,
649 TP_PROTO(struct cdnsp_slot_ctx *ctx),
653 DEFINE_EVENT(cdnsp_log_slot_ctx, cdnsp_handle_cmd_reset_dev,
654 TP_PROTO(struct cdnsp_slot_ctx *ctx),
658 DEFINE_EVENT(cdnsp_log_slot_ctx, cdnsp_handle_cmd_set_deq,
659 TP_PROTO(struct cdnsp_slot_ctx *ctx),
663 DEFINE_EVENT(cdnsp_log_slot_ctx, cdnsp_configure_endpoint,
664 TP_PROTO(struct cdnsp_slot_ctx *ctx),
668 DECLARE_EVENT_CLASS(cdnsp_log_td_info,
669 TP_PROTO(struct cdnsp_request *preq),
672 __string(name, preq->pep->name)
673 __field(struct usb_request *, request)
674 __field(struct cdnsp_request *, preq)
675 __field(union cdnsp_trb *, first_trb)
676 __field(union cdnsp_trb *, last_trb)
677 __field(dma_addr_t, trb_dma)
680 __assign_str(name, preq->pep->name);
681 __entry->request = &preq->request;
682 __entry->preq = preq;
683 __entry->first_trb = preq->td.first_trb;
684 __entry->last_trb = preq->td.last_trb;
685 __entry->trb_dma = cdnsp_trb_virt_to_dma(preq->td.start_seg,
688 TP_printk("%s req/preq: %p/%p, first trb %p[vir]/%pad(dma), last trb %p",
689 __get_str(name), __entry->request, __entry->preq,
690 __entry->first_trb, &__entry->trb_dma,
695 DEFINE_EVENT(cdnsp_log_td_info, cdnsp_remove_request_td,
696 TP_PROTO(struct cdnsp_request *preq),
700 DECLARE_EVENT_CLASS(cdnsp_log_ring,
701 TP_PROTO(struct cdnsp_ring *ring),
705 __field(void *, ring)
706 __field(dma_addr_t, enq)
707 __field(dma_addr_t, deq)
708 __field(dma_addr_t, enq_seg)
709 __field(dma_addr_t, deq_seg)
710 __field(unsigned int, num_segs)
711 __field(unsigned int, stream_id)
712 __field(unsigned int, cycle_state)
713 __field(unsigned int, num_trbs_free)
714 __field(unsigned int, bounce_buf_len)
717 __entry->ring = ring;
718 __entry->type = ring->type;
719 __entry->num_segs = ring->num_segs;
720 __entry->stream_id = ring->stream_id;
721 __entry->enq_seg = ring->enq_seg->dma;
722 __entry->deq_seg = ring->deq_seg->dma;
723 __entry->cycle_state = ring->cycle_state;
724 __entry->num_trbs_free = ring->num_trbs_free;
725 __entry->bounce_buf_len = ring->bounce_buf_len;
726 __entry->enq = cdnsp_trb_virt_to_dma(ring->enq_seg,
728 __entry->deq = cdnsp_trb_virt_to_dma(ring->deq_seg,
731 TP_printk("%s %p: enq %pad(%pad) deq %pad(%pad) segs %d stream %d"
732 " free_trbs %d bounce %d cycle %d",
733 cdnsp_ring_type_string(__entry->type), __entry->ring,
734 &__entry->enq, &__entry->enq_seg,
735 &__entry->deq, &__entry->deq_seg,
738 __entry->num_trbs_free,
739 __entry->bounce_buf_len,
744 DEFINE_EVENT(cdnsp_log_ring, cdnsp_ring_alloc,
745 TP_PROTO(struct cdnsp_ring *ring),
749 DEFINE_EVENT(cdnsp_log_ring, cdnsp_ring_free,
750 TP_PROTO(struct cdnsp_ring *ring),
754 DEFINE_EVENT(cdnsp_log_ring, cdnsp_set_stream_ring,
755 TP_PROTO(struct cdnsp_ring *ring),
759 DEFINE_EVENT(cdnsp_log_ring, cdnsp_ring_expansion,
760 TP_PROTO(struct cdnsp_ring *ring),
764 DEFINE_EVENT(cdnsp_log_ring, cdnsp_inc_enq,
765 TP_PROTO(struct cdnsp_ring *ring),
769 DEFINE_EVENT(cdnsp_log_ring, cdnsp_inc_deq,
770 TP_PROTO(struct cdnsp_ring *ring),
774 DECLARE_EVENT_CLASS(cdnsp_log_portsc,
775 TP_PROTO(u32 portnum, u32 portsc),
776 TP_ARGS(portnum, portsc),
778 __field(u32, portnum)
780 __dynamic_array(char, str, CDNSP_MSG_MAX)
783 __entry->portnum = portnum;
784 __entry->portsc = portsc;
786 TP_printk("port-%d: %s",
788 cdnsp_decode_portsc(__get_str(str), CDNSP_MSG_MAX,
793 DEFINE_EVENT(cdnsp_log_portsc, cdnsp_handle_port_status,
794 TP_PROTO(u32 portnum, u32 portsc),
795 TP_ARGS(portnum, portsc)
798 DEFINE_EVENT(cdnsp_log_portsc, cdnsp_link_state_changed,
799 TP_PROTO(u32 portnum, u32 portsc),
800 TP_ARGS(portnum, portsc)
803 TRACE_EVENT(cdnsp_stream_number,
804 TP_PROTO(struct cdnsp_ep *pep, int num_stream_ctxs, int num_streams),
805 TP_ARGS(pep, num_stream_ctxs, num_streams),
807 __string(name, pep->name)
808 __field(int, num_stream_ctxs)
809 __field(int, num_streams)
812 __entry->num_stream_ctxs = num_stream_ctxs;
813 __entry->num_streams = num_streams;
815 TP_printk("%s Need %u stream ctx entries for %u stream IDs.",
816 __get_str(name), __entry->num_stream_ctxs,
817 __entry->num_streams)
820 #endif /* __CDNSP_TRACE_H */
822 /* this part must be outside header guard */
824 #undef TRACE_INCLUDE_PATH
825 #define TRACE_INCLUDE_PATH .
827 #undef TRACE_INCLUDE_FILE
828 #define TRACE_INCLUDE_FILE cdnsp-trace
830 #include <trace/define_trace.h>