From: Gerd Hoffmann <kraxel@redhat.com>
To: qemu-devel@nongnu.org
Cc: Gerd Hoffmann <kraxel@redhat.com>
Subject: [Qemu-devel] [PATCH 36/54] xhci: trace cc codes in cleartext
Date: Thu, 6 Sep 2012 09:12:37 +0200 [thread overview]
Message-ID: <1346915575-12369-37-git-send-email-kraxel@redhat.com> (raw)
In-Reply-To: <1346915575-12369-1-git-send-email-kraxel@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
hw/usb/hcd-xhci.c | 48 +++++++++++++++++++++++++++++++++++++++++++++++-
trace-events | 2 +-
2 files changed, 48 insertions(+), 2 deletions(-)
diff --git a/hw/usb/hcd-xhci.c b/hw/usb/hcd-xhci.c
index 3c61bb8..ab32a7b 100644
--- a/hw/usb/hcd-xhci.c
+++ b/hw/usb/hcd-xhci.c
@@ -465,6 +465,45 @@ static const char *TRBType_names[] = {
[CR_VENDOR_NEC_CHALLENGE_RESPONSE] = "CR_VENDOR_NEC_CHALLENGE_RESPONSE",
};
+static const char *TRBCCode_names[] = {
+ [CC_INVALID] = "CC_INVALID",
+ [CC_SUCCESS] = "CC_SUCCESS",
+ [CC_DATA_BUFFER_ERROR] = "CC_DATA_BUFFER_ERROR",
+ [CC_BABBLE_DETECTED] = "CC_BABBLE_DETECTED",
+ [CC_USB_TRANSACTION_ERROR] = "CC_USB_TRANSACTION_ERROR",
+ [CC_TRB_ERROR] = "CC_TRB_ERROR",
+ [CC_STALL_ERROR] = "CC_STALL_ERROR",
+ [CC_RESOURCE_ERROR] = "CC_RESOURCE_ERROR",
+ [CC_BANDWIDTH_ERROR] = "CC_BANDWIDTH_ERROR",
+ [CC_NO_SLOTS_ERROR] = "CC_NO_SLOTS_ERROR",
+ [CC_INVALID_STREAM_TYPE_ERROR] = "CC_INVALID_STREAM_TYPE_ERROR",
+ [CC_SLOT_NOT_ENABLED_ERROR] = "CC_SLOT_NOT_ENABLED_ERROR",
+ [CC_EP_NOT_ENABLED_ERROR] = "CC_EP_NOT_ENABLED_ERROR",
+ [CC_SHORT_PACKET] = "CC_SHORT_PACKET",
+ [CC_RING_UNDERRUN] = "CC_RING_UNDERRUN",
+ [CC_RING_OVERRUN] = "CC_RING_OVERRUN",
+ [CC_VF_ER_FULL] = "CC_VF_ER_FULL",
+ [CC_PARAMETER_ERROR] = "CC_PARAMETER_ERROR",
+ [CC_BANDWIDTH_OVERRUN] = "CC_BANDWIDTH_OVERRUN",
+ [CC_CONTEXT_STATE_ERROR] = "CC_CONTEXT_STATE_ERROR",
+ [CC_NO_PING_RESPONSE_ERROR] = "CC_NO_PING_RESPONSE_ERROR",
+ [CC_EVENT_RING_FULL_ERROR] = "CC_EVENT_RING_FULL_ERROR",
+ [CC_INCOMPATIBLE_DEVICE_ERROR] = "CC_INCOMPATIBLE_DEVICE_ERROR",
+ [CC_MISSED_SERVICE_ERROR] = "CC_MISSED_SERVICE_ERROR",
+ [CC_COMMAND_RING_STOPPED] = "CC_COMMAND_RING_STOPPED",
+ [CC_COMMAND_ABORTED] = "CC_COMMAND_ABORTED",
+ [CC_STOPPED] = "CC_STOPPED",
+ [CC_STOPPED_LENGTH_INVALID] = "CC_STOPPED_LENGTH_INVALID",
+ [CC_MAX_EXIT_LATENCY_TOO_LARGE_ERROR]
+ = "CC_MAX_EXIT_LATENCY_TOO_LARGE_ERROR",
+ [CC_ISOCH_BUFFER_OVERRUN] = "CC_ISOCH_BUFFER_OVERRUN",
+ [CC_EVENT_LOST_ERROR] = "CC_EVENT_LOST_ERROR",
+ [CC_UNDEFINED_ERROR] = "CC_UNDEFINED_ERROR",
+ [CC_INVALID_STREAM_ID_ERROR] = "CC_INVALID_STREAM_ID_ERROR",
+ [CC_SECONDARY_BANDWIDTH_ERROR] = "CC_SECONDARY_BANDWIDTH_ERROR",
+ [CC_SPLIT_TRANSACTION_ERROR] = "CC_SPLIT_TRANSACTION_ERROR",
+};
+
static const char *lookup_name(uint32_t index, const char **list, uint32_t llen)
{
if (index >= llen || list[index] == NULL) {
@@ -479,6 +518,12 @@ static const char *trb_name(XHCITRB *trb)
ARRAY_SIZE(TRBType_names));
}
+static const char *event_name(XHCIEvent *event)
+{
+ return lookup_name(event->ccode, TRBCCode_names,
+ ARRAY_SIZE(TRBCCode_names));
+}
+
static uint64_t xhci_mfindex_get(XHCIState *xhci)
{
int64_t now = qemu_get_clock_ns(vm_clock);
@@ -574,7 +619,8 @@ static void xhci_write_event(XHCIState *xhci, XHCIEvent *event)
ev_trb.control = cpu_to_le32(ev_trb.control);
trace_usb_xhci_queue_event(xhci->er_ep_idx, trb_name(&ev_trb),
- ev_trb.parameter, ev_trb.status, ev_trb.control);
+ event_name(event), ev_trb.parameter,
+ ev_trb.status, ev_trb.control);
addr = xhci->er_start + TRB_SIZE*xhci->er_ep_idx;
pci_dma_write(&xhci->pci_dev, addr, &ev_trb, TRB_SIZE);
diff --git a/trace-events b/trace-events
index ba4b112..a642fad 100644
--- a/trace-events
+++ b/trace-events
@@ -313,7 +313,7 @@ usb_xhci_runtime_write(uint32_t off, uint32_t val) "off 0x%04x, val 0x%08x"
usb_xhci_doorbell_write(uint32_t off, uint32_t val) "off 0x%04x, val 0x%08x"
usb_xhci_irq_intx(uint32_t level) "level %d"
usb_xhci_irq_msi(uint32_t nr) "nr %d"
-usb_xhci_queue_event(uint32_t idx, const char *name, uint64_t param, uint32_t status, uint32_t control) "idx %d, %s, p %016" PRIx64 ", s %08x, c 0x%08x"
+usb_xhci_queue_event(uint32_t idx, const char *trb, const char *evt, uint64_t param, uint32_t status, uint32_t control) "idx %d, %s, %s, p %016" PRIx64 ", s %08x, c 0x%08x"
usb_xhci_fetch_trb(uint64_t addr, const char *name, uint64_t param, uint32_t status, uint32_t control) "addr %016" PRIx64 ", %s, p %016" PRIx64 ", s %08x, c 0x%08x"
usb_xhci_slot_enable(uint32_t slotid) "slotid %d"
usb_xhci_slot_disable(uint32_t slotid) "slotid %d"
--
1.7.1
next prev parent reply other threads:[~2012-09-06 7:13 UTC|newest]
Thread overview: 61+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-09-06 7:12 [Qemu-devel] [PULL 00/54] usb patch queue Gerd Hoffmann
2012-09-06 7:12 ` [Qemu-devel] [PATCH 01/54] usb: controllers do not need to check for babble themselves Gerd Hoffmann
2012-09-06 7:12 ` [Qemu-devel] [PATCH 02/54] usb-core: Don't set packet state to complete on a nak Gerd Hoffmann
2012-09-06 7:12 ` [Qemu-devel] [PATCH 03/54] usb-core: Add a usb_ep_find_packet_by_id() helper function Gerd Hoffmann
2012-09-06 7:12 ` [Qemu-devel] [PATCH 04/54] usb-core: Allow the first packet of a pipelined ep to complete immediately Gerd Hoffmann
2012-09-06 7:12 ` [Qemu-devel] [PATCH 05/54] Revert "ehci: don't flush cache on doorbell rings." Gerd Hoffmann
2012-09-06 7:12 ` [Qemu-devel] [PATCH 06/54] ehci: Validate qh is not changed unexpectedly by the guest Gerd Hoffmann
2012-09-06 7:12 ` [Qemu-devel] [PATCH 07/54] ehci: Update copyright headers to reflect recent work Gerd Hoffmann
2012-09-06 7:12 ` [Qemu-devel] [PATCH 08/54] ehci: Properly cleanup packets on cancel Gerd Hoffmann
2012-09-06 7:12 ` [Qemu-devel] [PATCH 09/54] ehci: Properly report completed but not yet processed packets to the guest Gerd Hoffmann
2012-09-06 7:12 ` [Qemu-devel] [PATCH 10/54] ehci: check for EHCI_ASYNC_FINISHED first in ehci_free_packet Gerd Hoffmann
2012-09-06 7:12 ` [Qemu-devel] [PATCH 11/54] ehci: trace guest bugs Gerd Hoffmann
2012-09-06 7:12 ` [Qemu-devel] [PATCH 12/54] ehci: add doorbell trace events Gerd Hoffmann
2012-09-06 7:12 ` [Qemu-devel] [PATCH 13/54] ehci: Add some additional ehci_trace_guest_bug() calls Gerd Hoffmann
2012-09-06 7:12 ` [Qemu-devel] [PATCH 14/54] ehci: Fix memory leak in handling of NAK-ed packets Gerd Hoffmann
2012-09-06 7:12 ` [Qemu-devel] [PATCH 15/54] ehci: Handle USB_RET_PROCERR in ehci_fill_queue Gerd Hoffmann
2012-09-06 7:12 ` [Qemu-devel] [PATCH 16/54] ehci: Correct a comment in fetchqtd packet processing Gerd Hoffmann
2012-09-06 7:12 ` [Qemu-devel] [PATCH 17/54] usb-redir: Never return USB_RET_NAK for async handled packets Gerd Hoffmann
2012-09-06 7:12 ` [Qemu-devel] [PATCH 18/54] usb-redir: Don't delay handling of open events to a bottom half Gerd Hoffmann
2012-09-06 7:12 ` [Qemu-devel] [PATCH 19/54] usb-redir: Get rid of async-struct get member Gerd Hoffmann
2012-09-06 7:12 ` [Qemu-devel] [PATCH 20/54] usb-redir: Get rid of local shadow copy of packet headers Gerd Hoffmann
2012-09-06 7:12 ` [Qemu-devel] [PATCH 21/54] usb-redir: Get rid of unused async-struct dev member Gerd Hoffmann
2012-09-06 7:12 ` [Qemu-devel] [PATCH 22/54] usb-redir: Move to core packet id and queue handling Gerd Hoffmann
2012-09-06 7:12 ` [Qemu-devel] [PATCH 23/54] usb-redir: Return babble when getting more bulk data then requested Gerd Hoffmann
2012-09-06 7:12 ` [Qemu-devel] [PATCH 24/54] usb-redir: Convert to new libusbredirparser 0.5 API Gerd Hoffmann
2012-09-06 7:12 ` [Qemu-devel] [PATCH 25/54] usb-redir: Set ep max_packet_size if available Gerd Hoffmann
2012-09-06 7:12 ` [Qemu-devel] [PATCH 26/54] usb-redir: Add a usbredir_reject_device helper function Gerd Hoffmann
2012-09-06 7:12 ` [Qemu-devel] [PATCH 27/54] usb-redir: Ensure our peer has the necessary caps when redirecting to XHCI Gerd Hoffmann
2012-09-06 7:12 ` [Qemu-devel] [PATCH 28/54] usb-redir: Enable pipelining for bulk endpoints Gerd Hoffmann
2012-09-06 7:12 ` [Qemu-devel] [PATCH 29/54] Better name usb braille device Gerd Hoffmann
2012-09-06 7:12 ` [Qemu-devel] [PATCH 30/54] usb-audio: fix usb version Gerd Hoffmann
2012-09-06 7:12 ` [Qemu-devel] [PATCH 31/54] xhci: rip out background transfer code Gerd Hoffmann
2012-09-06 7:12 ` [Qemu-devel] [PATCH 32/54] xhci: drop buffering Gerd Hoffmann
2012-09-06 7:12 ` [Qemu-devel] [PATCH 33/54] xhci: move device lookup into xhci_setup_packet Gerd Hoffmann
2012-09-06 7:12 ` [Qemu-devel] [PATCH 34/54] xhci: implement mfindex Gerd Hoffmann
2012-09-06 7:12 ` [Qemu-devel] [PATCH 35/54] xhci: iso xfer support Gerd Hoffmann
2012-09-06 7:12 ` Gerd Hoffmann [this message]
2012-09-06 7:12 ` [Qemu-devel] [PATCH 37/54] xhci: add trace_usb_xhci_ep_set_dequeue Gerd Hoffmann
2012-09-06 7:12 ` [Qemu-devel] [PATCH 38/54] xhci: fix runtime write tracepoint Gerd Hoffmann
2012-09-06 7:12 ` [Qemu-devel] [PATCH 39/54] xhci: update register layout Gerd Hoffmann
2012-09-06 7:12 ` [Qemu-devel] [PATCH 40/54] xhci: update port handling Gerd Hoffmann
2012-09-06 7:12 ` [Qemu-devel] [PATCH 41/54] usb3: superspeed descriptors Gerd Hoffmann
2012-09-06 7:12 ` [Qemu-devel] [PATCH 42/54] usb3: superspeed endpoint companion Gerd Hoffmann
2012-09-06 7:12 ` [Qemu-devel] [PATCH 43/54] usb3: bos decriptor Gerd Hoffmann
2012-09-06 7:12 ` [Qemu-devel] [PATCH 44/54] usb-storage: usb3 support Gerd Hoffmann
2012-09-06 7:12 ` [Qemu-devel] [PATCH 45/54] xhci: fix & cleanup msi Gerd Hoffmann
2012-09-06 7:12 ` [Qemu-devel] [PATCH 46/54] xhci: rework interrupt handling Gerd Hoffmann
2012-09-06 7:12 ` [Qemu-devel] [PATCH 47/54] xhci: add msix support Gerd Hoffmann
2012-09-06 7:12 ` [Qemu-devel] [PATCH 48/54] xhci: move register update into xhci_intr_raise Gerd Hoffmann
2012-09-06 7:12 ` [Qemu-devel] [PATCH 49/54] xhci: add XHCIInterrupter Gerd Hoffmann
2012-09-06 7:12 ` [Qemu-devel] [PATCH 50/54] xhci: prepare xhci_runtime_{read, write} for multiple interrupters Gerd Hoffmann
2012-09-06 7:12 ` [Qemu-devel] [PATCH 51/54] xhci: pick target interrupter Gerd Hoffmann
2012-09-06 7:12 ` [Qemu-devel] [PATCH 52/54] xhci: support multiple interrupters Gerd Hoffmann
2012-09-06 7:12 ` [Qemu-devel] [PATCH 53/54] xhci: kill xhci_mem_{read, write} dispatcher functions Gerd Hoffmann
2012-09-06 7:12 ` [Qemu-devel] [PATCH 54/54] xhci: allow bytewise capability register reads Gerd Hoffmann
2012-09-10 13:23 ` [Qemu-devel] [PULL 00/54] usb patch queue Aurelien Jarno
2012-09-10 13:37 ` Gerd Hoffmann
2012-09-10 15:08 ` Andreas Färber
2012-09-10 17:49 ` Anthony Liguori
2012-09-11 5:46 ` Gerd Hoffmann
2012-09-11 17:22 ` Aurelien Jarno
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1346915575-12369-37-git-send-email-kraxel@redhat.com \
--to=kraxel@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).