[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 05/16] hw/misc/empty_slot: Convert debug printf() to trace event
From: |
Philippe Mathieu-Daudé |
Subject: |
[PULL 05/16] hw/misc/empty_slot: Convert debug printf() to trace event |
Date: |
Tue, 9 Jun 2020 09:32:03 +0200 |
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Acked-by: Artyom Tarasenko <atar4qemu@gmail.com>
Message-Id: <20200510152840.13558-6-f4bug@amsat.org>
---
hw/core/empty_slot.c | 19 ++++++++-----------
hw/core/trace-events | 4 ++++
2 files changed, 12 insertions(+), 11 deletions(-)
diff --git a/hw/core/empty_slot.c b/hw/core/empty_slot.c
index 576b276c4b..d28f7f99c9 100644
--- a/hw/core/empty_slot.c
+++ b/hw/core/empty_slot.c
@@ -14,15 +14,7 @@
#include "qemu/module.h"
#include "hw/qdev-properties.h"
#include "hw/empty_slot.h"
-
-//#define DEBUG_EMPTY_SLOT
-
-#ifdef DEBUG_EMPTY_SLOT
-#define DPRINTF(fmt, ...) \
- do { printf("empty_slot: " fmt , ## __VA_ARGS__); } while (0)
-#else
-#define DPRINTF(fmt, ...) do {} while (0)
-#endif
+#include "trace.h"
#define TYPE_EMPTY_SLOT "empty_slot"
#define EMPTY_SLOT(obj) OBJECT_CHECK(EmptySlot, (obj), TYPE_EMPTY_SLOT)
@@ -38,14 +30,19 @@ typedef struct EmptySlot {
static uint64_t empty_slot_read(void *opaque, hwaddr addr,
unsigned size)
{
- DPRINTF("read from " TARGET_FMT_plx "\n", addr);
+ EmptySlot *s = EMPTY_SLOT(opaque);
+
+ trace_empty_slot_write(addr, size << 1, 0, size, s->name);
+
return 0;
}
static void empty_slot_write(void *opaque, hwaddr addr,
uint64_t val, unsigned size)
{
- DPRINTF("write 0x%x to " TARGET_FMT_plx "\n", (unsigned)val, addr);
+ EmptySlot *s = EMPTY_SLOT(opaque);
+
+ trace_empty_slot_write(addr, size << 1, val, size, s->name);
}
static const MemoryRegionOps empty_slot_ops = {
diff --git a/hw/core/trace-events b/hw/core/trace-events
index 1ac60ede6b..bbb68fb6f0 100644
--- a/hw/core/trace-events
+++ b/hw/core/trace-events
@@ -34,3 +34,7 @@ clock_disconnect(const char *clk) "'%s'"
clock_set(const char *clk, uint64_t old, uint64_t new) "'%s',
ns=%"PRIu64"->%"PRIu64
clock_propagate(const char *clk) "'%s'"
clock_update(const char *clk, const char *src, uint64_t val, int cb) "'%s',
src='%s', ns=%"PRIu64", cb=%d"
+
+# empty_slot.c
+empty_slot_read(uint64_t addr, unsigned width, uint64_t value, unsigned size,
const char *name) "rd addr:0x%04"PRIx64" data:0x%0*"PRIx64" size %u [%s]"
+empty_slot_write(uint64_t addr, unsigned width, uint64_t value, unsigned size,
const char *name) "wr addr:0x%04"PRIx64" data:0x%0*"PRIx64" size %u [%s]"
--
2.21.3
- [PULL 00/16] SPARC patches for 2020-06-09, Philippe Mathieu-Daudé, 2020/06/09
- [PULL 02/16] hw/misc/empty_slot: Lower address space priority, Philippe Mathieu-Daudé, 2020/06/09
- [PULL 01/16] hw/sparc/sun4m: Use UnimplementedDevice for I/O devices, Philippe Mathieu-Daudé, 2020/06/09
- [PULL 06/16] hw/misc/empty_slot: Move the 'hw/misc' and cover in MAINTAINERS, Philippe Mathieu-Daudé, 2020/06/09
- [PULL 04/16] hw/misc/empty_slot: Add a 'name' qdev property, Philippe Mathieu-Daudé, 2020/06/09
- [PULL 03/16] hw/misc/empty_slot: Convert 'size' field as qdev property, Philippe Mathieu-Daudé, 2020/06/09
- [PULL 09/16] hw/sparc64/niagara: Map the UART device unconditionally, Philippe Mathieu-Daudé, 2020/06/09
- [PULL 07/16] hw/misc/empty_slot: Name the slots when created, Philippe Mathieu-Daudé, 2020/06/09
- [PULL 12/16] hw/misc/grlib_ahb_apb_pnp: Fix AHB PnP 8-bit accesses, Philippe Mathieu-Daudé, 2020/06/09
- [PULL 05/16] hw/misc/empty_slot: Convert debug printf() to trace event,
Philippe Mathieu-Daudé <=
- [PULL 13/16] hw/misc/grlib_ahb_apb_pnp: Add trace events on read accesses, Philippe Mathieu-Daudé, 2020/06/09
- [PULL 14/16] hw/timer/grlib_gptimer: Display frequency in decimal, Philippe Mathieu-Daudé, 2020/06/09
- [PULL 11/16] hw/misc/grlib_ahb_apb_pnp: Avoid crash when writing to AHB PnP registers, Philippe Mathieu-Daudé, 2020/06/09
- [PULL 15/16] target/sparc/int32_helper: Remove DEBUG_PCALL definition, Philippe Mathieu-Daudé, 2020/06/09
- [PULL 08/16] hw/sparc/leon3: Map the UART device unconditionally, Philippe Mathieu-Daudé, 2020/06/09
- [PULL 10/16] hw/sparc64/niagara: Remove duplicated NIAGARA_UART_BASE definition, Philippe Mathieu-Daudé, 2020/06/09
- [PULL 16/16] target/sparc/int32_helper: Extract and use excp_name_str(), Philippe Mathieu-Daudé, 2020/06/09
- Re: [PULL 00/16] SPARC patches for 2020-06-09, Peter Maydell, 2020/06/09
- Re: [PULL 00/16] SPARC patches for 2020-06-09, Mark Cave-Ayland, 2020/06/09