6e36302024435eb98fa94810791ac38bbbb80159
[lttng-modules.git] / instrumentation / events / lttng-module / skb.h
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #undef TRACE_SYSTEM
3 #define TRACE_SYSTEM skb
4
5 #if !defined(LTTNG_TRACE_SKB_H) || defined(TRACE_HEADER_MULTI_READ)
6 #define LTTNG_TRACE_SKB_H
7
8 #include <probes/lttng-tracepoint-event.h>
9 #include <linux/skbuff.h>
10 #include <linux/netdevice.h>
11 #include <lttng-kernel-version.h>
12
13 /*
14 * Tracepoint for free an sk_buff:
15 */
16 #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,17,0) \
17 || LTTNG_KERNEL_RANGE(5,15,58, 5,16,0))
18
19 LTTNG_TRACEPOINT_ENUM(skb_drop_reason,
20 TP_ENUM_VALUES(
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)
28 )
29 )
30
31 LTTNG_TRACEPOINT_EVENT_MAP(kfree_skb,
32
33 skb_kfree,
34
35 TP_PROTO(struct sk_buff *skb, void *location,
36 enum skb_drop_reason reason),
37
38 TP_ARGS(skb, location, reason),
39
40 TP_FIELDS(
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)
45 )
46 )
47 #else
48 LTTNG_TRACEPOINT_EVENT_MAP(kfree_skb,
49
50 skb_kfree,
51
52 TP_PROTO(struct sk_buff *skb, void *location),
53
54 TP_ARGS(skb, location),
55
56 TP_FIELDS(
57 ctf_integer_hex(void *, skbaddr, skb)
58 ctf_integer_hex(void *, location, location)
59 ctf_integer_network(unsigned short, protocol, skb->protocol)
60 )
61 )
62 #endif
63
64 LTTNG_TRACEPOINT_EVENT_MAP(consume_skb,
65
66 skb_consume,
67
68 TP_PROTO(struct sk_buff *skb),
69
70 TP_ARGS(skb),
71
72 TP_FIELDS(
73 ctf_integer_hex(void *, skbaddr, skb)
74 )
75 )
76
77 LTTNG_TRACEPOINT_EVENT(skb_copy_datagram_iovec,
78
79 TP_PROTO(const struct sk_buff *skb, int len),
80
81 TP_ARGS(skb, len),
82
83 TP_FIELDS(
84 ctf_integer_hex(const void *, skbaddr, skb)
85 ctf_integer(int, len, len)
86 )
87 )
88
89 #endif /* LTTNG_TRACE_SKB_H */
90
91 /* This part must be outside protection */
92 #include <probes/define_trace.h>
This page took 0.031138 seconds and 3 git commands to generate.