[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 6/9] hw/misc/empty_slot: Convert debug printf()s
From: |
Artyom Tarasenko |
Subject: |
Re: [Qemu-devel] [PATCH 6/9] hw/misc/empty_slot: Convert debug printf()s to trace events |
Date: |
Tue, 25 Jun 2019 09:04:47 +0200 |
On Tue, Jun 25, 2019 at 12:01 AM Philippe Mathieu-Daudé <address@hidden> wrote:
>
> Signed-off-by: Philippe Mathieu-Daudé <address@hidden>
Reviewed-by: Artyom Tarasenko <address@hidden>
> ---
> hw/misc/empty_slot.c | 19 ++++++++-----------
> hw/misc/trace-events | 4 ++++
> 2 files changed, 12 insertions(+), 11 deletions(-)
>
> diff --git a/hw/misc/empty_slot.c b/hw/misc/empty_slot.c
> index c32241a9e5..b810655554 100644
> --- a/hw/misc/empty_slot.c
> +++ b/hw/misc/empty_slot.c
> @@ -15,15 +15,7 @@
> #include "hw/sysbus.h"
> #include "qemu/module.h"
> #include "hw/misc/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)
> @@ -39,14 +31,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/misc/trace-events b/hw/misc/trace-events
> index 47e1bccf71..b81135ab1e 100644
> --- a/hw/misc/trace-events
> +++ b/hw/misc/trace-events
> @@ -1,5 +1,9 @@
> # See docs/devel/tracing.txt for syntax documentation.
>
> +# 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]"
> +
> # eccmemctl.c
> ecc_mem_writel_mer(uint32_t val) "Write memory enable 0x%08x"
> ecc_mem_writel_mdr(uint32_t val) "Write memory delay 0x%08x"
> --
> 2.19.1
>
--
Regards,
Artyom Tarasenko
SPARC and PPC PReP under qemu blog: http://tyom.blogspot.com/search/label/qemu
- Re: [Qemu-devel] [PATCH 1/9] hw/misc: Move the 'empty_slot' device to hw/misc/, (continued)
- [Qemu-devel] [RFC PATCH 2/9] MAINTAINERS: Add the 'empty_slot' device with the 'unimp' one, Philippe Mathieu-Daudé, 2019/06/24
- [Qemu-devel] [PATCH 7/9] hw/sparc/sun4m: Mark some devices as 'unimplemented', Philippe Mathieu-Daudé, 2019/06/24
- [Qemu-devel] [PATCH 5/9] hw/misc/empty_slot: Add a qdev property 'name', Philippe Mathieu-Daudé, 2019/06/24
- [Qemu-devel] [PATCH 3/9] hw/misc/empty_slot: Allow overide by device with higher priority, Philippe Mathieu-Daudé, 2019/06/24
- [Qemu-devel] [PATCH 6/9] hw/misc/empty_slot: Convert debug printf()s to trace events, Philippe Mathieu-Daudé, 2019/06/24
- Re: [Qemu-devel] [PATCH 6/9] hw/misc/empty_slot: Convert debug printf()s to trace events,
Artyom Tarasenko <=
- [Qemu-devel] [PATCH 9/9] hw/misc/empty_slot: Pass the slot name as argument, Philippe Mathieu-Daudé, 2019/06/24
- [Qemu-devel] [PATCH 8/9] hw/sparc/sun4m: Simplify the RAM creation, Philippe Mathieu-Daudé, 2019/06/24
- [Qemu-devel] [PATCH 4/9] hw/misc/empty_slot: Add a qdev property 'size', Philippe Mathieu-Daudé, 2019/06/24