All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <philmd@oss.qualcomm.com>
To: qemu-devel@nongnu.org
Subject: [PULL 43/59] hw/net/imx_fec: Trace with QOM path where easily possible
Date: Tue, 27 Oct 2026 20:23:24 +0100	[thread overview]
Message-ID: <20261027192341.9197-44-philmd@oss.qualcomm.com> (raw)
In-Reply-To: <20261027192341.9197-1-philmd@oss.qualcomm.com>

From: Bernhard Beschow <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>
Reviewed-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
Message-ID: <20260921214710.29422-41-shentey@gmail.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.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 c177b7ff2b7b..fb8bcd52d203 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 001a20b0e2ac..81af808044e1 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-10-27 19:29 UTC|newest]

Thread overview: 66+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-27 19:22 [PULL 00/59] Misc HW patches for 2026-10-27 Philippe Mathieu-Daudé
2026-10-27 19:22 ` [PULL 01/59] scripts/checkpatch.pl: Don't complain about spaces before Fixes tags Philippe Mathieu-Daudé
2026-10-27 19:22 ` [PULL 02/59] hw/sd/sdcard: Keep high-capacity memory blocks at 512 bytes Philippe Mathieu-Daudé
2026-10-27 19:22 ` [PULL 03/59] hw/watchdog/wdt_imx2: Preserve own locked bits in WCR Philippe Mathieu-Daudé
2026-10-27 19:22 ` [PULL 04/59] hw/watchdog/wdt_imx2: Fix handling of write one once WCR bits Philippe Mathieu-Daudé
2026-10-27 19:22 ` [PULL 05/59] hw/watchdog/wdt_imx2: Clear WDT lock on reset Philippe Mathieu-Daudé
2026-10-27 19:22 ` [PULL 06/59] hw/watchdog/wdt_imx2: Remove redundant attributes Philippe Mathieu-Daudé
2026-10-27 19:22 ` [PULL 07/59] hw/arm/imx8mm-evk: Fix reference count of SoC object Philippe Mathieu-Daudé
2026-10-27 19:22 ` [PULL 08/59] docs, tests/functional: Drop redundant CLI arguments in imx8m*-evk invocations Philippe Mathieu-Daudé
2026-10-27 19:22 ` [PULL 09/59] hw/arm/sabrelite: Have 4 CPUs and 1 GiB of RAM by default Philippe Mathieu-Daudé
2026-10-27 19:22 ` [PULL 10/59] tests/functional/arm: Add console test for `sabrelite` machine Philippe Mathieu-Daudé
2026-10-27 19:22 ` [PULL 11/59] hw/arm/mcimx6ul-evk: Have 512 MiB of RAM by default Philippe Mathieu-Daudé
2026-10-27 19:22 ` [PULL 12/59] hw/arm/mcimx7d-sabre: Have 2 CPUs and 2 GiB " Philippe Mathieu-Daudé
2026-10-27 19:22 ` [PULL 13/59] tests/functional/arm: Add console test for `mcimx7d-sabre` machine Philippe Mathieu-Daudé
2026-10-27 19:22 ` [PULL 14/59] hw/arm/fsl-imx25: Derive from TYPE_SYS_BUS_DEVICE Philippe Mathieu-Daudé
2026-10-27 19:22 ` [PULL 15/59] hw/arm/fsl-imx31: " Philippe Mathieu-Daudé
2026-10-27 19:22 ` [PULL 16/59] hw/arm/fsl-imx6: " Philippe Mathieu-Daudé
2026-10-27 19:22 ` [PULL 17/59] hw/arm/fsl-imx6ul: " Philippe Mathieu-Daudé
2026-10-27 19:22 ` [PULL 18/59] hw/arm/fsl-imx7: " Philippe Mathieu-Daudé
2026-10-27 19:23 ` [PULL 19/59] hw/timer/imx_gpt: Wire clock control module via link property Philippe Mathieu-Daudé
2026-10-27 19:23 ` [PULL 20/59] hw/timer/imx_epit: " Philippe Mathieu-Daudé
2026-10-27 19:23 ` [PULL 21/59] hw/arm/Kconfig: Select missing UNIMP in config FSL_IMX8MM Philippe Mathieu-Daudé
2026-10-27 19:23 ` [PULL 22/59] hw/misc/Kconfig: Remove redundant USB_EHCI_SYSBUS from config IMX Philippe Mathieu-Daudé
2026-10-27 19:23 ` [PULL 23/59] Kconfig: Extract config IMX_AVIC " Philippe Mathieu-Daudé
2026-10-27 19:23 ` [PULL 24/59] Kconfig: Extract config IMX_GPCV2 " Philippe Mathieu-Daudé
2026-10-27 19:23 ` [PULL 25/59] Kconfig: Extract config IMX_RNG " Philippe Mathieu-Daudé
2026-10-27 19:23 ` [PULL 26/59] Kconfig: Extract config FSL_IMX7_GPR " Philippe Mathieu-Daudé
2026-10-27 19:23 ` [PULL 27/59] Kconfig: Extract config FSL_IMX{6, 7}_SRC " Philippe Mathieu-Daudé
2026-10-27 19:23 ` [PULL 28/59] Kconfig: Extract config FSL_IMX7_SNVS " Philippe Mathieu-Daudé
2026-10-27 19:23 ` [PULL 29/59] Kconfig: Extract dedicated config FSL_IMXx_CCM " Philippe Mathieu-Daudé
2026-10-27 19:23 ` [PULL 30/59] Kconfig: Extract config IMX_GPT " Philippe Mathieu-Daudé
2026-10-27 19:23 ` [PULL 31/59] Kconfig: Extract config IMX_EPIT " Philippe Mathieu-Daudé
2026-10-27 19:23 ` [PULL 32/59] Kconfig: Extract config GPIO_IMX " Philippe Mathieu-Daudé
2026-10-27 19:23 ` [PULL 33/59] Kconfig: Extract config IMX_SPI " Philippe Mathieu-Daudé
2026-10-27 19:23 ` [PULL 34/59] Kconfig: Extract config IMX_SERIAL " Philippe Mathieu-Daudé
2026-10-27 19:23 ` [PULL 35/59] Kconfig: Remove " Philippe Mathieu-Daudé
2026-10-27 19:23 ` [PULL 36/59] hw/vmapple/Kconfig: Remove unused GPIO_PWR dependency Philippe Mathieu-Daudé
2026-10-27 19:23 ` [PULL 37/59] hw/arm/fsl-imx8m: Fix typo Philippe Mathieu-Daudé
2026-10-27 19:23 ` [PULL 38/59] hw/misc/imx6_src: Avoid casting from void * Philippe Mathieu-Daudé
2026-10-27 19:23 ` [PULL 39/59] hw/char/imx_serial: " Philippe Mathieu-Daudé
2026-10-27 19:23 ` [PULL 40/59] hw/intc/imx_avic: " Philippe Mathieu-Daudé
2026-10-27 19:23 ` [PULL 41/59] hw/misc/imx*_ccm: " Philippe Mathieu-Daudé
2026-10-27 19:23 ` [PULL 42/59] hw/usb/imx-usb-phy: " Philippe Mathieu-Daudé
2026-10-27 19:23 ` Philippe Mathieu-Daudé [this message]
2026-10-27 19:23 ` [PULL 44/59] hw/net/lan9118_phy: Trace with QOM path Philippe Mathieu-Daudé
2026-10-27 19:23 ` [PULL 45/59] hw/watchdog/wdt_imx2: " Philippe Mathieu-Daudé
2026-10-27 19:23 ` [PULL 46/59] hw/arm: remove pci-bridge/pci_expander_bridge.h from virt.c Philippe Mathieu-Daudé
2026-10-27 19:23 ` [PULL 47/59] MAINTAINERS: Update Gustavo's email address Philippe Mathieu-Daudé
2026-10-27 19:23 ` [PULL 48/59] hw/char/sh_serial: fix RDF flag clear on FIFO reset Philippe Mathieu-Daudé
2026-10-27 19:23 ` [PULL 49/59] hw/char/sh_serial: use rx_cnt for available FIFO space Philippe Mathieu-Daudé
2026-10-27 19:23 ` [PULL 50/59] hw/char/sh_serial: fix break detection flag Philippe Mathieu-Daudé
2026-10-27 19:23 ` [PULL 51/59] system: Remove deprecated 'debug-threads' option for -name Philippe Mathieu-Daudé
2026-10-28  1:01   ` Richard Henderson
2026-10-28  7:32     ` Philippe Mathieu-Daudé
2026-10-28  8:13       ` Richard Henderson
2026-10-28  9:47       ` Daniel P. Berrangé
2026-10-28 11:54         ` Peter Xu
2026-10-28 12:04           ` Daniel P. Berrangé
2026-10-27 19:23 ` [PULL 52/59] hw/pci-host/aspeed_pcie: Fix global MSI setting during class initialization Philippe Mathieu-Daudé
2026-10-27 19:23 ` [PULL 53/59] hw/net/can/flexcan: Fix FLEXCAN_CRCR_MBCRC definition Philippe Mathieu-Daudé
2026-10-27 19:23 ` [PULL 54/59] hw/net/cadence_gem: Check guest-provided queue numbers in screening registers Philippe Mathieu-Daudé
2026-10-27 19:23 ` [PULL 55/59] hw/misc/allwinner-h3-dramc: Avoid shift by negative amount Philippe Mathieu-Daudé
2026-10-27 19:23 ` [PULL 56/59] hw/display/xlnx_dp: Make assertions clearer Philippe Mathieu-Daudé
2026-10-27 19:23 ` [PULL 57/59] qemu/arch-defs: extract QEMU_ARCH_BIT for QEMU_ARCH_* enums Philippe Mathieu-Daudé
2026-10-27 19:23 ` [PULL 58/59] qemu/arch-defs: Use SYS_EMU_TARGET__MAX to define QEMU_ARCH_ALL Philippe Mathieu-Daudé
2026-10-27 19:23 ` [PULL 59/59] qemu/arch-defs: increase width of QEMU_ARCH_* masks enums to be 64 bits Philippe Mathieu-Daudé

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=20261027192341.9197-44-philmd@oss.qualcomm.com \
    --to=philmd@oss.qualcomm.com \
    --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.