Skip to content

Commit

Permalink
usb: musb: add tracepoints to dump interrupt events
Browse files Browse the repository at this point in the history
This adds tracepoints to dump musb interrupt events.

Signed-off-by: Bin Liu <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
liubiin authored and gregkh committed Jul 16, 2016
1 parent c74173f commit cfb9a1b
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 3 deletions.
4 changes: 1 addition & 3 deletions drivers/usb/musb/musb_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1588,9 +1588,7 @@ irqreturn_t musb_interrupt(struct musb *musb)

devctl = musb_readb(musb->mregs, MUSB_DEVCTL);

dev_dbg(musb->controller, "** IRQ %s usb%04x tx%04x rx%04x\n",
is_host_active(musb) ? "host" : "peripheral",
musb->int_usb, musb->int_tx, musb->int_rx);
trace_musb_isr(musb);

/**
* According to Mentor Graphics' documentation, flowchart on page 98,
Expand Down
21 changes: 21 additions & 0 deletions drivers/usb/musb/musb_trace.h
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,27 @@ DEFINE_EVENT(musb_regl, musb_writel,
TP_ARGS(caller, addr, offset, data)
);

TRACE_EVENT(musb_isr,
TP_PROTO(struct musb *musb),
TP_ARGS(musb),
TP_STRUCT__entry(
__string(name, dev_name(musb->controller))
__field(u8, int_usb)
__field(u16, int_tx)
__field(u16, int_rx)
),
TP_fast_assign(
__assign_str(name, dev_name(musb->controller));
__entry->int_usb = musb->int_usb;
__entry->int_tx = musb->int_tx;
__entry->int_rx = musb->int_rx;
),
TP_printk("%s: usb %02x, tx %04x, rx %04x",
__get_str(name), __entry->int_usb,
__entry->int_tx, __entry->int_rx
)
);

#endif /* __MUSB_TRACE_H */

/* this part has to be here */
Expand Down

0 comments on commit cfb9a1b

Please sign in to comment.