^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) * musb_trace.h - MUSB Controller Trace Support
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) * Copyright (C) 2015 Texas Instruments Incorporated - http://www.ti.com
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7) * Author: Bin Liu <b-liu@ti.com>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) #undef TRACE_SYSTEM
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) #define TRACE_SYSTEM musb
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) #if !defined(__MUSB_TRACE_H) || defined(TRACE_HEADER_MULTI_READ)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) #define __MUSB_TRACE_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) #include <linux/types.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) #include <linux/tracepoint.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) #include <linux/usb.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) #include "musb_core.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) #ifdef CONFIG_USB_TI_CPPI41_DMA
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) #include "cppi_dma.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) #define MUSB_MSG_MAX 500
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) TRACE_EVENT(musb_log,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) TP_PROTO(struct musb *musb, struct va_format *vaf),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) TP_ARGS(musb, vaf),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) TP_STRUCT__entry(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) __string(name, dev_name(musb->controller))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) __dynamic_array(char, msg, MUSB_MSG_MAX)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) ),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) TP_fast_assign(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) __assign_str(name, dev_name(musb->controller));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) vsnprintf(__get_str(msg), MUSB_MSG_MAX, vaf->fmt, *vaf->va);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) ),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) TP_printk("%s: %s", __get_str(name), __get_str(msg))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) );
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) DECLARE_EVENT_CLASS(musb_regb,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) TP_PROTO(void *caller, const void __iomem *addr,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) unsigned int offset, u8 data),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) TP_ARGS(caller, addr, offset, data),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) TP_STRUCT__entry(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) __field(void *, caller)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46) __field(const void __iomem *, addr)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47) __field(unsigned int, offset)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48) __field(u8, data)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49) ),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50) TP_fast_assign(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51) __entry->caller = caller;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52) __entry->addr = addr;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53) __entry->offset = offset;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54) __entry->data = data;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55) ),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56) TP_printk("%pS: %p + %04x: %02x",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57) __entry->caller, __entry->addr, __entry->offset, __entry->data)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 58) );
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 59)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 60) DEFINE_EVENT(musb_regb, musb_readb,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 61) TP_PROTO(void *caller, const void __iomem *addr,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 62) unsigned int offset, u8 data),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 63) TP_ARGS(caller, addr, offset, data)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 64) );
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 65)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 66) DEFINE_EVENT(musb_regb, musb_writeb,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 67) TP_PROTO(void *caller, const void __iomem *addr,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 68) unsigned int offset, u8 data),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 69) TP_ARGS(caller, addr, offset, data)
^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(musb_regw,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 73) TP_PROTO(void *caller, const void __iomem *addr,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 74) unsigned int offset, u16 data),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 75) TP_ARGS(caller, addr, offset, data),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 76) TP_STRUCT__entry(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 77) __field(void *, caller)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 78) __field(const void __iomem *, addr)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 79) __field(unsigned int, offset)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 80) __field(u16, data)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 81) ),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 82) TP_fast_assign(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 83) __entry->caller = caller;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 84) __entry->addr = addr;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 85) __entry->offset = offset;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 86) __entry->data = data;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 87) ),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 88) TP_printk("%pS: %p + %04x: %04x",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 89) __entry->caller, __entry->addr, __entry->offset, __entry->data)
^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(musb_regw, musb_readw,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 93) TP_PROTO(void *caller, const void __iomem *addr,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 94) unsigned int offset, u16 data),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 95) TP_ARGS(caller, addr, offset, data)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 96) );
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 97)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 98) DEFINE_EVENT(musb_regw, musb_writew,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 99) TP_PROTO(void *caller, const void __iomem *addr,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 100) unsigned int offset, u16 data),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 101) TP_ARGS(caller, addr, offset, data)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 102) );
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 103)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 104) DECLARE_EVENT_CLASS(musb_regl,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 105) TP_PROTO(void *caller, const void __iomem *addr,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 106) unsigned int offset, u32 data),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 107) TP_ARGS(caller, addr, offset, data),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 108) TP_STRUCT__entry(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 109) __field(void *, caller)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 110) __field(const void __iomem *, addr)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 111) __field(unsigned int, offset)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 112) __field(u32, data)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 113) ),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 114) TP_fast_assign(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 115) __entry->caller = caller;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 116) __entry->addr = addr;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 117) __entry->offset = offset;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 118) __entry->data = data;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 119) ),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 120) TP_printk("%pS: %p + %04x: %08x",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 121) __entry->caller, __entry->addr, __entry->offset, __entry->data)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 122) );
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 123)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 124) DEFINE_EVENT(musb_regl, musb_readl,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 125) TP_PROTO(void *caller, const void __iomem *addr,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 126) unsigned int offset, u32 data),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 127) TP_ARGS(caller, addr, offset, data)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 128) );
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 129)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 130) DEFINE_EVENT(musb_regl, musb_writel,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 131) TP_PROTO(void *caller, const void __iomem *addr,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 132) unsigned int offset, u32 data),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 133) TP_ARGS(caller, addr, offset, data)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 134) );
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 135)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 136) TRACE_EVENT(musb_isr,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 137) TP_PROTO(struct musb *musb),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 138) TP_ARGS(musb),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 139) TP_STRUCT__entry(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 140) __string(name, dev_name(musb->controller))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 141) __field(u8, int_usb)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 142) __field(u16, int_tx)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 143) __field(u16, int_rx)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 144) ),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 145) TP_fast_assign(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 146) __assign_str(name, dev_name(musb->controller));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 147) __entry->int_usb = musb->int_usb;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 148) __entry->int_tx = musb->int_tx;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 149) __entry->int_rx = musb->int_rx;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 150) ),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 151) TP_printk("%s: usb %02x, tx %04x, rx %04x",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 152) __get_str(name), __entry->int_usb,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 153) __entry->int_tx, __entry->int_rx
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 154) )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 155) );
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 156)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 157) DECLARE_EVENT_CLASS(musb_urb,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 158) TP_PROTO(struct musb *musb, struct urb *urb),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 159) TP_ARGS(musb, urb),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 160) TP_STRUCT__entry(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 161) __string(name, dev_name(musb->controller))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 162) __field(struct urb *, urb)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 163) __field(unsigned int, pipe)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 164) __field(int, status)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 165) __field(unsigned int, flag)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 166) __field(u32, buf_len)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 167) __field(u32, actual_len)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 168) ),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 169) TP_fast_assign(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 170) __assign_str(name, dev_name(musb->controller));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 171) __entry->urb = urb;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 172) __entry->pipe = urb->pipe;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 173) __entry->status = urb->status;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 174) __entry->flag = urb->transfer_flags;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 175) __entry->buf_len = urb->transfer_buffer_length;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 176) __entry->actual_len = urb->actual_length;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 177) ),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 178) TP_printk("%s: %p, dev%d ep%d%s, flag 0x%x, len %d/%d, status %d",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 179) __get_str(name), __entry->urb,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 180) usb_pipedevice(__entry->pipe),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 181) usb_pipeendpoint(__entry->pipe),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 182) usb_pipein(__entry->pipe) ? "in" : "out",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 183) __entry->flag,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 184) __entry->actual_len, __entry->buf_len,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 185) __entry->status
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 186) )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 187) );
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 188)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 189) DEFINE_EVENT(musb_urb, musb_urb_start,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 190) TP_PROTO(struct musb *musb, struct urb *urb),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 191) TP_ARGS(musb, urb)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 192) );
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 193)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 194) DEFINE_EVENT(musb_urb, musb_urb_gb,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 195) TP_PROTO(struct musb *musb, struct urb *urb),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 196) TP_ARGS(musb, urb)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 197) );
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 198)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 199) DEFINE_EVENT(musb_urb, musb_urb_rx,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 200) TP_PROTO(struct musb *musb, struct urb *urb),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 201) TP_ARGS(musb, urb)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 202) );
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 203)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 204) DEFINE_EVENT(musb_urb, musb_urb_tx,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 205) TP_PROTO(struct musb *musb, struct urb *urb),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 206) TP_ARGS(musb, urb)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 207) );
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 208)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 209) DEFINE_EVENT(musb_urb, musb_urb_enq,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 210) TP_PROTO(struct musb *musb, struct urb *urb),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 211) TP_ARGS(musb, urb)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 212) );
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 213)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 214) DEFINE_EVENT(musb_urb, musb_urb_deq,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 215) TP_PROTO(struct musb *musb, struct urb *urb),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 216) TP_ARGS(musb, urb)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 217) );
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 218)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 219) DECLARE_EVENT_CLASS(musb_req,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 220) TP_PROTO(struct musb_request *req),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 221) TP_ARGS(req),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 222) TP_STRUCT__entry(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 223) __field(struct usb_request *, req)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 224) __field(u8, is_tx)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 225) __field(u8, epnum)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 226) __field(int, status)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 227) __field(unsigned int, buf_len)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 228) __field(unsigned int, actual_len)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 229) __field(unsigned int, zero)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 230) __field(unsigned int, short_not_ok)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 231) __field(unsigned int, no_interrupt)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 232) ),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 233) TP_fast_assign(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 234) __entry->req = &req->request;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 235) __entry->is_tx = req->tx;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 236) __entry->epnum = req->epnum;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 237) __entry->status = req->request.status;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 238) __entry->buf_len = req->request.length;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 239) __entry->actual_len = req->request.actual;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 240) __entry->zero = req->request.zero;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 241) __entry->short_not_ok = req->request.short_not_ok;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 242) __entry->no_interrupt = req->request.no_interrupt;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 243) ),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 244) TP_printk("%p, ep%d %s, %s%s%s, len %d/%d, status %d",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 245) __entry->req, __entry->epnum,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 246) __entry->is_tx ? "tx/IN" : "rx/OUT",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 247) __entry->zero ? "Z" : "z",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 248) __entry->short_not_ok ? "S" : "s",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 249) __entry->no_interrupt ? "I" : "i",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 250) __entry->actual_len, __entry->buf_len,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 251) __entry->status
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 252) )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 253) );
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 254)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 255) DEFINE_EVENT(musb_req, musb_req_gb,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 256) TP_PROTO(struct musb_request *req),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 257) TP_ARGS(req)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 258) );
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 259)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 260) DEFINE_EVENT(musb_req, musb_req_tx,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 261) TP_PROTO(struct musb_request *req),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 262) TP_ARGS(req)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 263) );
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 264)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 265) DEFINE_EVENT(musb_req, musb_req_rx,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 266) TP_PROTO(struct musb_request *req),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 267) TP_ARGS(req)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 268) );
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 269)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 270) DEFINE_EVENT(musb_req, musb_req_alloc,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 271) TP_PROTO(struct musb_request *req),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 272) TP_ARGS(req)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 273) );
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 274)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 275) DEFINE_EVENT(musb_req, musb_req_free,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 276) TP_PROTO(struct musb_request *req),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 277) TP_ARGS(req)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 278) );
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 279)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 280) DEFINE_EVENT(musb_req, musb_req_start,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 281) TP_PROTO(struct musb_request *req),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 282) TP_ARGS(req)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 283) );
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 284)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 285) DEFINE_EVENT(musb_req, musb_req_enq,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 286) TP_PROTO(struct musb_request *req),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 287) TP_ARGS(req)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 288) );
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 289)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 290) DEFINE_EVENT(musb_req, musb_req_deq,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 291) TP_PROTO(struct musb_request *req),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 292) TP_ARGS(req)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 293) );
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 294)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 295) #ifdef CONFIG_USB_TI_CPPI41_DMA
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 296) DECLARE_EVENT_CLASS(musb_cppi41,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 297) TP_PROTO(struct cppi41_dma_channel *ch),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 298) TP_ARGS(ch),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 299) TP_STRUCT__entry(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 300) __field(struct cppi41_dma_channel *, ch)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 301) __string(name, dev_name(ch->hw_ep->musb->controller))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 302) __field(u8, hwep)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 303) __field(u8, port)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 304) __field(u8, is_tx)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 305) __field(u32, len)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 306) __field(u32, prog_len)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 307) __field(u32, xferred)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 308) ),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 309) TP_fast_assign(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 310) __entry->ch = ch;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 311) __assign_str(name, dev_name(ch->hw_ep->musb->controller));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 312) __entry->hwep = ch->hw_ep->epnum;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 313) __entry->port = ch->port_num;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 314) __entry->is_tx = ch->is_tx;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 315) __entry->len = ch->total_len;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 316) __entry->prog_len = ch->prog_len;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 317) __entry->xferred = ch->transferred;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 318) ),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 319) TP_printk("%s: %p, hwep%d ch%d%s, prog_len %d, len %d/%d",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 320) __get_str(name), __entry->ch, __entry->hwep,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 321) __entry->port, __entry->is_tx ? "tx" : "rx",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 322) __entry->prog_len, __entry->xferred, __entry->len
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 323) )
^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) DEFINE_EVENT(musb_cppi41, musb_cppi41_done,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 327) TP_PROTO(struct cppi41_dma_channel *ch),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 328) TP_ARGS(ch)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 329) );
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 330)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 331) DEFINE_EVENT(musb_cppi41, musb_cppi41_gb,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 332) TP_PROTO(struct cppi41_dma_channel *ch),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 333) TP_ARGS(ch)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 334) );
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 335)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 336) DEFINE_EVENT(musb_cppi41, musb_cppi41_config,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 337) TP_PROTO(struct cppi41_dma_channel *ch),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 338) TP_ARGS(ch)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 339) );
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 340)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 341) DEFINE_EVENT(musb_cppi41, musb_cppi41_cont,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 342) TP_PROTO(struct cppi41_dma_channel *ch),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 343) TP_ARGS(ch)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 344) );
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 345)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 346) DEFINE_EVENT(musb_cppi41, musb_cppi41_alloc,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 347) TP_PROTO(struct cppi41_dma_channel *ch),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 348) TP_ARGS(ch)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 349) );
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 350)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 351) DEFINE_EVENT(musb_cppi41, musb_cppi41_abort,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 352) TP_PROTO(struct cppi41_dma_channel *ch),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 353) TP_ARGS(ch)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 354) );
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 355)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 356) DEFINE_EVENT(musb_cppi41, musb_cppi41_free,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 357) TP_PROTO(struct cppi41_dma_channel *ch),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 358) TP_ARGS(ch)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 359) );
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 360) #endif /* CONFIG_USB_TI_CPPI41_DMA */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 361)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 362) #endif /* __MUSB_TRACE_H */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 363)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 364) /* this part has to be here */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 365)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 366) #undef TRACE_INCLUDE_PATH
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 367) #define TRACE_INCLUDE_PATH .
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 368)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 369) #undef TRACE_INCLUDE_FILE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 370) #define TRACE_INCLUDE_FILE musb_trace
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 371)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 372) #include <trace/define_trace.h>