xref: /openbmc/linux/include/trace/events/skb.h (revision 3a83e4e6)
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 
19 	TP_ARGS(skb, location),
20 
21 	TP_STRUCT__entry(
22 		__field(	void *,		skbaddr		)
23 		__field(	void *,		location	)
24 		__field(	unsigned short,	protocol	)
25 	),
26 
27 	TP_fast_assign(
28 		__entry->skbaddr = skb;
29 		__entry->location = location;
30 		__entry->protocol = ntohs(skb->protocol);
31 	),
32 
33 	TP_printk("skbaddr=%p protocol=%u location=%p",
34 		__entry->skbaddr, __entry->protocol, __entry->location)
35 );
36 
37 TRACE_EVENT(consume_skb,
38 
39 	TP_PROTO(struct sk_buff *skb),
40 
41 	TP_ARGS(skb),
42 
43 	TP_STRUCT__entry(
44 		__field(	void *,	skbaddr	)
45 	),
46 
47 	TP_fast_assign(
48 		__entry->skbaddr = skb;
49 	),
50 
51 	TP_printk("skbaddr=%p", __entry->skbaddr)
52 );
53 
54 TRACE_EVENT(skb_copy_datagram_iovec,
55 
56 	TP_PROTO(const struct sk_buff *skb, int len),
57 
58 	TP_ARGS(skb, len),
59 
60 	TP_STRUCT__entry(
61 		__field(	const void *,		skbaddr		)
62 		__field(	int,			len		)
63 	),
64 
65 	TP_fast_assign(
66 		__entry->skbaddr = skb;
67 		__entry->len = len;
68 	),
69 
70 	TP_printk("skbaddr=%p len=%d", __entry->skbaddr, __entry->len)
71 );
72 
73 #endif /* _TRACE_SKB_H */
74 
75 /* This part must be outside protection */
76 #include <trace/define_trace.h>
77