trace.h (4136B)
1/* SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) */ 2/* Copyright (C) 2019 Netronome Systems, Inc. */ 3 4#undef TRACE_SYSTEM 5#define TRACE_SYSTEM tls 6 7#if !defined(_TLS_TRACE_H_) || defined(TRACE_HEADER_MULTI_READ) 8#define _TLS_TRACE_H_ 9 10#include <asm/unaligned.h> 11#include <linux/tracepoint.h> 12 13struct sock; 14 15TRACE_EVENT(tls_device_offload_set, 16 17 TP_PROTO(struct sock *sk, int dir, u32 tcp_seq, u8 *rec_no, int ret), 18 19 TP_ARGS(sk, dir, tcp_seq, rec_no, ret), 20 21 TP_STRUCT__entry( 22 __field( struct sock *, sk ) 23 __field( u64, rec_no ) 24 __field( int, dir ) 25 __field( u32, tcp_seq ) 26 __field( int, ret ) 27 ), 28 29 TP_fast_assign( 30 __entry->sk = sk; 31 __entry->rec_no = get_unaligned_be64(rec_no); 32 __entry->dir = dir; 33 __entry->tcp_seq = tcp_seq; 34 __entry->ret = ret; 35 ), 36 37 TP_printk( 38 "sk=%p direction=%d tcp_seq=%u rec_no=%llu ret=%d", 39 __entry->sk, __entry->dir, __entry->tcp_seq, __entry->rec_no, 40 __entry->ret 41 ) 42); 43 44TRACE_EVENT(tls_device_decrypted, 45 46 TP_PROTO(struct sock *sk, u32 tcp_seq, u8 *rec_no, u32 rec_len, 47 bool encrypted, bool decrypted), 48 49 TP_ARGS(sk, tcp_seq, rec_no, rec_len, encrypted, decrypted), 50 51 TP_STRUCT__entry( 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 ) 58 ), 59 60 TP_fast_assign( 61 __entry->sk = sk; 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; 67 ), 68 69 TP_printk( 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 74 ) 75); 76 77TRACE_EVENT(tls_device_rx_resync_send, 78 79 TP_PROTO(struct sock *sk, u32 tcp_seq, u8 *rec_no, int sync_type), 80 81 TP_ARGS(sk, tcp_seq, rec_no, sync_type), 82 83 TP_STRUCT__entry( 84 __field( struct sock *, sk ) 85 __field( u64, rec_no ) 86 __field( u32, tcp_seq ) 87 __field( int, sync_type ) 88 ), 89 90 TP_fast_assign( 91 __entry->sk = sk; 92 __entry->rec_no = get_unaligned_be64(rec_no); 93 __entry->tcp_seq = tcp_seq; 94 __entry->sync_type = sync_type; 95 ), 96 97 TP_printk( 98 "sk=%p tcp_seq=%u rec_no=%llu sync_type=%d", 99 __entry->sk, __entry->tcp_seq, __entry->rec_no, 100 __entry->sync_type 101 ) 102); 103 104TRACE_EVENT(tls_device_rx_resync_nh_schedule, 105 106 TP_PROTO(struct sock *sk), 107 108 TP_ARGS(sk), 109 110 TP_STRUCT__entry( 111 __field( struct sock *, sk ) 112 ), 113 114 TP_fast_assign( 115 __entry->sk = sk; 116 ), 117 118 TP_printk( 119 "sk=%p", __entry->sk 120 ) 121); 122 123TRACE_EVENT(tls_device_rx_resync_nh_delay, 124 125 TP_PROTO(struct sock *sk, u32 sock_data, u32 rec_len), 126 127 TP_ARGS(sk, sock_data, rec_len), 128 129 TP_STRUCT__entry( 130 __field( struct sock *, sk ) 131 __field( u32, sock_data ) 132 __field( u32, rec_len ) 133 ), 134 135 TP_fast_assign( 136 __entry->sk = sk; 137 __entry->sock_data = sock_data; 138 __entry->rec_len = rec_len; 139 ), 140 141 TP_printk( 142 "sk=%p sock_data=%u rec_len=%u", 143 __entry->sk, __entry->sock_data, __entry->rec_len 144 ) 145); 146 147TRACE_EVENT(tls_device_tx_resync_req, 148 149 TP_PROTO(struct sock *sk, u32 tcp_seq, u32 exp_tcp_seq), 150 151 TP_ARGS(sk, tcp_seq, exp_tcp_seq), 152 153 TP_STRUCT__entry( 154 __field( struct sock *, sk ) 155 __field( u32, tcp_seq ) 156 __field( u32, exp_tcp_seq ) 157 ), 158 159 TP_fast_assign( 160 __entry->sk = sk; 161 __entry->tcp_seq = tcp_seq; 162 __entry->exp_tcp_seq = exp_tcp_seq; 163 ), 164 165 TP_printk( 166 "sk=%p tcp_seq=%u exp_tcp_seq=%u", 167 __entry->sk, __entry->tcp_seq, __entry->exp_tcp_seq 168 ) 169); 170 171TRACE_EVENT(tls_device_tx_resync_send, 172 173 TP_PROTO(struct sock *sk, u32 tcp_seq, u8 *rec_no), 174 175 TP_ARGS(sk, tcp_seq, rec_no), 176 177 TP_STRUCT__entry( 178 __field( struct sock *, sk ) 179 __field( u64, rec_no ) 180 __field( u32, tcp_seq ) 181 ), 182 183 TP_fast_assign( 184 __entry->sk = sk; 185 __entry->rec_no = get_unaligned_be64(rec_no); 186 __entry->tcp_seq = tcp_seq; 187 ), 188 189 TP_printk( 190 "sk=%p tcp_seq=%u rec_no=%llu", 191 __entry->sk, __entry->tcp_seq, __entry->rec_no 192 ) 193); 194 195#endif /* _TLS_TRACE_H_ */ 196 197#undef TRACE_INCLUDE_PATH 198#define TRACE_INCLUDE_PATH . 199#undef TRACE_INCLUDE_FILE 200#define TRACE_INCLUDE_FILE trace 201 202#include <trace/define_trace.h>