From 15cae340094402bfe77565d7c6d09e2bb9d6601b Mon Sep 17 00:00:00 2001 From: Don Koch Date: Fri, 16 Jan 2015 14:21:39 -0500 Subject: [PATCH] Convert some debugging printfs to trace calls in pcnet.c. Signed-off-by: Don Koch Signed-off-by: Michael Tokarev --- hw/net/pcnet.c | 28 ++++++++-------------------- trace-events | 8 ++++++++ 2 files changed, 16 insertions(+), 20 deletions(-) diff --git a/hw/net/pcnet.c b/hw/net/pcnet.c index 8486b80bb7..7778b9ad47 100644 --- a/hw/net/pcnet.c +++ b/hw/net/pcnet.c @@ -40,6 +40,7 @@ #include "qemu/timer.h" #include "qemu/sockets.h" #include "sysemu/sysemu.h" +#include "trace.h" #include "pcnet.h" @@ -685,9 +686,7 @@ static void pcnet_bcr_writew(PCNetState *s, uint32_t rap, uint32_t val); static void pcnet_s_reset(PCNetState *s) { -#ifdef PCNET_DEBUG - printf("pcnet_s_reset\n"); -#endif + trace_pcnet_s_reset(s); s->rdra = 0; s->tdra = 0; @@ -760,9 +759,7 @@ static void pcnet_update_irq(PCNetState *s) s->csr[4] |= 0x0040; s->csr[0] |= 0x0080; isr = 1; -#ifdef PCNET_DEBUG - printf("pcnet user int\n"); -#endif + trace_pcnet_user_int(s); } #if 1 @@ -777,9 +774,7 @@ static void pcnet_update_irq(PCNetState *s) } if (isr != s->isr) { -#ifdef PCNET_DEBUG - printf("pcnet: INTA=%d\n", isr); -#endif + trace_pcnet_isr_change(s, isr, s->isr); } qemu_set_irq(s->irq, isr); s->isr = isr; @@ -791,9 +786,7 @@ static void pcnet_init(PCNetState *s) uint16_t padr[3], ladrf[4], mode; uint32_t rdra, tdra; -#ifdef PCNET_DEBUG - printf("pcnet_init init_addr=0x%08x\n", PHYSADDR(s,CSR_IADR(s))); -#endif + trace_pcnet_init(s, PHYSADDR(s, CSR_IADR(s))); if (BCR_SSIZE32(s)) { struct pcnet_initblk32 initblk; @@ -831,9 +824,7 @@ static void pcnet_init(PCNetState *s) tdra &= 0x00ffffff; } -#if defined(PCNET_DEBUG) - printf("rlen=%d tlen=%d\n", rlen, tlen); -#endif + trace_pcnet_rlen_tlen(s, rlen, tlen); CSR_RCVRL(s) = (rlen < 9) ? (1 << rlen) : 512; CSR_XMTRL(s) = (tlen < 9) ? (1 << tlen) : 512; @@ -852,11 +843,8 @@ static void pcnet_init(PCNetState *s) CSR_RCVRC(s) = CSR_RCVRL(s); CSR_XMTRC(s) = CSR_XMTRL(s); -#ifdef PCNET_DEBUG - printf("pcnet ss32=%d rdra=0x%08x[%d] tdra=0x%08x[%d]\n", - BCR_SSIZE32(s), - s->rdra, CSR_RCVRL(s), s->tdra, CSR_XMTRL(s)); -#endif + trace_pcnet_ss32_rdra_tdra(s, BCR_SSIZE32(s), + s->rdra, CSR_RCVRL(s), s->tdra, CSR_XMTRL(s)); s->csr[0] |= 0x0101; s->csr[0] &= ~0x0004; /* clear STOP bit */ diff --git a/trace-events b/trace-events index ae537f7e72..f87b077805 100644 --- a/trace-events +++ b/trace-events @@ -1282,6 +1282,14 @@ spapr_pci_msi_retry(unsigned config_addr, unsigned req_num, unsigned max_irqs) " pci_update_mappings_del(void *d, uint32_t bus, uint32_t func, uint32_t slot, int bar, uint64_t addr, uint64_t size) "d=%p %02x:%02x.%x %d,%#"PRIx64"+%#"PRIx64 pci_update_mappings_add(void *d, uint32_t bus, uint32_t func, uint32_t slot, int bar, uint64_t addr, uint64_t size) "d=%p %02x:%02x.%x %d,%#"PRIx64"+%#"PRIx64 +# hw/net/pcnet.c +pcnet_s_reset(void *s) "s=%p" +pcnet_user_int(void *s) "s=%p" +pcnet_isr_change(void *s, uint32_t isr, uint32_t isr_old) "s=%p INTA=%d<=%d" +pcnet_init(void *s, uint64_t init_addr) "s=%p init_addr=%#"PRIx64 +pcnet_rlen_tlen(void *s, uint32_t rlen, uint32_t tlen) "s=%p rlen=%d tlen=%d" +pcnet_ss32_rdra_tdra(void *s, uint32_t ss32, uint32_t rdra, uint32_t rcvrl, uint32_t tdra, uint32_t xmtrl) "s=%p ss32=%d rdra=0x%08x[%d] tdra=0x%08x[%d]" + # hw/net/pcnet-pci.c pcnet_aprom_writeb(void *opaque, uint32_t addr, uint32_t val) "opaque=%p addr=0x%08x val=0x%02x" pcnet_aprom_readb(void *opaque, uint32_t addr, uint32_t val) "opaque=%p addr=0x%08x val=0x%02x"