All of lore.kernel.org
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: Koki Sanagi <sanagi.koki@jp.fujitsu.com>
Cc: linux-kernel@vger.kernel.org, kaneshige.kenji@jp.fujitsu.com,
	izumi.taku@jp.fujitsu.com
Subject: Re: [RFC PATCH v2 3/5] netdev: add tracepoints to netdev layer
Date: Mon, 28 Jun 2010 14:09:57 -0400	[thread overview]
Message-ID: <1277748598.9181.71.camel@gandalf.stny.rr.com> (raw)
In-Reply-To: <4C23FF3E.1080503@jp.fujitsu.com>

On Fri, 2010-06-25 at 09:58 +0900, Koki Sanagi wrote:
> This patch adds tracepoint to dev_queue_xmit, dev_hard_start_xmit and
> netif_receive_skb. These tracepints help you to monitor network driver's
> input/output.
> 
>             sshd-4445  [001] 241367.066046: net_dev_queue: dev=eth3 skbaddr=dd6b2538 len=114
>             sshd-4445  [001] 241367.066047: net_dev_xmit: dev=eth3 skbaddr=dd6b2538 len=114 rc=0
>           <idle>-0     [001] 241367.067472: net_dev_receive: dev=eth3 skbaddr=f5e59000 len=52
> 
> Signed-off-by: Koki Sanagi <sanagi.koki@jp.fujitsu.com>
> ---
>  include/trace/events/net.h |   83 ++++++++++++++++++++++++++++++++++++++++++++
>  net/core/dev.c             |    5 +++
>  net/core/net-traces.c      |    1 +
>  3 files changed, 89 insertions(+), 0 deletions(-)
> 
> diff --git a/include/trace/events/net.h b/include/trace/events/net.h
> new file mode 100644
> index 0000000..ee10970
> --- /dev/null
> +++ b/include/trace/events/net.h
> @@ -0,0 +1,83 @@
> +#undef TRACE_SYSTEM
> +#define TRACE_SYSTEM net
> +
> +#if !defined(_TRACE_NET_H) || defined(TRACE_HEADER_MULTI_READ)
> +#define _TRACE_NET_H
> +
> +#include <linux/skbuff.h>
> +#include <linux/netdevice.h>
> +#include <linux/ip.h>
> +#include <linux/tracepoint.h>
> +
> +TRACE_EVENT(net_dev_xmit,
> +
> +	TP_PROTO(struct sk_buff *skb,
> +		 int rc),
> +
> +	TP_ARGS(skb, rc),
> +
> +	TP_STRUCT__entry(
> +		__field(	void *,		skbaddr		)
> +		__field(	unsigned int,	len		)
> +		__field(	int,		rc		)
> +		__string(	name,		skb->dev->name	)
> +	),
> +
> +	TP_fast_assign(
> +		__entry->skbaddr = skb;
> +		__entry->len = skb->len;
> +		__entry->rc = rc;
> +		__assign_str(name, skb->dev->name);
> +	),
> +
> +	TP_printk("dev=%s skbaddr=%p len=%u rc=%d",
> +		__get_str(name), __entry->skbaddr, __entry->len, __entry->rc)
> +);
> +
> +TRACE_EVENT(net_dev_queue,
> +
> +	TP_PROTO(struct sk_buff *skb),
> +
> +	TP_ARGS(skb),
> +
> +	TP_STRUCT__entry(
> +		__field(	void *,		skbaddr		)
> +		__field(	unsigned int,	len		)
> +		__string(	name,		skb->dev->name	)
> +	),
> +
> +	TP_fast_assign(
> +		__entry->skbaddr = skb;
> +		__entry->len = skb->len;
> +		__assign_str(name, skb->dev->name);
> +	),
> +
> +	TP_printk("dev=%s skbaddr=%p len=%u",
> +		__get_str(name), __entry->skbaddr, __entry->len)
> +);
> +
> +TRACE_EVENT(net_dev_receive,

This and net_dev_queue are identical. Please use DECLARE_EVENT_CLASS()
and DEFINE_EVENT() to create these, otherwise it bloats the kernel.

-- Steve

> +
> +	TP_PROTO(struct sk_buff *skb),
> +
> +	TP_ARGS(skb),
> +
> +	TP_STRUCT__entry(
> +		__field(	void *,		skbaddr		)
> +		__field(	unsigned int,	len		)
> +		__string(	name,		skb->dev->name	)
> +	),
> +
> +	TP_fast_assign(
> +		__entry->skbaddr = skb;
> +		__entry->len = skb->len;
> +		__assign_str(name, skb->dev->name);
> +	),
> +
> +	TP_printk("dev=%s skbaddr=%p len=%u",
> +		__get_str(name), __entry->skbaddr, __entry->len)
> +);
> +#endif /* _TRACE_NET_H */
> +



  reply	other threads:[~2010-06-28 18:10 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-24  8:09 [RFC PATCH v2 0/5] netdev: show a process of packets Koki Sanagi
2010-06-24  8:16 ` [RFC PATCH v2 1/5] irq: add tracepoint to softirq_raise Koki Sanagi
2010-06-24 19:15   ` Steven Rostedt
2010-06-25  0:49     ` Koki Sanagi
2010-06-24  8:17 ` [RFC PATCH v2 2/5] napi: convert trace_napi_poll to TRACE_EVENT Koki Sanagi
2010-06-24  8:18 ` [RFC PATCH v2 3/5] netdev: add tracepoints to netdev layer Koki Sanagi
2010-06-24  8:19 ` [RFC PATCH v2 4/5] skb: add tracepoints to freeing skb Koki Sanagi
2010-06-24  8:21 ` [RFC PATCH v2 5/5] perf:add a script shows a process of packet Koki Sanagi
2010-06-25  0:57 ` [RFC PATCH v2 1/5] irq: add tracepoint to softirq_raise Koki Sanagi
2010-06-25  1:10   ` KOSAKI Motohiro
2010-06-25  7:46     ` Frederic Weisbecker
2010-06-25  7:51     ` Koki Sanagi
2010-06-25  0:58 ` [RFC PATCH v2 2/5] napi: convert trace_napi_poll to TRACE_EVENT Koki Sanagi
2010-06-25  1:11   ` KOSAKI Motohiro
2010-06-25  7:57   ` Frederic Weisbecker
2010-06-25  0:58 ` [RFC PATCH v2 3/5] netdev: add tracepoints to netdev layer Koki Sanagi
2010-06-28 18:09   ` Steven Rostedt [this message]
2010-06-29  0:27     ` Koki Sanagi
2010-06-25  0:59 ` [RFC PATCH v2 4/5] skb: add tracepoints to freeing skb Koki Sanagi
2010-06-25  4:55   ` Eric Dumazet
2010-06-25  7:12     ` Koki Sanagi
2010-06-25 20:05       ` Eric Dumazet
2010-06-28  0:25         ` Koki Sanagi
2010-06-28 18:12   ` Steven Rostedt
2010-06-29  0:28     ` Koki Sanagi
2010-06-25  0:59 ` [RFC PATCH v2 5/5] perf:add a script shows a process of packet Koki Sanagi

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=1277748598.9181.71.camel@gandalf.stny.rr.com \
    --to=rostedt@goodmis.org \
    --cc=izumi.taku@jp.fujitsu.com \
    --cc=kaneshige.kenji@jp.fujitsu.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sanagi.koki@jp.fujitsu.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 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.