Fix: block instrumentation 4.14+ NULL pointer dereference
[lttng-modules.git] / instrumentation / events / lttng-module / sock.h
... / ...
CommitLineData
1#undef TRACE_SYSTEM
2#define TRACE_SYSTEM sock
3
4#if !defined(LTTNG_TRACE_SOCK_H) || defined(TRACE_HEADER_MULTI_READ)
5#define LTTNG_TRACE_SOCK_H
6
7#include <probes/lttng-tracepoint-event.h>
8#include <linux/version.h>
9#include <net/sock.h>
10
11LTTNG_TRACEPOINT_EVENT(sock_rcvqueue_full,
12
13 TP_PROTO(struct sock *sk, struct sk_buff *skb),
14
15 TP_ARGS(sk, skb),
16
17 TP_FIELDS(
18 ctf_integer(int, rmem_alloc, atomic_read(&sk->sk_rmem_alloc))
19 ctf_integer(unsigned int, truesize, skb->truesize)
20 ctf_integer(int, sk_rcvbuf, sk->sk_rcvbuf)
21 )
22)
23
24#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,15,0))
25
26LTTNG_TRACEPOINT_EVENT(sock_exceed_buf_limit,
27
28 TP_PROTO(struct sock *sk, struct proto *prot, long allocated),
29
30 TP_ARGS(sk, prot, allocated),
31
32 TP_FIELDS(
33 ctf_string(name, prot->name)
34 ctf_array(long, sysctl_mem, prot->sysctl_mem, 3)
35 ctf_integer(long, allocated, allocated)
36 ctf_integer(int, sysctl_rmem, sk_get_rmem0(sk, prot))
37 ctf_integer(int, rmem_alloc, atomic_read(&sk->sk_rmem_alloc))
38 )
39)
40
41#else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,15,0)) */
42
43LTTNG_TRACEPOINT_EVENT(sock_exceed_buf_limit,
44
45 TP_PROTO(struct sock *sk, struct proto *prot, long allocated),
46
47 TP_ARGS(sk, prot, allocated),
48
49 TP_FIELDS(
50 ctf_string(name, prot->name)
51 ctf_array(long, sysctl_mem, prot->sysctl_mem, 3)
52 ctf_integer(long, allocated, allocated)
53 ctf_integer(int, sysctl_rmem, prot->sysctl_rmem[0])
54 ctf_integer(int, rmem_alloc, atomic_read(&sk->sk_rmem_alloc))
55 )
56)
57
58#endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,15,0)) */
59
60#endif /* LTTNG_TRACE_SOCK_H */
61
62/* This part must be outside protection */
63#include <probes/define_trace.h>
This page took 0.022682 seconds and 4 git commands to generate.