#include "cppi_dma.h"
 #include "musb_core.h"
+#include "musb_trace.h"
 
 #define RNDIS_REG(x) (0x80 + ((x - 1) * 4))
 
                        csr = MUSB_TXCSR_MODE | MUSB_TXCSR_TXPKTRDY;
                        musb_writew(epio, MUSB_TXCSR, csr);
                }
+
+               trace_musb_cppi41_done(cppi41_channel);
                musb_dma_completion(musb, hw_ep->epnum, cppi41_channel->is_tx);
        } else {
                /* next iteration, reload */
                dma_desc->callback = cppi41_dma_callback;
                dma_desc->callback_param = &cppi41_channel->channel;
                cppi41_channel->cookie = dma_desc->tx_submit(dma_desc);
+               trace_musb_cppi41_cont(cppi41_channel);
                dma_async_issue_pending(dc);
 
                if (!cppi41_channel->is_tx) {
        transferred = cppi41_channel->prog_len - txstate.residue;
        cppi41_channel->transferred += transferred;
 
-       musb_dbg(musb, "DMA transfer done on hw_ep=%d bytes=%d/%d",
-               hw_ep->epnum, cppi41_channel->transferred,
-               cppi41_channel->total_len);
-
+       trace_musb_cppi41_gb(cppi41_channel);
        update_rx_toggle(cppi41_channel);
 
        if (cppi41_channel->transferred == cppi41_channel->total_len ||
        struct musb *musb = cppi41_channel->controller->musb;
        unsigned use_gen_rndis = 0;
 
-       musb_dbg(musb,
-               "configure ep%d/%x packet_sz=%d, mode=%d, dma_addr=0x%llx, len=%d is_tx=%d",
-               cppi41_channel->port_num, RNDIS_REG(cppi41_channel->port_num),
-               packet_sz, mode, (unsigned long long) dma_addr,
-               len, cppi41_channel->is_tx);
-
        cppi41_channel->buf_addr = dma_addr;
        cppi41_channel->total_len = len;
        cppi41_channel->transferred = 0;
        cppi41_channel->cookie = dma_desc->tx_submit(dma_desc);
        cppi41_channel->channel.rx_packet_done = false;
 
+       trace_musb_cppi41_config(cppi41_channel);
+
        save_rx_toggle(cppi41_channel);
        dma_async_issue_pending(dc);
        return true;
        cppi41_channel->hw_ep = hw_ep;
        cppi41_channel->is_allocated = 1;
 
+       trace_musb_cppi41_alloc(cppi41_channel);
        return &cppi41_channel->channel;
 }
 
 {
        struct cppi41_dma_channel *cppi41_channel = channel->private_data;
 
+       trace_musb_cppi41_free(cppi41_channel);
        if (cppi41_channel->is_allocated) {
                cppi41_channel->is_allocated = 0;
                channel->status = MUSB_DMA_STATUS_FREE;
        u16 csr;
 
        is_tx = cppi41_channel->is_tx;
-       musb_dbg(musb, "abort channel=%d, is_tx=%d",
-                       cppi41_channel->port_num, is_tx);
+       trace_musb_cppi41_abort(cppi41_channel);
 
        if (cppi41_channel->channel.status == MUSB_DMA_STATUS_FREE)
                return 0;
 
 #include <linux/tracepoint.h>
 #include <linux/usb.h>
 #include "musb_core.h"
+#ifdef CONFIG_USB_TI_CPPI41_DMA
+#include "cppi_dma.h"
+#endif
 
 #define MUSB_MSG_MAX   500
 
        TP_ARGS(req)
 );
 
+#ifdef CONFIG_USB_TI_CPPI41_DMA
+DECLARE_EVENT_CLASS(musb_cppi41,
+       TP_PROTO(struct cppi41_dma_channel *ch),
+       TP_ARGS(ch),
+       TP_STRUCT__entry(
+               __field(struct cppi41_dma_channel *, ch)
+               __string(name, dev_name(ch->hw_ep->musb->controller))
+               __field(u8, hwep)
+               __field(u8, port)
+               __field(u8, is_tx)
+               __field(u32, len)
+               __field(u32, prog_len)
+               __field(u32, xferred)
+       ),
+       TP_fast_assign(
+               __entry->ch = ch;
+               __assign_str(name, dev_name(ch->hw_ep->musb->controller));
+               __entry->hwep = ch->hw_ep->epnum;
+               __entry->port = ch->port_num;
+               __entry->is_tx = ch->is_tx;
+               __entry->len = ch->total_len;
+               __entry->prog_len = ch->prog_len;
+               __entry->xferred = ch->transferred;
+       ),
+       TP_printk("%s: %p, hwep%d ch%d%s, prog_len %d, len %d/%d",
+                       __get_str(name), __entry->ch, __entry->hwep,
+                       __entry->port, __entry->is_tx ? "tx" : "rx",
+                       __entry->prog_len, __entry->xferred, __entry->len
+       )
+);
+
+DEFINE_EVENT(musb_cppi41, musb_cppi41_done,
+       TP_PROTO(struct cppi41_dma_channel *ch),
+       TP_ARGS(ch)
+);
+
+DEFINE_EVENT(musb_cppi41, musb_cppi41_gb,
+       TP_PROTO(struct cppi41_dma_channel *ch),
+       TP_ARGS(ch)
+);
+
+DEFINE_EVENT(musb_cppi41, musb_cppi41_config,
+       TP_PROTO(struct cppi41_dma_channel *ch),
+       TP_ARGS(ch)
+);
+
+DEFINE_EVENT(musb_cppi41, musb_cppi41_cont,
+       TP_PROTO(struct cppi41_dma_channel *ch),
+       TP_ARGS(ch)
+);
+
+DEFINE_EVENT(musb_cppi41, musb_cppi41_alloc,
+       TP_PROTO(struct cppi41_dma_channel *ch),
+       TP_ARGS(ch)
+);
+
+DEFINE_EVENT(musb_cppi41, musb_cppi41_abort,
+       TP_PROTO(struct cppi41_dma_channel *ch),
+       TP_ARGS(ch)
+);
+
+DEFINE_EVENT(musb_cppi41, musb_cppi41_free,
+       TP_PROTO(struct cppi41_dma_channel *ch),
+       TP_ARGS(ch)
+);
+#endif /* CONFIG_USB_TI_CPPI41_DMA */
+
 #endif /* __MUSB_TRACE_H */
 
 /* this part has to be here */