All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bernhard Beschow <shentey@gmail.com>
To: qemu-devel@nongnu.org
Cc: "Fabiano Rosas" <farosas@suse.de>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Guenter Roeck" <linux@roeck-us.net>,
	"Philippe Mathieu-Daudé" <philmd@linaro.org>,
	"Peter Maydell" <peter.maydell@linaro.org>,
	"Andrey Smirnov" <andrew.smirnov@gmail.com>,
	qemu-arm@nongnu.org,
	"Marc-André Lureau" <marcandre.lureau@redhat.com>,
	"Jean-Christophe Dubois" <jcd@tribudubois.net>,
	"Laurent Vivier" <lvivier@redhat.com>,
	"Bin Meng" <bmeng.cn@gmail.com>,
	qemu-block@nongnu.org, "Bernhard Beschow" <shentey@gmail.com>
Subject: [PATCH v2 12/13] hw/misc/imx6_src: Convert DPRINTF() to trace events
Date: Sat, 11 Jan 2025 19:37:10 +0100	[thread overview]
Message-ID: <20250111183711.2338-13-shentey@gmail.com> (raw)
In-Reply-To: <20250111183711.2338-1-shentey@gmail.com>

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Tested-by: Philippe Mathieu-Daudé <philmd@linaro.org>
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.48.0


  parent reply	other threads:[~2025-01-11 18:38 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-11 18:36 [PATCH v2 00/13] i.MX and SDHCI improvements Bernhard Beschow
2025-01-11 18:36 ` [PATCH v2 01/13] hw/sd/sdhci: Set SDHC_NIS_DMA bit when appropriate Bernhard Beschow
2025-01-15 12:55   ` Michael Tokarev
2025-01-16 23:39     ` Bernhard Beschow
2025-01-17  7:11       ` Michael Tokarev
2025-01-11 18:37 ` [PATCH v2 02/13] hw/char/imx_serial: Fix reset value of UFCR register Bernhard Beschow
2025-01-27 13:18   ` Peter Maydell
2025-01-11 18:37 ` [PATCH v2 03/13] hw/char/imx_serial: Update all state before restarting ageing timer Bernhard Beschow
2025-01-27 13:19   ` Peter Maydell
2025-01-11 18:37 ` [PATCH v2 04/13] hw/pci-host/designware: Expose MSI IRQ Bernhard Beschow
2025-01-27 13:30   ` Peter Maydell
2025-01-11 18:37 ` [PATCH v2 05/13] hw/gpio/imx_gpio: Don't clear input GPIO values upon reset Bernhard Beschow
2025-01-27 13:47   ` Peter Maydell
2025-01-11 18:37 ` [PATCH v2 06/13] hw/sd/sd: Remove legacy sd_set_cb() in favor of GPIOs Bernhard Beschow
2025-01-27 13:24   ` Peter Maydell
2025-01-27 23:11     ` Bernhard Beschow
2025-01-28 10:34       ` Peter Maydell
2025-01-28 22:45         ` Bernhard Beschow
2025-01-11 18:37 ` [PATCH v2 07/13] hw/sd/sd: Allow for inverting polarities of presence and write-protect GPIOs Bernhard Beschow
2025-01-15 17:32   ` Philippe Mathieu-Daudé
2025-01-17  9:29     ` Bernhard Beschow
2025-01-11 18:37 ` [PATCH v2 08/13] hw/char/imx_serial: Turn some DPRINTF() statements into trace events Bernhard Beschow
2025-01-11 18:37 ` [PATCH v2 09/13] hw/timer/imx_gpt: Remove unused define Bernhard Beschow
2025-01-11 18:37 ` [PATCH v2 10/13] tests/qtest/libqos: Reuse TYPE_IMX_I2C define Bernhard Beschow
2025-01-11 18:37 ` [PATCH v2 11/13] hw/i2c/imx_i2c: Convert DPRINTF() to trace events Bernhard Beschow
2025-01-14 13:34   ` Corey Minyard
2025-01-11 18:37 ` Bernhard Beschow [this message]
2025-01-11 18:37 ` [PATCH v2 13/13] hw/gpio/imx_gpio: Turn DPRINTF() into " Bernhard Beschow
2025-01-14 12:46 ` [PATCH v2 00/13] i.MX and SDHCI improvements Bernhard Beschow
2025-01-27 13:54 ` 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=20250111183711.2338-13-shentey@gmail.com \
    --to=shentey@gmail.com \
    --cc=andrew.smirnov@gmail.com \
    --cc=bmeng.cn@gmail.com \
    --cc=farosas@suse.de \
    --cc=jcd@tribudubois.net \
    --cc=linux@roeck-us.net \
    --cc=lvivier@redhat.com \
    --cc=marcandre.lureau@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=philmd@linaro.org \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-block@nongnu.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.