1 /* SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) */
2 /* Copyright (C) 2019 Netronome Systems, Inc. */
5 #define TRACE_SYSTEM tls
7 #if !defined(_TLS_TRACE_H_) || defined(TRACE_HEADER_MULTI_READ)
10 #include <linux/unaligned.h>
11 #include <linux/tracepoint.h>
15 TRACE_EVENT(tls_device_offload_set
,
17 TP_PROTO(struct sock
*sk
, int dir
, u32 tcp_seq
, u8
*rec_no
, int ret
),
19 TP_ARGS(sk
, dir
, tcp_seq
, rec_no
, ret
),
22 __field( struct sock
*, sk
)
23 __field( u64
, rec_no
)
25 __field( u32
, tcp_seq
)
31 __entry
->rec_no
= get_unaligned_be64(rec_no
);
33 __entry
->tcp_seq
= tcp_seq
;
38 "sk=%p direction=%d tcp_seq=%u rec_no=%llu ret=%d",
39 __entry
->sk
, __entry
->dir
, __entry
->tcp_seq
, __entry
->rec_no
,
44 TRACE_EVENT(tls_device_decrypted
,
46 TP_PROTO(struct sock
*sk
, u32 tcp_seq
, u8
*rec_no
, u32 rec_len
,
47 bool encrypted
, bool decrypted
),
49 TP_ARGS(sk
, tcp_seq
, rec_no
, rec_len
, encrypted
, decrypted
),
52 __field( struct sock
*, sk
)
53 __field( u64
, rec_no
)
54 __field( u32
, tcp_seq
)
55 __field( u32
, rec_len
)
56 __field( bool, encrypted
)
57 __field( bool, decrypted
)
62 __entry
->rec_no
= get_unaligned_be64(rec_no
);
63 __entry
->tcp_seq
= tcp_seq
;
64 __entry
->rec_len
= rec_len
;
65 __entry
->encrypted
= encrypted
;
66 __entry
->decrypted
= decrypted
;
70 "sk=%p tcp_seq=%u rec_no=%llu len=%u encrypted=%d decrypted=%d",
71 __entry
->sk
, __entry
->tcp_seq
,
72 __entry
->rec_no
, __entry
->rec_len
,
73 __entry
->encrypted
, __entry
->decrypted
77 TRACE_EVENT(tls_device_rx_resync_send
,
79 TP_PROTO(struct sock
*sk
, u32 tcp_seq
, u8
*rec_no
, int sync_type
),
81 TP_ARGS(sk
, tcp_seq
, rec_no
, sync_type
),
84 __field( struct sock
*, sk
)
85 __field( u64
, rec_no
)
86 __field( u32
, tcp_seq
)
87 __field( int, sync_type
)
92 __entry
->rec_no
= get_unaligned_be64(rec_no
);
93 __entry
->tcp_seq
= tcp_seq
;
94 __entry
->sync_type
= sync_type
;
98 "sk=%p tcp_seq=%u rec_no=%llu sync_type=%d",
99 __entry
->sk
, __entry
->tcp_seq
, __entry
->rec_no
,
104 TRACE_EVENT(tls_device_rx_resync_nh_schedule
,
106 TP_PROTO(struct sock
*sk
),
111 __field( struct sock
*, sk
)
123 TRACE_EVENT(tls_device_rx_resync_nh_delay
,
125 TP_PROTO(struct sock
*sk
, u32 sock_data
, u32 rec_len
),
127 TP_ARGS(sk
, sock_data
, rec_len
),
130 __field( struct sock
*, sk
)
131 __field( u32
, sock_data
)
132 __field( u32
, rec_len
)
137 __entry
->sock_data
= sock_data
;
138 __entry
->rec_len
= rec_len
;
142 "sk=%p sock_data=%u rec_len=%u",
143 __entry
->sk
, __entry
->sock_data
, __entry
->rec_len
147 TRACE_EVENT(tls_device_tx_resync_req
,
149 TP_PROTO(struct sock
*sk
, u32 tcp_seq
, u32 exp_tcp_seq
),
151 TP_ARGS(sk
, tcp_seq
, exp_tcp_seq
),
154 __field( struct sock
*, sk
)
155 __field( u32
, tcp_seq
)
156 __field( u32
, exp_tcp_seq
)
161 __entry
->tcp_seq
= tcp_seq
;
162 __entry
->exp_tcp_seq
= exp_tcp_seq
;
166 "sk=%p tcp_seq=%u exp_tcp_seq=%u",
167 __entry
->sk
, __entry
->tcp_seq
, __entry
->exp_tcp_seq
171 TRACE_EVENT(tls_device_tx_resync_send
,
173 TP_PROTO(struct sock
*sk
, u32 tcp_seq
, u8
*rec_no
),
175 TP_ARGS(sk
, tcp_seq
, rec_no
),
178 __field( struct sock
*, sk
)
179 __field( u64
, rec_no
)
180 __field( u32
, tcp_seq
)
185 __entry
->rec_no
= get_unaligned_be64(rec_no
);
186 __entry
->tcp_seq
= tcp_seq
;
190 "sk=%p tcp_seq=%u rec_no=%llu",
191 __entry
->sk
, __entry
->tcp_seq
, __entry
->rec_no
195 #endif /* _TLS_TRACE_H_ */
197 #undef TRACE_INCLUDE_PATH
198 #define TRACE_INCLUDE_PATH .
199 #undef TRACE_INCLUDE_FILE
200 #define TRACE_INCLUDE_FILE trace
202 #include <trace/define_trace.h>