[tip:perf/core] napi: Convert trace_napi_poll to TRACE_EVENT

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: tip-bot for Neil Horman
Date: Wednesday, September 8, 2010 - 1:34 am

Commit-ID:  3e4b10d7a4d2a78af64f8096dc7cdb3bebd65adb
Gitweb:     http://git.kernel.org/tip/3e4b10d7a4d2a78af64f8096dc7cdb3bebd65adb
Author:     Neil Horman <nhorman@tuxdriver.com>
AuthorDate: Mon, 23 Aug 2010 18:43:51 +0900
Committer:  Frederic Weisbecker <fweisbec@gmail.com>
CommitDate: Tue, 7 Sep 2010 17:51:01 +0200

napi: Convert trace_napi_poll to TRACE_EVENT

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

The original patch is below:
http://marc.info/?l=linux-kernel&m=126021713809450&w=2

[ sanagi.koki@jp.fujitsu.com: And add a fix by Steven Rostedt:
http://marc.info/?l=linux-kernel&m=126150506519173&w=2 ]

Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
Acked-by: David S. Miller <davem@davemloft.net>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Cc: Kaneshige Kenji <kaneshige.kenji@jp.fujitsu.com>
Cc: Izumo Taku <izumi.taku@jp.fujitsu.com>
Cc: Kosaki Motohiro <kosaki.motohiro@jp.fujitsu.com>
Cc: Lai Jiangshan <laijs@cn.fujitsu.com>
Cc: Scott Mcmillan <scott.a.mcmillan@intel.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Eric Dumazet <eric.dumazet@gmail.com>
LKML-Reference: <4C7242D7.4050009@jp.fujitsu.com>
Signed-off-by: Koki Sanagi <sanagi.koki@jp.fujitsu.com>
Signed-off-by: Frederic Weisbecker <fweisbec@gmail.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_ */
 
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH v4 0/5] netdev: show a process of packets, Koki Sanagi, (Mon Aug 23, 2:41 am)
[PATCH v4 1/5] irq: add tracepoint to softirq_raise, Koki Sanagi, (Mon Aug 23, 2:42 am)
[PATCH v4 4/5] skb: add tracepoints to freeing skb, Koki Sanagi, (Mon Aug 23, 2:46 am)
Re: [PATCH v4 4/5] skb: add tracepoints to freeing skb, David Miller, (Mon Aug 23, 8:53 pm)
Re: [PATCH v4 0/5] netdev: show a process of packets, Steven Rostedt, (Mon Aug 30, 4:50 pm)
Re: [PATCH v4 0/5] netdev: show a process of packets, Koki Sanagi, (Thu Sep 2, 7:10 pm)
Re: [PATCH v4 0/5] netdev: show a process of packets, David Miller, (Thu Sep 2, 7:17 pm)
Re: [PATCH v4 0/5] netdev: show a process of packets, Koki Sanagi, (Thu Sep 2, 7:55 pm)
Re: [PATCH v4 0/5] netdev: show a process of packets, Frederic Weisbecker, (Thu Sep 2, 9:46 pm)
Re: [PATCH v4 0/5] netdev: show a process of packets, Koki Sanagi, (Thu Sep 2, 10:12 pm)
Re: [PATCH v4 1/5] irq: add tracepoint to softirq_raise, Frederic Weisbecker, (Fri Sep 3, 8:29 am)
Re: [PATCH v4 1/5] irq: add tracepoint to softirq_raise, Steven Rostedt, (Fri Sep 3, 8:39 am)
Re: [PATCH v4 1/5] irq: add tracepoint to softirq_raise, Frederic Weisbecker, (Fri Sep 3, 8:42 am)
Re: [PATCH v4 1/5] irq: add tracepoint to softirq_raise, Steven Rostedt, (Fri Sep 3, 8:43 am)
Re: [PATCH v4 1/5] irq: add tracepoint to softirq_raise, Frederic Weisbecker, (Fri Sep 3, 8:50 am)
Re: [PATCH v4 5/5] perf:add a script shows a process of packet, Frederic Weisbecker, (Tue Sep 7, 9:57 am)
[tip:perf/core] irq: Add tracepoint to softirq_raise, tip-bot for Lai Jian ..., (Wed Sep 8, 1:33 am)
[tip:perf/core] napi: Convert trace_napi_poll to TRACE_EVENT, tip-bot for Neil Horman, (Wed Sep 8, 1:34 am)
[tip:perf/core] skb: Add tracepoints to freeing skb, tip-bot for Koki Sanagi, (Wed Sep 8, 1:35 am)
[tip:perf/core] perf: Add a script to show packets processing, tip-bot for Koki Sanagi, (Wed Sep 8, 1:35 am)
[PATCH] irq: Fix circular headers dependency, Frederic Weisbecker, (Wed Sep 8, 5:26 am)
[tip:perf/core] irq: Fix circular headers dependency, tip-bot for Frederic ..., (Thu Sep 9, 12:54 pm)
[PATCH] tracing: Cleanup the convoluted softirq tracepoints, Thomas Gleixner, (Tue Oct 19, 6:00 am)
Re: [PATCH] tracing: Cleanup the convoluted softirq tracep ..., Mathieu Desnoyers, (Tue Oct 19, 6:22 am)
Re: [PATCH] tracing: Cleanup the convoluted softirq tracep ..., Mathieu Desnoyers, (Tue Oct 19, 7:00 am)
Re: [PATCH] tracing: Cleanup the convoluted softirq tracep ..., Mathieu Desnoyers, (Tue Oct 19, 7:28 am)
Re: [PATCH] tracing: Cleanup the convoluted softirq tracep ..., Mathieu Desnoyers, (Tue Oct 19, 3:41 pm)
Re: [PATCH] tracing: Cleanup the convoluted softirq tracep ..., Mathieu Desnoyers, (Wed Oct 20, 8:41 am)
[tip:perf/core] tracing: Cleanup the convoluted softirq tr ..., tip-bot for Thomas G ..., (Thu Oct 21, 7:52 am)
Re: [PATCH] tracing: Cleanup the convoluted softirq tracep ..., Mathieu Desnoyers, (Mon Oct 25, 3:01 pm)
Re: [PATCH] tracing: Cleanup the convoluted softirq tracep ..., Mathieu Desnoyers, (Mon Oct 25, 3:55 pm)
Re: [PATCH] tracing: Cleanup the convoluted softirq tracep ..., Mathieu Desnoyers, (Mon Oct 25, 6:14 pm)