[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 05/12] usb-ehci: improve mmio tracing
From: |
Gerd Hoffmann |
Subject: |
[Qemu-devel] [PATCH 05/12] usb-ehci: improve mmio tracing |
Date: |
Thu, 26 May 2011 12:44:07 +0200 |
Add a separate tracepoint to log how register values change in response
to a mmio write. Especially useful for registers which have read-only
or clear-on-write bits in them.
No change in behavior.
Signed-off-by: Gerd Hoffmann <address@hidden>
---
hw/usb-ehci.c | 16 ++++++----------
trace-events | 3 ++-
2 files changed, 8 insertions(+), 11 deletions(-)
diff --git a/hw/usb-ehci.c b/hw/usb-ehci.c
index 85e5ed9..b9204ab 100644
--- a/hw/usb-ehci.c
+++ b/hw/usb-ehci.c
@@ -719,10 +719,6 @@ static void handle_port_status_write(EHCIState *s, int
port, uint32_t val)
int rwc;
USBDevice *dev = s->ports[port].dev;
- DPRINTF("port_status_write: "
- "PORTSC (port %d) curr %08X new %08X rw-clear %08X rw %08X\n",
- port, *portsc, val, (val & PORTSC_RWC_MASK), val & PORTSC_RO_MASK);
-
rwc = val & PORTSC_RWC_MASK;
val &= PORTSC_RO_MASK;
@@ -744,8 +740,6 @@ static void handle_port_status_write(EHCIState *s, int
port, uint32_t val)
}
if (s->ports[port].dev) {
- DPRINTF("port_status_write: "
- "Device was connected before reset, clearing CSC bit\n");
*portsc &= ~PORTSC_CSC;
}
@@ -760,16 +754,16 @@ static void handle_port_status_write(EHCIState *s, int
port, uint32_t val)
*portsc &= ~PORTSC_RO_MASK;
*portsc |= val;
- DPRINTF("port_status_write: Port %d status set to 0x%08x\n", port,
*portsc);
}
static void ehci_mem_writel(void *ptr, target_phys_addr_t addr, uint32_t val)
{
EHCIState *s = ptr;
+ uint32_t *mmio = (uint32_t *)(&s->mmio[addr]);
+ uint32_t old = *mmio;
int i;
- trace_usb_ehci_mmio_writel(addr, addr2str(addr), val,
- *(uint32_t *)(&s->mmio[addr]));
+ trace_usb_ehci_mmio_writel(addr, addr2str(addr), val);
/* Only aligned reads are allowed on OHCI */
if (addr & 3) {
@@ -780,6 +774,7 @@ static void ehci_mem_writel(void *ptr, target_phys_addr_t
addr, uint32_t val)
if (addr >= PORTSC && addr < PORTSC + 4 * NB_PORTS) {
handle_port_status_write(s, (addr-PORTSC)/4, val);
+ trace_usb_ehci_mmio_change(addr, addr2str(addr), *mmio, old);
return;
}
@@ -858,7 +853,8 @@ static void ehci_mem_writel(void *ptr, target_phys_addr_t
addr, uint32_t val)
break;
}
- *(uint32_t *)(&s->mmio[addr]) = val;
+ *mmio = val;
+ trace_usb_ehci_mmio_change(addr, addr2str(addr), *mmio, old);
}
diff --git a/trace-events b/trace-events
index 22f93c7..b2ccd07 100644
--- a/trace-events
+++ b/trace-events
@@ -197,7 +197,8 @@ disable sun4m_iommu_bad_addr(uint64_t addr) "bad addr
%"PRIx64""
# hw/usb-ehci.c
disable usb_ehci_reset(void) "=== RESET ==="
disable usb_ehci_mmio_readl(uint32_t addr, const char *str, uint32_t val) "rd
mmio %04x [%s] = %x"
-disable usb_ehci_mmio_writel(uint32_t addr, const char *str, uint32_t val,
uint32_t oldval) "wr mmio %04x [%s] = %x (old: %x)"
+disable usb_ehci_mmio_writel(uint32_t addr, const char *str, uint32_t val) "wr
mmio %04x [%s] = %x"
+disable usb_ehci_mmio_change(uint32_t addr, const char *str, uint32_t new,
uint32_t old) "ch mmio %04x [%s] = %x (old: %x)"
disable usb_ehci_usbsts(const char *sts, int state) "usbsts %s %d"
disable usb_ehci_state(const char *schedule, const char *state) "%s schedule
%s"
disable usb_ehci_qh(uint32_t addr, uint32_t next, uint32_t c_qtd, uint32_t
n_qtd, uint32_t a_qtd, int rl, int mplen, int eps, int ep, int devaddr, int c,
int h, int dtc, int i) "QH @ %08x: next %08x qtds %08x,%08x,%08x - rl %d, mplen
%d, eps %d, ep %d, dev %d, c %d, h %d, dtc %d, i %d"
--
1.7.1
- [Qemu-devel] [PATCH 00/12] ehci: tracing, multiqueue, bugfixes., Gerd Hoffmann, 2011/05/26
- [Qemu-devel] [PATCH 04/12] usb-ehci: trace port state, Gerd Hoffmann, 2011/05/26
- [Qemu-devel] [PATCH 01/12] usb-linux: catch NODEV in more places., Gerd Hoffmann, 2011/05/26
- [Qemu-devel] [PATCH 02/12] usb-ehci: trace mmio and usbsts, Gerd Hoffmann, 2011/05/26
- [Qemu-devel] [PATCH 03/12] usb-ehci: trace state machine changes, Gerd Hoffmann, 2011/05/26
- [Qemu-devel] [PATCH 06/12] usb-ehci: trace buffer copy, Gerd Hoffmann, 2011/05/26
- [Qemu-devel] [PATCH 09/12] usb-ehci: fix offset writeback in ehci_buffer_rw, Gerd Hoffmann, 2011/05/26
- [Qemu-devel] [PATCH 05/12] usb-ehci: improve mmio tracing,
Gerd Hoffmann <=
- [Qemu-devel] [PATCH 10/12] usb-ehci: fix error handling., Gerd Hoffmann, 2011/05/26
- [Qemu-devel] [PATCH 11/12] ehci: fix a number of unused-but-set-variable warnings (new with gcc-4.6), Gerd Hoffmann, 2011/05/26
- [Qemu-devel] [PATCH 08/12] usb-ehci: multiqueue support, Gerd Hoffmann, 2011/05/26
- [Qemu-devel] [PATCH 12/12] usb: cancel async packets on unplug, Gerd Hoffmann, 2011/05/26
- [Qemu-devel] [PATCH 07/12] usb-ehci: add queue data struct, Gerd Hoffmann, 2011/05/26