From: Tonghao Zhang <tonghao@bamaicloud.com>
To: netdev@vger.kernel.org
Cc: Tonghao Zhang <tonghao@bamaicloud.com>,
Eran Ben Elisha <eranbe@mellanox.com>,
Jiri Pirko <jiri@mellanox.com>,
Cong Wang <xiyou.wangcong@gmail.com>,
Ido Schimmel <idosch@idosch.org>,
Jakub Kicinski <kuba@kernel.org>
Subject: [PATCH net-next v2] net: add net cookie for trace_net_dev_xmit_timeout
Date: Fri, 24 Oct 2025 20:18:53 +0800 [thread overview]
Message-ID: <20251024121853.94199-1-tonghao@bamaicloud.com> (raw)
In a multi-network card or container environment, provide more information.
[002] ..s1. 1838.311662: net_dev_xmit_timeout: dev=eth0 driver=virtio_net queue=10 net_cookie=3
[007] ..s1. 1839.335650: net_dev_xmit_timeout: dev=eth4 driver=virtio_net queue=10 net_cookie=4100
[007] ..s1. 1844.455659: net_dev_xmit_timeout: dev=eth0 driver=virtio_net queue=10 net_cookie=3
[007] ..s1. 1845.479663: net_dev_xmit_timeout: dev=eth4 driver=virtio_net queue=10 net_cookie=4100
[002] ..s1. 1850.087647: net_dev_xmit_timeout: dev=eth0 driver=virtio_net queue=10 net_cookie=3
Cc: Eran Ben Elisha <eranbe@mellanox.com>
Cc: Jiri Pirko <jiri@mellanox.com>
Cc: Cong Wang <xiyou.wangcong@gmail.com>
Cc: Ido Schimmel <idosch@idosch.org>
Cc: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Tonghao Zhang <tonghao@bamaicloud.com>
---
v2: use net cookie instead of ifindex.
---
include/trace/events/net.h | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/include/trace/events/net.h b/include/trace/events/net.h
index d55162c12f90..8d064bf1ae7f 100644
--- a/include/trace/events/net.h
+++ b/include/trace/events/net.h
@@ -107,16 +107,20 @@ TRACE_EVENT(net_dev_xmit_timeout,
__string( name, dev->name )
__string( driver, netdev_drivername(dev))
__field( int, queue_index )
+ __field( u64, net_cookie )
),
TP_fast_assign(
__assign_str(name);
__assign_str(driver);
__entry->queue_index = queue_index;
+ __entry->net_cookie = dev_net(dev)->net_cookie;
),
- TP_printk("dev=%s driver=%s queue=%d",
- __get_str(name), __get_str(driver), __entry->queue_index)
+ TP_printk("dev=%s driver=%s queue=%d net_cookie=%llu",
+ __get_str(name), __get_str(driver),
+ __entry->queue_index,
+ __entry->net_cookie)
);
DECLARE_EVENT_CLASS(net_dev_template,
--
2.34.1
next reply other threads:[~2025-10-24 12:19 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-24 12:18 Tonghao Zhang [this message]
2025-10-26 15:13 ` [PATCH net-next v2] net: add net cookie for trace_net_dev_xmit_timeout Ido Schimmel
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=20251024121853.94199-1-tonghao@bamaicloud.com \
--to=tonghao@bamaicloud.com \
--cc=eranbe@mellanox.com \
--cc=idosch@idosch.org \
--cc=jiri@mellanox.com \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=xiyou.wangcong@gmail.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox