hw/char/sh_serial: Add device id to trace output
Normally there are at least two sh_serial instances. Add device id to
trace messages to make it clear which instance they belong to
otherwise its not possible to tell which serial device is accessed.
Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <cc1f9ff9f4259ae799750e452f8871849c7a104c.1635541329.git.balaton@eik.bme.hu>
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
diff --git a/hw/char/sh_serial.c b/hw/char/sh_serial.c
index 808d4eb..355886e 100644
--- a/hw/char/sh_serial.c
+++ b/hw/char/sh_serial.c
@@ -94,9 +94,10 @@
uint64_t val, unsigned size)
{
SHSerialState *s = opaque;
+ DeviceState *d = DEVICE(s);
unsigned char ch;
- trace_sh_serial_write(size, offs, val);
+ trace_sh_serial_write(d->id, size, offs, val);
switch (offs) {
case 0x00: /* SMR */
s->smr = val & ((s->feat & SH_SERIAL_FEAT_SCIF) ? 0x7b : 0xff);
@@ -212,6 +213,7 @@
unsigned size)
{
SHSerialState *s = opaque;
+ DeviceState *d = DEVICE(s);
uint32_t ret = UINT32_MAX;
#if 0
@@ -304,7 +306,7 @@
break;
}
}
- trace_sh_serial_read(size, offs, ret);
+ trace_sh_serial_read(d->id, size, offs, ret);
if (ret > UINT16_MAX) {
qemu_log_mask(LOG_GUEST_ERROR,