public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: Koki Sanagi <sanagi.koki@jp•fujitsu.com>
To: netdev@vger•kernel.org
Cc: linux-kernel@vger•kernel.org, davem@davemloft•net,
	kaneshige.kenji@jp•fujitsu.com, izumi.taku@jp•fujitsu.com,
	kosaki.motohiro@jp•fujitsu.com, nhorman@tuxdriver•com,
	laijs@cn•fujitsu.com, scott.a.mcmillan@intel•com,
	rostedt@goodmis•org, eric.dumazet@gmail•com, fweisbec@gmail•com,
	mathieu.desnoyers@polymtl•ca
Subject: [PATCH v4 2/5] napi: convert trace_napi_poll to TRACE_EVENT
Date: Mon, 23 Aug 2010 18:43:51 +0900	[thread overview]
Message-ID: <4C7242D7.4050009@jp.fujitsu.com> (raw)
In-Reply-To: <4C72422C.5070102@jp.fujitsu.com>

From: Neil Horman <nhorman@tuxdriver•com>

This patch converts trace_napi_poll from DECLARE_EVENT to TRACE_EVENT to improve
the usability of napi_poll tracepoint.

          <idle>-0     [001] 241302.750777: napi_poll: napi poll on napi struct f6acc480 for device eth3
          <idle>-0     [000] 241302.852389: napi_poll: napi poll on napi struct f5d0d70c for device eth1

An original patch is below.
http://marc.info/?l=linux-kernel&m=126021713809450&w=2
Signed-off-by: Neil Horman <nhorman@tuxdriver•com>

And add a fix by Steven Rostedt.
http://marc.info/?l=linux-kernel&m=126150506519173&w=2

Signed-off-by: Koki Sanagi <sanagi.koki@jp•fujitsu.com>
---
 include/trace/events/napi.h |   25 +++++++++++++++++++++++--
 1 files changed, 23 insertions(+), 2 deletions(-)

diff --git a/include/trace/events/napi.h b/include/trace/events/napi.h
index 188deca..8fe1e93 100644
--- a/include/trace/events/napi.h
+++ b/include/trace/events/napi.h
@@ -6,10 +6,31 @@
 
 #include <linux/netdevice.h>
 #include <linux/tracepoint.h>
+#include <linux/ftrace.h>
+
+#define NO_DEV "(no_device)"
+
+TRACE_EVENT(napi_poll,
 
-DECLARE_TRACE(napi_poll,
 	TP_PROTO(struct napi_struct *napi),
-	TP_ARGS(napi));
+
+	TP_ARGS(napi),
+
+	TP_STRUCT__entry(
+		__field(	struct napi_struct *,	napi)
+		__string(	dev_name, napi->dev ? napi->dev->name : NO_DEV)
+	),
+
+	TP_fast_assign(
+		__entry->napi = napi;
+		__assign_str(dev_name, napi->dev ? napi->dev->name : NO_DEV);
+	),
+
+	TP_printk("napi poll on napi struct %p for device %s",
+		__entry->napi, __get_str(dev_name))
+);
+
+#undef NO_DEV
 
 #endif /* _TRACE_NAPI_H_ */
 

  parent reply	other threads:[~2010-08-23  9:43 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-23  9:41 [PATCH v4 0/5] netdev: show a process of packets Koki Sanagi
2010-08-23  9:42 ` [PATCH v4 1/5] irq: add tracepoint to softirq_raise Koki Sanagi
2010-09-03 15:29   ` Frederic Weisbecker
2010-09-03 15:39     ` Steven Rostedt
2010-09-03 15:42       ` Frederic Weisbecker
2010-09-03 15:43     ` Steven Rostedt
2010-09-03 15:50       ` Frederic Weisbecker
2010-09-06  1:46         ` Koki Sanagi
2010-08-23  9:43 ` Koki Sanagi [this message]
2010-08-24  3:52   ` [PATCH v4 2/5] napi: convert trace_napi_poll to TRACE_EVENT David Miller
2010-08-23  9:45 ` [PATCH v4 3/5] netdev: add tracepoints to netdev layer Koki Sanagi
2010-08-24  3:53   ` David Miller
2010-08-23  9:46 ` [PATCH v4 4/5] skb: add tracepoints to freeing skb Koki Sanagi
2010-08-24  3:53   ` David Miller
2010-08-23  9:47 ` [PATCH v4 5/5] perf:add a script shows a process of packet Koki Sanagi
2010-08-24  3:53   ` David Miller
2010-09-07 16:57   ` Frederic Weisbecker
2010-08-30 23:50 ` [PATCH v4 0/5] netdev: show a process of packets Steven Rostedt
2010-09-03  2:10   ` Koki Sanagi
2010-09-03  2:17     ` David Miller
2010-09-03  2:55       ` Koki Sanagi
2010-09-03  4:46         ` Frederic Weisbecker
2010-09-03  5:12           ` 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=4C7242D7.4050009@jp.fujitsu.com \
    --to=sanagi.koki@jp$(echo .)fujitsu.com \
    --cc=davem@davemloft$(echo .)net \
    --cc=eric.dumazet@gmail$(echo .)com \
    --cc=fweisbec@gmail$(echo .)com \
    --cc=izumi.taku@jp$(echo .)fujitsu.com \
    --cc=kaneshige.kenji@jp$(echo .)fujitsu.com \
    --cc=kosaki.motohiro@jp$(echo .)fujitsu.com \
    --cc=laijs@cn$(echo .)fujitsu.com \
    --cc=linux-kernel@vger$(echo .)kernel.org \
    --cc=mathieu.desnoyers@polymtl$(echo .)ca \
    --cc=netdev@vger$(echo .)kernel.org \
    --cc=nhorman@tuxdriver$(echo .)com \
    --cc=rostedt@goodmis$(echo .)org \
    --cc=scott.a.mcmillan@intel$(echo .)com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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