[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 13/16] hw/misc/grlib_ahb_apb_pnp: Add trace events on read accesse
From: |
Philippe Mathieu-Daudé |
Subject: |
[PULL 13/16] hw/misc/grlib_ahb_apb_pnp: Add trace events on read accesses |
Date: |
Tue, 9 Jun 2020 09:32:11 +0200 |
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: KONRAD Frederic <frederic.konrad@adacore.com>
Message-Id: <20200331105048.27989-5-f4bug@amsat.org>
---
hw/misc/grlib_ahb_apb_pnp.c | 13 +++++++++++--
hw/misc/trace-events | 4 ++++
2 files changed, 15 insertions(+), 2 deletions(-)
diff --git a/hw/misc/grlib_ahb_apb_pnp.c b/hw/misc/grlib_ahb_apb_pnp.c
index d22ed00206..43e001c3c7 100644
--- a/hw/misc/grlib_ahb_apb_pnp.c
+++ b/hw/misc/grlib_ahb_apb_pnp.c
@@ -25,6 +25,7 @@
#include "qemu/log.h"
#include "hw/sysbus.h"
#include "hw/misc/grlib_ahb_apb_pnp.h"
+#include "trace.h"
#define GRLIB_PNP_VENDOR_SHIFT (24)
#define GRLIB_PNP_VENDOR_SIZE (8)
@@ -132,8 +133,12 @@ void grlib_ahb_pnp_add_entry(AHBPnp *dev, uint32_t
address, uint32_t mask,
static uint64_t grlib_ahb_pnp_read(void *opaque, hwaddr offset, unsigned size)
{
AHBPnp *ahb_pnp = GRLIB_AHB_PNP(opaque);
+ uint32_t val;
- return ahb_pnp->regs[offset >> 2];
+ val = ahb_pnp->regs[offset >> 2];
+ trace_grlib_ahb_pnp_read(offset, val);
+
+ return val;
}
static void grlib_ahb_pnp_write(void *opaque, hwaddr addr,
@@ -239,8 +244,12 @@ void grlib_apb_pnp_add_entry(APBPnp *dev, uint32_t
address, uint32_t mask,
static uint64_t grlib_apb_pnp_read(void *opaque, hwaddr offset, unsigned size)
{
APBPnp *apb_pnp = GRLIB_APB_PNP(opaque);
+ uint32_t val;
- return apb_pnp->regs[offset >> 2];
+ val = apb_pnp->regs[offset >> 2];
+ trace_grlib_apb_pnp_read(offset, val);
+
+ return val;
}
static void grlib_apb_pnp_write(void *opaque, hwaddr addr,
diff --git a/hw/misc/trace-events b/hw/misc/trace-events
index 0cb4c64ae7..5561746866 100644
--- a/hw/misc/trace-events
+++ b/hw/misc/trace-events
@@ -202,3 +202,7 @@ via1_rtc_cmd_pram_read(int addr, int value) "addr=%u
value=0x%02x"
via1_rtc_cmd_pram_write(int addr, int value) "addr=%u value=0x%02x"
via1_rtc_cmd_pram_sect_read(int sector, int offset, int addr, int value)
"sector=%u offset=%u addr=%d value=0x%02x"
via1_rtc_cmd_pram_sect_write(int sector, int offset, int addr, int value)
"sector=%u offset=%u addr=%d value=0x%02x"
+
+# grlib_ahb_apb_pnp.c
+grlib_ahb_pnp_read(uint64_t addr, uint32_t value) "AHB PnP read
addr:0x%03"PRIx64" data:0x%08x"
+grlib_apb_pnp_read(uint64_t addr, uint32_t value) "APB PnP read
addr:0x%03"PRIx64" data:0x%08x"
--
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é, 2020/06/09
- [PULL 13/16] hw/misc/grlib_ahb_apb_pnp: Add trace events on read accesses,
Philippe Mathieu-Daudé <=
- [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