[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 07/11] hw/net/ne2000: Add trace events
From: |
Philippe Mathieu-Daudé |
Subject: |
[Qemu-devel] [PATCH 07/11] hw/net/ne2000: Add trace events |
Date: |
Thu, 21 Jun 2018 14:12:53 -0300 |
Signed-off-by: Philippe Mathieu-Daudé <address@hidden>
---
hw/net/ne2000.c | 17 ++++++++++++-----
hw/net/trace-events | 4 ++++
2 files changed, 16 insertions(+), 5 deletions(-)
diff --git a/hw/net/ne2000.c b/hw/net/ne2000.c
index 3a9fc89e48..26b234b7eb 100644
--- a/hw/net/ne2000.c
+++ b/hw/net/ne2000.c
@@ -26,6 +26,7 @@
#include "net/eth.h"
#include "ne2000.h"
#include "sysemu/sysemu.h"
+#include "trace.h"
/* debug NE2000 card */
//#define DEBUG_NE2000
@@ -662,19 +663,24 @@ static uint64_t ne2000_read(void *opaque, hwaddr addr,
unsigned size)
{
NE2000State *s = opaque;
+ uint64_t val;
if (addr < 0x10 && size == 1) {
- return ne2000_ioport_read(s, addr);
+ val = ne2000_ioport_read(s, addr);
} else if (addr == 0x10) {
if (size <= 2) {
- return ne2000_asic_ioport_read(s, addr);
+ val = ne2000_asic_ioport_read(s, addr);
} else {
- return ne2000_asic_ioport_readl(s, addr);
+ val = ne2000_asic_ioport_readl(s, addr);
}
} else if (addr == 0x1f && size == 1) {
- return ne2000_reset_ioport_read(s, addr);
+ val = ne2000_reset_ioport_read(s, addr);
+ } else {
+ val = ((uint64_t)1 << (size * 8)) - 1;
}
- return ((uint64_t)1 << (size * 8)) - 1;
+ trace_ne2000_read(addr, val);
+
+ return val;
}
static void ne2000_write(void *opaque, hwaddr addr,
@@ -682,6 +688,7 @@ static void ne2000_write(void *opaque, hwaddr addr,
{
NE2000State *s = opaque;
+ trace_ne2000_write(addr, data);
if (addr < 0x10 && size == 1) {
ne2000_ioport_write(s, addr, data);
} else if (addr == 0x10) {
diff --git a/hw/net/trace-events b/hw/net/trace-events
index 45c4e9fba0..95a1de01e9 100644
--- a/hw/net/trace-events
+++ b/hw/net/trace-events
@@ -23,6 +23,10 @@ mipsnet_read(uint64_t addr, uint32_t val) "read addr=0x%"
PRIx64 " val=0x%x"
mipsnet_write(uint64_t addr, uint64_t val) "write addr=0x%" PRIx64 " val=0x%"
PRIx64
mipsnet_irq(uint32_t isr, uint32_t intctl) "set irq to %d (0x%02x)"
+# hw/net/ne2000.c
+ne2000_read(uint64_t addr, uint64_t val) "read addr=0x%" PRIx64 " val=0x%"
PRIx64
+ne2000_write(uint64_t addr, uint64_t val) "write addr=0x%" PRIx64 " val=0x%"
PRIx64
+
# hw/net/opencores_eth.c
open_eth_mii_write(unsigned idx, uint16_t v) "MII[0x%02x] <- 0x%04x"
open_eth_mii_read(unsigned idx, uint16_t v) "MII[0x%02x] -> 0x%04x"
--
2.18.0.rc2
- [Qemu-devel] [PATCH 00/11] hw: various conversions to trace-events, Philippe Mathieu-Daudé, 2018/06/21
- [Qemu-devel] [PATCH 02/11] sdcard: Reduce sdcard_set_blocklen() trace digits, Philippe Mathieu-Daudé, 2018/06/21
- [Qemu-devel] [PATCH 01/11] trace: Fix format string for the struct timeval members casted to size_t, Philippe Mathieu-Daudé, 2018/06/21
- [Qemu-devel] [PATCH 03/11] hw/char/serial: Convert from DPRINTF macro to trace events, Philippe Mathieu-Daudé, 2018/06/21
- [Qemu-devel] [PATCH 04/11] hw/char/parallel: Convert from pdebug() macro to trace events, Philippe Mathieu-Daudé, 2018/06/21
- [Qemu-devel] [PATCH 06/11] hw/input/tsc2005: Convert a fprintf() call to trace events, Philippe Mathieu-Daudé, 2018/06/21
- [Qemu-devel] [PATCH 07/11] hw/net/ne2000: Add trace events,
Philippe Mathieu-Daudé <=
- [Qemu-devel] [PATCH 08/11] hw/net/ne2000: Convert printf() calls to trace events, Philippe Mathieu-Daudé, 2018/06/21
- [Qemu-devel] [PATCH 09/11] hw/net/etraxfs_eth: Convert printf() calls to trace events, Philippe Mathieu-Daudé, 2018/06/21
- [Qemu-devel] [PATCH 10/11] hw/block/fdc: Convert from FLOPPY_DPRINTF() macro to trace events, Philippe Mathieu-Daudé, 2018/06/21
- [Qemu-devel] [PATCH 11/11] hw/block/pflash_cfi: Convert from DPRINTF() macro to trace events, Philippe Mathieu-Daudé, 2018/06/21
- Message not available