1 #undef TRACE_SYSTEM
2 #define TRACE_SYSTEM net
3 
4 #if !defined(_TRACE_NET_H) || defined(TRACE_HEADER_MULTI_READ)
5 #define _TRACE_NET_H
6 
7 #include <linux/skbuff.h>
8 #include <linux/netdevice.h>
9 #include <linux/ip.h>
10 #include <linux/tracepoint.h>
11 
12 TRACE_EVENT(net_dev_xmit,
13 
14 	TP_PROTO(struct sk_buff *skb,
15 		 int rc),
16 
17 	TP_ARGS(skb, rc),
18 
19 	TP_STRUCT__entry(
20 		__field(	void *,		skbaddr		)
21 		__field(	unsigned int,	len		)
22 		__field(	int,		rc		)
23 		__string(	name,		skb->dev->name	)
24 	),
25 
26 	TP_fast_assign(
27 		__entry->skbaddr = skb;
28 		__entry->len = skb->len;
29 		__entry->rc = rc;
30 		__assign_str(name, skb->dev->name);
31 	),
32 
33 	TP_printk("dev=%s skbaddr=%p len=%u rc=%d",
34 		__get_str(name), __entry->skbaddr, __entry->len, __entry->rc)
35 );
36 
37 DECLARE_EVENT_CLASS(net_dev_template,
38 
39 	TP_PROTO(struct sk_buff *skb),
40 
41 	TP_ARGS(skb),
42 
43 	TP_STRUCT__entry(
44 		__field(	void *,		skbaddr		)
45 		__field(	unsigned int,	len		)
46 		__string(	name,		skb->dev->name	)
47 	),
48 
49 	TP_fast_assign(
50 		__entry->skbaddr = skb;
51 		__entry->len = skb->len;
52 		__assign_str(name, skb->dev->name);
53 	),
54 
55 	TP_printk("dev=%s skbaddr=%p len=%u",
56 		__get_str(name), __entry->skbaddr, __entry->len)
57 )
58 
59 DEFINE_EVENT(net_dev_template, net_dev_queue,
60 
61 	TP_PROTO(struct sk_buff *skb),
62 
63 	TP_ARGS(skb)
64 );
65 
66 DEFINE_EVENT(net_dev_template, netif_receive_skb,
67 
68 	TP_PROTO(struct sk_buff *skb),
69 
70 	TP_ARGS(skb)
71 );
72 
73 DEFINE_EVENT(net_dev_template, netif_rx,
74 
75 	TP_PROTO(struct sk_buff *skb),
76 
77 	TP_ARGS(skb)
78 );
79 #endif /* _TRACE_NET_H */
80 
81 /* This part must be outside protection */
82 #include <trace/define_trace.h>
83