From: Peter Maydell <peter.maydell@linaro.org>
To: qemu-devel@nongnu.org
Subject: [PULL 05/36] aspeed/smc: Add some tracing
Date: Thu, 12 Mar 2020 16:44:28 +0000 [thread overview]
Message-ID: <20200312164459.25924-6-peter.maydell@linaro.org> (raw)
In-Reply-To: <20200312164459.25924-1-peter.maydell@linaro.org>
From: Cédric Le Goater <clg@kaod.org>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
Reviewed-by: Andrew Jeffery <andrew@aj.id.au>
Reviewed-by: Joel Stanley <joel@jms.id.au>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-id: 20200206112645.21275-2-clg@kaod.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
Makefile.objs | 1 +
hw/ssi/aspeed_smc.c | 17 +++++++++++++++++
hw/ssi/trace-events | 9 +++++++++
3 files changed, 27 insertions(+)
create mode 100644 hw/ssi/trace-events
diff --git a/Makefile.objs b/Makefile.objs
index 40d3a1696cb..a7c967633ac 100644
--- a/Makefile.objs
+++ b/Makefile.objs
@@ -175,6 +175,7 @@ trace-events-subdirs += hw/scsi
trace-events-subdirs += hw/sd
trace-events-subdirs += hw/sparc
trace-events-subdirs += hw/sparc64
+trace-events-subdirs += hw/ssi
trace-events-subdirs += hw/timer
trace-events-subdirs += hw/tpm
trace-events-subdirs += hw/usb
diff --git a/hw/ssi/aspeed_smc.c b/hw/ssi/aspeed_smc.c
index 23c8d2f0624..e5621bf728c 100644
--- a/hw/ssi/aspeed_smc.c
+++ b/hw/ssi/aspeed_smc.c
@@ -31,6 +31,7 @@
#include "qapi/error.h"
#include "exec/address-spaces.h"
#include "qemu/units.h"
+#include "trace.h"
#include "hw/irq.h"
#include "hw/qdev-properties.h"
@@ -513,6 +514,8 @@ static void aspeed_smc_flash_set_segment(AspeedSMCState *s, int cs,
s->ctrl->reg_to_segment(s, new, &seg);
+ trace_aspeed_smc_flash_set_segment(cs, new, seg.addr, seg.addr + seg.size);
+
/* The start address of CS0 is read-only */
if (cs == 0 && seg.addr != s->ctrl->flash_window_base) {
qemu_log_mask(LOG_GUEST_ERROR,
@@ -753,6 +756,8 @@ static uint64_t aspeed_smc_flash_read(void *opaque, hwaddr addr, unsigned size)
__func__, aspeed_smc_flash_mode(fl));
}
+ trace_aspeed_smc_flash_read(fl->id, addr, size, ret,
+ aspeed_smc_flash_mode(fl));
return ret;
}
@@ -808,6 +813,9 @@ static bool aspeed_smc_do_snoop(AspeedSMCFlash *fl, uint64_t data,
AspeedSMCState *s = fl->controller;
uint8_t addr_width = aspeed_smc_flash_is_4byte(fl) ? 4 : 3;
+ trace_aspeed_smc_do_snoop(fl->id, s->snoop_index, s->snoop_dummies,
+ (uint8_t) data & 0xff);
+
if (s->snoop_index == SNOOP_OFF) {
return false; /* Do nothing */
@@ -858,6 +866,9 @@ static void aspeed_smc_flash_write(void *opaque, hwaddr addr, uint64_t data,
AspeedSMCState *s = fl->controller;
int i;
+ trace_aspeed_smc_flash_write(fl->id, addr, size, data,
+ aspeed_smc_flash_mode(fl));
+
if (!aspeed_smc_is_writable(fl)) {
qemu_log_mask(LOG_GUEST_ERROR, "%s: flash is not writable at 0x%"
HWADDR_PRIx "\n", __func__, addr);
@@ -972,6 +983,9 @@ static uint64_t aspeed_smc_read(void *opaque, hwaddr addr, unsigned int size)
(s->ctrl->has_dma && addr == R_DMA_CHECKSUM) ||
(addr >= R_SEG_ADDR0 && addr < R_SEG_ADDR0 + s->ctrl->max_slaves) ||
(addr >= s->r_ctrl0 && addr < s->r_ctrl0 + s->ctrl->max_slaves)) {
+
+ trace_aspeed_smc_read(addr, size, s->regs[addr]);
+
return s->regs[addr];
} else {
qemu_log_mask(LOG_UNIMP, "%s: not implemented: 0x%" HWADDR_PRIx "\n",
@@ -1091,6 +1105,7 @@ static void aspeed_smc_dma_checksum(AspeedSMCState *s)
__func__, s->regs[R_DMA_FLASH_ADDR]);
return;
}
+ trace_aspeed_smc_dma_checksum(s->regs[R_DMA_FLASH_ADDR], data);
/*
* When the DMA is on-going, the DMA registers are updated
@@ -1225,6 +1240,8 @@ static void aspeed_smc_write(void *opaque, hwaddr addr, uint64_t data,
addr >>= 2;
+ trace_aspeed_smc_write(addr, size, data);
+
if (addr == s->r_conf ||
(addr >= s->r_timings &&
addr < s->r_timings + s->ctrl->nregs_timings) ||
diff --git a/hw/ssi/trace-events b/hw/ssi/trace-events
new file mode 100644
index 00000000000..ffe531a500a
--- /dev/null
+++ b/hw/ssi/trace-events
@@ -0,0 +1,9 @@
+# aspeed_smc.c
+
+aspeed_smc_flash_set_segment(int cs, uint64_t reg, uint64_t start, uint64_t end) "CS%d segreg=0x%"PRIx64" [ 0x%"PRIx64" - 0x%"PRIx64" ]"
+aspeed_smc_flash_read(int cs, uint64_t addr, uint32_t size, uint64_t data, int mode) "CS%d @0x%" PRIx64 " size %u: 0x%" PRIx64" mode:%d"
+aspeed_smc_do_snoop(int cs, int index, int dummies, int data) "CS%d index:0x%x dummies:%d data:0x%x"
+aspeed_smc_flash_write(int cs, uint64_t addr, uint32_t size, uint64_t data, int mode) "CS%d @0x%" PRIx64 " size %u: 0x%" PRIx64" mode:%d"
+aspeed_smc_read(uint64_t addr, uint32_t size, uint64_t data) "@0x%" PRIx64 " size %u: 0x%" PRIx64
+aspeed_smc_dma_checksum(uint32_t addr, uint32_t data) "0x%08x: 0x%08x"
+aspeed_smc_write(uint64_t addr, uint32_t size, uint64_t data) "@0x%" PRIx64 " size %u: 0x%" PRIx64
--
2.20.1
next prev parent reply other threads:[~2020-03-12 16:46 UTC|newest]
Thread overview: 44+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-12 16:44 [PULL 00/36] target-arm queue Peter Maydell
2020-03-12 16:44 ` [PULL 01/36] hw/intc/armv7m_nvic: Rebuild hflags on reset Peter Maydell
2020-03-12 16:44 ` [PULL 02/36] target/arm: Update hflags in trans_CPS_v7m() Peter Maydell
2020-03-12 16:44 ` [PULL 03/36] target/arm: Recalculate hflags correctly after writes to CONTROL Peter Maydell
2020-03-12 16:44 ` [PULL 04/36] target/arm: Fix some comment typos Peter Maydell
2020-03-12 16:44 ` Peter Maydell [this message]
2020-03-12 16:44 ` [PULL 06/36] aspeed/smc: Fix User mode select/unselect scheme Peter Maydell
2020-03-12 16:44 ` [PULL 07/36] target/arm: Check addresses for disabled regimes Peter Maydell
2020-03-12 16:44 ` [PULL 08/36] target/arm: Disable clean_data_tbi for system mode Peter Maydell
2020-03-12 16:44 ` [PULL 09/36] hw/arm/cubieboard: make sure SOC object isn't leaked Peter Maydell
2020-03-12 16:44 ` [PULL 10/36] hw/arm/fsl-imx25: Wire up eSDHC controllers Peter Maydell
2020-03-12 16:44 ` [PULL 11/36] hw/arm/fsl-imx25: Wire up USB controllers Peter Maydell
2020-03-12 16:44 ` [PULL 12/36] hw/arm: add Allwinner H3 System-on-Chip Peter Maydell
2020-03-12 16:44 ` [PULL 13/36] hw/arm: add Xunlong Orange Pi PC machine Peter Maydell
2020-03-12 16:44 ` [PULL 14/36] hw/arm/allwinner-h3: add Clock Control Unit Peter Maydell
2020-03-12 16:44 ` [PULL 15/36] hw/arm/allwinner-h3: add USB host controller Peter Maydell
2020-03-12 16:44 ` [PULL 16/36] hw/arm/allwinner-h3: add System Control module Peter Maydell
2020-03-12 16:44 ` [PULL 17/36] hw/arm/allwinner: add CPU Configuration module Peter Maydell
2020-03-12 16:44 ` [PULL 18/36] hw/arm/allwinner: add Security Identifier device Peter Maydell
2020-03-12 16:44 ` [PULL 19/36] hw/arm/allwinner: add SD/MMC host controller Peter Maydell
2020-03-12 16:44 ` [PULL 20/36] hw/arm/allwinner-h3: add EMAC ethernet device Peter Maydell
2020-03-12 16:44 ` [PULL 21/36] hw/arm/allwinner-h3: add Boot ROM support Peter Maydell
2020-03-20 12:07 ` Peter Maydell
2020-03-21 17:17 ` Niek Linnenbank
2020-03-21 19:47 ` Peter Maydell
2020-03-12 16:44 ` [PULL 22/36] hw/arm/allwinner-h3: add SDRAM controller device Peter Maydell
2020-03-20 15:46 ` Peter Maydell
2020-03-22 20:23 ` Niek Linnenbank
2020-03-22 21:17 ` Peter Maydell
2020-03-12 16:44 ` [PULL 23/36] hw/arm/allwinner: add RTC device support Peter Maydell
2020-03-12 16:44 ` [PULL 24/36] tests/boot_linux_console: Add a quick test for the OrangePi PC board Peter Maydell
2020-03-12 16:44 ` [PULL 25/36] tests/boot_linux_console: Add initrd test for the Orange Pi " Peter Maydell
2020-03-12 16:44 ` [PULL 26/36] tests/boot_linux_console: Add a SD card test for the OrangePi " Peter Maydell
2020-03-12 16:44 ` [PULL 27/36] tests/boot_linux_console: Add a SLOW test booting Ubuntu on OrangePi PC Peter Maydell
2020-03-12 16:44 ` [PULL 28/36] tests/boot_linux_console: Test booting NetBSD via U-Boot " Peter Maydell
2020-03-12 16:44 ` [PULL 29/36] docs: add Orange Pi PC document Peter Maydell
2020-03-12 16:44 ` [PULL 30/36] hw/arm/virt: Document 'max' value in gic-version property description Peter Maydell
2020-03-12 16:44 ` [PULL 31/36] hw/arm/virt: Introduce VirtGICType enum type Peter Maydell
2020-03-12 16:44 ` [PULL 32/36] hw/arm/virt: Introduce finalize_gic_version() Peter Maydell
2020-03-12 16:44 ` [PULL 33/36] target/arm/kvm: Let kvm_arm_vgic_probe() return a bitmap Peter Maydell
2020-03-12 16:44 ` [PULL 34/36] hw/arm/virt: kvm: Restructure finalize_gic_version() Peter Maydell
2020-03-12 16:44 ` [PULL 35/36] hw/arm/virt: kvm: allow gicv3 by default if v2 cannot work Peter Maydell
2020-03-12 16:44 ` [PULL 36/36] target/arm: kvm: Inject events at the last stage of sync Peter Maydell
2020-03-12 20:32 ` [PULL 00/36] target-arm queue Peter Maydell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200312164459.25924-6-peter.maydell@linaro.org \
--to=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).