Jakub Kicinski | 8538d29 | 2019-10-04 16:19:22 -0700 | [diff] [blame^] | 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 | |
| 13 | struct sock; |
| 14 | |
| 15 | TRACE_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 | |
| 44 | TRACE_EVENT(tls_device_rx_resync_send, |
| 45 | |
| 46 | TP_PROTO(struct sock *sk, u32 tcp_seq, u8 *rec_no, int sync_type), |
| 47 | |
| 48 | TP_ARGS(sk, tcp_seq, rec_no, sync_type), |
| 49 | |
| 50 | TP_STRUCT__entry( |
| 51 | __field( struct sock *, sk ) |
| 52 | __field( u64, rec_no ) |
| 53 | __field( u32, tcp_seq ) |
| 54 | __field( int, sync_type ) |
| 55 | ), |
| 56 | |
| 57 | TP_fast_assign( |
| 58 | __entry->sk = sk; |
| 59 | __entry->rec_no = get_unaligned_be64(rec_no); |
| 60 | __entry->tcp_seq = tcp_seq; |
| 61 | __entry->sync_type = sync_type; |
| 62 | ), |
| 63 | |
| 64 | TP_printk( |
| 65 | "sk=%p tcp_seq=%u rec_no=%llu sync_type=%d", |
| 66 | __entry->sk, __entry->tcp_seq, __entry->rec_no, |
| 67 | __entry->sync_type |
| 68 | ) |
| 69 | ); |
| 70 | |
| 71 | TRACE_EVENT(tls_device_rx_resync_nh_schedule, |
| 72 | |
| 73 | TP_PROTO(struct sock *sk), |
| 74 | |
| 75 | TP_ARGS(sk), |
| 76 | |
| 77 | TP_STRUCT__entry( |
| 78 | __field( struct sock *, sk ) |
| 79 | ), |
| 80 | |
| 81 | TP_fast_assign( |
| 82 | __entry->sk = sk; |
| 83 | ), |
| 84 | |
| 85 | TP_printk( |
| 86 | "sk=%p", __entry->sk |
| 87 | ) |
| 88 | ); |
| 89 | |
| 90 | TRACE_EVENT(tls_device_rx_resync_nh_delay, |
| 91 | |
| 92 | TP_PROTO(struct sock *sk, u32 sock_data, u32 rec_len), |
| 93 | |
| 94 | TP_ARGS(sk, sock_data, rec_len), |
| 95 | |
| 96 | TP_STRUCT__entry( |
| 97 | __field( struct sock *, sk ) |
| 98 | __field( u32, sock_data ) |
| 99 | __field( u32, rec_len ) |
| 100 | ), |
| 101 | |
| 102 | TP_fast_assign( |
| 103 | __entry->sk = sk; |
| 104 | __entry->sock_data = sock_data; |
| 105 | __entry->rec_len = rec_len; |
| 106 | ), |
| 107 | |
| 108 | TP_printk( |
| 109 | "sk=%p sock_data=%u rec_len=%u", |
| 110 | __entry->sk, __entry->sock_data, __entry->rec_len |
| 111 | ) |
| 112 | ); |
| 113 | |
| 114 | TRACE_EVENT(tls_device_tx_resync_req, |
| 115 | |
| 116 | TP_PROTO(struct sock *sk, u32 tcp_seq, u32 exp_tcp_seq), |
| 117 | |
| 118 | TP_ARGS(sk, tcp_seq, exp_tcp_seq), |
| 119 | |
| 120 | TP_STRUCT__entry( |
| 121 | __field( struct sock *, sk ) |
| 122 | __field( u32, tcp_seq ) |
| 123 | __field( u32, exp_tcp_seq ) |
| 124 | ), |
| 125 | |
| 126 | TP_fast_assign( |
| 127 | __entry->sk = sk; |
| 128 | __entry->tcp_seq = tcp_seq; |
| 129 | __entry->exp_tcp_seq = exp_tcp_seq; |
| 130 | ), |
| 131 | |
| 132 | TP_printk( |
| 133 | "sk=%p tcp_seq=%u exp_tcp_seq=%u", |
| 134 | __entry->sk, __entry->tcp_seq, __entry->exp_tcp_seq |
| 135 | ) |
| 136 | ); |
| 137 | |
| 138 | TRACE_EVENT(tls_device_tx_resync_send, |
| 139 | |
| 140 | TP_PROTO(struct sock *sk, u32 tcp_seq, u8 *rec_no), |
| 141 | |
| 142 | TP_ARGS(sk, tcp_seq, rec_no), |
| 143 | |
| 144 | TP_STRUCT__entry( |
| 145 | __field( struct sock *, sk ) |
| 146 | __field( u64, rec_no ) |
| 147 | __field( u32, tcp_seq ) |
| 148 | ), |
| 149 | |
| 150 | TP_fast_assign( |
| 151 | __entry->sk = sk; |
| 152 | __entry->rec_no = get_unaligned_be64(rec_no); |
| 153 | __entry->tcp_seq = tcp_seq; |
| 154 | ), |
| 155 | |
| 156 | TP_printk( |
| 157 | "sk=%p tcp_seq=%u rec_no=%llu", |
| 158 | __entry->sk, __entry->tcp_seq, __entry->rec_no |
| 159 | ) |
| 160 | ); |
| 161 | |
| 162 | #endif /* _TLS_TRACE_H_ */ |
| 163 | |
| 164 | #undef TRACE_INCLUDE_PATH |
| 165 | #define TRACE_INCLUDE_PATH . |
| 166 | #undef TRACE_INCLUDE_FILE |
| 167 | #define TRACE_INCLUDE_FILE trace |
| 168 | |
| 169 | #include <trace/define_trace.h> |