1 /* SPDX-License-Identifier: GPL-2.0-only */
3 #define TRACE_SYSTEM skb
5 #if !defined(LTTNG_TRACE_SKB_H) || defined(TRACE_HEADER_MULTI_READ)
6 #define LTTNG_TRACE_SKB_H
8 #include <lttng/tracepoint-event.h>
9 #include <linux/skbuff.h>
10 #include <linux/netdevice.h>
11 #include <lttng/kernel-version.h>
14 * Tracepoint for free an sk_buff:
16 #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,17,0) \
17 || LTTNG_KERNEL_RANGE(5,15,58, 5,16,0))
19 LTTNG_TRACEPOINT_ENUM(skb_drop_reason
,
21 ctf_enum_value("NOT_SPECIFIED", SKB_DROP_REASON_NOT_SPECIFIED
)
22 ctf_enum_value("NO_SOCKET", SKB_DROP_REASON_NO_SOCKET
)
23 ctf_enum_value("PKT_TOO_SMALL", SKB_DROP_REASON_PKT_TOO_SMALL
)
24 ctf_enum_value("TCP_CSUM", SKB_DROP_REASON_TCP_CSUM
)
25 ctf_enum_value("SOCKET_FILTER", SKB_DROP_REASON_SOCKET_FILTER
)
26 ctf_enum_value("UDP_CSUM", SKB_DROP_REASON_UDP_CSUM
)
27 ctf_enum_value("MAX", SKB_DROP_REASON_MAX
)
31 LTTNG_TRACEPOINT_EVENT_MAP(kfree_skb
,
35 TP_PROTO(struct sk_buff
*skb
, void *location
,
36 enum skb_drop_reason reason
),
38 TP_ARGS(skb
, location
, reason
),
41 ctf_integer_hex(void *, skbaddr
, skb
)
42 ctf_integer_hex(void *, location
, location
)
43 ctf_integer_network(unsigned short, protocol
, skb
->protocol
)
44 ctf_enum(skb_drop_reason
, uint8_t, reason
, reason
)
48 LTTNG_TRACEPOINT_EVENT_MAP(kfree_skb
,
52 TP_PROTO(struct sk_buff
*skb
, void *location
),
54 TP_ARGS(skb
, location
),
57 ctf_integer_hex(void *, skbaddr
, skb
)
58 ctf_integer_hex(void *, location
, location
)
59 ctf_integer_network(unsigned short, protocol
, skb
->protocol
)
64 LTTNG_TRACEPOINT_EVENT_MAP(consume_skb
,
68 TP_PROTO(struct sk_buff
*skb
),
73 ctf_integer_hex(void *, skbaddr
, skb
)
77 LTTNG_TRACEPOINT_EVENT(skb_copy_datagram_iovec
,
79 TP_PROTO(const struct sk_buff
*skb
, int len
),
84 ctf_integer_hex(const void *, skbaddr
, skb
)
85 ctf_integer(int, len
, len
)
89 #endif /* LTTNG_TRACE_SKB_H */
91 /* This part must be outside protection */
92 #include <lttng/define_trace.h>