hw/timer/imx_epit: Replace DPRINTF with trace events
Clean up the codebase by removing the outdated DEBUG_IMX_EPIT and DPRINTF macros, replacing them with modern QEMU trace events. This also removes an empty and meaningless DPRINTF("\n") in the imx_epit_realize function. Signed-off-by: jack wang <163wangjack@gmail.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com> Message-id: 20260617161406.14705-1-163wangjack@gmail.com [PMM: remove stray blank lines from bottom of trace-events file] Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
jack wang committed
Jun 18, 2026 at 00:14 UTC
af80302588731566033b5c5362e56e9e9062ae68
2 files changed
+11
-20
hw/timer/imx_epit.c
+5
-20
@@ -20,18 +20,7 @@
20
#include "hw/misc/imx_ccm.h"
21
#include "qemu/module.h"
22
#include "qemu/log.h"
23
-
24
-#ifndef DEBUG_IMX_EPIT
25
-#define DEBUG_IMX_EPIT 0
26
-#endif
27
-
28
-#define DPRINTF(fmt, args...) \
29
- do { \
30
- if (DEBUG_IMX_EPIT) { \
31
- fprintf(stderr, "[%s]%s: " fmt , TYPE_IMX_EPIT, \
32
- __func__, ##args); \
33
- } \
34
- } while (0)
23
+#include "trace.h"
24
25
static const char *imx_epit_reg_name(uint32_t reg)
26
{
@@ -80,7 +69,7 @@ static uint32_t imx_epit_get_freq(IMXEPITState *s)
69
uint32_t prescaler = 1 + extract32(s->cr, CR_PRESCALE_SHIFT, CR_PRESCALE_BITS);
70
uint32_t f_in = imx_ccm_get_clock_frequency(s->ccm, imx_epit_clocks[clksrc]);
71
uint32_t freq = f_in / prescaler;
83
- DPRINTF("ptimer frequency is %u\n", freq);
72
+ trace_imx_epit_get_freq(freq);
73
return freq;
74
}
75
@@ -146,8 +135,7 @@ static uint64_t imx_epit_read(void *opaque, hwaddr offset, unsigned size)
135
HWADDR_PRIx "\n", TYPE_IMX_EPIT, __func__, offset);
136
break;
137
}
149
-
150
- DPRINTF("(%s) = 0x%08x\n", imx_epit_reg_name(offset >> 2), reg_value);
138
+ trace_imx_epit_read(imx_epit_reg_name(offset >> 2), reg_value);
139
140
return reg_value;
141
}
@@ -328,8 +316,7 @@ static void imx_epit_write(void *opaque, hwaddr offset, uint64_t value,
316
{
317
IMXEPITState *s = IMX_EPIT(opaque);
318
331
- DPRINTF("(%s, value = 0x%08x)\n", imx_epit_reg_name(offset >> 2),
332
- (uint32_t)value);
319
+ trace_imx_epit_write(imx_epit_reg_name(offset >> 2), value);
320
321
switch (offset >> 2) {
322
case 0: /* CR */
@@ -362,7 +349,7 @@ static void imx_epit_cmp(void *opaque)
349
/* The cmp ptimer can't be running when the peripheral is disabled */
350
assert(s->cr & CR_EN);
351
365
- DPRINTF("sr was %d\n", s->sr);
352
+ trace_imx_epit_cmp(s->sr);
353
/* Set interrupt status bit SR.OCIF and update the interrupt state */
354
s->sr |= SR_OCIF;
355
imx_epit_update_int(s);
@@ -399,8 +386,6 @@ static void imx_epit_realize(DeviceState *dev, Error **errp)
386
IMXEPITState *s = IMX_EPIT(dev);
387
SysBusDevice *sbd = SYS_BUS_DEVICE(dev);
388
402
- DPRINTF("\n");
403
-
389
sysbus_init_irq(sbd, &s->irq);
390
memory_region_init_io(&s->iomem, OBJECT(s), &imx_epit_ops, s, TYPE_IMX_EPIT,
391
0x00001000);
hw/timer/trace-events
+6
@@ -122,3 +122,9 @@ hpet_ram_write_tn_cmp(uint8_t reg_off) "hpet_ram_writel HPET_TN_CMP + %" PRIu8
122
hpet_ram_write_invalid_tn_cmp(void) "invalid HPET_TN_CMP + 4 write"
123
hpet_ram_write_invalid(void) "invalid hpet_ram_writel"
124
hpet_ram_write_counter_write_while_enabled(void) "Writing counter while HPET enabled!"
125
+
126
+# imx_epit.c
127
+imx_epit_get_freq(uint32_t freq) "ptimer frequency is %u"
128
+imx_epit_read(const char *name, uint32_t value) "(%s) = 0x%08x"
129
+imx_epit_write(const char *name, uint64_t value) "(%s, value = 0x%08" PRIx64 ")"
130
+imx_epit_cmp(uint32_t sr) "sr was %d"