fix: net: skb: introduce kfree_skb_reason() (v5.15.58..v5.16)
[lttng-modules.git] / instrumentation / events / lttng-module / sock.h
CommitLineData
9f36eaed 1/* SPDX-License-Identifier: GPL-2.0 */
b283666f
PW
2#undef TRACE_SYSTEM
3#define TRACE_SYSTEM sock
4
3bc29f0a
MD
5#if !defined(LTTNG_TRACE_SOCK_H) || defined(TRACE_HEADER_MULTI_READ)
6#define LTTNG_TRACE_SOCK_H
b283666f 7
6ec43db8 8#include <probes/lttng-tracepoint-event.h>
2d042821 9#include <lttng-kernel-version.h>
b283666f 10#include <net/sock.h>
b283666f 11
3bc29f0a 12LTTNG_TRACEPOINT_EVENT(sock_rcvqueue_full,
b283666f
PW
13
14 TP_PROTO(struct sock *sk, struct sk_buff *skb),
15
16 TP_ARGS(sk, skb),
17
f127e61e
MD
18 TP_FIELDS(
19 ctf_integer(int, rmem_alloc, atomic_read(&sk->sk_rmem_alloc))
20 ctf_integer(unsigned int, truesize, skb->truesize)
21 ctf_integer(int, sk_rcvbuf, sk->sk_rcvbuf)
22 )
b283666f
PW
23)
24
2d042821 25#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,19,0))
53f9bf80
MJ
26
27LTTNG_TRACEPOINT_EVENT(sock_exceed_buf_limit,
28
29 TP_PROTO(struct sock *sk, struct proto *prot, long allocated, int kind),
30
31 TP_ARGS(sk, prot, allocated, kind),
32
33 TP_FIELDS(
34 ctf_string(name, prot->name)
35 ctf_array(long, sysctl_mem, prot->sysctl_mem, 3)
36 ctf_integer(long, allocated, allocated)
37 ctf_integer(int, sysctl_rmem, sk_get_rmem0(sk, prot))
38 ctf_integer(int, rmem_alloc, atomic_read(&sk->sk_rmem_alloc))
39 ctf_integer(int, sysctl_wmem, sk_get_wmem0(sk, prot))
40 ctf_integer(int, wmem_alloc, refcount_read(&sk->sk_wmem_alloc))
41 ctf_integer(int, wmem_queued, sk->sk_wmem_queued)
42 ctf_integer(int, kind, kind)
43 )
44)
45
2d042821 46#elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,15,0))
f279893a
MD
47
48LTTNG_TRACEPOINT_EVENT(sock_exceed_buf_limit,
49
50 TP_PROTO(struct sock *sk, struct proto *prot, long allocated),
51
52 TP_ARGS(sk, prot, allocated),
53
54 TP_FIELDS(
55 ctf_string(name, prot->name)
56 ctf_array(long, sysctl_mem, prot->sysctl_mem, 3)
57 ctf_integer(long, allocated, allocated)
58 ctf_integer(int, sysctl_rmem, sk_get_rmem0(sk, prot))
59 ctf_integer(int, rmem_alloc, atomic_read(&sk->sk_rmem_alloc))
60 )
61)
62
2d042821 63#else /* #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,15,0)) */
f279893a 64
3bc29f0a 65LTTNG_TRACEPOINT_EVENT(sock_exceed_buf_limit,
b283666f
PW
66
67 TP_PROTO(struct sock *sk, struct proto *prot, long allocated),
68
69 TP_ARGS(sk, prot, allocated),
70
f127e61e
MD
71 TP_FIELDS(
72 ctf_string(name, prot->name)
73 ctf_array(long, sysctl_mem, prot->sysctl_mem, 3)
74 ctf_integer(long, allocated, allocated)
75 ctf_integer(int, sysctl_rmem, prot->sysctl_rmem[0])
76 ctf_integer(int, rmem_alloc, atomic_read(&sk->sk_rmem_alloc))
77 )
b283666f
PW
78)
79
2d042821 80#endif /* #else #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,15,0)) */
f279893a 81
3bc29f0a 82#endif /* LTTNG_TRACE_SOCK_H */
b283666f
PW
83
84/* This part must be outside protection */
6ec43db8 85#include <probes/define_trace.h>
This page took 0.048864 seconds and 4 git commands to generate.