diff options
author | Zhaolei <zhaolei@cn.fujitsu.com> | 2009-04-09 02:08:18 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-04-10 06:57:55 -0400 |
commit | 5cb3d1d9d34ac04bcaa2034139345b2a5fea54c1 (patch) | |
tree | efbdf02871dff1fd12fdcd1594529ce30add3d57 | |
parent | e71e99c294058a61b7a8b9bb6da2f745ac51aa4f (diff) |
tracing, net, skb tracepoint: make skb tracepoint use the TRACE_EVENT() macro
TRACE_EVENT is a more generic way to define a tracepoint.
Doing so adds these new capabilities to this tracepoint:
- zero-copy and per-cpu splice() tracing
- binary tracing without printf overhead
- structured logging records exposed under /debug/tracing/events
- trace events embedded in function tracer output and other plugins
- user-defined, per tracepoint filter expressions
Signed-off-by: Zhao Lei <zhaolei@cn.fujitsu.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: "Steven Rostedt ;" <rostedt@goodmis.org>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Tom Zanussi <tzanussi@gmail.com>
LKML-Reference: <49DD90D2.5020604@cn.fujitsu.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
-rw-r--r-- | include/trace/skb.h | 4 | ||||
-rw-r--r-- | include/trace/skb_event_types.h | 38 | ||||
-rw-r--r-- | include/trace/trace_event_types.h | 1 | ||||
-rw-r--r-- | include/trace/trace_events.h | 1 |
4 files changed, 41 insertions, 3 deletions
diff --git a/include/trace/skb.h b/include/trace/skb.h index b66206d9be72..d2de7174a6e8 100644 --- a/include/trace/skb.h +++ b/include/trace/skb.h | |||
@@ -4,8 +4,6 @@ | |||
4 | #include <linux/skbuff.h> | 4 | #include <linux/skbuff.h> |
5 | #include <linux/tracepoint.h> | 5 | #include <linux/tracepoint.h> |
6 | 6 | ||
7 | DECLARE_TRACE(kfree_skb, | 7 | #include <trace/skb_event_types.h> |
8 | TP_PROTO(struct sk_buff *skb, void *location), | ||
9 | TP_ARGS(skb, location)); | ||
10 | 8 | ||
11 | #endif | 9 | #endif |
diff --git a/include/trace/skb_event_types.h b/include/trace/skb_event_types.h new file mode 100644 index 000000000000..4a1c504c0e16 --- /dev/null +++ b/include/trace/skb_event_types.h | |||
@@ -0,0 +1,38 @@ | |||
1 | |||
2 | /* use <trace/skb.h> instead */ | ||
3 | #ifndef TRACE_EVENT | ||
4 | # error Do not include this file directly. | ||
5 | # error Unless you know what you are doing. | ||
6 | #endif | ||
7 | |||
8 | #undef TRACE_SYSTEM | ||
9 | #define TRACE_SYSTEM skb | ||
10 | |||
11 | /* | ||
12 | * Tracepoint for free an sk_buff: | ||
13 | */ | ||
14 | TRACE_EVENT(kfree_skb, | ||
15 | |||
16 | TP_PROTO(struct sk_buff *skb, void *location), | ||
17 | |||
18 | TP_ARGS(skb, location), | ||
19 | |||
20 | TP_STRUCT__entry( | ||
21 | __field( void *, skbaddr ) | ||
22 | __field( unsigned short, protocol ) | ||
23 | __field( void *, location ) | ||
24 | ), | ||
25 | |||
26 | TP_fast_assign( | ||
27 | __entry->skbaddr = skb; | ||
28 | if (skb) { | ||
29 | __entry->protocol = ntohs(skb->protocol); | ||
30 | } | ||
31 | __entry->location = location; | ||
32 | ), | ||
33 | |||
34 | TP_printk("skbaddr=%p protocol=%u location=%p", | ||
35 | __entry->skbaddr, __entry->protocol, __entry->location) | ||
36 | ); | ||
37 | |||
38 | #undef TRACE_SYSTEM | ||
diff --git a/include/trace/trace_event_types.h b/include/trace/trace_event_types.h index df56f5694be6..33b6bfcba93b 100644 --- a/include/trace/trace_event_types.h +++ b/include/trace/trace_event_types.h | |||
@@ -3,3 +3,4 @@ | |||
3 | #include <trace/sched_event_types.h> | 3 | #include <trace/sched_event_types.h> |
4 | #include <trace/irq_event_types.h> | 4 | #include <trace/irq_event_types.h> |
5 | #include <trace/lockdep_event_types.h> | 5 | #include <trace/lockdep_event_types.h> |
6 | #include <trace/skb_event_types.h> | ||
diff --git a/include/trace/trace_events.h b/include/trace/trace_events.h index fd13750ca4ba..0e2aa80076d9 100644 --- a/include/trace/trace_events.h +++ b/include/trace/trace_events.h | |||
@@ -3,3 +3,4 @@ | |||
3 | #include <trace/sched.h> | 3 | #include <trace/sched.h> |
4 | #include <trace/irq.h> | 4 | #include <trace/irq.h> |
5 | #include <trace/lockdep.h> | 5 | #include <trace/lockdep.h> |
6 | #include <trace/skb.h> | ||