[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 13/14] hw/misc/imx6_src: Convert DPRINTF() to trace events
From: |
Bernhard Beschow |
Subject: |
[PATCH 13/14] hw/misc/imx6_src: Convert DPRINTF() to trace events |
Date: |
Wed, 8 Jan 2025 10:25:37 +0100 |
Signed-off-by: Bernhard Beschow <shentey@gmail.com>
---
hw/misc/imx6_src.c | 23 +++++------------------
hw/misc/trace-events | 6 ++++++
2 files changed, 11 insertions(+), 18 deletions(-)
diff --git a/hw/misc/imx6_src.c b/hw/misc/imx6_src.c
index dc6a2b92ba..06cc46292e 100644
--- a/hw/misc/imx6_src.c
+++ b/hw/misc/imx6_src.c
@@ -17,18 +17,7 @@
#include "qemu/module.h"
#include "target/arm/arm-powerctl.h"
#include "hw/core/cpu.h"
-
-#ifndef DEBUG_IMX6_SRC
-#define DEBUG_IMX6_SRC 0
-#endif
-
-#define DPRINTF(fmt, args...) \
- do { \
- if (DEBUG_IMX6_SRC) { \
- fprintf(stderr, "[%s]%s: " fmt , TYPE_IMX6_SRC, \
- __func__, ##args); \
- } \
- } while (0)
+#include "trace.h"
static const char *imx6_src_reg_name(uint32_t reg)
{
@@ -87,7 +76,7 @@ static void imx6_src_reset(DeviceState *dev)
{
IMX6SRCState *s = IMX6_SRC(dev);
- DPRINTF("\n");
+ trace_imx6_src_reset();
memset(s->regs, 0, sizeof(s->regs));
@@ -111,7 +100,7 @@ static uint64_t imx6_src_read(void *opaque, hwaddr offset,
unsigned size)
}
- DPRINTF("reg[%s] => 0x%" PRIx32 "\n", imx6_src_reg_name(index), value);
+ trace_imx6_src_read(imx6_src_reg_name(index), value);
return value;
}
@@ -134,8 +123,7 @@ static void imx6_clear_reset_bit(CPUState *cpu,
run_on_cpu_data data)
assert(bql_locked());
s->regs[SRC_SCR] = deposit32(s->regs[SRC_SCR], ri->reset_bit, 1, 0);
- DPRINTF("reg[%s] <= 0x%" PRIx32 "\n",
- imx6_src_reg_name(SRC_SCR), s->regs[SRC_SCR]);
+ trace_imx6_clear_reset_bit(imx6_src_reg_name(SRC_SCR), s->regs[SRC_SCR]);
g_free(ri);
}
@@ -173,8 +161,7 @@ static void imx6_src_write(void *opaque, hwaddr offset,
uint64_t value,
return;
}
- DPRINTF("reg[%s] <= 0x%" PRIx32 "\n", imx6_src_reg_name(index),
- (uint32_t)current_value);
+ trace_imx6_src_write(imx6_src_reg_name(index), value);
change_mask = s->regs[index] ^ (uint32_t)current_value;
diff --git a/hw/misc/trace-events b/hw/misc/trace-events
index 0f5d2b5666..cf1abe6928 100644
--- a/hw/misc/trace-events
+++ b/hw/misc/trace-events
@@ -253,6 +253,12 @@ ccm_clock_freq(uint32_t clock, uint32_t freq) "(Clock =
%d) = %d"
ccm_read_reg(const char *reg_name, uint32_t value) "reg[%s] <= 0x%" PRIx32
ccm_write_reg(const char *reg_name, uint32_t value) "reg[%s] => 0x%" PRIx32
+# imx6_src.c
+imx6_src_read(const char *reg_name, uint32_t value) "reg[%s] => 0x%" PRIx32
+imx6_src_write(const char *reg_name, uint64_t value) "reg[%s] <= 0x%" PRIx64
+imx6_clear_reset_bit(const char *reg_name, uint32_t value) "reg[%s] <= 0x%"
PRIx32
+imx6_src_reset(void) ""
+
# imx7_src.c
imx7_src_read(const char *reg_name, uint32_t value) "reg[%s] => 0x%" PRIx32
imx7_src_write(const char *reg_name, uint32_t value) "reg[%s] <= 0x%" PRIx32
--
2.47.1
- [PATCH 00/14] i.MX and SDHCI improvements, Bernhard Beschow, 2025/01/08
- [PATCH 04/14] hw/core: Introduce TYPE_SHARED_IRQ, Bernhard Beschow, 2025/01/08
- [PATCH 02/14] hw/char/imx_serial: Fix reset value of UFCR register, Bernhard Beschow, 2025/01/08
- [PATCH 01/14] hw/sd/sdhci: Set SDHC_NIS_DMA bit when appropriate, Bernhard Beschow, 2025/01/08
- [PATCH 13/14] hw/misc/imx6_src: Convert DPRINTF() to trace events,
Bernhard Beschow <=
- [PATCH 03/14] hw/char/imx_serial: Update all state before restarting ageing timer, Bernhard Beschow, 2025/01/08
- [PATCH 06/14] hw/gpio/imx_gpio: Don't clear input GPIO values upon reset, Bernhard Beschow, 2025/01/08
- [PATCH 07/14] hw/sd/sd: Remove legacy sd_set_cb() in favor of GPIOs, Bernhard Beschow, 2025/01/08
- [PATCH 05/14] hw/pci-host/designware: Expose MSI IRQ, Bernhard Beschow, 2025/01/08
- [PATCH 10/14] hw/timer/imx_gpt: Remove unused define, Bernhard Beschow, 2025/01/08
- [PATCH 14/14] hw/gpio/imx_gpio: Turn DPRINTF() into trace events, Bernhard Beschow, 2025/01/08