Skip to contentSkip to conversation

net: Print the packet size in the debug output

PATCH In review Bin Meng 2 participants 2 messages Feb 26, 2021 Networking

lore
Share & tools
lore

Bin Meng

author
#0 lore raw

PATCH 1/1 net: Print the packet size in the debug output

From: Bin Meng <[email protected]>

Printing out the packet size is helpful during debug.

---

 net/net.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/net.c +1 -1
index 32d71c1..b038370 100644
@@ -641,7 +641,7 @@ static ssize_t qemu_send_packet_async_with_flags(NetClientState *sender,
     int ret;
 
 #ifdef DEBUG_NET
-    printf("qemu_send_packet_async:\n");
+    printf("qemu_send_packet_async: packet size (%d)\n", size);
     qemu_hexdump(stdout, "net", buf, size);
 #endif
 
Signature · 1 line
2.7.4
#1 lore raw
Quoted 15 lines · Bin Meng

From: Bin Meng <[email protected]>

Printing out the packet size is helpful during debug.

---

 net/net.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/net.c +0 -0
index 32d71c1..b038370 100644

net/net.c static ssize_t qemu_send_packet_async_with_flags(NetClientState *sender, · line 645

Quoted 6 lines
net/net.c +1 -1
@@ -641,7 +641,7 @@ static ssize_t qemu_send_packet_async_with_flags(NetClientState *sender,
     int ret;
 
 #ifdef DEBUG_NET
-    printf("qemu_send_packet_async:\n");
+    printf("qemu_send_packet_async: packet size (%d)\n", size);
     qemu_hexdump(stdout, "net", buf, size);

At this point better to convert to trace events (see commit db1e7afa371):

        if (trace_event_get_state_backends(TRACE_NET_SEND_PACKET)) {
            net_pkt_hexdump(buf, size);
        }