提交 1c82392a 编写于 作者: G Gerd Hoffmann

xhci: add tracepoint for endpoint state changes

Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
上级 52190422
...@@ -586,6 +586,14 @@ static const char *TRBCCode_names[] = { ...@@ -586,6 +586,14 @@ static const char *TRBCCode_names[] = {
[CC_SPLIT_TRANSACTION_ERROR] = "CC_SPLIT_TRANSACTION_ERROR", [CC_SPLIT_TRANSACTION_ERROR] = "CC_SPLIT_TRANSACTION_ERROR",
}; };
static const char *ep_state_names[] = {
[EP_DISABLED] = "disabled",
[EP_RUNNING] = "running",
[EP_HALTED] = "halted",
[EP_STOPPED] = "stopped",
[EP_ERROR] = "error",
};
static const char *lookup_name(uint32_t index, const char **list, uint32_t llen) static const char *lookup_name(uint32_t index, const char **list, uint32_t llen)
{ {
if (index >= llen || list[index] == NULL) { if (index >= llen || list[index] == NULL) {
...@@ -606,6 +614,12 @@ static const char *event_name(XHCIEvent *event) ...@@ -606,6 +614,12 @@ static const char *event_name(XHCIEvent *event)
ARRAY_SIZE(TRBCCode_names)); ARRAY_SIZE(TRBCCode_names));
} }
static const char *ep_state_name(uint32_t state)
{
return lookup_name(state, ep_state_names,
ARRAY_SIZE(ep_state_names));
}
static uint64_t xhci_mfindex_get(XHCIState *xhci) static uint64_t xhci_mfindex_get(XHCIState *xhci)
{ {
int64_t now = qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL); int64_t now = qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL);
...@@ -1203,6 +1217,11 @@ static void xhci_set_ep_state(XHCIState *xhci, XHCIEPContext *epctx, ...@@ -1203,6 +1217,11 @@ static void xhci_set_ep_state(XHCIState *xhci, XHCIEPContext *epctx,
} }
xhci_dma_write_u32s(xhci, epctx->pctx, ctx, sizeof(ctx)); xhci_dma_write_u32s(xhci, epctx->pctx, ctx, sizeof(ctx));
if (epctx->state != state) {
trace_usb_xhci_ep_state(epctx->slotid, epctx->epid,
ep_state_name(epctx->state),
ep_state_name(state));
}
epctx->state = state; epctx->state = state;
} }
......
...@@ -381,6 +381,7 @@ usb_xhci_ep_set_dequeue(uint32_t slotid, uint32_t epid, uint32_t streamid, uint6 ...@@ -381,6 +381,7 @@ usb_xhci_ep_set_dequeue(uint32_t slotid, uint32_t epid, uint32_t streamid, uint6
usb_xhci_ep_kick(uint32_t slotid, uint32_t epid, uint32_t streamid) "slotid %d, epid %d, streamid %d" usb_xhci_ep_kick(uint32_t slotid, uint32_t epid, uint32_t streamid) "slotid %d, epid %d, streamid %d"
usb_xhci_ep_stop(uint32_t slotid, uint32_t epid) "slotid %d, epid %d" usb_xhci_ep_stop(uint32_t slotid, uint32_t epid) "slotid %d, epid %d"
usb_xhci_ep_reset(uint32_t slotid, uint32_t epid) "slotid %d, epid %d" usb_xhci_ep_reset(uint32_t slotid, uint32_t epid) "slotid %d, epid %d"
usb_xhci_ep_state(uint32_t slotid, uint32_t epid, const char *os, const char *ns) "slotid %d, epid %d, %s -> %s"
usb_xhci_xfer_start(void *xfer, uint32_t slotid, uint32_t epid, uint32_t streamid) "%p: slotid %d, epid %d, streamid %d" usb_xhci_xfer_start(void *xfer, uint32_t slotid, uint32_t epid, uint32_t streamid) "%p: slotid %d, epid %d, streamid %d"
usb_xhci_xfer_async(void *xfer) "%p" usb_xhci_xfer_async(void *xfer) "%p"
usb_xhci_xfer_nak(void *xfer) "%p" usb_xhci_xfer_nak(void *xfer) "%p"
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册