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 4/5] skb: add tracepoints to freeing skb
Date: Mon, 28 Jun 2010 14:12:59 -0400	[thread overview]
Message-ID: <1277748779.9181.72.camel@gandalf.stny.rr.com> (raw)
In-Reply-To: <4C23FF55.3090604@jp.fujitsu.com>

On Fri, 2010-06-25 at 09:59 +0900, Koki Sanagi wrote:
> This patch adds tracepoint to consume_skb and dev_kfree_skb_irq.
> Combinating with tracepoint on dev_hard_start_xmit, we can check how long it
> takes to free transmited packets. And using it, we can calculate how many
> packets driver had at that time. It is useful when a drop of transmited packet
> is a problem.
> 
>           <idle>-0     [001] 241409.218333: consume_skb: skbaddr=dd6b2fb8
>           <idle>-0     [001] 241409.490555: dev_kfree_skb_irq: skbaddr=f5e29840
> 
> Signed-off-by: Koki Sanagi <sanagi.koki@jp.fujitsu.com>
> ---
> include/trace/events/skb.h |   36 ++++++++++++++++++++++++++++++++++++
>  net/core/dev.c             |    2 ++
>  net/core/skbuff.c          |    1 +
>  3 files changed, 39 insertions(+), 0 deletions(-)
> 
> diff --git a/include/trace/events/skb.h b/include/trace/events/skb.h
> index 4b2be6d..6ab5b34 100644
> --- a/include/trace/events/skb.h
> +++ b/include/trace/events/skb.h
> @@ -35,6 +35,42 @@ TRACE_EVENT(kfree_skb,
>  		__entry->skbaddr, __entry->protocol, __entry->location)
>  );
>  
> +TRACE_EVENT(consume_skb,
> +
> +	TP_PROTO(struct sk_buff *skb),
> +
> +	TP_ARGS(skb),
> +
> +	TP_STRUCT__entry(
> +		__field(	void *,	skbaddr	)
> +	),
> +
> +	TP_fast_assign(
> +		__entry->skbaddr = skb;
> +	),
> +
> +	TP_printk("skbaddr=%p",
> +		__entry->skbaddr)
> +);
> +
> +TRACE_EVENT(dev_kfree_skb_irq,
> +
> +	TP_PROTO(struct sk_buff *skb),
> +
> +	TP_ARGS(skb),
> +
> +	TP_STRUCT__entry(
> +		__field(	void *,	skbaddr	)
> +	),
> +
> +	TP_fast_assign(
> +		__entry->skbaddr = skb;
> +	),
> +
> +	TP_printk("skbaddr=%p",
> +		__entry->skbaddr)
> +);

These two tracepoints are also identical in body. Please use
DECLARE_EVENT_CLASS() and DEFINE_EVENT() instead.

-- Steve

> +
>  TRACE_EVENT(skb_copy_datagram_iovec,
>  
>  	TP_PROTO(const struct sk_buff *skb, int len),
> diff --git a/net/core/dev.c b/net/core/dev.c
> index 4b64b21..807b1ca 100644
> --- a/net/core/dev.c
> +++ b/net/core/dev.c
> @@ -131,6 +131,7 @@
>  #include <linux/random.h>
>  #include <trace/events/napi.h>
>  #include <trace/events/net.h>
> +#include <trace/events/skb.h>
>  #include <linux/pci.h>
>  
>  #include "net-sysfs.h"
> @@ -1580,6 +1581,7 @@ void dev_kfree_skb_irq(struct sk_buff *skb)
>  		struct softnet_data *sd;
>  		unsigned long flags;
>  
> +		trace_dev_kfree_skb_irq(skb);
>  		local_irq_save(flags);
>  		sd = &__get_cpu_var(softnet_data);
>  		skb->next = sd->completion_queue;
> diff --git a/net/core/skbuff.c b/net/core/skbuff.c
> index 34432b4..a7b4036 100644
> --- a/net/core/skbuff.c
> +++ b/net/core/skbuff.c
> @@ -466,6 +466,7 @@ void consume_skb(struct sk_buff *skb)
>  		smp_rmb();
>  	else if (likely(!atomic_dec_and_test(&skb->users)))
>  		return;
> +	trace_consume_skb(skb);
>  	__kfree_skb(skb);
>  }
>  EXPORT_SYMBOL(consume_skb);
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/



  parent reply	other threads:[~2010-06-28 18:13 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
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 [this message]
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=1277748779.9181.72.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.