From nobody Mon Feb 9 07:43:01 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=eik.bme.hu Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1635345896531434.1899381747286; Wed, 27 Oct 2021 07:44:56 -0700 (PDT) Received: from localhost ([::1]:43606 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mfkAh-0002Wq-Cm for importer@patchew.org; Wed, 27 Oct 2021 10:44:55 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41954) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mfjS7-0003us-7p for qemu-devel@nongnu.org; Wed, 27 Oct 2021 09:58:52 -0400 Received: from zero.eik.bme.hu ([2001:738:2001:2001::2001]:28151) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mfjS3-0004Ut-Hi for qemu-devel@nongnu.org; Wed, 27 Oct 2021 09:58:50 -0400 Received: from zero.eik.bme.hu (blah.eik.bme.hu [152.66.115.182]) by localhost (Postfix) with SMTP id 121567561A5; Wed, 27 Oct 2021 15:58:42 +0200 (CEST) Received: by zero.eik.bme.hu (Postfix, from userid 432) id AFE0075605E; Wed, 27 Oct 2021 15:58:41 +0200 (CEST) Message-Id: <5bfade7f5e807a3e950b328a5a11a67859e176cf.1635342377.git.balaton@eik.bme.hu> In-Reply-To: References: From: BALATON Zoltan Subject: [PATCH v2 07/11] hw/char/sh_serial: Add device id to trace output Date: Wed, 27 Oct 2021 15:46:17 +0200 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable To: qemu-devel@nongnu.org X-Spam-Probability: 8% Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2001:738:2001:2001::2001; envelope-from=balaton@eik.bme.hu; helo=zero.eik.bme.hu X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Richard Henderson , Magnus Damm , Yoshinori Sato Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZM-MESSAGEID: 1635345897107100001 Content-Type: text/plain; charset="utf-8" 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 Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- 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 ad576b693b..3c400b2dd1 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 =3D opaque; + DeviceState *d =3D DEVICE(s); unsigned char ch; =20 - trace_sh_serial_write(size, offs, val); + trace_sh_serial_write(d->id, size, offs, val); switch (offs) { case 0x00: /* SMR */ s->smr =3D val & ((s->feat & SH_SERIAL_FEAT_SCIF) ? 0x7b : 0xff); @@ -213,6 +214,7 @@ static uint64_t sh_serial_read(void *opaque, hwaddr off= s, unsigned size) { SHSerialState *s =3D opaque; + DeviceState *d =3D DEVICE(s); uint32_t ret =3D ~0; =20 #if 0 @@ -305,7 +307,7 @@ static uint64_t sh_serial_read(void *opaque, hwaddr off= s, break; } } - trace_sh_serial_read(size, offs, ret); + trace_sh_serial_read(d->id, size, offs, ret); =20 if (ret & ~((1 << 16) - 1)) { qemu_log_mask(LOG_UNIMP, "sh_serial: unsupported read from 0x%02" diff --git a/hw/char/trace-events b/hw/char/trace-events index 4a92e7674a..2ecb36232e 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" =20 # 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 --=20 2.21.4