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