From: Neil Horman <nhorman@tuxdriver.com>
To: netdev@vger.kernel.org
Cc: davem@davemloft.net, mingo@elte.hu, rostedt@goodmis.org,
nhorman@tuxdriver.com
Subject: [PATCH] skb: Augment skb_copy_datagram_iovec TRACE_EVENT to dump more info
Date: Fri, 28 Aug 2009 16:33:14 -0400 [thread overview]
Message-ID: <20090828203314.GA30417@hmsreliant.think-freely.org> (raw)
Hey all-
As promised in our previous discussion, I've augmented the
skb_copy_datagram_iovec TRACE_EVENT to dump out the info I was previously
gathering in the ftrace module thats been removed. This patch gives me
everything I need. Tested and working by me
Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
Neil
skb.h | 26 +++++++++++++++++++++++---
1 file changed, 23 insertions(+), 3 deletions(-)
diff --git a/include/trace/events/skb.h b/include/trace/events/skb.h
index 4b2be6d..45b9a3f 100644
--- a/include/trace/events/skb.h
+++ b/include/trace/events/skb.h
@@ -7,6 +7,7 @@
#include <linux/skbuff.h>
#include <linux/netdevice.h>
#include <linux/tracepoint.h>
+#include <net/sock.h>
/*
* Tracepoint for free an sk_buff:
@@ -42,16 +43,35 @@ TRACE_EVENT(skb_copy_datagram_iovec,
TP_ARGS(skb, len),
TP_STRUCT__entry(
- __field( const void *, skbaddr )
+ __field( const struct sk_buff *, skb )
__field( int, len )
+ __field( int, anid )
+ __field( int, cnid )
+ __field( int, rx_queue )
+ __dynamic_array(char, name, IFNAMSIZ )
),
TP_fast_assign(
- __entry->skbaddr = skb;
+ struct net_device *dev = NULL;
+ __entry->skb = skb;
__entry->len = len;
+ __entry->anid = page_to_nid(virt_to_page(skb->data));
+ __entry->cnid = cpu_to_node(smp_processor_id());
+ __entry->rx_queue = skb->queue_mapping;
+ if (skb->sk) {
+ dev = dev_get_by_index(sock_net(skb->sk), skb->iif);
+ }
+ if (dev) {
+ __assign_str(name, dev->name);
+ dev_put(dev);
+ } else {
+ __assign_str(name, "Unknown");
+ }
),
- TP_printk("skbaddr=%p len=%d", __entry->skbaddr, __entry->len)
+ TP_printk("skb=%p anid=%d cnid=%d len=%d rx_queue=%d name=%s",
+ __entry->skb, __entry->anid, __entry->cnid,
+ __entry->len, __entry->rx_queue, __get_str(name))
);
#endif /* _TRACE_SKB_H */
next reply other threads:[~2009-08-28 20:33 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-08-28 20:33 Neil Horman [this message]
2009-08-28 20:50 ` [PATCH] skb: Augment skb_copy_datagram_iovec TRACE_EVENT to dump more info Steven Rostedt
2009-08-28 23:17 ` Neil Horman
2009-08-31 19:05 ` Steven Rostedt
2009-08-31 19:06 ` Steven Rostedt
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=20090828203314.GA30417@hmsreliant.think-freely.org \
--to=nhorman@tuxdriver.com \
--cc=davem@davemloft.net \
--cc=mingo@elte.hu \
--cc=netdev@vger.kernel.org \
--cc=rostedt@goodmis.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox