All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bernhard Beschow <shentey@gmail.com>
To: qemu-devel@nongnu.org
Cc: "Phil Dennis-Jordan" <phil@philjordan.eu>,
	"Alistair Francis" <alistair@alistair23.me>,
	"Peter Maydell" <peter.maydell@linaro.org>,
	"Alexander Graf" <agraf@csgraf.de>,
	"Jason Wang" <jasowangio@gmail.com>,
	qemu-arm@nongnu.org,
	"Pierrick Bouvier" <pierrick.bouvier@oss.qualcomm.com>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Marc-André Lureau" <marcandre.lureau@redhat.com>,
	"Bernhard Beschow" <shentey@gmail.com>,
	"Jean-Christophe Dubois" <jcd@tribudubois.net>,
	"Gaurav Sharma" <gaurav.sharma_7@nxp.com>
Subject: [PATCH 40/42] hw/net/imx_fec: Trace with QOM path where easily possible
Date: Mon, 21 Sep 2026 23:47:08 +0200	[thread overview]
Message-ID: <20260921214710.29422-41-shentey@gmail.com> (raw)
In-Reply-To: <20260921214710.29422-1-shentey@gmail.com>

Some i.MX SoCs have multiple i.MX network IP blocks. Allow to
distinguish them via their QOM path when tracing.

Signed-off-by: Bernhard Beschow <shentey@gmail.com>
---
 hw/net/imx_fec.c    | 28 +++++++++++++++-------------
 hw/net/trace-events | 24 ++++++++++++------------
 2 files changed, 27 insertions(+), 25 deletions(-)

diff --git a/hw/net/imx_fec.c b/hw/net/imx_fec.c
index c177b7ff2b..fb8bcd52d2 100644
--- a/hw/net/imx_fec.c
+++ b/hw/net/imx_fec.c
@@ -248,7 +248,7 @@ static uint32_t imx_phy_read(IMXFECState *s, int reg)
         if (s->phy_consumer && phy == s->phy_consumer->phy_num) {
             s = s->phy_consumer;
         } else {
-            trace_imx_phy_read_num(phy, s->phy_num);
+            trace_imx_phy_read_num(DEVICE(s)->canonical_path, phy, s->phy_num);
             return 0xffff;
         }
     }
@@ -270,7 +270,7 @@ static void imx_phy_write(IMXFECState *s, int reg, uint32_t val)
         if (s->phy_consumer && phy == s->phy_consumer->phy_num) {
             s = s->phy_consumer;
         } else {
-            trace_imx_phy_write_num(phy, s->phy_num);
+            trace_imx_phy_write_num(DEVICE(s)->canonical_path, phy, s->phy_num);
             return;
         }
     }
@@ -364,7 +364,7 @@ static void imx_fec_do_tx(IMXFECState *s)
         if ((bd.flags & ENET_BD_R) == 0) {
 
             /* Run out of descriptors to transmit.  */
-            trace_imx_eth_tx_bd_busy();
+            trace_imx_eth_tx_bd_busy(DEVICE(s)->canonical_path);
 
             break;
         }
@@ -446,7 +446,7 @@ static void imx_enet_do_tx(IMXFECState *s, uint32_t index)
         if ((bd.flags & ENET_BD_R) == 0) {
             /* Run out of descriptors to transmit.  */
 
-            trace_imx_eth_tx_bd_busy();
+            trace_imx_eth_tx_bd_busy(DEVICE(s)->canonical_path);
 
             break;
         }
@@ -521,7 +521,7 @@ static void imx_eth_enable_rx(IMXFECState *s, bool flush)
     s->regs[ENET_RDAR] = (bd.flags & ENET_BD_E) ? ENET_RDAR_RDAR : 0;
 
     if (!s->regs[ENET_RDAR]) {
-        trace_imx_eth_rx_bd_full();
+        trace_imx_eth_rx_bd_full(DEVICE(s)->canonical_path);
     } else if (flush) {
         qemu_flush_queued_packets(qemu_get_queue(s->nic));
     }
