Skip to content

Commit 2eabc49

Browse files
shentokphilmd
authored andcommitted
hw/misc/imx6_src: Convert DPRINTF() to trace events
Signed-off-by: Bernhard Beschow <[email protected]> Reviewed-by: Philippe Mathieu-Daudé <[email protected]> Tested-by: Philippe Mathieu-Daudé <[email protected]> Message-ID: <[email protected]> Signed-off-by: Philippe Mathieu-Daudé <[email protected]>
1 parent bbaf7a0 commit 2eabc49

File tree

2 files changed

+11
-18
lines changed

2 files changed

+11
-18
lines changed

hw/misc/imx6_src.c

Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -17,18 +17,7 @@
1717
#include "qemu/module.h"
1818
#include "target/arm/arm-powerctl.h"
1919
#include "hw/core/cpu.h"
20-
21-
#ifndef DEBUG_IMX6_SRC
22-
#define DEBUG_IMX6_SRC 0
23-
#endif
24-
25-
#define DPRINTF(fmt, args...) \
26-
do { \
27-
if (DEBUG_IMX6_SRC) { \
28-
fprintf(stderr, "[%s]%s: " fmt , TYPE_IMX6_SRC, \
29-
__func__, ##args); \
30-
} \
31-
} while (0)
20+
#include "trace.h"
3221

3322
static const char *imx6_src_reg_name(uint32_t reg)
3423
{
@@ -87,7 +76,7 @@ static void imx6_src_reset(DeviceState *dev)
8776
{
8877
IMX6SRCState *s = IMX6_SRC(dev);
8978

90-
DPRINTF("\n");
79+
trace_imx6_src_reset();
9180

9281
memset(s->regs, 0, sizeof(s->regs));
9382

@@ -111,7 +100,7 @@ static uint64_t imx6_src_read(void *opaque, hwaddr offset, unsigned size)
111100

112101
}
113102

114-
DPRINTF("reg[%s] => 0x%" PRIx32 "\n", imx6_src_reg_name(index), value);
103+
trace_imx6_src_read(imx6_src_reg_name(index), value);
115104

116105
return value;
117106
}
@@ -134,8 +123,7 @@ static void imx6_clear_reset_bit(CPUState *cpu, run_on_cpu_data data)
134123
assert(bql_locked());
135124

136125
s->regs[SRC_SCR] = deposit32(s->regs[SRC_SCR], ri->reset_bit, 1, 0);
137-
DPRINTF("reg[%s] <= 0x%" PRIx32 "\n",
138-
imx6_src_reg_name(SRC_SCR), s->regs[SRC_SCR]);
126+
trace_imx6_clear_reset_bit(imx6_src_reg_name(SRC_SCR), s->regs[SRC_SCR]);
139127

140128
g_free(ri);
141129
}
@@ -173,8 +161,7 @@ static void imx6_src_write(void *opaque, hwaddr offset, uint64_t value,
173161
return;
174162
}
175163

176-
DPRINTF("reg[%s] <= 0x%" PRIx32 "\n", imx6_src_reg_name(index),
177-
(uint32_t)current_value);
164+
trace_imx6_src_write(imx6_src_reg_name(index), value);
178165

179166
change_mask = s->regs[index] ^ (uint32_t)current_value;
180167

hw/misc/trace-events

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,12 @@ ccm_clock_freq(uint32_t clock, uint32_t freq) "(Clock = %d) = %d"
253253
ccm_read_reg(const char *reg_name, uint32_t value) "reg[%s] <= 0x%" PRIx32
254254
ccm_write_reg(const char *reg_name, uint32_t value) "reg[%s] => 0x%" PRIx32
255255

256+
# imx6_src.c
257+
imx6_src_read(const char *reg_name, uint32_t value) "reg[%s] => 0x%" PRIx32
258+
imx6_src_write(const char *reg_name, uint64_t value) "reg[%s] <= 0x%" PRIx64
259+
imx6_clear_reset_bit(const char *reg_name, uint32_t value) "reg[%s] <= 0x%" PRIx32
260+
imx6_src_reset(void) ""
261+
256262
# imx7_src.c
257263
imx7_src_read(const char *reg_name, uint32_t value) "reg[%s] => 0x%" PRIx32
258264
imx7_src_write(const char *reg_name, uint32_t value) "reg[%s] <= 0x%" PRIx32

0 commit comments

Comments
 (0)