| 1 |
/* SPDX-License-Identifier: GPL-2.0 */ |
| 2 |
/* |
| 3 |
* Copyright (C) 2018, Microsoft Corporation. |
| 4 |
* |
| 5 |
* Author(s): Steve French <[email protected]> |
| 6 |
* |
| 7 |
* Please use this 3-part article as a reference for writing new tracepoints: |
| 8 |
* https://lwn.net/Articles/379903/ |
| 9 |
*/ |
| 10 |
#undef TRACE_SYSTEM |
| 11 |
#define TRACE_SYSTEM cifs |
| 12 |
|
| 13 |
#if !defined(_CIFS_TRACE_H) || defined(TRACE_HEADER_MULTI_READ) |
| 14 |
#define _CIFS_TRACE_H |
| 15 |
|
| 16 |
#include <linux/tracepoint.h> |
| 17 |
#include <linux/net.h> |
| 18 |
#include <linux/inet.h> |
| 19 |
|
| 20 |
/* |
| 21 |
* Specify enums for tracing information. |
| 22 |
*/ |
| 23 |
#define smb_eio_traces \ |
| 24 |
EM(smb_eio_trace_compress_copy, "compress_copy") \ |
| 25 |
EM(smb_eio_trace_copychunk_inv_rsp, "copychunk_inv_rsp") \ |
| 26 |
EM(smb_eio_trace_copychunk_overcopy_b, "copychunk_overcopy_b") \ |
| 27 |
EM(smb_eio_trace_copychunk_overcopy_c, "copychunk_overcopy_c") \ |
| 28 |
EM(smb_eio_trace_create_rsp_too_small, "create_rsp_too_small") \ |
| 29 |
EM(smb_eio_trace_dfsref_no_rsp, "dfsref_no_rsp") \ |
| 30 |
EM(smb_eio_trace_ea_overrun, "ea_overrun") \ |
| 31 |
EM(smb_eio_trace_extract_will_pin, "extract_will_pin") \ |
| 32 |
EM(smb_eio_trace_forced_shutdown, "forced_shutdown") \ |
| 33 |
EM(smb_eio_trace_getacl_bcc_too_small, "getacl_bcc_too_small") \ |
| 34 |
EM(smb_eio_trace_getcifsacl_param_count, "getcifsacl_param_count") \ |
| 35 |
EM(smb_eio_trace_getdfsrefer_bcc_too_small, "getdfsrefer_bcc_too_small") \ |
| 36 |
EM(smb_eio_trace_getextattr_bcc_too_small, "getextattr_bcc_too_small") \ |
| 37 |
EM(smb_eio_trace_getextattr_inv_size, "getextattr_inv_size") \ |
| 38 |
EM(smb_eio_trace_getsrvinonum_bcc_too_small, "getsrvinonum_bcc_too_small") \ |
| 39 |
EM(smb_eio_trace_getsrvinonum_size, "getsrvinonum_size") \ |
| 40 |
EM(smb_eio_trace_ioctl_data_len, "ioctl_data_len") \ |
| 41 |
EM(smb_eio_trace_ioctl_no_rsp, "ioctl_no_rsp") \ |
| 42 |
EM(smb_eio_trace_ioctl_out_off, "ioctl_out_off") \ |
| 43 |
EM(smb_eio_trace_lock_bcc_too_small, "lock_bcc_too_small") \ |
| 44 |
EM(smb_eio_trace_lock_data_too_small, "lock_data_too_small") \ |
| 45 |
EM(smb_eio_trace_malformed_ksid_key, "malformed_ksid_key") \ |
| 46 |
EM(smb_eio_trace_malformed_sid_key, "malformed_sid_key") \ |
| 47 |
EM(smb_eio_trace_mkdir_no_rsp, "mkdir_no_rsp") \ |
| 48 |
EM(smb_eio_trace_neg_bad_rsplen, "neg_bad_rsplen") \ |
| 49 |
EM(smb_eio_trace_neg_decode_token, "neg_decode_token") \ |
| 50 |
EM(smb_eio_trace_neg_info_caps, "neg_info_caps") \ |
| 51 |
EM(smb_eio_trace_neg_info_dialect, "neg_info_dialect") \ |
| 52 |
EM(smb_eio_trace_neg_info_fail, "neg_info_fail") \ |
| 53 |
EM(smb_eio_trace_neg_info_sec_mode, "neg_info_sec_mode") \ |
| 54 |
EM(smb_eio_trace_neg_inval_dialect, "neg_inval_dialect") \ |
| 55 |
EM(smb_eio_trace_neg_no_crypt_key, "neg_no_crypt_key") \ |
| 56 |
EM(smb_eio_trace_neg_sec_blob_too_small, "neg_sec_blob_too_small") \ |
| 57 |
EM(smb_eio_trace_neg_unreq_dialect, "neg_unreq_dialect") \ |
| 58 |
EM(smb_eio_trace_no_auth_key, "no_auth_key") \ |
| 59 |
EM(smb_eio_trace_no_lease_key, "no_lease_key") \ |
| 60 |
EM(smb_eio_trace_not_netfs_writeback, "not_netfs_writeback") \ |
| 61 |
EM(smb_eio_trace_null_pointers, "null_pointers") \ |
| 62 |
EM(smb_eio_trace_oldqfsinfo_bcc_too_small, "oldqfsinfo_bcc_too_small") \ |
| 63 |
EM(smb_eio_trace_pend_del_fail, "pend_del_fail") \ |
| 64 |
EM(smb_eio_trace_qalleas_bcc_too_small, "qalleas_bcc_too_small") \ |
| 65 |
EM(smb_eio_trace_qalleas_ea_overlong, "qalleas_ea_overlong") \ |
| 66 |
EM(smb_eio_trace_qalleas_overlong, "qalleas_overlong") \ |
| 67 |
EM(smb_eio_trace_qfileinfo_bcc_too_small, "qfileinfo_bcc_too_small") \ |
| 68 |
EM(smb_eio_trace_qfileinfo_invalid, "qfileinfo_invalid") \ |
| 69 |
EM(smb_eio_trace_qfsattrinfo_bcc_too_small, "qfsattrinfo_bcc_too_small") \ |
| 70 |
EM(smb_eio_trace_qfsdevinfo_bcc_too_small, "qfsdevinfo_bcc_too_small") \ |
| 71 |
EM(smb_eio_trace_qfsinfo_bcc_too_small, "qfsinfo_bcc_too_small") \ |
| 72 |
EM(smb_eio_trace_qfsposixinfo_bcc_too_small, "qfsposixinfo_bcc_too_small") \ |
| 73 |
EM(smb_eio_trace_qfsunixinfo_bcc_too_small, "qfsunixinfo_bcc_too_small") \ |
| 74 |
EM(smb_eio_trace_qpathinfo_bcc_too_small, "qpathinfo_bcc_too_small") \ |
| 75 |
EM(smb_eio_trace_qpathinfo_invalid, "qpathinfo_invalid") \ |
| 76 |
EM(smb_eio_trace_qreparse_data_area, "qreparse_data_area") \ |
| 77 |
EM(smb_eio_trace_qreparse_rep_datalen, "qreparse_rep_datalen") \ |
| 78 |
EM(smb_eio_trace_qreparse_ret_datalen, "qreparse_ret_datalen") \ |
| 79 |
EM(smb_eio_trace_qreparse_setup_count, "qreparse_setup_count") \ |
| 80 |
EM(smb_eio_trace_qreparse_sizes_wrong, "qreparse_sizes_wrong") \ |
| 81 |
EM(smb_eio_trace_qsym_bcc_too_small, "qsym_bcc_too_small") \ |
| 82 |
EM(smb_eio_trace_read_mid_state_unknown, "read_mid_state_unknown") \ |
| 83 |
EM(smb_eio_trace_read_overlarge, "read_overlarge") \ |
| 84 |
EM(smb_eio_trace_read_rsp_malformed, "read_rsp_malformed") \ |
| 85 |
EM(smb_eio_trace_read_rsp_short, "read_rsp_short") \ |
| 86 |
EM(smb_eio_trace_read_too_far, "read_too_far") \ |
| 87 |
EM(smb_eio_trace_reparse_data_len, "reparse_data_len") \ |
| 88 |
EM(smb_eio_trace_reparse_native_len, "reparse_native_len") \ |
| 89 |
EM(smb_eio_trace_reparse_native_nul, "reparse_native_nul") \ |
| 90 |
EM(smb_eio_trace_reparse_native_sym_len, "reparse_native_sym_len") \ |
| 91 |
EM(smb_eio_trace_reparse_nfs_dev, "reparse_nfs_dev") \ |
| 92 |
EM(smb_eio_trace_reparse_nfs_nul, "reparse_nfs_nul") \ |
| 93 |
EM(smb_eio_trace_reparse_nfs_sockfifo, "reparse_nfs_sockfifo") \ |
| 94 |
EM(smb_eio_trace_reparse_nfs_symbuf, "reparse_nfs_symbuf") \ |
| 95 |
EM(smb_eio_trace_reparse_nfs_too_short, "reparse_nfs_too_short") \ |
| 96 |
EM(smb_eio_trace_reparse_overlong, "reparse_overlong") \ |
| 97 |
EM(smb_eio_trace_reparse_rdlen, "reparse_rdlen") \ |
| 98 |
EM(smb_eio_trace_reparse_wsl_nul, "reparse_wsl_nul") \ |
| 99 |
EM(smb_eio_trace_reparse_wsl_symbuf, "reparse_wsl_symbuf") \ |
| 100 |
EM(smb_eio_trace_reparse_wsl_ver, "reparse_wsl_ver") \ |
| 101 |
EM(smb_eio_trace_rx_b_read_short, "rx_b_read_short") \ |
| 102 |
EM(smb_eio_trace_rx_bad_datalen, "rx_bad_datalen") \ |
| 103 |
EM(smb_eio_trace_rx_both_buf, "rx_both_buf") \ |
| 104 |
EM(smb_eio_trace_rx_calc_len_too_big, "rx_calc_len_too_big") \ |
| 105 |
EM(smb_eio_trace_rx_check_rsp, "rx_check_rsp") \ |
| 106 |
EM(smb_eio_trace_rx_copy_to_iter, "rx_copy_to_iter") \ |
| 107 |
EM(smb_eio_trace_rx_insuff_res, "rx_insuff_res") \ |
| 108 |
EM(smb_eio_trace_rx_inv_bcc, "rx_inv_bcc") \ |
| 109 |
EM(smb_eio_trace_rx_mid_unready, "rx_mid_unready") \ |
| 110 |
EM(smb_eio_trace_rx_neg_sess_resp, "rx_neg_sess_resp") \ |
| 111 |
EM(smb_eio_trace_rx_overlong, "rx_overlong") \ |
| 112 |
EM(smb_eio_trace_rx_overpage, "rx_overpage") \ |
| 113 |
EM(smb_eio_trace_rx_pos_sess_resp, "rx_pos_sess_resp") \ |
| 114 |
EM(smb_eio_trace_rx_rfc1002_magic, "rx_rfc1002_magic") \ |
| 115 |
EM(smb_eio_trace_rx_sync_mid_invalid, "rx_sync_mid_invalid") \ |
| 116 |
EM(smb_eio_trace_rx_sync_mid_malformed, "rx_sync_mid_malformed") \ |
| 117 |
EM(smb_eio_trace_rx_too_short, "rx_too_short") \ |
| 118 |
EM(smb_eio_trace_rx_trans2_extract, "rx_trans2_extract") \ |
| 119 |
EM(smb_eio_trace_rx_unknown_resp, "rx_unknown_resp") \ |
| 120 |
EM(smb_eio_trace_rx_unspec_error, "rx_unspec_error") \ |
| 121 |
EM(smb_eio_trace_sess_buf_off, "sess_buf_off") \ |
| 122 |
EM(smb_eio_trace_sess_exiting, "sess_exiting") \ |
| 123 |
EM(smb_eio_trace_sess_krb_wcc, "sess_krb_wcc") \ |
| 124 |
EM(smb_eio_trace_sess_nl2_wcc, "sess_nl2_wcc") \ |
| 125 |
EM(smb_eio_trace_sess_rawnl_auth_wcc, "sess_rawnl_auth_wcc") \ |
| 126 |
EM(smb_eio_trace_sess_rawnl_neg_wcc, "sess_rawnl_neg_wcc") \ |
| 127 |
EM(smb_eio_trace_short_symlink_write, "short_symlink_write") \ |
| 128 |
EM(smb_eio_trace_sid_too_many_auth, "sid_too_many_auth") \ |
| 129 |
EM(smb_eio_trace_sig_data_too_small, "sig_data_too_small") \ |
| 130 |
EM(smb_eio_trace_sig_iter, "sig_iter") \ |
| 131 |
EM(smb_eio_trace_smb1_received_error, "smb1_received_error") \ |
| 132 |
EM(smb_eio_trace_smb2_received_error, "smb2_received_error") \ |
| 133 |
EM(smb_eio_trace_sym_slash, "sym_slash") \ |
| 134 |
EM(smb_eio_trace_sym_target_len, "sym_target_len") \ |
| 135 |
EM(smb_eio_trace_symlink_file_size, "symlink_file_size") \ |
| 136 |
EM(smb_eio_trace_tdis_in_reconnect, "tdis_in_reconnect") \ |
| 137 |
EM(smb_eio_trace_tx_chained_async, "tx_chained_async") \ |
| 138 |
EM(smb_eio_trace_tx_compress_failed, "tx_compress_failed") \ |
| 139 |
EM(smb_eio_trace_tx_copy_iter_to_buf, "tx_copy_iter_to_buf") \ |
| 140 |
EM(smb_eio_trace_tx_copy_to_buf, "tx_copy_to_buf") \ |
| 141 |
EM(smb_eio_trace_tx_max_compound, "tx_max_compound") \ |
| 142 |
EM(smb_eio_trace_tx_miscopy_to_buf, "tx_miscopy_to_buf") \ |
| 143 |
EM(smb_eio_trace_tx_need_transform, "tx_need_transform") \ |
| 144 |
EM(smb_eio_trace_tx_too_long, "sr_too_long") \ |
| 145 |
EM(smb_eio_trace_unixqfileinfo_bcc_too_small, "unixqfileinfo_bcc_too_small") \ |
| 146 |
EM(smb_eio_trace_unixqpathinfo_bcc_too_small, "unixqpathinfo_bcc_too_small") \ |
| 147 |
EM(smb_eio_trace_user_iter, "user_iter") \ |
| 148 |
EM(smb_eio_trace_write_bad_buf_type, "write_bad_buf_type") \ |
| 149 |
EM(smb_eio_trace_write_mid_state_unknown, "write_mid_state_unknown") \ |
| 150 |
EM(smb_eio_trace_write_rsp_malformed, "write_rsp_malformed") \ |
| 151 |
E_(smb_eio_trace_write_too_far, "write_too_far") |
| 152 |
|
| 153 |
#define smb3_rw_credits_traces \ |
| 154 |
EM(cifs_trace_rw_credits_call_readv_adjust, "rd-call-adj") \ |
| 155 |
EM(cifs_trace_rw_credits_call_writev_adjust, "wr-call-adj") \ |
| 156 |
EM(cifs_trace_rw_credits_free_subreq, "free-subreq") \ |
| 157 |
EM(cifs_trace_rw_credits_issue_read_adjust, "rd-issu-adj") \ |
| 158 |
EM(cifs_trace_rw_credits_issue_write_adjust, "wr-issu-adj") \ |
| 159 |
EM(cifs_trace_rw_credits_no_adjust_up, "no-adj-up ") \ |
| 160 |
EM(cifs_trace_rw_credits_old_session, "old-session") \ |
| 161 |
EM(cifs_trace_rw_credits_read_response_add, "rd-resp-add") \ |
| 162 |
EM(cifs_trace_rw_credits_read_response_clear, "rd-resp-clr") \ |
| 163 |
EM(cifs_trace_rw_credits_read_resubmit, "rd-resubmit") \ |
| 164 |
EM(cifs_trace_rw_credits_read_submit, "rd-submit ") \ |
| 165 |
EM(cifs_trace_rw_credits_write_prepare, "wr-prepare ") \ |
| 166 |
EM(cifs_trace_rw_credits_write_response_add, "wr-resp-add") \ |
| 167 |
EM(cifs_trace_rw_credits_write_response_clear, "wr-resp-clr") \ |
| 168 |
E_(cifs_trace_rw_credits_zero_in_flight, "ZERO-IN-FLT") |
| 169 |
|
| 170 |
#define smb3_tcon_ref_traces \ |
| 171 |
EM(netfs_trace_tcon_ref_free, "FRE ") \ |
| 172 |
EM(netfs_trace_tcon_ref_free_fail, "FRE Fail ") \ |
| 173 |
EM(netfs_trace_tcon_ref_free_ipc, "FRE Ipc ") \ |
| 174 |
EM(netfs_trace_tcon_ref_free_ipc_fail, "FRE Ipc-F ") \ |
| 175 |
EM(netfs_trace_tcon_ref_free_reconnect_server, "FRE Reconn") \ |
| 176 |
EM(netfs_trace_tcon_ref_get_cached_laundromat, "GET Ch-Lau") \ |
| 177 |
EM(netfs_trace_tcon_ref_get_cached_lease_break, "GET Ch-Lea") \ |
| 178 |
EM(netfs_trace_tcon_ref_get_cancelled_close, "GET Cn-Cls") \ |
| 179 |
EM(netfs_trace_tcon_ref_get_close_defer_files, "GET Cl-Def") \ |
| 180 |
EM(netfs_trace_tcon_ref_get_dfs_refer, "GET DfsRef") \ |
| 181 |
EM(netfs_trace_tcon_ref_get_find, "GET Find ") \ |
| 182 |
EM(netfs_trace_tcon_ref_get_find_sess_tcon, "GET FndSes") \ |
| 183 |
EM(netfs_trace_tcon_ref_get_reconnect_server, "GET Reconn") \ |
| 184 |
EM(netfs_trace_tcon_ref_new, "NEW ") \ |
| 185 |
EM(netfs_trace_tcon_ref_new_ipc, "NEW Ipc ") \ |
| 186 |
EM(netfs_trace_tcon_ref_new_reconnect_server, "NEW Reconn") \ |
| 187 |
EM(netfs_trace_tcon_ref_put_cached_close, "PUT Ch-Cls") \ |
| 188 |
EM(netfs_trace_tcon_ref_put_cancelled_close, "PUT Cn-Cls") \ |
| 189 |
EM(netfs_trace_tcon_ref_put_cancelled_close_fid, "PUT Cn-Fid") \ |
| 190 |
EM(netfs_trace_tcon_ref_put_cancelled_mid, "PUT Cn-Mid") \ |
| 191 |
EM(netfs_trace_tcon_ref_put_close_defer_files, "PUT Cl-Def") \ |
| 192 |
EM(netfs_trace_tcon_ref_put_mnt_ctx, "PUT MntCtx") \ |
| 193 |
EM(netfs_trace_tcon_ref_put_dfs_refer, "PUT DfsRfr") \ |
| 194 |
EM(netfs_trace_tcon_ref_put_reconnect_server, "PUT Reconn") \ |
| 195 |
EM(netfs_trace_tcon_ref_put_tlink, "PUT Tlink ") \ |
| 196 |
EM(netfs_trace_tcon_ref_see_cancelled_close, "SEE Cn-Cls") \ |
| 197 |
EM(netfs_trace_tcon_ref_see_fscache_collision, "SEE FV-CO!") \ |
| 198 |
EM(netfs_trace_tcon_ref_see_fscache_okay, "SEE FV-Ok ") \ |
| 199 |
EM(netfs_trace_tcon_ref_see_fscache_relinq, "SEE FV-Rlq") \ |
| 200 |
E_(netfs_trace_tcon_ref_see_umount, "SEE Umount") |
| 201 |
|
| 202 |
#undef EM |
| 203 |
#undef E_ |
| 204 |
|
| 205 |
/* |
| 206 |
* Define those tracing enums. |
| 207 |
*/ |
| 208 |
#ifndef __SMB3_DECLARE_TRACE_ENUMS_ONCE_ONLY |
| 209 |
#define __SMB3_DECLARE_TRACE_ENUMS_ONCE_ONLY |
| 210 |
|
| 211 |
#define EM(a, b) a, |
| 212 |
#define E_(a, b) a |
| 213 |
|
| 214 |
enum smb_eio_trace { smb_eio_traces } __mode(byte); |
| 215 |
enum smb3_rw_credits_trace { smb3_rw_credits_traces } __mode(byte); |
| 216 |
enum smb3_tcon_ref_trace { smb3_tcon_ref_traces } __mode(byte); |
| 217 |
|
| 218 |
#undef EM |
| 219 |
#undef E_ |
| 220 |
#endif |
| 221 |
|
| 222 |
/* |
| 223 |
* Export enum symbols via userspace. |
| 224 |
*/ |
| 225 |
#define EM(a, b) TRACE_DEFINE_ENUM(a); |
| 226 |
#define E_(a, b) TRACE_DEFINE_ENUM(a); |
| 227 |
|
| 228 |
smb_eio_traces; |
| 229 |
smb3_rw_credits_traces; |
| 230 |
smb3_tcon_ref_traces; |
| 231 |
|
| 232 |
#undef EM |
| 233 |
#undef E_ |
| 234 |
|
| 235 |
/* |
| 236 |
* Now redefine the EM() and E_() macros to map the enums to the strings that |
| 237 |
* will be printed in the output. |
| 238 |
*/ |
| 239 |
#define EM(a, b) { a, b }, |
| 240 |
#define E_(a, b) { a, b } |
| 241 |
|
| 242 |
/* For logging errors in read or write */ |
| 243 |
DECLARE_EVENT_CLASS(smb3_rw_err_class, |
| 244 |
TP_PROTO(unsigned int rreq_debug_id, |
| 245 |
unsigned int rreq_debug_index, |
| 246 |
unsigned int xid, |
| 247 |
__u64 fid, |
| 248 |
__u32 tid, |
| 249 |
__u64 sesid, |
| 250 |
__u64 offset, |
| 251 |
__u32 len, |
| 252 |
int rc), |
| 253 |
TP_ARGS(rreq_debug_id, rreq_debug_index, |
| 254 |
xid, fid, tid, sesid, offset, len, rc), |
| 255 |
TP_STRUCT__entry( |
| 256 |
__field(unsigned int, rreq_debug_id) |
| 257 |
__field(unsigned int, rreq_debug_index) |
| 258 |
__field(unsigned int, xid) |
| 259 |
__field(__u64, fid) |
| 260 |
__field(__u32, tid) |
| 261 |
__field(__u64, sesid) |
| 262 |
__field(__u64, offset) |
| 263 |
__field(__u32, len) |
| 264 |
__field(int, rc) |
| 265 |
), |
| 266 |
TP_fast_assign( |
| 267 |
__entry->rreq_debug_id = rreq_debug_id; |
| 268 |
__entry->rreq_debug_index = rreq_debug_index; |
| 269 |
__entry->xid = xid; |
| 270 |
__entry->fid = fid; |
| 271 |
__entry->tid = tid; |
| 272 |
__entry->sesid = sesid; |
| 273 |
__entry->offset = offset; |
| 274 |
__entry->len = len; |
| 275 |
__entry->rc = rc; |
| 276 |
), |
| 277 |
TP_printk("R=%08x[%x] xid=%u sid=0x%llx tid=0x%x fid=0x%llx offset=0x%llx len=0x%x rc=%d", |
| 278 |
__entry->rreq_debug_id, __entry->rreq_debug_index, |
| 279 |
__entry->xid, __entry->sesid, __entry->tid, __entry->fid, |
| 280 |
__entry->offset, __entry->len, __entry->rc) |
| 281 |
) |
| 282 |
|
| 283 |
#define DEFINE_SMB3_RW_ERR_EVENT(name) \ |
| 284 |
DEFINE_EVENT(smb3_rw_err_class, smb3_##name, \ |
| 285 |
TP_PROTO(unsigned int rreq_debug_id, \ |
| 286 |
unsigned int rreq_debug_index, \ |
| 287 |
unsigned int xid, \ |
| 288 |
__u64 fid, \ |
| 289 |
__u32 tid, \ |
| 290 |
__u64 sesid, \ |
| 291 |
__u64 offset, \ |
| 292 |
__u32 len, \ |
| 293 |
int rc), \ |
| 294 |
TP_ARGS(rreq_debug_id, rreq_debug_index, xid, fid, tid, sesid, offset, len, rc)) |
| 295 |
|
| 296 |
DEFINE_SMB3_RW_ERR_EVENT(read_err); |
| 297 |
DEFINE_SMB3_RW_ERR_EVENT(write_err); |
| 298 |
|
| 299 |
/* For logging errors in other file I/O ops */ |
| 300 |
DECLARE_EVENT_CLASS(smb3_other_err_class, |
| 301 |
TP_PROTO(unsigned int xid, |
| 302 |
__u64 fid, |
| 303 |
__u32 tid, |
| 304 |
__u64 sesid, |
| 305 |
__u64 offset, |
| 306 |
__u32 len, |
| 307 |
int rc), |
| 308 |
TP_ARGS(xid, fid, tid, sesid, offset, len, rc), |
| 309 |
TP_STRUCT__entry( |
| 310 |
__field(unsigned int, xid) |
| 311 |
__field(__u64, fid) |
| 312 |
__field(__u32, tid) |
| 313 |
__field(__u64, sesid) |
| 314 |
__field(__u64, offset) |
| 315 |
__field(__u32, len) |
| 316 |
__field(int, rc) |
| 317 |
), |
| 318 |
TP_fast_assign( |
| 319 |
__entry->xid = xid; |
| 320 |
__entry->fid = fid; |
| 321 |
__entry->tid = tid; |
| 322 |
__entry->sesid = sesid; |
| 323 |
__entry->offset = offset; |
| 324 |
__entry->len = len; |
| 325 |
__entry->rc = rc; |
| 326 |
), |
| 327 |
TP_printk("xid=%u sid=0x%llx tid=0x%x fid=0x%llx offset=0x%llx len=0x%x rc=%d", |
| 328 |
__entry->xid, __entry->sesid, __entry->tid, __entry->fid, |
| 329 |
__entry->offset, __entry->len, __entry->rc) |
| 330 |
) |
| 331 |
|
| 332 |
#define DEFINE_SMB3_OTHER_ERR_EVENT(name) \ |
| 333 |
DEFINE_EVENT(smb3_other_err_class, smb3_##name, \ |
| 334 |
TP_PROTO(unsigned int xid, \ |
| 335 |
__u64 fid, \ |
| 336 |
__u32 tid, \ |
| 337 |
__u64 sesid, \ |
| 338 |
__u64 offset, \ |
| 339 |
__u32 len, \ |
| 340 |
int rc), \ |
| 341 |
TP_ARGS(xid, fid, tid, sesid, offset, len, rc)) |
| 342 |
|
| 343 |
DEFINE_SMB3_OTHER_ERR_EVENT(query_dir_err); |
| 344 |
DEFINE_SMB3_OTHER_ERR_EVENT(zero_err); |
| 345 |
DEFINE_SMB3_OTHER_ERR_EVENT(falloc_err); |
| 346 |
|
| 347 |
/* |
| 348 |
* For logging errors in reflink and copy_range ops e.g. smb2_copychunk_range |
| 349 |
* and smb2_duplicate_extents |
| 350 |
*/ |
| 351 |
DECLARE_EVENT_CLASS(smb3_copy_range_err_class, |
| 352 |
TP_PROTO(unsigned int xid, |
| 353 |
__u64 src_fid, |
| 354 |
__u64 target_fid, |
| 355 |
__u32 tid, |
| 356 |
__u64 sesid, |
| 357 |
__u64 src_offset, |
| 358 |
__u64 target_offset, |
| 359 |
__u32 len, |
| 360 |
int rc), |
| 361 |
TP_ARGS(xid, src_fid, target_fid, tid, sesid, src_offset, target_offset, len, rc), |
| 362 |
TP_STRUCT__entry( |
| 363 |
__field(unsigned int, xid) |
| 364 |
__field(__u64, src_fid) |
| 365 |
__field(__u64, target_fid) |
| 366 |
__field(__u32, tid) |
| 367 |
__field(__u64, sesid) |
| 368 |
__field(__u64, src_offset) |
| 369 |
__field(__u64, target_offset) |
| 370 |
__field(__u32, len) |
| 371 |
__field(int, rc) |
| 372 |
), |
| 373 |
TP_fast_assign( |
| 374 |
__entry->xid = xid; |
| 375 |
__entry->src_fid = src_fid; |
| 376 |
__entry->target_fid = target_fid; |
| 377 |
__entry->tid = tid; |
| 378 |
__entry->sesid = sesid; |
| 379 |
__entry->src_offset = src_offset; |
| 380 |
__entry->target_offset = target_offset; |
| 381 |
__entry->len = len; |
| 382 |
__entry->rc = rc; |
| 383 |
), |
| 384 |
TP_printk("xid=%u sid=0x%llx tid=0x%x source fid=0x%llx source offset=0x%llx target fid=0x%llx target offset=0x%llx len=0x%x rc=%d", |
| 385 |
__entry->xid, __entry->sesid, __entry->tid, __entry->target_fid, |
| 386 |
__entry->src_offset, __entry->target_fid, __entry->target_offset, __entry->len, __entry->rc) |
| 387 |
) |
| 388 |
|
| 389 |
#define DEFINE_SMB3_COPY_RANGE_ERR_EVENT(name) \ |
| 390 |
DEFINE_EVENT(smb3_copy_range_err_class, smb3_##name, \ |
| 391 |
TP_PROTO(unsigned int xid, \ |
| 392 |
__u64 src_fid, \ |
| 393 |
__u64 target_fid, \ |
| 394 |
__u32 tid, \ |
| 395 |
__u64 sesid, \ |
| 396 |
__u64 src_offset, \ |
| 397 |
__u64 target_offset, \ |
| 398 |
__u32 len, \ |
| 399 |
int rc), \ |
| 400 |
TP_ARGS(xid, src_fid, target_fid, tid, sesid, src_offset, target_offset, len, rc)) |
| 401 |
|
| 402 |
DEFINE_SMB3_COPY_RANGE_ERR_EVENT(clone_err); |
| 403 |
DEFINE_SMB3_COPY_RANGE_ERR_EVENT(copychunk_err); |
| 404 |
|
| 405 |
DECLARE_EVENT_CLASS(smb3_copy_range_done_class, |
| 406 |
TP_PROTO(unsigned int xid, |
| 407 |
__u64 src_fid, |
| 408 |
__u64 target_fid, |
| 409 |
__u32 tid, |
| 410 |
__u64 sesid, |
| 411 |
__u64 src_offset, |
| 412 |
__u64 target_offset, |
| 413 |
__u32 len), |
| 414 |
TP_ARGS(xid, src_fid, target_fid, tid, sesid, src_offset, target_offset, len), |
| 415 |
TP_STRUCT__entry( |
| 416 |
__field(unsigned int, xid) |
| 417 |
__field(__u64, src_fid) |
| 418 |
__field(__u64, target_fid) |
| 419 |
__field(__u32, tid) |
| 420 |
__field(__u64, sesid) |
| 421 |
__field(__u64, src_offset) |
| 422 |
__field(__u64, target_offset) |
| 423 |
__field(__u32, len) |
| 424 |
), |
| 425 |
TP_fast_assign( |
| 426 |
__entry->xid = xid; |
| 427 |
__entry->src_fid = src_fid; |
| 428 |
__entry->target_fid = target_fid; |
| 429 |
__entry->tid = tid; |
| 430 |
__entry->sesid = sesid; |
| 431 |
__entry->src_offset = src_offset; |
| 432 |
__entry->target_offset = target_offset; |
| 433 |
__entry->len = len; |
| 434 |
), |
| 435 |
TP_printk("xid=%u sid=0x%llx tid=0x%x source fid=0x%llx source offset=0x%llx target fid=0x%llx target offset=0x%llx len=0x%x", |
| 436 |
__entry->xid, __entry->sesid, __entry->tid, __entry->target_fid, |
| 437 |
__entry->src_offset, __entry->target_fid, __entry->target_offset, __entry->len) |
| 438 |
) |
| 439 |
|
| 440 |
#define DEFINE_SMB3_COPY_RANGE_DONE_EVENT(name) \ |
| 441 |
DEFINE_EVENT(smb3_copy_range_done_class, smb3_##name, \ |
| 442 |
TP_PROTO(unsigned int xid, \ |
| 443 |
__u64 src_fid, \ |
| 444 |
__u64 target_fid, \ |
| 445 |
__u32 tid, \ |
| 446 |
__u64 sesid, \ |
| 447 |
__u64 src_offset, \ |
| 448 |
__u64 target_offset, \ |
| 449 |
__u32 len), \ |
| 450 |
TP_ARGS(xid, src_fid, target_fid, tid, sesid, src_offset, target_offset, len)) |
| 451 |
|
| 452 |
DEFINE_SMB3_COPY_RANGE_DONE_EVENT(copychunk_enter); |
| 453 |
DEFINE_SMB3_COPY_RANGE_DONE_EVENT(clone_enter); |
| 454 |
DEFINE_SMB3_COPY_RANGE_DONE_EVENT(copychunk_done); |
| 455 |
DEFINE_SMB3_COPY_RANGE_DONE_EVENT(clone_done); |
| 456 |
|
| 457 |
|
| 458 |
/* For logging successful read or write */ |
| 459 |
DECLARE_EVENT_CLASS(smb3_rw_done_class, |
| 460 |
TP_PROTO(unsigned int rreq_debug_id, |
| 461 |
unsigned int rreq_debug_index, |
| 462 |
unsigned int xid, |
| 463 |
__u64 fid, |
| 464 |
__u32 tid, |
| 465 |
__u64 sesid, |
| 466 |
__u64 offset, |
| 467 |
__u32 len), |
| 468 |
TP_ARGS(rreq_debug_id, rreq_debug_index, |
| 469 |
xid, fid, tid, sesid, offset, len), |
| 470 |
TP_STRUCT__entry( |
| 471 |
__field(unsigned int, rreq_debug_id) |
| 472 |
__field(unsigned int, rreq_debug_index) |
| 473 |
__field(unsigned int, xid) |
| 474 |
__field(__u64, fid) |
| 475 |
__field(__u32, tid) |
| 476 |
__field(__u64, sesid) |
| 477 |
__field(__u64, offset) |
| 478 |
__field(__u32, len) |
| 479 |
), |
| 480 |
TP_fast_assign( |
| 481 |
__entry->rreq_debug_id = rreq_debug_id; |
| 482 |
__entry->rreq_debug_index = rreq_debug_index; |
| 483 |
__entry->xid = xid; |
| 484 |
__entry->fid = fid; |
| 485 |
__entry->tid = tid; |
| 486 |
__entry->sesid = sesid; |
| 487 |
__entry->offset = offset; |
| 488 |
__entry->len = len; |
| 489 |
), |
| 490 |
TP_printk("R=%08x[%x] xid=%u sid=0x%llx tid=0x%x fid=0x%llx offset=0x%llx len=0x%x", |
| 491 |
__entry->rreq_debug_id, __entry->rreq_debug_index, |
| 492 |
__entry->xid, __entry->sesid, __entry->tid, __entry->fid, |
| 493 |
__entry->offset, __entry->len) |
| 494 |
) |
| 495 |
|
| 496 |
#define DEFINE_SMB3_RW_DONE_EVENT(name) \ |
| 497 |
DEFINE_EVENT(smb3_rw_done_class, smb3_##name, \ |
| 498 |
TP_PROTO(unsigned int rreq_debug_id, \ |
| 499 |
unsigned int rreq_debug_index, \ |
| 500 |
unsigned int xid, \ |
| 501 |
__u64 fid, \ |
| 502 |
__u32 tid, \ |
| 503 |
__u64 sesid, \ |
| 504 |
__u64 offset, \ |
| 505 |
__u32 len), \ |
| 506 |
TP_ARGS(rreq_debug_id, rreq_debug_index, xid, fid, tid, sesid, offset, len)) |
| 507 |
|
| 508 |
DEFINE_SMB3_RW_DONE_EVENT(read_enter); |
| 509 |
DEFINE_SMB3_RW_DONE_EVENT(read_done); |
| 510 |
DEFINE_SMB3_RW_DONE_EVENT(write_enter); |
| 511 |
DEFINE_SMB3_RW_DONE_EVENT(write_done); |
| 512 |
|
| 513 |
/* For logging successful other op */ |
| 514 |
DECLARE_EVENT_CLASS(smb3_other_done_class, |
| 515 |
TP_PROTO(unsigned int xid, |
| 516 |
__u64 fid, |
| 517 |
__u32 tid, |
| 518 |
__u64 sesid, |
| 519 |
__u64 offset, |
| 520 |
__u32 len), |
| 521 |
TP_ARGS(xid, fid, tid, sesid, offset, len), |
| 522 |
TP_STRUCT__entry( |
| 523 |
__field(unsigned int, xid) |
| 524 |
__field(__u64, fid) |
| 525 |
__field(__u32, tid) |
| 526 |
__field(__u64, sesid) |
| 527 |
__field(__u64, offset) |
| 528 |
__field(__u32, len) |
| 529 |
), |
| 530 |
TP_fast_assign( |
| 531 |
__entry->xid = xid; |
| 532 |
__entry->fid = fid; |
| 533 |
__entry->tid = tid; |
| 534 |
__entry->sesid = sesid; |
| 535 |
__entry->offset = offset; |
| 536 |
__entry->len = len; |
| 537 |
), |
| 538 |
TP_printk("xid=%u sid=0x%llx tid=0x%x fid=0x%llx offset=0x%llx len=0x%x", |
| 539 |
__entry->xid, __entry->sesid, __entry->tid, __entry->fid, |
| 540 |
__entry->offset, __entry->len) |
| 541 |
) |
| 542 |
|
| 543 |
#define DEFINE_SMB3_OTHER_DONE_EVENT(name) \ |
| 544 |
DEFINE_EVENT(smb3_other_done_class, smb3_##name, \ |
| 545 |
TP_PROTO(unsigned int xid, \ |
| 546 |
__u64 fid, \ |
| 547 |
__u32 tid, \ |
| 548 |
__u64 sesid, \ |
| 549 |
__u64 offset, \ |
| 550 |
__u32 len), \ |
| 551 |
TP_ARGS(xid, fid, tid, sesid, offset, len)) |
| 552 |
|
| 553 |
DEFINE_SMB3_OTHER_DONE_EVENT(query_dir_enter); |
| 554 |
DEFINE_SMB3_OTHER_DONE_EVENT(zero_enter); |
| 555 |
DEFINE_SMB3_OTHER_DONE_EVENT(falloc_enter); |
| 556 |
DEFINE_SMB3_OTHER_DONE_EVENT(query_dir_done); |
| 557 |
DEFINE_SMB3_OTHER_DONE_EVENT(zero_done); |
| 558 |
DEFINE_SMB3_OTHER_DONE_EVENT(falloc_done); |
| 559 |
|
| 560 |
/* For logging successful set EOF (truncate) */ |
| 561 |
DECLARE_EVENT_CLASS(smb3_eof_class, |
| 562 |
TP_PROTO(unsigned int xid, |
| 563 |
__u64 fid, |
| 564 |
__u32 tid, |
| 565 |
__u64 sesid, |
| 566 |
__u64 offset), |
| 567 |
TP_ARGS(xid, fid, tid, sesid, offset), |
| 568 |
TP_STRUCT__entry( |
| 569 |
__field(unsigned int, xid) |
| 570 |
__field(__u64, fid) |
| 571 |
__field(__u32, tid) |
| 572 |
__field(__u64, sesid) |
| 573 |
__field(__u64, offset) |
| 574 |
), |
| 575 |
TP_fast_assign( |
| 576 |
__entry->xid = xid; |
| 577 |
__entry->fid = fid; |
| 578 |
__entry->tid = tid; |
| 579 |
__entry->sesid = sesid; |
| 580 |
__entry->offset = offset; |
| 581 |
), |
| 582 |
TP_printk("xid=%u sid=0x%llx tid=0x%x fid=0x%llx offset=0x%llx", |
| 583 |
__entry->xid, __entry->sesid, __entry->tid, __entry->fid, |
| 584 |
__entry->offset) |
| 585 |
) |
| 586 |
|
| 587 |
#define DEFINE_SMB3_EOF_EVENT(name) \ |
| 588 |
DEFINE_EVENT(smb3_eof_class, smb3_##name, \ |
| 589 |
TP_PROTO(unsigned int xid, \ |
| 590 |
__u64 fid, \ |
| 591 |
__u32 tid, \ |
| 592 |
__u64 sesid, \ |
| 593 |
__u64 offset), \ |
| 594 |
TP_ARGS(xid, fid, tid, sesid, offset)) |
| 595 |
|
| 596 |
DEFINE_SMB3_EOF_EVENT(set_eof); |
| 597 |
|
| 598 |
/* |
| 599 |
* For handle based calls other than read and write, and get/set info |
| 600 |
*/ |
| 601 |
DECLARE_EVENT_CLASS(smb3_fd_class, |
| 602 |
TP_PROTO(unsigned int xid, |
| 603 |
__u64 fid, |
| 604 |
__u32 tid, |
| 605 |
__u64 sesid), |
| 606 |
TP_ARGS(xid, fid, tid, sesid), |
| 607 |
TP_STRUCT__entry( |
| 608 |
__field(unsigned int, xid) |
| 609 |
__field(__u64, fid) |
| 610 |
__field(__u32, tid) |
| 611 |
__field(__u64, sesid) |
| 612 |
), |
| 613 |
TP_fast_assign( |
| 614 |
__entry->xid = xid; |
| 615 |
__entry->fid = fid; |
| 616 |
__entry->tid = tid; |
| 617 |
__entry->sesid = sesid; |
| 618 |
), |
| 619 |
TP_printk("xid=%u sid=0x%llx tid=0x%x fid=0x%llx", |
| 620 |
__entry->xid, __entry->sesid, __entry->tid, __entry->fid) |
| 621 |
) |
| 622 |
|
| 623 |
#define DEFINE_SMB3_FD_EVENT(name) \ |
| 624 |
DEFINE_EVENT(smb3_fd_class, smb3_##name, \ |
| 625 |
TP_PROTO(unsigned int xid, \ |
| 626 |
__u64 fid, \ |
| 627 |
__u32 tid, \ |
| 628 |
__u64 sesid), \ |
| 629 |
TP_ARGS(xid, fid, tid, sesid)) |
| 630 |
|
| 631 |
DEFINE_SMB3_FD_EVENT(flush_enter); |
| 632 |
DEFINE_SMB3_FD_EVENT(flush_done); |
| 633 |
DEFINE_SMB3_FD_EVENT(close_enter); |
| 634 |
DEFINE_SMB3_FD_EVENT(close_done); |
| 635 |
DEFINE_SMB3_FD_EVENT(oplock_not_found); |
| 636 |
|
| 637 |
DECLARE_EVENT_CLASS(smb3_fd_err_class, |
| 638 |
TP_PROTO(unsigned int xid, |
| 639 |
__u64 fid, |
| 640 |
__u32 tid, |
| 641 |
__u64 sesid, |
| 642 |
int rc), |
| 643 |
TP_ARGS(xid, fid, tid, sesid, rc), |
| 644 |
TP_STRUCT__entry( |
| 645 |
__field(unsigned int, xid) |
| 646 |
__field(__u64, fid) |
| 647 |
__field(__u32, tid) |
| 648 |
__field(__u64, sesid) |
| 649 |
__field(int, rc) |
| 650 |
), |
| 651 |
TP_fast_assign( |
| 652 |
__entry->xid = xid; |
| 653 |
__entry->fid = fid; |
| 654 |
__entry->tid = tid; |
| 655 |
__entry->sesid = sesid; |
| 656 |
__entry->rc = rc; |
| 657 |
), |
| 658 |
TP_printk("xid=%u sid=0x%llx tid=0x%x fid=0x%llx rc=%d", |
| 659 |
__entry->xid, __entry->sesid, __entry->tid, __entry->fid, |
| 660 |
__entry->rc) |
| 661 |
) |
| 662 |
|
| 663 |
#define DEFINE_SMB3_FD_ERR_EVENT(name) \ |
| 664 |
DEFINE_EVENT(smb3_fd_err_class, smb3_##name, \ |
| 665 |
TP_PROTO(unsigned int xid, \ |
| 666 |
__u64 fid, \ |
| 667 |
__u32 tid, \ |
| 668 |
__u64 sesid, \ |
| 669 |
int rc), \ |
| 670 |
TP_ARGS(xid, fid, tid, sesid, rc)) |
| 671 |
|
| 672 |
DEFINE_SMB3_FD_ERR_EVENT(flush_err); |
| 673 |
DEFINE_SMB3_FD_ERR_EVENT(lock_err); |
| 674 |
DEFINE_SMB3_FD_ERR_EVENT(close_err); |
| 675 |
|
| 676 |
/* |
| 677 |
* For handle based query/set info calls |
| 678 |
*/ |
| 679 |
DECLARE_EVENT_CLASS(smb3_inf_enter_class, |
| 680 |
TP_PROTO(unsigned int xid, |
| 681 |
__u64 fid, |
| 682 |
__u32 tid, |
| 683 |
__u64 sesid, |
| 684 |
__u8 infclass, |
| 685 |
__u32 type), |
| 686 |
TP_ARGS(xid, fid, tid, sesid, infclass, type), |
| 687 |
TP_STRUCT__entry( |
| 688 |
__field(unsigned int, xid) |
| 689 |
__field(__u64, fid) |
| 690 |
__field(__u32, tid) |
| 691 |
__field(__u64, sesid) |
| 692 |
__field(__u8, infclass) |
| 693 |
__field(__u32, type) |
| 694 |
), |
| 695 |
TP_fast_assign( |
| 696 |
__entry->xid = xid; |
| 697 |
__entry->fid = fid; |
| 698 |
__entry->tid = tid; |
| 699 |
__entry->sesid = sesid; |
| 700 |
__entry->infclass = infclass; |
| 701 |
__entry->type = type; |
| 702 |
), |
| 703 |
TP_printk("xid=%u sid=0x%llx tid=0x%x fid=0x%llx class=%u type=0x%x", |
| 704 |
__entry->xid, __entry->sesid, __entry->tid, __entry->fid, |
| 705 |
__entry->infclass, __entry->type) |
| 706 |
) |
| 707 |
|
| 708 |
#define DEFINE_SMB3_INF_ENTER_EVENT(name) \ |
| 709 |
DEFINE_EVENT(smb3_inf_enter_class, smb3_##name, \ |
| 710 |
TP_PROTO(unsigned int xid, \ |
| 711 |
__u64 fid, \ |
| 712 |
__u32 tid, \ |
| 713 |
__u64 sesid, \ |
| 714 |
__u8 infclass, \ |
| 715 |
__u32 type), \ |
| 716 |
TP_ARGS(xid, fid, tid, sesid, infclass, type)) |
| 717 |
|
| 718 |
DEFINE_SMB3_INF_ENTER_EVENT(query_info_enter); |
| 719 |
DEFINE_SMB3_INF_ENTER_EVENT(query_info_done); |
| 720 |
DEFINE_SMB3_INF_ENTER_EVENT(notify_enter); |
| 721 |
DEFINE_SMB3_INF_ENTER_EVENT(notify_done); |
| 722 |
|
| 723 |
DECLARE_EVENT_CLASS(smb3_inf_err_class, |
| 724 |
TP_PROTO(unsigned int xid, |
| 725 |
__u64 fid, |
| 726 |
__u32 tid, |
| 727 |
__u64 sesid, |
| 728 |
__u8 infclass, |
| 729 |
__u32 type, |
| 730 |
int rc), |
| 731 |
TP_ARGS(xid, fid, tid, sesid, infclass, type, rc), |
| 732 |
TP_STRUCT__entry( |
| 733 |
__field(unsigned int, xid) |
| 734 |
__field(__u64, fid) |
| 735 |
__field(__u32, tid) |
| 736 |
__field(__u64, sesid) |
| 737 |
__field(__u8, infclass) |
| 738 |
__field(__u32, type) |
| 739 |
__field(int, rc) |
| 740 |
), |
| 741 |
TP_fast_assign( |
| 742 |
__entry->xid = xid; |
| 743 |
__entry->fid = fid; |
| 744 |
__entry->tid = tid; |
| 745 |
__entry->sesid = sesid; |
| 746 |
__entry->infclass = infclass; |
| 747 |
__entry->type = type; |
| 748 |
__entry->rc = rc; |
| 749 |
), |
| 750 |
TP_printk("xid=%u sid=0x%llx tid=0x%x fid=0x%llx class=%u type=0x%x rc=%d", |
| 751 |
__entry->xid, __entry->sesid, __entry->tid, __entry->fid, |
| 752 |
__entry->infclass, __entry->type, __entry->rc) |
| 753 |
) |
| 754 |
|
| 755 |
#define DEFINE_SMB3_INF_ERR_EVENT(name) \ |
| 756 |
DEFINE_EVENT(smb3_inf_err_class, smb3_##name, \ |
| 757 |
TP_PROTO(unsigned int xid, \ |
| 758 |
__u64 fid, \ |
| 759 |
__u32 tid, \ |
| 760 |
__u64 sesid, \ |
| 761 |
__u8 infclass, \ |
| 762 |
__u32 type, \ |
| 763 |
int rc), \ |
| 764 |
TP_ARGS(xid, fid, tid, sesid, infclass, type, rc)) |
| 765 |
|
| 766 |
DEFINE_SMB3_INF_ERR_EVENT(query_info_err); |
| 767 |
DEFINE_SMB3_INF_ERR_EVENT(set_info_err); |
| 768 |
DEFINE_SMB3_INF_ERR_EVENT(notify_err); |
| 769 |
DEFINE_SMB3_INF_ERR_EVENT(fsctl_err); |
| 770 |
|
| 771 |
DECLARE_EVENT_CLASS(smb3_inf_compound_enter_class, |
| 772 |
TP_PROTO(unsigned int xid, |
| 773 |
__u32 tid, |
| 774 |
__u64 sesid, |
| 775 |
const char *full_path), |
| 776 |
TP_ARGS(xid, tid, sesid, full_path), |
| 777 |
TP_STRUCT__entry( |
| 778 |
__field(unsigned int, xid) |
| 779 |
__field(__u32, tid) |
| 780 |
__field(__u64, sesid) |
| 781 |
__string(path, full_path) |
| 782 |
), |
| 783 |
TP_fast_assign( |
| 784 |
__entry->xid = xid; |
| 785 |
__entry->tid = tid; |
| 786 |
__entry->sesid = sesid; |
| 787 |
__assign_str(path); |
| 788 |
), |
| 789 |
TP_printk("xid=%u sid=0x%llx tid=0x%x path=%s", |
| 790 |
__entry->xid, __entry->sesid, __entry->tid, |
| 791 |
__get_str(path)) |
| 792 |
) |
| 793 |
|
| 794 |
#define DEFINE_SMB3_INF_COMPOUND_ENTER_EVENT(name) \ |
| 795 |
DEFINE_EVENT(smb3_inf_compound_enter_class, smb3_##name, \ |
| 796 |
TP_PROTO(unsigned int xid, \ |
| 797 |
__u32 tid, \ |
| 798 |
__u64 sesid, \ |
| 799 |
const char *full_path), \ |
| 800 |
TP_ARGS(xid, tid, sesid, full_path)) |
| 801 |
|
| 802 |
DEFINE_SMB3_INF_COMPOUND_ENTER_EVENT(query_info_compound_enter); |
| 803 |
DEFINE_SMB3_INF_COMPOUND_ENTER_EVENT(posix_query_info_compound_enter); |
| 804 |
DEFINE_SMB3_INF_COMPOUND_ENTER_EVENT(hardlink_enter); |
| 805 |
DEFINE_SMB3_INF_COMPOUND_ENTER_EVENT(rename_enter); |
| 806 |
DEFINE_SMB3_INF_COMPOUND_ENTER_EVENT(unlink_enter); |
| 807 |
DEFINE_SMB3_INF_COMPOUND_ENTER_EVENT(set_eof_enter); |
| 808 |
DEFINE_SMB3_INF_COMPOUND_ENTER_EVENT(set_info_compound_enter); |
| 809 |
DEFINE_SMB3_INF_COMPOUND_ENTER_EVENT(set_reparse_compound_enter); |
| 810 |
DEFINE_SMB3_INF_COMPOUND_ENTER_EVENT(get_reparse_compound_enter); |
| 811 |
DEFINE_SMB3_INF_COMPOUND_ENTER_EVENT(query_wsl_ea_compound_enter); |
| 812 |
DEFINE_SMB3_INF_COMPOUND_ENTER_EVENT(mkdir_enter); |
| 813 |
DEFINE_SMB3_INF_COMPOUND_ENTER_EVENT(tdis_enter); |
| 814 |
DEFINE_SMB3_INF_COMPOUND_ENTER_EVENT(mknod_enter); |
| 815 |
|
| 816 |
DECLARE_EVENT_CLASS(smb3_inf_compound_done_class, |
| 817 |
TP_PROTO(unsigned int xid, |
| 818 |
__u32 tid, |
| 819 |
__u64 sesid), |
| 820 |
TP_ARGS(xid, tid, sesid), |
| 821 |
TP_STRUCT__entry( |
| 822 |
__field(unsigned int, xid) |
| 823 |
__field(__u32, tid) |
| 824 |
__field(__u64, sesid) |
| 825 |
), |
| 826 |
TP_fast_assign( |
| 827 |
__entry->xid = xid; |
| 828 |
__entry->tid = tid; |
| 829 |
__entry->sesid = sesid; |
| 830 |
), |
| 831 |
TP_printk("xid=%u sid=0x%llx tid=0x%x", |
| 832 |
__entry->xid, __entry->sesid, __entry->tid) |
| 833 |
) |
| 834 |
|
| 835 |
#define DEFINE_SMB3_INF_COMPOUND_DONE_EVENT(name) \ |
| 836 |
DEFINE_EVENT(smb3_inf_compound_done_class, smb3_##name, \ |
| 837 |
TP_PROTO(unsigned int xid, \ |
| 838 |
__u32 tid, \ |
| 839 |
__u64 sesid), \ |
| 840 |
TP_ARGS(xid, tid, sesid)) |
| 841 |
|
| 842 |
DEFINE_SMB3_INF_COMPOUND_DONE_EVENT(query_info_compound_done); |
| 843 |
DEFINE_SMB3_INF_COMPOUND_DONE_EVENT(posix_query_info_compound_done); |
| 844 |
DEFINE_SMB3_INF_COMPOUND_DONE_EVENT(hardlink_done); |
| 845 |
DEFINE_SMB3_INF_COMPOUND_DONE_EVENT(rename_done); |
| 846 |
DEFINE_SMB3_INF_COMPOUND_DONE_EVENT(unlink_done); |
| 847 |
DEFINE_SMB3_INF_COMPOUND_DONE_EVENT(set_eof_done); |
| 848 |
DEFINE_SMB3_INF_COMPOUND_DONE_EVENT(set_info_compound_done); |
| 849 |
DEFINE_SMB3_INF_COMPOUND_DONE_EVENT(set_reparse_compound_done); |
| 850 |
DEFINE_SMB3_INF_COMPOUND_DONE_EVENT(get_reparse_compound_done); |
| 851 |
DEFINE_SMB3_INF_COMPOUND_DONE_EVENT(query_wsl_ea_compound_done); |
| 852 |
DEFINE_SMB3_INF_COMPOUND_DONE_EVENT(mkdir_done); |
| 853 |
DEFINE_SMB3_INF_COMPOUND_DONE_EVENT(tdis_done); |
| 854 |
DEFINE_SMB3_INF_COMPOUND_DONE_EVENT(mknod_done); |
| 855 |
|
| 856 |
DECLARE_EVENT_CLASS(smb3_inf_compound_err_class, |
| 857 |
TP_PROTO(unsigned int xid, |
| 858 |
__u32 tid, |
| 859 |
__u64 sesid, |
| 860 |
int rc), |
| 861 |
TP_ARGS(xid, tid, sesid, rc), |
| 862 |
TP_STRUCT__entry( |
| 863 |
__field(unsigned int, xid) |
| 864 |
__field(__u32, tid) |
| 865 |
__field(__u64, sesid) |
| 866 |
__field(int, rc) |
| 867 |
), |
| 868 |
TP_fast_assign( |
| 869 |
__entry->xid = xid; |
| 870 |
__entry->tid = tid; |
| 871 |
__entry->sesid = sesid; |
| 872 |
__entry->rc = rc; |
| 873 |
), |
| 874 |
TP_printk("xid=%u sid=0x%llx tid=0x%x rc=%d", |
| 875 |
__entry->xid, __entry->sesid, __entry->tid, |
| 876 |
__entry->rc) |
| 877 |
) |
| 878 |
|
| 879 |
#define DEFINE_SMB3_INF_COMPOUND_ERR_EVENT(name) \ |
| 880 |
DEFINE_EVENT(smb3_inf_compound_err_class, smb3_##name, \ |
| 881 |
TP_PROTO(unsigned int xid, \ |
| 882 |
__u32 tid, \ |
| 883 |
__u64 sesid, \ |
| 884 |
int rc), \ |
| 885 |
TP_ARGS(xid, tid, sesid, rc)) |
| 886 |
|
| 887 |
DEFINE_SMB3_INF_COMPOUND_ERR_EVENT(query_info_compound_err); |
| 888 |
DEFINE_SMB3_INF_COMPOUND_ERR_EVENT(posix_query_info_compound_err); |
| 889 |
DEFINE_SMB3_INF_COMPOUND_ERR_EVENT(hardlink_err); |
| 890 |
DEFINE_SMB3_INF_COMPOUND_ERR_EVENT(rename_err); |
| 891 |
DEFINE_SMB3_INF_COMPOUND_ERR_EVENT(unlink_err); |
| 892 |
DEFINE_SMB3_INF_COMPOUND_ERR_EVENT(set_eof_err); |
| 893 |
DEFINE_SMB3_INF_COMPOUND_ERR_EVENT(set_info_compound_err); |
| 894 |
DEFINE_SMB3_INF_COMPOUND_ERR_EVENT(set_reparse_compound_err); |
| 895 |
DEFINE_SMB3_INF_COMPOUND_ERR_EVENT(get_reparse_compound_err); |
| 896 |
DEFINE_SMB3_INF_COMPOUND_ERR_EVENT(query_wsl_ea_compound_err); |
| 897 |
DEFINE_SMB3_INF_COMPOUND_ERR_EVENT(mkdir_err); |
| 898 |
DEFINE_SMB3_INF_COMPOUND_ERR_EVENT(tdis_err); |
| 899 |
DEFINE_SMB3_INF_COMPOUND_ERR_EVENT(mknod_err); |
| 900 |
|
| 901 |
/* |
| 902 |
* For logging SMB3 Status code and Command for responses which return errors |
| 903 |
*/ |
| 904 |
DECLARE_EVENT_CLASS(smb3_cmd_err_class, |
| 905 |
TP_PROTO(__u32 tid, |
| 906 |
__u64 sesid, |
| 907 |
__u16 cmd, |
| 908 |
__u64 mid, |
| 909 |
__u32 status, |
| 910 |
int rc), |
| 911 |
TP_ARGS(tid, sesid, cmd, mid, status, rc), |
| 912 |
TP_STRUCT__entry( |
| 913 |
__field(__u32, tid) |
| 914 |
__field(__u64, sesid) |
| 915 |
__field(__u16, cmd) |
| 916 |
__field(__u64, mid) |
| 917 |
__field(__u32, status) |
| 918 |
__field(int, rc) |
| 919 |
), |
| 920 |
TP_fast_assign( |
| 921 |
__entry->tid = tid; |
| 922 |
__entry->sesid = sesid; |
| 923 |
__entry->cmd = cmd; |
| 924 |
__entry->mid = mid; |
| 925 |
__entry->status = status; |
| 926 |
__entry->rc = rc; |
| 927 |
), |
| 928 |
TP_printk("sid=0x%llx tid=0x%x cmd=%u mid=%llu status=0x%x rc=%d", |
| 929 |
__entry->sesid, __entry->tid, __entry->cmd, __entry->mid, |
| 930 |
__entry->status, __entry->rc) |
| 931 |
) |
| 932 |
|
| 933 |
#define DEFINE_SMB3_CMD_ERR_EVENT(name) \ |
| 934 |
DEFINE_EVENT(smb3_cmd_err_class, smb3_##name, \ |
| 935 |
TP_PROTO(__u32 tid, \ |
| 936 |
__u64 sesid, \ |
| 937 |
__u16 cmd, \ |
| 938 |
__u64 mid, \ |
| 939 |
__u32 status, \ |
| 940 |
int rc), \ |
| 941 |
TP_ARGS(tid, sesid, cmd, mid, status, rc)) |
| 942 |
|
| 943 |
DEFINE_SMB3_CMD_ERR_EVENT(cmd_err); |
| 944 |
|
| 945 |
DECLARE_EVENT_CLASS(smb3_cmd_done_class, |
| 946 |
TP_PROTO(__u32 tid, |
| 947 |
__u64 sesid, |
| 948 |
__u16 cmd, |
| 949 |
__u64 mid), |
| 950 |
TP_ARGS(tid, sesid, cmd, mid), |
| 951 |
TP_STRUCT__entry( |
| 952 |
__field(__u32, tid) |
| 953 |
__field(__u64, sesid) |
| 954 |
__field(__u16, cmd) |
| 955 |
__field(__u64, mid) |
| 956 |
), |
| 957 |
TP_fast_assign( |
| 958 |
__entry->tid = tid; |
| 959 |
__entry->sesid = sesid; |
| 960 |
__entry->cmd = cmd; |
| 961 |
__entry->mid = mid; |
| 962 |
), |
| 963 |
TP_printk("sid=0x%llx tid=0x%x cmd=%u mid=%llu", |
| 964 |
__entry->sesid, __entry->tid, |
| 965 |
__entry->cmd, __entry->mid) |
| 966 |
) |
| 967 |
|
| 968 |
#define DEFINE_SMB3_CMD_DONE_EVENT(name) \ |
| 969 |
DEFINE_EVENT(smb3_cmd_done_class, smb3_##name, \ |
| 970 |
TP_PROTO(__u32 tid, \ |
| 971 |
__u64 sesid, \ |
| 972 |
__u16 cmd, \ |
| 973 |
__u64 mid), \ |
| 974 |
TP_ARGS(tid, sesid, cmd, mid)) |
| 975 |
|
| 976 |
DEFINE_SMB3_CMD_DONE_EVENT(cmd_enter); |
| 977 |
DEFINE_SMB3_CMD_DONE_EVENT(cmd_done); |
| 978 |
DEFINE_SMB3_CMD_DONE_EVENT(ses_expired); |
| 979 |
|
| 980 |
DECLARE_EVENT_CLASS(smb3_mid_class, |
| 981 |
TP_PROTO(__u16 cmd, |
| 982 |
__u64 mid, |
| 983 |
__u32 pid, |
| 984 |
unsigned long when_sent, |
| 985 |
unsigned long when_received), |
| 986 |
TP_ARGS(cmd, mid, pid, when_sent, when_received), |
| 987 |
TP_STRUCT__entry( |
| 988 |
__field(__u16, cmd) |
| 989 |
__field(__u64, mid) |
| 990 |
__field(__u32, pid) |
| 991 |
__field(unsigned long, when_sent) |
| 992 |
__field(unsigned long, when_received) |
| 993 |
), |
| 994 |
TP_fast_assign( |
| 995 |
__entry->cmd = cmd; |
| 996 |
__entry->mid = mid; |
| 997 |
__entry->pid = pid; |
| 998 |
__entry->when_sent = when_sent; |
| 999 |
__entry->when_received = when_received; |
| 1000 |
), |
| 1001 |
TP_printk("cmd=%u mid=%llu pid=%u, when_sent=%lu when_rcv=%lu", |
| 1002 |
__entry->cmd, __entry->mid, __entry->pid, __entry->when_sent, |
| 1003 |
__entry->when_received) |
| 1004 |
) |
| 1005 |
|
| 1006 |
#define DEFINE_SMB3_MID_EVENT(name) \ |
| 1007 |
DEFINE_EVENT(smb3_mid_class, smb3_##name, \ |
| 1008 |
TP_PROTO(__u16 cmd, \ |
| 1009 |
__u64 mid, \ |
| 1010 |
__u32 pid, \ |
| 1011 |
unsigned long when_sent, \ |
| 1012 |
unsigned long when_received), \ |
| 1013 |
TP_ARGS(cmd, mid, pid, when_sent, when_received)) |
| 1014 |
|
| 1015 |
DEFINE_SMB3_MID_EVENT(slow_rsp); |
| 1016 |
|
| 1017 |
DECLARE_EVENT_CLASS(smb3_exit_err_class, |
| 1018 |
TP_PROTO(unsigned int xid, |
| 1019 |
const char *func_name, |
| 1020 |
int rc), |
| 1021 |
TP_ARGS(xid, func_name, rc), |
| 1022 |
TP_STRUCT__entry( |
| 1023 |
__field(unsigned int, xid) |
| 1024 |
__string(func_name, func_name) |
| 1025 |
__field(int, rc) |
| 1026 |
), |
| 1027 |
TP_fast_assign( |
| 1028 |
__entry->xid = xid; |
| 1029 |
__assign_str(func_name); |
| 1030 |
__entry->rc = rc; |
| 1031 |
), |
| 1032 |
TP_printk("%s: xid=%u rc=%d", |
| 1033 |
__get_str(func_name), __entry->xid, __entry->rc) |
| 1034 |
) |
| 1035 |
|
| 1036 |
#define DEFINE_SMB3_EXIT_ERR_EVENT(name) \ |
| 1037 |
DEFINE_EVENT(smb3_exit_err_class, smb3_##name, \ |
| 1038 |
TP_PROTO(unsigned int xid, \ |
| 1039 |
const char *func_name, \ |
| 1040 |
int rc), \ |
| 1041 |
TP_ARGS(xid, func_name, rc)) |
| 1042 |
|
| 1043 |
DEFINE_SMB3_EXIT_ERR_EVENT(exit_err); |
| 1044 |
|
| 1045 |
|
| 1046 |
DECLARE_EVENT_CLASS(smb3_sync_err_class, |
| 1047 |
TP_PROTO(unsigned long ino, |
| 1048 |
int rc), |
| 1049 |
TP_ARGS(ino, rc), |
| 1050 |
TP_STRUCT__entry( |
| 1051 |
__field(unsigned long, ino) |
| 1052 |
__field(int, rc) |
| 1053 |
), |
| 1054 |
TP_fast_assign( |
| 1055 |
__entry->ino = ino; |
| 1056 |
__entry->rc = rc; |
| 1057 |
), |
| 1058 |
TP_printk("ino=%lu rc=%d", |
| 1059 |
__entry->ino, __entry->rc) |
| 1060 |
) |
| 1061 |
|
| 1062 |
#define DEFINE_SMB3_SYNC_ERR_EVENT(name) \ |
| 1063 |
DEFINE_EVENT(smb3_sync_err_class, cifs_##name, \ |
| 1064 |
TP_PROTO(unsigned long ino, \ |
| 1065 |
int rc), \ |
| 1066 |
TP_ARGS(ino, rc)) |
| 1067 |
|
| 1068 |
DEFINE_SMB3_SYNC_ERR_EVENT(fsync_err); |
| 1069 |
DEFINE_SMB3_SYNC_ERR_EVENT(flush_err); |
| 1070 |
|
| 1071 |
|
| 1072 |
DECLARE_EVENT_CLASS(smb3_enter_exit_class, |
| 1073 |
TP_PROTO(unsigned int xid, |
| 1074 |
const char *func_name), |
| 1075 |
TP_ARGS(xid, func_name), |
| 1076 |
TP_STRUCT__entry( |
| 1077 |
__field(unsigned int, xid) |
| 1078 |
__string(func_name, func_name) |
| 1079 |
), |
| 1080 |
TP_fast_assign( |
| 1081 |
__entry->xid = xid; |
| 1082 |
__assign_str(func_name); |
| 1083 |
), |
| 1084 |
TP_printk("%s: xid=%u", |
| 1085 |
__get_str(func_name), __entry->xid) |
| 1086 |
) |
| 1087 |
|
| 1088 |
#define DEFINE_SMB3_ENTER_EXIT_EVENT(name) \ |
| 1089 |
DEFINE_EVENT(smb3_enter_exit_class, smb3_##name, \ |
| 1090 |
TP_PROTO(unsigned int xid, \ |
| 1091 |
const char *func_name), \ |
| 1092 |
TP_ARGS(xid, func_name)) |
| 1093 |
|
| 1094 |
DEFINE_SMB3_ENTER_EXIT_EVENT(enter); |
| 1095 |
DEFINE_SMB3_ENTER_EXIT_EVENT(exit_done); |
| 1096 |
|
| 1097 |
/* |
| 1098 |
* For SMB2/SMB3 tree connect |
| 1099 |
*/ |
| 1100 |
|
| 1101 |
DECLARE_EVENT_CLASS(smb3_tcon_class, |
| 1102 |
TP_PROTO(unsigned int xid, |
| 1103 |
__u32 tid, |
| 1104 |
__u64 sesid, |
| 1105 |
const char *unc_name, |
| 1106 |
int rc), |
| 1107 |
TP_ARGS(xid, tid, sesid, unc_name, rc), |
| 1108 |
TP_STRUCT__entry( |
| 1109 |
__field(unsigned int, xid) |
| 1110 |
__field(__u32, tid) |
| 1111 |
__field(__u64, sesid) |
| 1112 |
__string(name, unc_name) |
| 1113 |
__field(int, rc) |
| 1114 |
), |
| 1115 |
TP_fast_assign( |
| 1116 |
__entry->xid = xid; |
| 1117 |
__entry->tid = tid; |
| 1118 |
__entry->sesid = sesid; |
| 1119 |
__assign_str(name); |
| 1120 |
__entry->rc = rc; |
| 1121 |
), |
| 1122 |
TP_printk("xid=%u sid=0x%llx tid=0x%x unc_name=%s rc=%d", |
| 1123 |
__entry->xid, __entry->sesid, __entry->tid, |
| 1124 |
__get_str(name), __entry->rc) |
| 1125 |
) |
| 1126 |
|
| 1127 |
#define DEFINE_SMB3_TCON_EVENT(name) \ |
| 1128 |
DEFINE_EVENT(smb3_tcon_class, smb3_##name, \ |
| 1129 |
TP_PROTO(unsigned int xid, \ |
| 1130 |
__u32 tid, \ |
| 1131 |
__u64 sesid, \ |
| 1132 |
const char *unc_name, \ |
| 1133 |
int rc), \ |
| 1134 |
TP_ARGS(xid, tid, sesid, unc_name, rc)) |
| 1135 |
|
| 1136 |
DEFINE_SMB3_TCON_EVENT(tcon); |
| 1137 |
DEFINE_SMB3_TCON_EVENT(qfs_done); |
| 1138 |
|
| 1139 |
/* |
| 1140 |
* For smb2/smb3 open (including create and mkdir) calls |
| 1141 |
*/ |
| 1142 |
|
| 1143 |
DECLARE_EVENT_CLASS(smb3_open_enter_class, |
| 1144 |
TP_PROTO(unsigned int xid, |
| 1145 |
__u32 tid, |
| 1146 |
__u64 sesid, |
| 1147 |
const char *full_path, |
| 1148 |
int create_options, |
| 1149 |
int desired_access), |
| 1150 |
TP_ARGS(xid, tid, sesid, full_path, create_options, desired_access), |
| 1151 |
TP_STRUCT__entry( |
| 1152 |
__field(unsigned int, xid) |
| 1153 |
__field(__u32, tid) |
| 1154 |
__field(__u64, sesid) |
| 1155 |
__string(path, full_path) |
| 1156 |
__field(int, create_options) |
| 1157 |
__field(int, desired_access) |
| 1158 |
), |
| 1159 |
TP_fast_assign( |
| 1160 |
__entry->xid = xid; |
| 1161 |
__entry->tid = tid; |
| 1162 |
__entry->sesid = sesid; |
| 1163 |
__assign_str(path); |
| 1164 |
__entry->create_options = create_options; |
| 1165 |
__entry->desired_access = desired_access; |
| 1166 |
), |
| 1167 |
TP_printk("xid=%u sid=0x%llx tid=0x%x path=%s cr_opts=0x%x des_access=0x%x", |
| 1168 |
__entry->xid, __entry->sesid, __entry->tid, __get_str(path), |
| 1169 |
__entry->create_options, __entry->desired_access) |
| 1170 |
) |
| 1171 |
|
| 1172 |
#define DEFINE_SMB3_OPEN_ENTER_EVENT(name) \ |
| 1173 |
DEFINE_EVENT(smb3_open_enter_class, smb3_##name, \ |
| 1174 |
TP_PROTO(unsigned int xid, \ |
| 1175 |
__u32 tid, \ |
| 1176 |
__u64 sesid, \ |
| 1177 |
const char *full_path, \ |
| 1178 |
int create_options, \ |
| 1179 |
int desired_access), \ |
| 1180 |
TP_ARGS(xid, tid, sesid, full_path, create_options, desired_access)) |
| 1181 |
|
| 1182 |
DEFINE_SMB3_OPEN_ENTER_EVENT(open_enter); |
| 1183 |
DEFINE_SMB3_OPEN_ENTER_EVENT(posix_mkdir_enter); |
| 1184 |
|
| 1185 |
DECLARE_EVENT_CLASS(smb3_open_err_class, |
| 1186 |
TP_PROTO(unsigned int xid, |
| 1187 |
__u32 tid, |
| 1188 |
__u64 sesid, |
| 1189 |
int create_options, |
| 1190 |
int desired_access, |
| 1191 |
int rc), |
| 1192 |
TP_ARGS(xid, tid, sesid, create_options, desired_access, rc), |
| 1193 |
TP_STRUCT__entry( |
| 1194 |
__field(unsigned int, xid) |
| 1195 |
__field(__u32, tid) |
| 1196 |
__field(__u64, sesid) |
| 1197 |
__field(int, create_options) |
| 1198 |
__field(int, desired_access) |
| 1199 |
__field(int, rc) |
| 1200 |
), |
| 1201 |
TP_fast_assign( |
| 1202 |
__entry->xid = xid; |
| 1203 |
__entry->tid = tid; |
| 1204 |
__entry->sesid = sesid; |
| 1205 |
__entry->create_options = create_options; |
| 1206 |
__entry->desired_access = desired_access; |
| 1207 |
__entry->rc = rc; |
| 1208 |
), |
| 1209 |
TP_printk("xid=%u sid=0x%llx tid=0x%x cr_opts=0x%x des_access=0x%x rc=%d", |
| 1210 |
__entry->xid, __entry->sesid, __entry->tid, |
| 1211 |
__entry->create_options, __entry->desired_access, __entry->rc) |
| 1212 |
) |
| 1213 |
|
| 1214 |
#define DEFINE_SMB3_OPEN_ERR_EVENT(name) \ |
| 1215 |
DEFINE_EVENT(smb3_open_err_class, smb3_##name, \ |
| 1216 |
TP_PROTO(unsigned int xid, \ |
| 1217 |
__u32 tid, \ |
| 1218 |
__u64 sesid, \ |
| 1219 |
int create_options, \ |
| 1220 |
int desired_access, \ |
| 1221 |
int rc), \ |
| 1222 |
TP_ARGS(xid, tid, sesid, create_options, desired_access, rc)) |
| 1223 |
|
| 1224 |
DEFINE_SMB3_OPEN_ERR_EVENT(open_err); |
| 1225 |
DEFINE_SMB3_OPEN_ERR_EVENT(posix_mkdir_err); |
| 1226 |
|
| 1227 |
DECLARE_EVENT_CLASS(smb3_open_done_class, |
| 1228 |
TP_PROTO(unsigned int xid, |
| 1229 |
__u64 fid, |
| 1230 |
__u32 tid, |
| 1231 |
__u64 sesid, |
| 1232 |
int create_options, |
| 1233 |
int desired_access), |
| 1234 |
TP_ARGS(xid, fid, tid, sesid, create_options, desired_access), |
| 1235 |
TP_STRUCT__entry( |
| 1236 |
__field(unsigned int, xid) |
| 1237 |
__field(__u64, fid) |
| 1238 |
__field(__u32, tid) |
| 1239 |
__field(__u64, sesid) |
| 1240 |
__field(int, create_options) |
| 1241 |
__field(int, desired_access) |
| 1242 |
), |
| 1243 |
TP_fast_assign( |
| 1244 |
__entry->xid = xid; |
| 1245 |
__entry->fid = fid; |
| 1246 |
__entry->tid = tid; |
| 1247 |
__entry->sesid = sesid; |
| 1248 |
__entry->create_options = create_options; |
| 1249 |
__entry->desired_access = desired_access; |
| 1250 |
), |
| 1251 |
TP_printk("xid=%u sid=0x%llx tid=0x%x fid=0x%llx cr_opts=0x%x des_access=0x%x", |
| 1252 |
__entry->xid, __entry->sesid, __entry->tid, __entry->fid, |
| 1253 |
__entry->create_options, __entry->desired_access) |
| 1254 |
) |
| 1255 |
|
| 1256 |
#define DEFINE_SMB3_OPEN_DONE_EVENT(name) \ |
| 1257 |
DEFINE_EVENT(smb3_open_done_class, smb3_##name, \ |
| 1258 |
TP_PROTO(unsigned int xid, \ |
| 1259 |
__u64 fid, \ |
| 1260 |
__u32 tid, \ |
| 1261 |
__u64 sesid, \ |
| 1262 |
int create_options, \ |
| 1263 |
int desired_access), \ |
| 1264 |
TP_ARGS(xid, fid, tid, sesid, create_options, desired_access)) |
| 1265 |
|
| 1266 |
DEFINE_SMB3_OPEN_DONE_EVENT(open_done); |
| 1267 |
DEFINE_SMB3_OPEN_DONE_EVENT(posix_mkdir_done); |
| 1268 |
|
| 1269 |
|
| 1270 |
DECLARE_EVENT_CLASS(smb3_lease_done_class, |
| 1271 |
TP_PROTO(__u32 lease_state, |
| 1272 |
__u32 tid, |
| 1273 |
__u64 sesid, |
| 1274 |
__u64 lease_key_low, |
| 1275 |
__u64 lease_key_high), |
| 1276 |
TP_ARGS(lease_state, tid, sesid, lease_key_low, lease_key_high), |
| 1277 |
TP_STRUCT__entry( |
| 1278 |
__field(__u32, lease_state) |
| 1279 |
__field(__u32, tid) |
| 1280 |
__field(__u64, sesid) |
| 1281 |
__field(__u64, lease_key_low) |
| 1282 |
__field(__u64, lease_key_high) |
| 1283 |
), |
| 1284 |
TP_fast_assign( |
| 1285 |
__entry->lease_state = lease_state; |
| 1286 |
__entry->tid = tid; |
| 1287 |
__entry->sesid = sesid; |
| 1288 |
__entry->lease_key_low = lease_key_low; |
| 1289 |
__entry->lease_key_high = lease_key_high; |
| 1290 |
), |
| 1291 |
TP_printk("sid=0x%llx tid=0x%x lease_key=0x%llx%llx lease_state=0x%x", |
| 1292 |
__entry->sesid, __entry->tid, __entry->lease_key_high, |
| 1293 |
__entry->lease_key_low, __entry->lease_state) |
| 1294 |
) |
| 1295 |
|
| 1296 |
#define DEFINE_SMB3_LEASE_DONE_EVENT(name) \ |
| 1297 |
DEFINE_EVENT(smb3_lease_done_class, smb3_##name, \ |
| 1298 |
TP_PROTO(__u32 lease_state, \ |
| 1299 |
__u32 tid, \ |
| 1300 |
__u64 sesid, \ |
| 1301 |
__u64 lease_key_low, \ |
| 1302 |
__u64 lease_key_high), \ |
| 1303 |
TP_ARGS(lease_state, tid, sesid, lease_key_low, lease_key_high)) |
| 1304 |
|
| 1305 |
DEFINE_SMB3_LEASE_DONE_EVENT(lease_ack_done); |
| 1306 |
/* Tracepoint when a lease break request is received/entered (includes epoch and flags) */ |
| 1307 |
DECLARE_EVENT_CLASS(smb3_lease_enter_class, |
| 1308 |
TP_PROTO(__u32 lease_state, |
| 1309 |
__u32 flags, |
| 1310 |
__u16 epoch, |
| 1311 |
__u32 tid, |
| 1312 |
__u64 sesid, |
| 1313 |
__u64 lease_key_low, |
| 1314 |
__u64 lease_key_high), |
| 1315 |
TP_ARGS(lease_state, flags, epoch, tid, sesid, lease_key_low, lease_key_high), |
| 1316 |
TP_STRUCT__entry( |
| 1317 |
__field(__u32, lease_state) |
| 1318 |
__field(__u32, flags) |
| 1319 |
__field(__u16, epoch) |
| 1320 |
__field(__u32, tid) |
| 1321 |
__field(__u64, sesid) |
| 1322 |
__field(__u64, lease_key_low) |
| 1323 |
__field(__u64, lease_key_high) |
| 1324 |
), |
| 1325 |
TP_fast_assign( |
| 1326 |
__entry->lease_state = lease_state; |
| 1327 |
__entry->flags = flags; |
| 1328 |
__entry->epoch = epoch; |
| 1329 |
__entry->tid = tid; |
| 1330 |
__entry->sesid = sesid; |
| 1331 |
__entry->lease_key_low = lease_key_low; |
| 1332 |
__entry->lease_key_high = lease_key_high; |
| 1333 |
), |
| 1334 |
TP_printk("sid=0x%llx tid=0x%x lease_key=0x%llx%llx lease_state=0x%x flags=0x%x epoch=%u", |
| 1335 |
__entry->sesid, __entry->tid, __entry->lease_key_high, |
| 1336 |
__entry->lease_key_low, __entry->lease_state, __entry->flags, __entry->epoch) |
| 1337 |
) |
| 1338 |
|
| 1339 |
#define DEFINE_SMB3_LEASE_ENTER_EVENT(name) \ |
| 1340 |
DEFINE_EVENT(smb3_lease_enter_class, smb3_##name, \ |
| 1341 |
TP_PROTO(__u32 lease_state, \ |
| 1342 |
__u32 flags, \ |
| 1343 |
__u16 epoch, \ |
| 1344 |
__u32 tid, \ |
| 1345 |
__u64 sesid, \ |
| 1346 |
__u64 lease_key_low, \ |
| 1347 |
__u64 lease_key_high), \ |
| 1348 |
TP_ARGS(lease_state, flags, epoch, tid, sesid, lease_key_low, lease_key_high)) |
| 1349 |
|
| 1350 |
DEFINE_SMB3_LEASE_ENTER_EVENT(lease_break_enter); |
| 1351 |
/* Lease not found: reuse lease_enter payload (includes epoch and flags) */ |
| 1352 |
DEFINE_SMB3_LEASE_ENTER_EVENT(lease_not_found); |
| 1353 |
|
| 1354 |
DECLARE_EVENT_CLASS(smb3_lease_err_class, |
| 1355 |
TP_PROTO(__u32 lease_state, |
| 1356 |
__u32 tid, |
| 1357 |
__u64 sesid, |
| 1358 |
__u64 lease_key_low, |
| 1359 |
__u64 lease_key_high, |
| 1360 |
int rc), |
| 1361 |
TP_ARGS(lease_state, tid, sesid, lease_key_low, lease_key_high, rc), |
| 1362 |
TP_STRUCT__entry( |
| 1363 |
__field(__u32, lease_state) |
| 1364 |
__field(__u32, tid) |
| 1365 |
__field(__u64, sesid) |
| 1366 |
__field(__u64, lease_key_low) |
| 1367 |
__field(__u64, lease_key_high) |
| 1368 |
__field(int, rc) |
| 1369 |
), |
| 1370 |
TP_fast_assign( |
| 1371 |
__entry->lease_state = lease_state; |
| 1372 |
__entry->tid = tid; |
| 1373 |
__entry->sesid = sesid; |
| 1374 |
__entry->lease_key_low = lease_key_low; |
| 1375 |
__entry->lease_key_high = lease_key_high; |
| 1376 |
__entry->rc = rc; |
| 1377 |
), |
| 1378 |
TP_printk("sid=0x%llx tid=0x%x lease_key=0x%llx%llx lease_state=0x%x rc=%d", |
| 1379 |
__entry->sesid, __entry->tid, __entry->lease_key_high, |
| 1380 |
__entry->lease_key_low, __entry->lease_state, __entry->rc) |
| 1381 |
) |
| 1382 |
|
| 1383 |
#define DEFINE_SMB3_LEASE_ERR_EVENT(name) \ |
| 1384 |
DEFINE_EVENT(smb3_lease_err_class, smb3_##name, \ |
| 1385 |
TP_PROTO(__u32 lease_state, \ |
| 1386 |
__u32 tid, \ |
| 1387 |
__u64 sesid, \ |
| 1388 |
__u64 lease_key_low, \ |
| 1389 |
__u64 lease_key_high, \ |
| 1390 |
int rc), \ |
| 1391 |
TP_ARGS(lease_state, tid, sesid, lease_key_low, lease_key_high, rc)) |
| 1392 |
|
| 1393 |
DEFINE_SMB3_LEASE_ERR_EVENT(lease_ack_err); |
| 1394 |
|
| 1395 |
DECLARE_EVENT_CLASS(smb3_connect_class, |
| 1396 |
TP_PROTO(char *hostname, |
| 1397 |
__u64 conn_id, |
| 1398 |
const struct __kernel_sockaddr_storage *dst_addr), |
| 1399 |
TP_ARGS(hostname, conn_id, dst_addr), |
| 1400 |
TP_STRUCT__entry( |
| 1401 |
__string(hostname, hostname) |
| 1402 |
__field(__u64, conn_id) |
| 1403 |
__array(__u8, dst_addr, sizeof(struct sockaddr_storage)) |
| 1404 |
), |
| 1405 |
TP_fast_assign( |
| 1406 |
struct sockaddr_storage *pss = NULL; |
| 1407 |
|
| 1408 |
__entry->conn_id = conn_id; |
| 1409 |
pss = (struct sockaddr_storage *)__entry->dst_addr; |
| 1410 |
*pss = *dst_addr; |
| 1411 |
__assign_str(hostname); |
| 1412 |
), |
| 1413 |
TP_printk("conn_id=0x%llx server=%s addr=%pISpsfc", |
| 1414 |
__entry->conn_id, |
| 1415 |
__get_str(hostname), |
| 1416 |
__entry->dst_addr) |
| 1417 |
) |
| 1418 |
|
| 1419 |
#define DEFINE_SMB3_CONNECT_EVENT(name) \ |
| 1420 |
DEFINE_EVENT(smb3_connect_class, smb3_##name, \ |
| 1421 |
TP_PROTO(char *hostname, \ |
| 1422 |
__u64 conn_id, \ |
| 1423 |
const struct __kernel_sockaddr_storage *addr), \ |
| 1424 |
TP_ARGS(hostname, conn_id, addr)) |
| 1425 |
|
| 1426 |
DEFINE_SMB3_CONNECT_EVENT(connect_done); |
| 1427 |
DEFINE_SMB3_CONNECT_EVENT(smbd_connect_done); |
| 1428 |
DEFINE_SMB3_CONNECT_EVENT(smbd_connect_err); |
| 1429 |
|
| 1430 |
DECLARE_EVENT_CLASS(smb3_connect_err_class, |
| 1431 |
TP_PROTO(char *hostname, __u64 conn_id, |
| 1432 |
const struct __kernel_sockaddr_storage *dst_addr, int rc), |
| 1433 |
TP_ARGS(hostname, conn_id, dst_addr, rc), |
| 1434 |
TP_STRUCT__entry( |
| 1435 |
__string(hostname, hostname) |
| 1436 |
__field(__u64, conn_id) |
| 1437 |
__array(__u8, dst_addr, sizeof(struct sockaddr_storage)) |
| 1438 |
__field(int, rc) |
| 1439 |
), |
| 1440 |
TP_fast_assign( |
| 1441 |
struct sockaddr_storage *pss = NULL; |
| 1442 |
|
| 1443 |
__entry->conn_id = conn_id; |
| 1444 |
__entry->rc = rc; |
| 1445 |
pss = (struct sockaddr_storage *)__entry->dst_addr; |
| 1446 |
*pss = *dst_addr; |
| 1447 |
__assign_str(hostname); |
| 1448 |
), |
| 1449 |
TP_printk("rc=%d conn_id=0x%llx server=%s addr=%pISpsfc", |
| 1450 |
__entry->rc, |
| 1451 |
__entry->conn_id, |
| 1452 |
__get_str(hostname), |
| 1453 |
__entry->dst_addr) |
| 1454 |
) |
| 1455 |
|
| 1456 |
#define DEFINE_SMB3_CONNECT_ERR_EVENT(name) \ |
| 1457 |
DEFINE_EVENT(smb3_connect_err_class, smb3_##name, \ |
| 1458 |
TP_PROTO(char *hostname, \ |
| 1459 |
__u64 conn_id, \ |
| 1460 |
const struct __kernel_sockaddr_storage *addr, \ |
| 1461 |
int rc), \ |
| 1462 |
TP_ARGS(hostname, conn_id, addr, rc)) |
| 1463 |
|
| 1464 |
DEFINE_SMB3_CONNECT_ERR_EVENT(connect_err); |
| 1465 |
|
| 1466 |
DECLARE_EVENT_CLASS(smb3_sess_setup_err_class, |
| 1467 |
TP_PROTO(char *hostname, char *username, __u64 conn_id, |
| 1468 |
const struct __kernel_sockaddr_storage *dst_addr, int rc), |
| 1469 |
TP_ARGS(hostname, username, conn_id, dst_addr, rc), |
| 1470 |
TP_STRUCT__entry( |
| 1471 |
__string(hostname, hostname) |
| 1472 |
__string(username, username) |
| 1473 |
__field(__u64, conn_id) |
| 1474 |
__array(__u8, dst_addr, sizeof(struct sockaddr_storage)) |
| 1475 |
__field(int, rc) |
| 1476 |
), |
| 1477 |
TP_fast_assign( |
| 1478 |
struct sockaddr_storage *pss = NULL; |
| 1479 |
|
| 1480 |
__entry->conn_id = conn_id; |
| 1481 |
__entry->rc = rc; |
| 1482 |
pss = (struct sockaddr_storage *)__entry->dst_addr; |
| 1483 |
*pss = *dst_addr; |
| 1484 |
__assign_str(hostname); |
| 1485 |
__assign_str(username); |
| 1486 |
), |
| 1487 |
TP_printk("rc=%d user=%s conn_id=0x%llx server=%s addr=%pISpsfc", |
| 1488 |
__entry->rc, |
| 1489 |
__get_str(username), |
| 1490 |
__entry->conn_id, |
| 1491 |
__get_str(hostname), |
| 1492 |
__entry->dst_addr) |
| 1493 |
) |
| 1494 |
|
| 1495 |
#define DEFINE_SMB3_SES_SETUP_ERR_EVENT(name) \ |
| 1496 |
DEFINE_EVENT(smb3_sess_setup_err_class, smb3_##name, \ |
| 1497 |
TP_PROTO(char *hostname, \ |
| 1498 |
char *username, \ |
| 1499 |
__u64 conn_id, \ |
| 1500 |
const struct __kernel_sockaddr_storage *addr, \ |
| 1501 |
int rc), \ |
| 1502 |
TP_ARGS(hostname, username, conn_id, addr, rc)) |
| 1503 |
|
| 1504 |
DEFINE_SMB3_SES_SETUP_ERR_EVENT(key_expired); |
| 1505 |
|
| 1506 |
DECLARE_EVENT_CLASS(smb3_reconnect_class, |
| 1507 |
TP_PROTO(__u64 currmid, |
| 1508 |
__u64 conn_id, |
| 1509 |
char *hostname), |
| 1510 |
TP_ARGS(currmid, conn_id, hostname), |
| 1511 |
TP_STRUCT__entry( |
| 1512 |
__field(__u64, currmid) |
| 1513 |
__field(__u64, conn_id) |
| 1514 |
__string(hostname, hostname) |
| 1515 |
), |
| 1516 |
TP_fast_assign( |
| 1517 |
__entry->currmid = currmid; |
| 1518 |
__entry->conn_id = conn_id; |
| 1519 |
__assign_str(hostname); |
| 1520 |
), |
| 1521 |
TP_printk("conn_id=0x%llx server=%s current_mid=%llu", |
| 1522 |
__entry->conn_id, |
| 1523 |
__get_str(hostname), |
| 1524 |
__entry->currmid) |
| 1525 |
) |
| 1526 |
|
| 1527 |
#define DEFINE_SMB3_RECONNECT_EVENT(name) \ |
| 1528 |
DEFINE_EVENT(smb3_reconnect_class, smb3_##name, \ |
| 1529 |
TP_PROTO(__u64 currmid, \ |
| 1530 |
__u64 conn_id, \ |
| 1531 |
char *hostname), \ |
| 1532 |
TP_ARGS(currmid, conn_id, hostname)) |
| 1533 |
|
| 1534 |
DEFINE_SMB3_RECONNECT_EVENT(reconnect); |
| 1535 |
DEFINE_SMB3_RECONNECT_EVENT(partial_send_reconnect); |
| 1536 |
|
| 1537 |
DECLARE_EVENT_CLASS(smb3_ses_class, |
| 1538 |
TP_PROTO(__u64 sesid), |
| 1539 |
TP_ARGS(sesid), |
| 1540 |
TP_STRUCT__entry( |
| 1541 |
__field(__u64, sesid) |
| 1542 |
), |
| 1543 |
TP_fast_assign( |
| 1544 |
__entry->sesid = sesid; |
| 1545 |
), |
| 1546 |
TP_printk("sid=0x%llx", |
| 1547 |
__entry->sesid) |
| 1548 |
) |
| 1549 |
|
| 1550 |
#define DEFINE_SMB3_SES_EVENT(name) \ |
| 1551 |
DEFINE_EVENT(smb3_ses_class, smb3_##name, \ |
| 1552 |
TP_PROTO(__u64 sesid), \ |
| 1553 |
TP_ARGS(sesid)) |
| 1554 |
|
| 1555 |
DEFINE_SMB3_SES_EVENT(ses_not_found); |
| 1556 |
|
| 1557 |
DECLARE_EVENT_CLASS(smb3_ioctl_class, |
| 1558 |
TP_PROTO(unsigned int xid, |
| 1559 |
__u64 fid, |
| 1560 |
unsigned int command), |
| 1561 |
TP_ARGS(xid, fid, command), |
| 1562 |
TP_STRUCT__entry( |
| 1563 |
__field(unsigned int, xid) |
| 1564 |
__field(__u64, fid) |
| 1565 |
__field(unsigned int, command) |
| 1566 |
), |
| 1567 |
TP_fast_assign( |
| 1568 |
__entry->xid = xid; |
| 1569 |
__entry->fid = fid; |
| 1570 |
__entry->command = command; |
| 1571 |
), |
| 1572 |
TP_printk("xid=%u fid=0x%llx ioctl cmd=0x%x", |
| 1573 |
__entry->xid, __entry->fid, __entry->command) |
| 1574 |
) |
| 1575 |
|
| 1576 |
#define DEFINE_SMB3_IOCTL_EVENT(name) \ |
| 1577 |
DEFINE_EVENT(smb3_ioctl_class, smb3_##name, \ |
| 1578 |
TP_PROTO(unsigned int xid, \ |
| 1579 |
__u64 fid, \ |
| 1580 |
unsigned int command), \ |
| 1581 |
TP_ARGS(xid, fid, command)) |
| 1582 |
|
| 1583 |
DEFINE_SMB3_IOCTL_EVENT(ioctl); |
| 1584 |
DEFINE_SMB3_IOCTL_EVENT(unsupported_ioctl); |
| 1585 |
|
| 1586 |
DECLARE_EVENT_CLASS(smb3_shutdown_class, |
| 1587 |
TP_PROTO(__u32 flags, |
| 1588 |
__u32 tid), |
| 1589 |
TP_ARGS(flags, tid), |
| 1590 |
TP_STRUCT__entry( |
| 1591 |
__field(__u32, flags) |
| 1592 |
__field(__u32, tid) |
| 1593 |
), |
| 1594 |
TP_fast_assign( |
| 1595 |
__entry->flags = flags; |
| 1596 |
__entry->tid = tid; |
| 1597 |
), |
| 1598 |
TP_printk("flags=0x%x tid=0x%x", |
| 1599 |
__entry->flags, __entry->tid) |
| 1600 |
) |
| 1601 |
|
| 1602 |
#define DEFINE_SMB3_SHUTDOWN_EVENT(name) \ |
| 1603 |
DEFINE_EVENT(smb3_shutdown_class, smb3_##name, \ |
| 1604 |
TP_PROTO(__u32 flags, \ |
| 1605 |
__u32 tid), \ |
| 1606 |
TP_ARGS(flags, tid)) |
| 1607 |
|
| 1608 |
DEFINE_SMB3_SHUTDOWN_EVENT(shutdown_enter); |
| 1609 |
DEFINE_SMB3_SHUTDOWN_EVENT(shutdown_done); |
| 1610 |
|
| 1611 |
DECLARE_EVENT_CLASS(smb3_shutdown_err_class, |
| 1612 |
TP_PROTO(int rc, |
| 1613 |
__u32 flags, |
| 1614 |
__u32 tid), |
| 1615 |
TP_ARGS(rc, flags, tid), |
| 1616 |
TP_STRUCT__entry( |
| 1617 |
__field(int, rc) |
| 1618 |
__field(__u32, flags) |
| 1619 |
__field(__u32, tid) |
| 1620 |
), |
| 1621 |
TP_fast_assign( |
| 1622 |
__entry->rc = rc; |
| 1623 |
__entry->flags = flags; |
| 1624 |
__entry->tid = tid; |
| 1625 |
), |
| 1626 |
TP_printk("rc=%d flags=0x%x tid=0x%x", |
| 1627 |
__entry->rc, __entry->flags, __entry->tid) |
| 1628 |
) |
| 1629 |
|
| 1630 |
#define DEFINE_SMB3_SHUTDOWN_ERR_EVENT(name) \ |
| 1631 |
DEFINE_EVENT(smb3_shutdown_err_class, smb3_##name, \ |
| 1632 |
TP_PROTO(int rc, \ |
| 1633 |
__u32 flags, \ |
| 1634 |
__u32 tid), \ |
| 1635 |
TP_ARGS(rc, flags, tid)) |
| 1636 |
|
| 1637 |
DEFINE_SMB3_SHUTDOWN_ERR_EVENT(shutdown_err); |
| 1638 |
|
| 1639 |
DECLARE_EVENT_CLASS(smb3_credit_class, |
| 1640 |
TP_PROTO(__u64 currmid, |
| 1641 |
__u64 conn_id, |
| 1642 |
char *hostname, |
| 1643 |
int credits, |
| 1644 |
int credits_to_add, |
| 1645 |
int in_flight), |
| 1646 |
TP_ARGS(currmid, conn_id, hostname, credits, credits_to_add, in_flight), |
| 1647 |
TP_STRUCT__entry( |
| 1648 |
__field(__u64, currmid) |
| 1649 |
__field(__u64, conn_id) |
| 1650 |
__string(hostname, hostname) |
| 1651 |
__field(int, credits) |
| 1652 |
__field(int, credits_to_add) |
| 1653 |
__field(int, in_flight) |
| 1654 |
), |
| 1655 |
TP_fast_assign( |
| 1656 |
__entry->currmid = currmid; |
| 1657 |
__entry->conn_id = conn_id; |
| 1658 |
__assign_str(hostname); |
| 1659 |
__entry->credits = credits; |
| 1660 |
__entry->credits_to_add = credits_to_add; |
| 1661 |
__entry->in_flight = in_flight; |
| 1662 |
), |
| 1663 |
TP_printk("conn_id=0x%llx server=%s current_mid=%llu " |
| 1664 |
"credits=%d credit_change=%d in_flight=%d", |
| 1665 |
__entry->conn_id, |
| 1666 |
__get_str(hostname), |
| 1667 |
__entry->currmid, |
| 1668 |
__entry->credits, |
| 1669 |
__entry->credits_to_add, |
| 1670 |
__entry->in_flight) |
| 1671 |
) |
| 1672 |
|
| 1673 |
#define DEFINE_SMB3_CREDIT_EVENT(name) \ |
| 1674 |
DEFINE_EVENT(smb3_credit_class, smb3_##name, \ |
| 1675 |
TP_PROTO(__u64 currmid, \ |
| 1676 |
__u64 conn_id, \ |
| 1677 |
char *hostname, \ |
| 1678 |
int credits, \ |
| 1679 |
int credits_to_add, \ |
| 1680 |
int in_flight), \ |
| 1681 |
TP_ARGS(currmid, conn_id, hostname, credits, credits_to_add, in_flight)) |
| 1682 |
|
| 1683 |
DEFINE_SMB3_CREDIT_EVENT(reconnect_with_invalid_credits); |
| 1684 |
DEFINE_SMB3_CREDIT_EVENT(reconnect_detected); |
| 1685 |
DEFINE_SMB3_CREDIT_EVENT(credit_timeout); |
| 1686 |
DEFINE_SMB3_CREDIT_EVENT(insufficient_credits); |
| 1687 |
DEFINE_SMB3_CREDIT_EVENT(too_many_credits); |
| 1688 |
DEFINE_SMB3_CREDIT_EVENT(add_credits); |
| 1689 |
DEFINE_SMB3_CREDIT_EVENT(adj_credits); |
| 1690 |
DEFINE_SMB3_CREDIT_EVENT(hdr_credits); |
| 1691 |
DEFINE_SMB3_CREDIT_EVENT(nblk_credits); |
| 1692 |
DEFINE_SMB3_CREDIT_EVENT(pend_credits); |
| 1693 |
DEFINE_SMB3_CREDIT_EVENT(wait_credits); |
| 1694 |
DEFINE_SMB3_CREDIT_EVENT(waitff_credits); |
| 1695 |
DEFINE_SMB3_CREDIT_EVENT(overflow_credits); |
| 1696 |
DEFINE_SMB3_CREDIT_EVENT(set_credits); |
| 1697 |
|
| 1698 |
TRACE_EVENT(smb3_kerberos_auth, |
| 1699 |
TP_PROTO(struct TCP_Server_Info *server, |
| 1700 |
struct cifs_ses *ses, |
| 1701 |
int rc), |
| 1702 |
TP_ARGS(server, ses, rc), |
| 1703 |
TP_STRUCT__entry( |
| 1704 |
__field(pid_t, pid) |
| 1705 |
__field(uid_t, uid) |
| 1706 |
__field(uid_t, cruid) |
| 1707 |
__string(host, server->hostname) |
| 1708 |
__string(user, ses->user_name) |
| 1709 |
__array(__u8, addr, sizeof(struct sockaddr_storage)) |
| 1710 |
__array(char, sec, sizeof("ntlmsspi")) |
| 1711 |
__array(char, upcall_target, sizeof("mount")) |
| 1712 |
__field(int, rc) |
| 1713 |
), |
| 1714 |
TP_fast_assign( |
| 1715 |
__entry->pid = current->pid; |
| 1716 |
__entry->uid = from_kuid_munged(&init_user_ns, ses->linux_uid); |
| 1717 |
__entry->cruid = from_kuid_munged(&init_user_ns, ses->cred_uid); |
| 1718 |
__assign_str(host); |
| 1719 |
__assign_str(user); |
| 1720 |
memcpy(__entry->addr, &server->dstaddr, sizeof(__entry->addr)); |
| 1721 |
|
| 1722 |
if (server->sec_kerberos) |
| 1723 |
memcpy(__entry->sec, "krb5", sizeof("krb5")); |
| 1724 |
else if (server->sec_mskerberos) |
| 1725 |
memcpy(__entry->sec, "mskrb5", sizeof("mskrb5")); |
| 1726 |
else if (server->sec_iakerb) |
| 1727 |
memcpy(__entry->sec, "iakerb", sizeof("iakerb")); |
| 1728 |
else |
| 1729 |
memcpy(__entry->sec, "krb5", sizeof("krb5")); |
| 1730 |
|
| 1731 |
if (ses->upcall_target == UPTARGET_MOUNT) |
| 1732 |
memcpy(__entry->upcall_target, "mount", sizeof("mount")); |
| 1733 |
else |
| 1734 |
memcpy(__entry->upcall_target, "app", sizeof("app")); |
| 1735 |
__entry->rc = rc; |
| 1736 |
), |
| 1737 |
TP_printk("vers=%d host=%s ip=%pISpsfc sec=%s uid=%d cruid=%d user=%s pid=%d upcall_target=%s err=%d", |
| 1738 |
CIFS_SPNEGO_UPCALL_VERSION, __get_str(host), __entry->addr, |
| 1739 |
__entry->sec, __entry->uid, __entry->cruid, __get_str(user), |
| 1740 |
__entry->pid, __entry->upcall_target, __entry->rc)) |
| 1741 |
|
| 1742 |
TRACE_EVENT(smb3_tcon_ref, |
| 1743 |
TP_PROTO(unsigned int tcon_debug_id, int ref, |
| 1744 |
enum smb3_tcon_ref_trace trace), |
| 1745 |
TP_ARGS(tcon_debug_id, ref, trace), |
| 1746 |
TP_STRUCT__entry( |
| 1747 |
__field(unsigned int, tcon) |
| 1748 |
__field(int, ref) |
| 1749 |
__field(enum smb3_tcon_ref_trace, trace) |
| 1750 |
), |
| 1751 |
TP_fast_assign( |
| 1752 |
__entry->tcon = tcon_debug_id; |
| 1753 |
__entry->ref = ref; |
| 1754 |
__entry->trace = trace; |
| 1755 |
), |
| 1756 |
TP_printk("TC=%08x %s r=%u", |
| 1757 |
__entry->tcon, |
| 1758 |
__print_symbolic(__entry->trace, smb3_tcon_ref_traces), |
| 1759 |
__entry->ref) |
| 1760 |
); |
| 1761 |
|
| 1762 |
TRACE_EVENT(smb3_rw_credits, |
| 1763 |
TP_PROTO(unsigned int rreq_debug_id, |
| 1764 |
unsigned int subreq_debug_index, |
| 1765 |
unsigned int subreq_credits, |
| 1766 |
unsigned int server_credits, |
| 1767 |
int server_in_flight, |
| 1768 |
int credit_change, |
| 1769 |
enum smb3_rw_credits_trace trace), |
| 1770 |
TP_ARGS(rreq_debug_id, subreq_debug_index, subreq_credits, |
| 1771 |
server_credits, server_in_flight, credit_change, trace), |
| 1772 |
TP_STRUCT__entry( |
| 1773 |
__field(unsigned int, rreq_debug_id) |
| 1774 |
__field(unsigned int, subreq_debug_index) |
| 1775 |
__field(unsigned int, subreq_credits) |
| 1776 |
__field(unsigned int, server_credits) |
| 1777 |
__field(int, in_flight) |
| 1778 |
__field(int, credit_change) |
| 1779 |
__field(enum smb3_rw_credits_trace, trace) |
| 1780 |
), |
| 1781 |
TP_fast_assign( |
| 1782 |
__entry->rreq_debug_id = rreq_debug_id; |
| 1783 |
__entry->subreq_debug_index = subreq_debug_index; |
| 1784 |
__entry->subreq_credits = subreq_credits; |
| 1785 |
__entry->server_credits = server_credits; |
| 1786 |
__entry->in_flight = server_in_flight; |
| 1787 |
__entry->credit_change = credit_change; |
| 1788 |
__entry->trace = trace; |
| 1789 |
), |
| 1790 |
TP_printk("R=%08x[%x] %s cred=%u chg=%d pool=%u ifl=%d", |
| 1791 |
__entry->rreq_debug_id, __entry->subreq_debug_index, |
| 1792 |
__print_symbolic(__entry->trace, smb3_rw_credits_traces), |
| 1793 |
__entry->subreq_credits, __entry->credit_change, |
| 1794 |
__entry->server_credits, __entry->in_flight) |
| 1795 |
); |
| 1796 |
|
| 1797 |
TRACE_EVENT(smb3_eio, |
| 1798 |
TP_PROTO(enum smb_eio_trace trace, unsigned long info, unsigned long info2), |
| 1799 |
TP_ARGS(trace, info, info2), |
| 1800 |
TP_STRUCT__entry( |
| 1801 |
__field(enum smb_eio_trace, trace) |
| 1802 |
__field(unsigned long, info) |
| 1803 |
__field(unsigned long, info2) |
| 1804 |
), |
| 1805 |
TP_fast_assign( |
| 1806 |
__entry->trace = trace; |
| 1807 |
__entry->info = info; |
| 1808 |
__entry->info2 = info2; |
| 1809 |
), |
| 1810 |
TP_printk("%s info=%lx,%lx", |
| 1811 |
__print_symbolic(__entry->trace, smb_eio_traces), |
| 1812 |
__entry->info, __entry->info2) |
| 1813 |
); |
| 1814 |
|
| 1815 |
#undef EM |
| 1816 |
#undef E_ |
| 1817 |
#endif /* _CIFS_TRACE_H */ |
| 1818 |
|
| 1819 |
#undef TRACE_INCLUDE_PATH |
| 1820 |
#define TRACE_INCLUDE_PATH . |
| 1821 |
#define TRACE_INCLUDE_FILE trace |
| 1822 |
#include <trace/define_trace.h> |