fix: net: add location to trace_consume_skb() (v6.3)
[lttng-modules.git] / include / instrumentation / events / skb.h
CommitLineData
b7cdc182 1/* SPDX-License-Identifier: GPL-2.0-only */
b283666f
PW
2#undef TRACE_SYSTEM
3#define TRACE_SYSTEM skb
4
3bc29f0a
MD
5#if !defined(LTTNG_TRACE_SKB_H) || defined(TRACE_HEADER_MULTI_READ)
6#define LTTNG_TRACE_SKB_H
b283666f 7
3b4aafcb 8#include <lttng/tracepoint-event.h>
b283666f
PW
9#include <linux/skbuff.h>
10#include <linux/netdevice.h>
5f4c791e 11#include <lttng/kernel-version.h>
b283666f
PW
12
13/*
14 * Tracepoint for free an sk_buff:
15 */
96c477da
MD
16#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,17,0) \
17 || LTTNG_KERNEL_RANGE(5,15,58, 5,16,0))
18
4b329355
MJ
19LTTNG_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)
9e77c175 25 ctf_enum_value("SOCKET_FILTER", SKB_DROP_REASON_SOCKET_FILTER)
4b329355
MJ
26 ctf_enum_value("UDP_CSUM", SKB_DROP_REASON_UDP_CSUM)
27 ctf_enum_value("MAX", SKB_DROP_REASON_MAX)
28 )
29)
30
31LTTNG_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
3bc29f0a 48LTTNG_TRACEPOINT_EVENT_MAP(kfree_skb,
9cf29d3e
MD
49
50 skb_kfree,
b283666f
PW
51
52 TP_PROTO(struct sk_buff *skb, void *location),
53
54 TP_ARGS(skb, location),
55
f127e61e 56 TP_FIELDS(
fa91fcac
MD
57 ctf_integer_hex(void *, skbaddr, skb)
58 ctf_integer_hex(void *, location, location)
f127e61e
MD
59 ctf_integer_network(unsigned short, protocol, skb->protocol)
60 )
b283666f 61)
4b329355 62#endif
b283666f 63
6bc8ed7d
MJ
64#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(6,3,0))
65LTTNG_TRACEPOINT_EVENT_MAP(consume_skb,
66
67 skb_consume,
68
69 TP_PROTO(struct sk_buff *skb, void *location),
70
71 TP_ARGS(skb, location),
72
73 TP_FIELDS(
74 ctf_integer_hex(void *, skbaddr, skb)
75 ctf_integer_hex(void *, location, location)
76 )
77)
78#else
3bc29f0a 79LTTNG_TRACEPOINT_EVENT_MAP(consume_skb,
9cf29d3e
MD
80
81 skb_consume,
b283666f
PW
82
83 TP_PROTO(struct sk_buff *skb),
84
85 TP_ARGS(skb),
86
f127e61e 87 TP_FIELDS(
fa91fcac 88 ctf_integer_hex(void *, skbaddr, skb)
f127e61e 89 )
b283666f 90)
6bc8ed7d 91#endif
b283666f 92
3bc29f0a 93LTTNG_TRACEPOINT_EVENT(skb_copy_datagram_iovec,
b283666f
PW
94
95 TP_PROTO(const struct sk_buff *skb, int len),
96
97 TP_ARGS(skb, len),
98
f127e61e 99 TP_FIELDS(
fa91fcac 100 ctf_integer_hex(const void *, skbaddr, skb)
f127e61e
MD
101 ctf_integer(int, len, len)
102 )
b283666f
PW
103)
104
3bc29f0a 105#endif /* LTTNG_TRACE_SKB_H */
b283666f
PW
106
107/* This part must be outside protection */
3b4aafcb 108#include <lttng/define_trace.h>
This page took 0.060379 seconds and 4 git commands to generate.