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