xref: /openbmc/linux/include/trace/events/skb.h (revision 2a9eb57e)
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #undef TRACE_SYSTEM
3 #define TRACE_SYSTEM skb
4 
5 #if !defined(_TRACE_SKB_H) || defined(TRACE_HEADER_MULTI_READ)
6 #define _TRACE_SKB_H
7 
8 #include <linux/skbuff.h>
9 #include <linux/netdevice.h>
10 #include <linux/tracepoint.h>
11 
12 /*
13  * Tracepoint for free an sk_buff:
14  */
15 TRACE_EVENT(kfree_skb,
16 
17 	TP_PROTO(struct sk_buff *skb, void *location,
18 		 enum skb_drop_reason reason),
19 
20 	TP_ARGS(skb, location, reason),
21 
22 	TP_STRUCT__entry(
23 		__field(void *,		skbaddr)
24 		__field(void *,		location)
25 		__field(unsigned short,	protocol)
26 		__field(enum skb_drop_reason,	reason)
27 	),
28 
29 	TP_fast_assign(
30 		__entry->skbaddr = skb;
31 		__entry->location = location;
32 		__entry->protocol = ntohs(skb->protocol);
33 		__entry->reason = reason;
34 	),
35 
36 	TP_printk("skbaddr=%p protocol=%u location=%p reason: %s",
37 		  __entry->skbaddr, __entry->protocol, __entry->location,
38 		  drop_reasons[__entry->reason])
39 );
40 
41 TRACE_EVENT(consume_skb,
42 
43 	TP_PROTO(struct sk_buff *skb),
44 
45 	TP_ARGS(skb),
46 
47 	TP_STRUCT__entry(
48 		__field(	void *,	skbaddr	)
49 	),
50 
51 	TP_fast_assign(
52 		__entry->skbaddr = skb;
53 	),
54 
55 	TP_printk("skbaddr=%p", __entry->skbaddr)
56 );
57 
58 TRACE_EVENT(skb_copy_datagram_iovec,
59 
60 	TP_PROTO(const struct sk_buff *skb, int len),
61 
62 	TP_ARGS(skb, len),
63 
64 	TP_STRUCT__entry(
65 		__field(	const void *,		skbaddr		)
66 		__field(	int,			len		)
67 	),
68 
69 	TP_fast_assign(
70 		__entry->skbaddr = skb;
71 		__entry->len = len;
72 	),
73 
74 	TP_printk("skbaddr=%p len=%d", __entry->skbaddr, __entry->len)
75 );
76 
77 #endif /* _TRACE_SKB_H */
78 
79 /* This part must be outside protection */
80 #include <trace/define_trace.h>
81