[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 14/30] hw/char/sh_serial: Add device id to trace output
From: |
Philippe Mathieu-Daudé |
Subject: |
[PULL 14/30] hw/char/sh_serial: Add device id to trace output |
Date: |
Sat, 30 Oct 2021 19:05:59 +0200 |
From: BALATON Zoltan <balaton@eik.bme.hu>
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>
---
hw/char/sh_serial.c | 6 ++++--
hw/char/trace-events | 4 ++--
2 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/hw/char/sh_serial.c b/hw/char/sh_serial.c
index 808d4ebae70..355886ee3a1 100644
--- a/hw/char/sh_serial.c
+++ b/hw/char/sh_serial.c
@@ -94,9 +94,10 @@ static void sh_serial_write(void *opaque, hwaddr offs,
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 @@ static uint64_t sh_serial_read(void *opaque, hwaddr offs,
unsigned size)
{
SHSerialState *s = opaque;
+ DeviceState *d = DEVICE(s);
uint32_t ret = UINT32_MAX;
#if 0
@@ -304,7 +306,7 @@ static uint64_t sh_serial_read(void *opaque, hwaddr offs,
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,
diff --git a/hw/char/trace-events b/hw/char/trace-events
index 4a92e7674a2..2ecb36232e9 100644
--- a/hw/char/trace-events
+++ b/hw/char/trace-events
@@ -103,5 +103,5 @@ exynos_uart_rx_timeout(uint32_t channel, uint32_t stat,
uint32_t intsp) "UART%d:
cadence_uart_baudrate(unsigned baudrate) "baudrate %u"
# sh_serial.c
-sh_serial_read(unsigned size, uint64_t offs, uint64_t val) " size %d offs
0x%02" PRIx64 " -> 0x%02" PRIx64
-sh_serial_write(unsigned size, uint64_t offs, uint64_t val) "size %d offs
0x%02" PRIx64 " <- 0x%02" PRIx64
+sh_serial_read(char *id, unsigned size, uint64_t offs, uint64_t val) " %s size
%d offs 0x%02" PRIx64 " -> 0x%02" PRIx64
+sh_serial_write(char *id, unsigned size, uint64_t offs, uint64_t val) "%s size
%d offs 0x%02" PRIx64 " <- 0x%02" PRIx64
--
2.31.1
- [PULL 04/30] hw/sh4: Coding style: Add missing braces, (continued)
- [PULL 04/30] hw/sh4: Coding style: Add missing braces, Philippe Mathieu-Daudé, 2021/10/30
- [PULL 05/30] hw/sh4: Coding style: Remove unnecessary casts, Philippe Mathieu-Daudé, 2021/10/30
- [PULL 06/30] hw/sh4: Fix typos in a comment, Philippe Mathieu-Daudé, 2021/10/30
- [PULL 07/30] hw/sh4: Change debug printfs to traces, Philippe Mathieu-Daudé, 2021/10/30
- [PULL 08/30] hw/sh4/r2d: Use error_report instead of fprintf to stderr, Philippe Mathieu-Daudé, 2021/10/30
- [PULL 09/30] hw/char/sh_serial: Do not abort on invalid access, Philippe Mathieu-Daudé, 2021/10/30
- [PULL 10/30] hw/char/sh_serial: Rename type sh_serial_state to SHSerialState, Philippe Mathieu-Daudé, 2021/10/30
- [PULL 11/30] hw/char/sh_serial: Embed QEMUTimer in state struct, Philippe Mathieu-Daudé, 2021/10/30
- [PULL 12/30] hw/char/sh_serial: Split off sh_serial_reset() from sh_serial_init(), Philippe Mathieu-Daudé, 2021/10/30
- [PULL 13/30] hw/char/sh_serial: QOM-ify, Philippe Mathieu-Daudé, 2021/10/30
- [PULL 14/30] hw/char/sh_serial: Add device id to trace output,
Philippe Mathieu-Daudé <=
- [PULL 15/30] hw/intc/sh_intc: Use existing macro instead of local one, Philippe Mathieu-Daudé, 2021/10/30
- [PULL 16/30] hw/intc/sh_intc: Turn some defines into an enum, Philippe Mathieu-Daudé, 2021/10/30
- [PULL 17/30] hw/intc/sh_intc: Rename iomem region, Philippe Mathieu-Daudé, 2021/10/30
- [PULL 18/30] hw/intc/sh_intc: Drop another useless macro, Philippe Mathieu-Daudé, 2021/10/30
- [PULL 19/30] hw/intc/sh_intc: Move sh_intc_register() closer to its only user, Philippe Mathieu-Daudé, 2021/10/30
- [PULL 20/30] hw/intc/sh_intc: Remove excessive parenthesis, Philippe Mathieu-Daudé, 2021/10/30
- [PULL 21/30] hw/intc/sh_intc: Use array index instead of pointer arithmetics, Philippe Mathieu-Daudé, 2021/10/30
- [PULL 22/30] hw/intc/sh_intc: Inline and drop sh_intc_source() function, Philippe Mathieu-Daudé, 2021/10/30
- [PULL 23/30] hw/intc/sh_intc: Replace abort() with g_assert_not_reached(), Philippe Mathieu-Daudé, 2021/10/30
- [PULL 24/30] hw/intc/sh_intc: Avoid using continue in loops, Philippe Mathieu-Daudé, 2021/10/30