summaryrefslogtreecommitdiff
path: root/net/tls/trace.h
blob: 9ba5f600ea43c88917e457e1cc594e8c3d9c042b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
/* SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) */
/* Copyright (C) 2019 Netronome Systems, Inc. */

#undef TRACE_SYSTEM
#define TRACE_SYSTEM tls

#if !defined(_TLS_TRACE_H_) || defined(TRACE_HEADER_MULTI_READ)
#define _TLS_TRACE_H_

#include <asm/unaligned.h>
#include <linux/tracepoint.h>

struct sock;

TRACE_EVENT(tls_device_offload_set,

	TP_PROTO(struct sock *sk, int dir, u32 tcp_seq, u8 *rec_no, int ret),

	TP_ARGS(sk, dir, tcp_seq, rec_no, ret),

	TP_STRUCT__entry(
		__field(	struct sock *,	sk		)
		__field(	u64,		rec_no		)
		__field(	int,		dir		)
		__field(	u32,		tcp_seq		)
		__field(	int,		ret		)
	),

	TP_fast_assign(
		__entry->sk = sk;
		__entry->rec_no = get_unaligned_be64(rec_no);
		__entry->dir = dir;
		__entry->tcp_seq = tcp_seq;
		__entry->ret = ret;
	),

	TP_printk(
		"sk=%p direction=%d tcp_seq=%u rec_no=%llu ret=%d",
		__entry->sk, __entry->dir, __entry->tcp_seq, __entry->rec_no,
		__entry->ret
	)
);

TRACE_EVENT(tls_device_decrypted,

	TP_PROTO(struct sock *sk, u32 tcp_seq, u8 *rec_no, u32 rec_len,
		 bool encrypted, bool decrypted),

	TP_ARGS(sk, tcp_seq, rec_no, rec_len, encrypted, decrypted),

	TP_STRUCT__entry(
		__field(	struct sock *,	sk		)
		__field(	u64,		rec_no		)
		__field(	u32,		tcp_seq		)
		__field(	u32,		rec_len		)
		__field(	bool,		encrypted	)
		__field(	bool,		decrypted	)
	),

	TP_fast_assign(
		__entry->sk = sk;
		__entry->rec_no = get_unaligned_be64(rec_no);
		__entry->tcp_seq = tcp_seq;
		__entry->rec_len = rec_len;
		__entry->encrypted = encrypted;
		__entry->decrypted = decrypted;
	),

	TP_printk(
		"sk=%p tcp_seq=%u rec_no=%llu len=%u encrypted=%d decrypted=%d",
		__entry->sk, __entry->tcp_seq,
		__entry->rec_no, __entry->rec_len,
		__entry->encrypted, __entry->decrypted
	)
);

TRACE_EVENT(tls_device_rx_resync_send,

	TP_PROTO(struct sock *sk, u32 tcp_seq, u8 *rec_no, int sync_type),

	TP_ARGS(sk, tcp_seq, rec_no, sync_type),

	TP_STRUCT__entry(
		__field(	struct sock *,	sk		)
		__field(	u64,		rec_no		)
		__field(	u32,		tcp_seq		)
		__field(	int,		sync_type	)
	),

	TP_fast_assign(
		__entry->sk = sk;
		__entry->rec_no = get_unaligned_be64(rec_no);
		__entry->tcp_seq = tcp_seq;
		__entry->sync_type = sync_type;
	),

	TP_printk(
		"sk=%p tcp_seq=%u rec_no=%llu sync_type=%d",
		__entry->sk, __entry->tcp_seq, __entry->rec_no,
		__entry->sync_type
	)
);

TRACE_EVENT(tls_device_rx_resync_nh_schedule,

	TP_PROTO(struct sock *sk),

	TP_ARGS(sk),

	TP_STRUCT__entry(
		__field(	struct sock *,	sk		)
	),

	TP_fast_assign(
		__entry->sk = sk;
	),

	TP_printk(
		"sk=%p", __entry->sk
	)
);

TRACE_EVENT(tls_device_rx_resync_nh_delay,

	TP_PROTO(struct sock *sk, u32 sock_data, u32 rec_len),

	TP_ARGS(sk, sock_data, rec_len),

	TP_STRUCT__entry(
		__field(	struct sock *,	sk		)
		__field(	u32,		sock_data	)
		__field(	u32,		rec_len		)
	),

	TP_fast_assign(
		__entry->sk = sk;
		__entry->sock_data = sock_data;
		__entry->rec_len = rec_len;
	),

	TP_printk(
		"sk=%p sock_data=%u rec_len=%u",
		__entry->sk, __entry->sock_data, __entry->rec_len
	)
);

TRACE_EVENT(tls_device_tx_resync_req,

	TP_PROTO(struct sock *sk, u32 tcp_seq, u32 exp_tcp_seq),

	TP_ARGS(sk, tcp_seq, exp_tcp_seq),

	TP_STRUCT__entry(
		__field(	struct sock *,	sk		)
		__field(	u32,		tcp_seq		)
		__field(	u32,		exp_tcp_seq	)
	),

	TP_fast_assign(
		__entry->sk = sk;
		__entry->tcp_seq = tcp_seq;
		__entry->exp_tcp_seq = exp_tcp_seq;
	),

	TP_printk(
		"sk=%p tcp_seq=%u exp_tcp_seq=%u",
		__entry->sk, __entry->tcp_seq, __entry->exp_tcp_seq
	)
);

TRACE_EVENT(tls_device_tx_resync_send,

	TP_PROTO(struct sock *sk, u32 tcp_seq, u8 *rec_no),

	TP_ARGS(sk, tcp_seq, rec_no),

	TP_STRUCT__entry(
		__field(	struct sock *,	sk		)
		__field(	u64,		rec_no		)
		__field(	u32,		tcp_seq		)
	),

	TP_fast_assign(
		__entry->sk = sk;
		__entry->rec_no = get_unaligned_be64(rec_no);
		__entry->tcp_seq = tcp_seq;
	),

	TP_printk(
		"sk=%p tcp_seq=%u rec_no=%llu",
		__entry->sk, __entry->tcp_seq, __entry->rec_no
	)
);

#endif /* _TLS_TRACE_H_ */

#undef TRACE_INCLUDE_PATH
#define TRACE_INCLUDE_PATH .
#undef TRACE_INCLUDE_FILE
#define TRACE_INCLUDE_FILE trace

#include <trace/define_trace.h>