public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Tracepoint: Make skb tracepoint use TRACE_EVENT macro
@ 2009-04-09  6:08 Zhaolei
  2009-04-09  6:40 ` Ingo Molnar
  2009-04-12  9:27 ` [tip:tracing/core] tracing, net, skb tracepoint: make skb tracepoint use the TRACE_EVENT() macro Zhaolei
  0 siblings, 2 replies; 6+ messages in thread
From: Zhaolei @ 2009-04-09  6:08 UTC (permalink / raw)
  To: Steven Rostedt ;, Frederic Weisbecker, Tom Zanussi, Ingo Molnar
  Cc: linux-kernel

TRACE_EVENT is more unify and generic for define a tracepoint.
It also add ftrace support for this tracepoint.

Signed-off-by: Zhao Lei <zhaolei@cn.fujitsu.com>
---
 include/trace/skb.h               |    4 +--
 include/trace/skb_event_types.h   |   38 +++++++++++++++++++++++++++++++++++++
 include/trace/trace_event_types.h |    1 +
 include/trace/trace_events.h      |    1 +
 4 files changed, 41 insertions(+), 3 deletions(-)
 create mode 100644 include/trace/skb_event_types.h

diff --git a/include/trace/skb.h b/include/trace/skb.h
index b66206d..d2de717 100644
--- a/include/trace/skb.h
+++ b/include/trace/skb.h
@@ -4,8 +4,6 @@
 #include <linux/skbuff.h>
 #include <linux/tracepoint.h>
 
-DECLARE_TRACE(kfree_skb,
-	TP_PROTO(struct sk_buff *skb, void *location),
-	TP_ARGS(skb, location));
+#include <trace/skb_event_types.h>
 
 #endif
diff --git a/include/trace/skb_event_types.h b/include/trace/skb_event_types.h
new file mode 100644
index 0000000..4a1c504
--- /dev/null
+++ b/include/trace/skb_event_types.h
@@ -0,0 +1,38 @@
+
+/* use <trace/skb.h> instead */
+#ifndef TRACE_EVENT
+# error Do not include this file directly.
+# error Unless you know what you are doing.
+#endif
+
+#undef TRACE_SYSTEM
+#define TRACE_SYSTEM skb
+
+/*
+ * Tracepoint for free an sk_buff:
+ */
+TRACE_EVENT(kfree_skb,
+
+	TP_PROTO(struct sk_buff *skb, void *location),
+
+	TP_ARGS(skb, location),
+
+	TP_STRUCT__entry(
+		__field(	void *,		skbaddr		)
+		__field(	unsigned short,	protocol	)
+		__field(	void *,		location	)
+	),
+
+	TP_fast_assign(
+		__entry->skbaddr = skb;
+		if (skb) {
+			__entry->protocol = ntohs(skb->protocol);
+		}
+		__entry->location = location;
+	),
+
+	TP_printk("skbaddr=%p protocol=%u location=%p",
+		__entry->skbaddr, __entry->protocol, __entry->location)
+);
+
+#undef TRACE_SYSTEM
diff --git a/include/trace/trace_event_types.h b/include/trace/trace_event_types.h
index df56f56..33b6bfc 100644
--- a/include/trace/trace_event_types.h
+++ b/include/trace/trace_event_types.h
@@ -3,3 +3,4 @@
 #include <trace/sched_event_types.h>
 #include <trace/irq_event_types.h>
 #include <trace/lockdep_event_types.h>
+#include <trace/skb_event_types.h>
diff --git a/include/trace/trace_events.h b/include/trace/trace_events.h
index fd13750..0e2aa80 100644
--- a/include/trace/trace_events.h
+++ b/include/trace/trace_events.h
@@ -3,3 +3,4 @@
 #include <trace/sched.h>
 #include <trace/irq.h>
 #include <trace/lockdep.h>
+#include <trace/skb.h>
-- 
1.5.5.3



^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2009-04-12  9:28 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-04-09  6:08 [PATCH] Tracepoint: Make skb tracepoint use TRACE_EVENT macro Zhaolei
2009-04-09  6:40 ` Ingo Molnar
2009-04-09 13:56   ` Neil Horman
2009-04-09 15:05     ` Steven Rostedt
2009-04-09 15:29       ` Neil Horman
2009-04-12  9:27 ` [tip:tracing/core] tracing, net, skb tracepoint: make skb tracepoint use the TRACE_EVENT() macro Zhaolei

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox