Cleanup: Remove toplevel directory from include search path
[lttng-modules.git] / include / instrumentation / events / lttng-module / sock.h
CommitLineData
b7cdc182 1/* SPDX-License-Identifier: GPL-2.0-only */
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
3b4aafcb 8#include <lttng/tracepoint-event.h>
f279893a 9#include <linux/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
53f9bf80
MJ
25#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,19,0))
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
46#elif (LINUX_VERSION_CODE >= 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
63#else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,15,0)) */
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
f279893a
MD
80#endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,15,0)) */
81
3bc29f0a 82#endif /* LTTNG_TRACE_SOCK_H */
b283666f
PW
83
84/* This part must be outside protection */
3b4aafcb 85#include <lttng/define_trace.h>
This page took 0.038228 seconds and 4 git commands to generate.