@@ -659,7 +659,8 @@ static uint64_t imx_eth_read(void *opaque, hwaddr offset, unsigned size)
         break;
     }
 
-    trace_imx_eth_read(index, imx_eth_reg_name(s, index), value);
+    trace_imx_eth_read(DEVICE(s)->canonical_path, index,
+                       imx_eth_reg_name(s, index), value);
 
     return value;
 }
@@ -767,7 +768,8 @@ static void imx_eth_write(void *opaque, hwaddr offset, uint64_t value,
     const bool single_tx_ring = !imx_eth_is_multi_tx_ring(s);
     uint32_t index = offset >> 2;
 
-    trace_imx_eth_write(index, imx_eth_reg_name(s, index), value);
+    trace_imx_eth_write(DEVICE(s)->canonical_path, index,
+                        imx_eth_reg_name(s, index), value);
 
     switch (index) {
     case ENET_EIR:
@@ -951,7 +953,7 @@ static ssize_t imx_fec_receive(NetClientState *nc, const uint8_t *buf,
     unsigned int buf_len;
     size_t size = len;
 
-    trace_imx_fec_receive(size);
+    trace_imx_fec_receive(DEVICE(s)->canonical_path, size);
 
     if (!s->regs[ENET_RDAR]) {
         qemu_log_mask(LOG_GUEST_ERROR, "[%s]%s: Unexpected packet\n",
@@ -993,7 +995,7 @@ static ssize_t imx_fec_receive(NetClientState *nc, const uint8_t *buf,
         bd.length = buf_len;
         size -= buf_len;
 
-        trace_imx_fec_receive_len(addr, bd.length);
+        trace_imx_fec_receive_len(DEVICE(s)->canonical_path, addr, bd.length);
 
         /* The last 4 bytes are the CRC.  */
         if (size < 4) {
@@ -1013,7 +1015,7 @@ static ssize_t imx_fec_receive(NetClientState *nc, const uint8_t *buf,
             /* Last buffer in frame.  */
             bd.flags |= flags | ENET_BD_L;
 
-            trace_imx_fec_receive_last(bd.flags);
+            trace_imx_fec_receive_last(DEVICE(s)->canonical_path, bd.flags);
 
             s->regs[ENET_EIR] |= ENET_INT_RXF;
         } else {
@@ -1047,7 +1049,7 @@ static ssize_t imx_enet_receive(NetClientState *nc, const uint8_t *buf,
     size_t size = len;
     bool shift16 = s->regs[ENET_RACC] & ENET_RACC_SHIFT16;
 
-    trace_imx_enet_receive(size);
+    trace_imx_enet_receive(DEVICE(s)->canonical_path, size);
 
     if (!s->regs[ENET_RDAR]) {
         qemu_log_mask(LOG_GUEST_ERROR, "[%s]%s: Unexpected packet\n",
@@ -1093,7 +1095,7 @@ static ssize_t imx_enet_receive(NetClientState *nc, const uint8_t *buf,
         bd.length = buf_len;
         size -= buf_len;
 
-        trace_imx_enet_receive_len(addr, bd.length);
+        trace_imx_enet_receive_len(DEVICE(s)->canonical_path, addr, bd.length);
 
         /* The last 4 bytes are the CRC.  */
         if (size < 4) {
@@ -1131,7 +1133,7 @@ static ssize_t imx_enet_receive(NetClientState *nc, const uint8_t *buf,
             /* Last buffer in frame.  */
             bd.flags |= flags | ENET_BD_L;
 
-            trace_imx_enet_receive_last(bd.flags);
+            trace_imx_enet_receive_last(DEVICE(s)->canonical_path, bd.flags);
 
             /* Indicate that we've updated the last buffer descriptor. */
             bd.last_buffer = ENET_BD_BDU;
diff --git a/hw/net/trace-events b/hw/net/trace-events
index 001a20b0e2..81af808044 100644
--- a/hw/net/trace-events
+++ b/hw/net/trace-events
@@ -444,20 +444,20 @@ i82596_ca_init(uint32_t scb, uint8_t mode, uint32_t base) "CA: Init - SCB=0x%08x
 i82596_ioport_write(uint32_t addr, uint32_t val) "IO write addr=0x%08x val=0x%08x"
 
 # imx_fec.c
-imx_phy_read_num(int phy, int configured) "read request from unconfigured phy %d (configured %d)"
-imx_phy_write_num(int phy, int configured) "write request to unconfigured phy %d (configured %d)"
+imx_phy_read_num(const char *path, int phy, int configured) "%s: read request from unconfigured phy %d (configured %d)"
+imx_phy_write_num(const char *path, int phy, int configured) "%s: write request to unconfigured phy %d (configured %d)"
 imx_fec_read_bd(uint64_t addr, int flags, int len, int data) "tx_bd 0x%"PRIx64" flags 0x%04x len %d data 0x%08x"
 imx_enet_read_bd(uint64_t addr, int flags, int len, int data, int options, int status) "tx_bd 0x%"PRIx64" flags 0x%04x len %d data 0x%08x option 0x%04x status 0x%04x"
-imx_eth_tx_bd_busy(void) "tx_bd ran out of descriptors to transmit"
-imx_eth_rx_bd_full(void) "RX buffer is full"
-imx_eth_read(int reg, const char *reg_name, uint32_t value) "reg[%d:%s] => 0x%08"PRIx32
-imx_eth_write(int reg, const char *reg_name, uint64_t value) "reg[%d:%s] <= 0x%08"PRIx64
-imx_fec_receive(size_t size) "len %zu"
-imx_fec_receive_len(uint64_t addr, int len) "rx_bd 0x%"PRIx64" length %d"
-imx_fec_receive_last(int last) "rx frame flags 0x%04x"
-imx_enet_receive(size_t size) "len %zu"
-imx_enet_receive_len(uint64_t addr, int len) "rx_bd 0x%"PRIx64" length %d"
-imx_enet_receive_last(int last) "rx frame flags 0x%04x"
+imx_eth_tx_bd_busy(const char *path) "%s: tx_bd ran out of descriptors to transmit"
+imx_eth_rx_bd_full(const char *path) "%s: RX buffer is full"
+imx_eth_read(const char *path, int reg, const char *reg_name, uint32_t value) "%s: reg[%d:%s] => 0x%08"PRIx32
+imx_eth_write(const char *path, int reg, const char *reg_name, uint64_t value) "%s: reg[%d:%s] <= 0x%08"PRIx64
+imx_fec_receive(const char *path, size_t size) "%s: len %zu"
+imx_fec_receive_len(const char *path, uint64_t addr, int len) "%s: rx_bd 0x%"PRIx64" length %d"
+imx_fec_receive_last(const char *path, int last) "%s: rx frame flags 0x%04x"
+imx_enet_receive(const char *path, size_t size) "%s: len %zu"
+imx_enet_receive_len(const char *path, uint64_t addr, int len) "%s, rx_bd 0x%"PRIx64" length %d"
+imx_enet_receive_last(const char *path, int last) "%s: rx frame flags 0x%04x"
 
 # npcm7xx_emc.c
 npcm7xx_emc_reset(int emc_num) "Resetting emc%d"
-- 
2.55.0



  parent reply	other threads:[~2026-09-21 21:53 UTC|newest]

Thread overview: 71+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-21 21:46 [PATCH 00/42] i.MX fixes and cleanup Bernhard Beschow
2026-09-21 21:46 ` [PATCH 01/42] hw/watchdog/wdt_imx2: Fix handling of write-once WCR bits Bernhard Beschow
2026-09-28 18:22   ` Peter Maydell
2026-09-28 20:55     ` Bernhard Beschow
2026-09-21 21:46 ` [PATCH 02/42] hw/watchdog/wdt_imx2: Remove unused attributes Bernhard Beschow
2026-09-28 18:24   ` Peter Maydell
2026-09-21 21:46 ` [PATCH 03/42] hw/arm/imx8mm-evk: Fix reference count of SoC object Bernhard Beschow
2026-09-28 18:36   ` Peter Maydell
2026-09-21 21:46 ` [PATCH 04/42] hw/arm/mcimx7d-sabre: Ignore memory transaction failures Bernhard Beschow
2026-09-28 18:05   ` Peter Maydell
2026-09-28 20:58     ` Bernhard Beschow
2026-09-21 21:46 ` [PATCH 05/42] docs, tests/functional: Drop redundant CLI arguments in imx8m*-evk invocations Bernhard Beschow
2026-09-28 18:37   ` Peter Maydell
2026-09-29 12:15   ` Philippe Mathieu-Daudé
2026-09-21 21:46 ` [PATCH 06/42] hw/arm/sabrelite: Have 4 CPUs and 1 GiB of RAM by default Bernhard Beschow
2026-09-29 12:13   ` Philippe Mathieu-Daudé
2026-09-21 21:46 ` [PATCH 07/42] tests/functional/arm: Add console test for `sabrelite` machine Bernhard Beschow
2026-09-29 12:14   ` Philippe Mathieu-Daudé
2026-09-21 21:46 ` [PATCH 08/42] hw/arm/mcimx6ul-evk: Have 512 MiB of RAM by default Bernhard Beschow
2026-09-21 21:46 ` [PATCH 09/42] hw/arm/mcimx7d-sabre: Have 2 CPUs and 2 GiB " Bernhard Beschow
2026-09-21 21:46 ` [PATCH 10/42] tests/functional/arm: Add console test for `mcimx7d-sabre` machine Bernhard Beschow
2026-09-29 12:14   ` Philippe Mathieu-Daudé
2026-09-21 21:46 ` [PATCH 11/42] hw/arm/fsl-imx25: Derive from TYPE_SYS_BUS_DEVICE Bernhard Beschow
2026-09-29 12:17   ` Philippe Mathieu-Daudé
2026-09-21 21:46 ` [PATCH 12/42] hw/arm/fsl-imx31: " Bernhard Beschow
2026-09-21 21:46 ` [PATCH 13/42] hw/arm/fsl-imx6: " Bernhard Beschow
2026-09-21 21:46 ` [PATCH 14/42] hw/arm/fsl-imx6ul: " Bernhard Beschow
2026-09-21 21:46 ` [PATCH 15/42] hw/arm/fsl-imx7: " Bernhard Beschow
2026-09-21 21:46 ` [PATCH 16/42] hw/timer/imx_gpt: Wire clock control module via link property Bernhard Beschow
2026-09-29 12:18   ` Philippe Mathieu-Daudé
2026-09-21 21:46 ` [PATCH 17/42] hw/timer/imx_epit: " Bernhard Beschow
2026-09-29 12:18   ` Philippe Mathieu-Daudé
2026-09-21 21:46 ` [PATCH 18/42] hw/arm/Kconfig: Select missing UNIMP in config FSL_IMX8MM Bernhard Beschow
2026-09-29 12:18   ` Philippe Mathieu-Daudé
2026-09-21 21:46 ` [PATCH 19/42] hw/misc/Kconfig: Remove redundant USB_EHCI_SYSBUS from config IMX Bernhard Beschow
2026-09-21 21:46 ` [PATCH 20/42] Kconfig: Extract config IMX_AVIC " Bernhard Beschow
2026-09-29 12:19   ` Philippe Mathieu-Daudé
2026-09-21 21:46 ` [PATCH 21/42] Kconfig: Extract config IMX_GPCV2 " Bernhard Beschow
2026-09-29 12:19   ` Philippe Mathieu-Daudé
2026-09-21 21:46 ` [PATCH 22/42] Kconfig: Extract config IMX_RNG " Bernhard Beschow
2026-09-29 12:20   ` Philippe Mathieu-Daudé
2026-09-21 21:46 ` [PATCH 23/42] Kconfig: Extract config FSL_IMX7_GPR " Bernhard Beschow
2026-09-29 12:23   ` Philippe Mathieu-Daudé
2026-09-21 21:46 ` [PATCH 24/42] Kconfig: Extract config FSL_IMX{6, 7}_SRC " Bernhard Beschow
2026-09-21 21:46 ` [PATCH 25/42] Kconfig: Extract config FSL_IMX7_SNVS " Bernhard Beschow
2026-09-21 21:46 ` [PATCH 26/42] Kconfig: Extract dedicated config FSL_IMXx_CCM " Bernhard Beschow
2026-09-21 21:46 ` [PATCH 27/42] Kconfig: Extract config IMX_GPT " Bernhard Beschow
2026-09-21 21:46 ` [PATCH 28/42] Kconfig: Extract config IMX_EPIT " Bernhard Beschow
2026-09-21 21:46 ` [PATCH 29/42] Kconfig: Extract config GPIO_IMX " Bernhard Beschow
2026-09-21 21:46 ` [PATCH 30/42] Kconfig: Extract config IMX_SPI " Bernhard Beschow
2026-09-21 21:46 ` [PATCH 31/42] Kconfig: Extract config IMX_SERIAL " Bernhard Beschow
2026-09-21 21:47 ` [PATCH 32/42] Kconfig: Remove " Bernhard Beschow
2026-09-21 21:47 ` [PATCH 33/42] hw/vmapple/Kconfig: Remove unused GPIO_PWR dependency Bernhard Beschow
2026-09-29 12:25   ` Philippe Mathieu-Daudé
2026-09-21 21:47 ` [PATCH 34/42] hw/arm/fsl-imx8m: Fix typo Bernhard Beschow
2026-09-21 21:47 ` [PATCH 35/42] hw/misc/imx6_src: Avoid casting from void * Bernhard Beschow
2026-09-29 12:25   ` Philippe Mathieu-Daudé
2026-09-21 21:47 ` [PATCH 36/42] hw/char/imx_serial: " Bernhard Beschow
2026-09-29 12:26   ` Philippe Mathieu-Daudé
2026-09-21 21:47 ` [PATCH 37/42] hw/intc/imx_avic: " Bernhard Beschow
2026-09-21 21:47 ` [PATCH 38/42] hw/misc/imx*_ccm: " Bernhard Beschow
2026-09-21 21:47 ` [PATCH 39/42] hw/usb/imx-usb-phy: " Bernhard Beschow
2026-09-21 21:47 ` Bernhard Beschow [this message]
2026-09-29 12:27   ` [PATCH 40/42] hw/net/imx_fec: Trace with QOM path where easily possible Philippe Mathieu-Daudé
2026-09-21 21:47 ` [PATCH 41/42] hw/net/lan9118_phy: Trace with QOM path Bernhard Beschow
2026-09-21 21:47 ` [PATCH 42/42] hw/watchdog/wdt_imx2: " Bernhard Beschow
2026-09-29 12:39 ` [PATCH 00/42] i.MX fixes and cleanup Philippe Mathieu-Daudé
2026-09-29 12:54   ` Peter Maydell
2026-10-04 12:30   ` Bernhard Beschow
2026-10-05 14:35 ` SysBus reset and heterogeneous emulation Philippe Mathieu-Daudé
2026-10-05 15:05   ` Peter Maydell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260921214710.29422-41-shentey@gmail.com \
    --to=shentey@gmail.com \
    --cc=agraf@csgraf.de \
    --cc=alistair@alistair23.me \
    --cc=gaurav.sharma_7@nxp.com \
    --cc=jasowangio@gmail.com \
    --cc=jcd@tribudubois.net \
    --cc=marcandre.lureau@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=phil@philjordan.eu \
    --cc=pierrick.bouvier@oss.qualcomm.com \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.