Steve French | eccb442 | 2018-05-17 21:16:55 -0500 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
| 2 | /* |
| 3 | * Copyright (C) 2018, Microsoft Corporation. |
| 4 | * |
| 5 | * Author(s): Steve French <stfrench@microsoft.com> |
Steve French | eccb442 | 2018-05-17 21:16:55 -0500 | [diff] [blame] | 6 | */ |
| 7 | #undef TRACE_SYSTEM |
| 8 | #define TRACE_SYSTEM cifs |
| 9 | |
| 10 | #if !defined(_CIFS_TRACE_H) || defined(TRACE_HEADER_MULTI_READ) |
| 11 | #define _CIFS_TRACE_H |
| 12 | |
| 13 | #include <linux/tracepoint.h> |
Steve French | d7171cd | 2021-11-04 15:56:37 -0500 | [diff] [blame] | 14 | #include <linux/net.h> |
| 15 | #include <linux/inet.h> |
Steve French | eccb442 | 2018-05-17 21:16:55 -0500 | [diff] [blame] | 16 | |
Shyam Prasad N | eb06881 | 2021-05-21 06:35:52 +0000 | [diff] [blame] | 17 | /* |
| 18 | * Please use this 3-part article as a reference for writing new tracepoints: |
| 19 | * https://lwn.net/Articles/379903/ |
| 20 | */ |
| 21 | |
Steve French | eccb442 | 2018-05-17 21:16:55 -0500 | [diff] [blame] | 22 | /* For logging errors in read or write */ |
| 23 | DECLARE_EVENT_CLASS(smb3_rw_err_class, |
| 24 | TP_PROTO(unsigned int xid, |
| 25 | __u64 fid, |
| 26 | __u32 tid, |
| 27 | __u64 sesid, |
| 28 | __u64 offset, |
| 29 | __u32 len, |
| 30 | int rc), |
| 31 | TP_ARGS(xid, fid, tid, sesid, offset, len, rc), |
| 32 | TP_STRUCT__entry( |
| 33 | __field(unsigned int, xid) |
| 34 | __field(__u64, fid) |
| 35 | __field(__u32, tid) |
| 36 | __field(__u64, sesid) |
| 37 | __field(__u64, offset) |
| 38 | __field(__u32, len) |
| 39 | __field(int, rc) |
| 40 | ), |
| 41 | TP_fast_assign( |
| 42 | __entry->xid = xid; |
| 43 | __entry->fid = fid; |
| 44 | __entry->tid = tid; |
| 45 | __entry->sesid = sesid; |
| 46 | __entry->offset = offset; |
| 47 | __entry->len = len; |
| 48 | __entry->rc = rc; |
| 49 | ), |
Steve French | d683bcd | 2018-05-19 02:28:53 -0500 | [diff] [blame] | 50 | TP_printk("\txid=%u sid=0x%llx tid=0x%x fid=0x%llx offset=0x%llx len=0x%x rc=%d", |
| 51 | __entry->xid, __entry->sesid, __entry->tid, __entry->fid, |
Steve French | eccb442 | 2018-05-17 21:16:55 -0500 | [diff] [blame] | 52 | __entry->offset, __entry->len, __entry->rc) |
| 53 | ) |
| 54 | |
| 55 | #define DEFINE_SMB3_RW_ERR_EVENT(name) \ |
| 56 | DEFINE_EVENT(smb3_rw_err_class, smb3_##name, \ |
| 57 | TP_PROTO(unsigned int xid, \ |
| 58 | __u64 fid, \ |
| 59 | __u32 tid, \ |
| 60 | __u64 sesid, \ |
| 61 | __u64 offset, \ |
| 62 | __u32 len, \ |
| 63 | int rc), \ |
| 64 | TP_ARGS(xid, fid, tid, sesid, offset, len, rc)) |
| 65 | |
| 66 | DEFINE_SMB3_RW_ERR_EVENT(write_err); |
| 67 | DEFINE_SMB3_RW_ERR_EVENT(read_err); |
Steve French | adb3b4e | 2019-02-25 13:51:11 -0600 | [diff] [blame] | 68 | DEFINE_SMB3_RW_ERR_EVENT(query_dir_err); |
Steve French | 779ede0 | 2019-03-13 01:41:49 -0500 | [diff] [blame] | 69 | DEFINE_SMB3_RW_ERR_EVENT(zero_err); |
| 70 | DEFINE_SMB3_RW_ERR_EVENT(falloc_err); |
Steve French | eccb442 | 2018-05-17 21:16:55 -0500 | [diff] [blame] | 71 | |
| 72 | |
| 73 | /* For logging successful read or write */ |
| 74 | DECLARE_EVENT_CLASS(smb3_rw_done_class, |
| 75 | TP_PROTO(unsigned int xid, |
| 76 | __u64 fid, |
| 77 | __u32 tid, |
| 78 | __u64 sesid, |
| 79 | __u64 offset, |
| 80 | __u32 len), |
| 81 | TP_ARGS(xid, fid, tid, sesid, offset, len), |
| 82 | TP_STRUCT__entry( |
| 83 | __field(unsigned int, xid) |
| 84 | __field(__u64, fid) |
| 85 | __field(__u32, tid) |
| 86 | __field(__u64, sesid) |
| 87 | __field(__u64, offset) |
| 88 | __field(__u32, len) |
| 89 | ), |
| 90 | TP_fast_assign( |
| 91 | __entry->xid = xid; |
| 92 | __entry->fid = fid; |
| 93 | __entry->tid = tid; |
| 94 | __entry->sesid = sesid; |
| 95 | __entry->offset = offset; |
| 96 | __entry->len = len; |
| 97 | ), |
Steve French | d683bcd | 2018-05-19 02:28:53 -0500 | [diff] [blame] | 98 | TP_printk("xid=%u sid=0x%llx tid=0x%x fid=0x%llx offset=0x%llx len=0x%x", |
| 99 | __entry->xid, __entry->sesid, __entry->tid, __entry->fid, |
Steve French | eccb442 | 2018-05-17 21:16:55 -0500 | [diff] [blame] | 100 | __entry->offset, __entry->len) |
| 101 | ) |
| 102 | |
| 103 | #define DEFINE_SMB3_RW_DONE_EVENT(name) \ |
| 104 | DEFINE_EVENT(smb3_rw_done_class, smb3_##name, \ |
| 105 | TP_PROTO(unsigned int xid, \ |
| 106 | __u64 fid, \ |
| 107 | __u32 tid, \ |
| 108 | __u64 sesid, \ |
| 109 | __u64 offset, \ |
| 110 | __u32 len), \ |
| 111 | TP_ARGS(xid, fid, tid, sesid, offset, len)) |
| 112 | |
Steve French | d323c246 | 2019-02-25 00:52:43 -0600 | [diff] [blame] | 113 | DEFINE_SMB3_RW_DONE_EVENT(write_enter); |
| 114 | DEFINE_SMB3_RW_DONE_EVENT(read_enter); |
| 115 | DEFINE_SMB3_RW_DONE_EVENT(query_dir_enter); |
Steve French | 779ede0 | 2019-03-13 01:41:49 -0500 | [diff] [blame] | 116 | DEFINE_SMB3_RW_DONE_EVENT(zero_enter); |
| 117 | DEFINE_SMB3_RW_DONE_EVENT(falloc_enter); |
Steve French | eccb442 | 2018-05-17 21:16:55 -0500 | [diff] [blame] | 118 | DEFINE_SMB3_RW_DONE_EVENT(write_done); |
| 119 | DEFINE_SMB3_RW_DONE_EVENT(read_done); |
Steve French | adb3b4e | 2019-02-25 13:51:11 -0600 | [diff] [blame] | 120 | DEFINE_SMB3_RW_DONE_EVENT(query_dir_done); |
Steve French | 779ede0 | 2019-03-13 01:41:49 -0500 | [diff] [blame] | 121 | DEFINE_SMB3_RW_DONE_EVENT(zero_done); |
| 122 | DEFINE_SMB3_RW_DONE_EVENT(falloc_done); |
Steve French | eccb442 | 2018-05-17 21:16:55 -0500 | [diff] [blame] | 123 | |
Steve French | 7c05eae | 2022-06-15 22:40:23 -0500 | [diff] [blame] | 124 | /* For logging successful set EOF (truncate) */ |
| 125 | DECLARE_EVENT_CLASS(smb3_eof_class, |
| 126 | TP_PROTO(unsigned int xid, |
| 127 | __u64 fid, |
| 128 | __u32 tid, |
| 129 | __u64 sesid, |
| 130 | __u64 offset), |
| 131 | TP_ARGS(xid, fid, tid, sesid, offset), |
| 132 | TP_STRUCT__entry( |
| 133 | __field(unsigned int, xid) |
| 134 | __field(__u64, fid) |
| 135 | __field(__u32, tid) |
| 136 | __field(__u64, sesid) |
| 137 | __field(__u64, offset) |
| 138 | ), |
| 139 | TP_fast_assign( |
| 140 | __entry->xid = xid; |
| 141 | __entry->fid = fid; |
| 142 | __entry->tid = tid; |
| 143 | __entry->sesid = sesid; |
| 144 | __entry->offset = offset; |
| 145 | ), |
| 146 | TP_printk("xid=%u sid=0x%llx tid=0x%x fid=0x%llx offset=0x%llx", |
| 147 | __entry->xid, __entry->sesid, __entry->tid, __entry->fid, |
| 148 | __entry->offset) |
| 149 | ) |
| 150 | |
| 151 | #define DEFINE_SMB3_EOF_EVENT(name) \ |
| 152 | DEFINE_EVENT(smb3_eof_class, smb3_##name, \ |
| 153 | TP_PROTO(unsigned int xid, \ |
| 154 | __u64 fid, \ |
| 155 | __u32 tid, \ |
| 156 | __u64 sesid, \ |
| 157 | __u64 offset), \ |
| 158 | TP_ARGS(xid, fid, tid, sesid, offset)) |
| 159 | |
| 160 | DEFINE_SMB3_EOF_EVENT(set_eof); |
| 161 | |
Steve French | eccb442 | 2018-05-17 21:16:55 -0500 | [diff] [blame] | 162 | /* |
| 163 | * For handle based calls other than read and write, and get/set info |
| 164 | */ |
Steve French | f90f979 | 2019-09-03 18:35:42 -0500 | [diff] [blame] | 165 | DECLARE_EVENT_CLASS(smb3_fd_class, |
| 166 | TP_PROTO(unsigned int xid, |
| 167 | __u64 fid, |
| 168 | __u32 tid, |
| 169 | __u64 sesid), |
| 170 | TP_ARGS(xid, fid, tid, sesid), |
| 171 | TP_STRUCT__entry( |
| 172 | __field(unsigned int, xid) |
| 173 | __field(__u64, fid) |
| 174 | __field(__u32, tid) |
| 175 | __field(__u64, sesid) |
| 176 | ), |
| 177 | TP_fast_assign( |
| 178 | __entry->xid = xid; |
| 179 | __entry->fid = fid; |
| 180 | __entry->tid = tid; |
| 181 | __entry->sesid = sesid; |
| 182 | ), |
| 183 | TP_printk("\txid=%u sid=0x%llx tid=0x%x fid=0x%llx", |
| 184 | __entry->xid, __entry->sesid, __entry->tid, __entry->fid) |
| 185 | ) |
| 186 | |
| 187 | #define DEFINE_SMB3_FD_EVENT(name) \ |
| 188 | DEFINE_EVENT(smb3_fd_class, smb3_##name, \ |
| 189 | TP_PROTO(unsigned int xid, \ |
| 190 | __u64 fid, \ |
| 191 | __u32 tid, \ |
| 192 | __u64 sesid), \ |
| 193 | TP_ARGS(xid, fid, tid, sesid)) |
| 194 | |
| 195 | DEFINE_SMB3_FD_EVENT(flush_enter); |
| 196 | DEFINE_SMB3_FD_EVENT(flush_done); |
| 197 | DEFINE_SMB3_FD_EVENT(close_enter); |
| 198 | DEFINE_SMB3_FD_EVENT(close_done); |
Steve French | 35a2b53 | 2022-05-22 00:41:41 -0500 | [diff] [blame] | 199 | DEFINE_SMB3_FD_EVENT(oplock_not_found); |
Steve French | f90f979 | 2019-09-03 18:35:42 -0500 | [diff] [blame] | 200 | |
Steve French | eccb442 | 2018-05-17 21:16:55 -0500 | [diff] [blame] | 201 | DECLARE_EVENT_CLASS(smb3_fd_err_class, |
| 202 | TP_PROTO(unsigned int xid, |
| 203 | __u64 fid, |
| 204 | __u32 tid, |
| 205 | __u64 sesid, |
| 206 | int rc), |
| 207 | TP_ARGS(xid, fid, tid, sesid, rc), |
| 208 | TP_STRUCT__entry( |
| 209 | __field(unsigned int, xid) |
| 210 | __field(__u64, fid) |
| 211 | __field(__u32, tid) |
| 212 | __field(__u64, sesid) |
| 213 | __field(int, rc) |
| 214 | ), |
| 215 | TP_fast_assign( |
| 216 | __entry->xid = xid; |
| 217 | __entry->fid = fid; |
| 218 | __entry->tid = tid; |
| 219 | __entry->sesid = sesid; |
| 220 | __entry->rc = rc; |
| 221 | ), |
Steve French | d683bcd | 2018-05-19 02:28:53 -0500 | [diff] [blame] | 222 | TP_printk("\txid=%u sid=0x%llx tid=0x%x fid=0x%llx rc=%d", |
| 223 | __entry->xid, __entry->sesid, __entry->tid, __entry->fid, |
Steve French | eccb442 | 2018-05-17 21:16:55 -0500 | [diff] [blame] | 224 | __entry->rc) |
| 225 | ) |
| 226 | |
| 227 | #define DEFINE_SMB3_FD_ERR_EVENT(name) \ |
| 228 | DEFINE_EVENT(smb3_fd_err_class, smb3_##name, \ |
| 229 | TP_PROTO(unsigned int xid, \ |
| 230 | __u64 fid, \ |
| 231 | __u32 tid, \ |
| 232 | __u64 sesid, \ |
| 233 | int rc), \ |
| 234 | TP_ARGS(xid, fid, tid, sesid, rc)) |
| 235 | |
| 236 | DEFINE_SMB3_FD_ERR_EVENT(flush_err); |
| 237 | DEFINE_SMB3_FD_ERR_EVENT(lock_err); |
| 238 | DEFINE_SMB3_FD_ERR_EVENT(close_err); |
| 239 | |
| 240 | /* |
| 241 | * For handle based query/set info calls |
| 242 | */ |
Steve French | d42043a | 2019-02-26 21:58:30 -0600 | [diff] [blame] | 243 | DECLARE_EVENT_CLASS(smb3_inf_enter_class, |
| 244 | TP_PROTO(unsigned int xid, |
| 245 | __u64 fid, |
| 246 | __u32 tid, |
| 247 | __u64 sesid, |
| 248 | __u8 infclass, |
| 249 | __u32 type), |
| 250 | TP_ARGS(xid, fid, tid, sesid, infclass, type), |
| 251 | TP_STRUCT__entry( |
| 252 | __field(unsigned int, xid) |
| 253 | __field(__u64, fid) |
| 254 | __field(__u32, tid) |
| 255 | __field(__u64, sesid) |
| 256 | __field(__u8, infclass) |
| 257 | __field(__u32, type) |
| 258 | ), |
| 259 | TP_fast_assign( |
| 260 | __entry->xid = xid; |
| 261 | __entry->fid = fid; |
| 262 | __entry->tid = tid; |
| 263 | __entry->sesid = sesid; |
| 264 | __entry->infclass = infclass; |
| 265 | __entry->type = type; |
| 266 | ), |
| 267 | TP_printk("xid=%u sid=0x%llx tid=0x%x fid=0x%llx class=%u type=0x%x", |
| 268 | __entry->xid, __entry->sesid, __entry->tid, __entry->fid, |
| 269 | __entry->infclass, __entry->type) |
| 270 | ) |
| 271 | |
| 272 | #define DEFINE_SMB3_INF_ENTER_EVENT(name) \ |
| 273 | DEFINE_EVENT(smb3_inf_enter_class, smb3_##name, \ |
| 274 | TP_PROTO(unsigned int xid, \ |
| 275 | __u64 fid, \ |
| 276 | __u32 tid, \ |
| 277 | __u64 sesid, \ |
| 278 | __u8 infclass, \ |
| 279 | __u32 type), \ |
| 280 | TP_ARGS(xid, fid, tid, sesid, infclass, type)) |
| 281 | |
| 282 | DEFINE_SMB3_INF_ENTER_EVENT(query_info_enter); |
| 283 | DEFINE_SMB3_INF_ENTER_EVENT(query_info_done); |
Steve French | c349818 | 2019-09-15 22:38:52 -0500 | [diff] [blame] | 284 | DEFINE_SMB3_INF_ENTER_EVENT(notify_enter); |
| 285 | DEFINE_SMB3_INF_ENTER_EVENT(notify_done); |
Steve French | d42043a | 2019-02-26 21:58:30 -0600 | [diff] [blame] | 286 | |
Steve French | eccb442 | 2018-05-17 21:16:55 -0500 | [diff] [blame] | 287 | DECLARE_EVENT_CLASS(smb3_inf_err_class, |
| 288 | TP_PROTO(unsigned int xid, |
| 289 | __u64 fid, |
| 290 | __u32 tid, |
| 291 | __u64 sesid, |
| 292 | __u8 infclass, |
| 293 | __u32 type, |
| 294 | int rc), |
| 295 | TP_ARGS(xid, fid, tid, sesid, infclass, type, rc), |
| 296 | TP_STRUCT__entry( |
| 297 | __field(unsigned int, xid) |
| 298 | __field(__u64, fid) |
| 299 | __field(__u32, tid) |
| 300 | __field(__u64, sesid) |
| 301 | __field(__u8, infclass) |
| 302 | __field(__u32, type) |
| 303 | __field(int, rc) |
| 304 | ), |
| 305 | TP_fast_assign( |
| 306 | __entry->xid = xid; |
| 307 | __entry->fid = fid; |
| 308 | __entry->tid = tid; |
| 309 | __entry->sesid = sesid; |
| 310 | __entry->infclass = infclass; |
| 311 | __entry->type = type; |
| 312 | __entry->rc = rc; |
| 313 | ), |
Steve French | d683bcd | 2018-05-19 02:28:53 -0500 | [diff] [blame] | 314 | TP_printk("xid=%u sid=0x%llx tid=0x%x fid=0x%llx class=%u type=0x%x rc=%d", |
| 315 | __entry->xid, __entry->sesid, __entry->tid, __entry->fid, |
Steve French | eccb442 | 2018-05-17 21:16:55 -0500 | [diff] [blame] | 316 | __entry->infclass, __entry->type, __entry->rc) |
| 317 | ) |
| 318 | |
| 319 | #define DEFINE_SMB3_INF_ERR_EVENT(name) \ |
| 320 | DEFINE_EVENT(smb3_inf_err_class, smb3_##name, \ |
| 321 | TP_PROTO(unsigned int xid, \ |
| 322 | __u64 fid, \ |
| 323 | __u32 tid, \ |
| 324 | __u64 sesid, \ |
| 325 | __u8 infclass, \ |
| 326 | __u32 type, \ |
| 327 | int rc), \ |
| 328 | TP_ARGS(xid, fid, tid, sesid, infclass, type, rc)) |
| 329 | |
| 330 | DEFINE_SMB3_INF_ERR_EVENT(query_info_err); |
| 331 | DEFINE_SMB3_INF_ERR_EVENT(set_info_err); |
Steve French | c349818 | 2019-09-15 22:38:52 -0500 | [diff] [blame] | 332 | DEFINE_SMB3_INF_ERR_EVENT(notify_err); |
Steve French | eccb442 | 2018-05-17 21:16:55 -0500 | [diff] [blame] | 333 | DEFINE_SMB3_INF_ERR_EVENT(fsctl_err); |
| 334 | |
Steve French | 8191576 | 2019-03-13 00:02:47 -0500 | [diff] [blame] | 335 | DECLARE_EVENT_CLASS(smb3_inf_compound_enter_class, |
| 336 | TP_PROTO(unsigned int xid, |
| 337 | __u32 tid, |
| 338 | __u64 sesid, |
| 339 | const char *full_path), |
| 340 | TP_ARGS(xid, tid, sesid, full_path), |
| 341 | TP_STRUCT__entry( |
| 342 | __field(unsigned int, xid) |
| 343 | __field(__u32, tid) |
| 344 | __field(__u64, sesid) |
| 345 | __string(path, full_path) |
| 346 | ), |
| 347 | TP_fast_assign( |
| 348 | __entry->xid = xid; |
| 349 | __entry->tid = tid; |
| 350 | __entry->sesid = sesid; |
| 351 | __assign_str(path, full_path); |
| 352 | ), |
| 353 | TP_printk("xid=%u sid=0x%llx tid=0x%x path=%s", |
| 354 | __entry->xid, __entry->sesid, __entry->tid, |
| 355 | __get_str(path)) |
| 356 | ) |
| 357 | |
| 358 | #define DEFINE_SMB3_INF_COMPOUND_ENTER_EVENT(name) \ |
| 359 | DEFINE_EVENT(smb3_inf_compound_enter_class, smb3_##name, \ |
| 360 | TP_PROTO(unsigned int xid, \ |
| 361 | __u32 tid, \ |
| 362 | __u64 sesid, \ |
| 363 | const char *full_path), \ |
| 364 | TP_ARGS(xid, tid, sesid, full_path)) |
| 365 | |
| 366 | DEFINE_SMB3_INF_COMPOUND_ENTER_EVENT(query_info_compound_enter); |
Steve French | e4bd7c4 | 2020-06-11 23:02:33 -0500 | [diff] [blame] | 367 | DEFINE_SMB3_INF_COMPOUND_ENTER_EVENT(posix_query_info_compound_enter); |
Steve French | 8191576 | 2019-03-13 00:02:47 -0500 | [diff] [blame] | 368 | DEFINE_SMB3_INF_COMPOUND_ENTER_EVENT(hardlink_enter); |
| 369 | DEFINE_SMB3_INF_COMPOUND_ENTER_EVENT(rename_enter); |
| 370 | DEFINE_SMB3_INF_COMPOUND_ENTER_EVENT(rmdir_enter); |
| 371 | DEFINE_SMB3_INF_COMPOUND_ENTER_EVENT(set_eof_enter); |
| 372 | DEFINE_SMB3_INF_COMPOUND_ENTER_EVENT(set_info_compound_enter); |
| 373 | DEFINE_SMB3_INF_COMPOUND_ENTER_EVENT(delete_enter); |
| 374 | DEFINE_SMB3_INF_COMPOUND_ENTER_EVENT(mkdir_enter); |
Steve French | 68e1456 | 2022-09-21 14:05:53 -0500 | [diff] [blame] | 375 | DEFINE_SMB3_INF_COMPOUND_ENTER_EVENT(tdis_enter); |
Steve French | 8191576 | 2019-03-13 00:02:47 -0500 | [diff] [blame] | 376 | |
| 377 | |
| 378 | DECLARE_EVENT_CLASS(smb3_inf_compound_done_class, |
| 379 | TP_PROTO(unsigned int xid, |
| 380 | __u32 tid, |
| 381 | __u64 sesid), |
| 382 | TP_ARGS(xid, tid, sesid), |
| 383 | TP_STRUCT__entry( |
| 384 | __field(unsigned int, xid) |
| 385 | __field(__u32, tid) |
| 386 | __field(__u64, sesid) |
| 387 | ), |
| 388 | TP_fast_assign( |
| 389 | __entry->xid = xid; |
| 390 | __entry->tid = tid; |
| 391 | __entry->sesid = sesid; |
| 392 | ), |
| 393 | TP_printk("xid=%u sid=0x%llx tid=0x%x", |
| 394 | __entry->xid, __entry->sesid, __entry->tid) |
| 395 | ) |
| 396 | |
| 397 | #define DEFINE_SMB3_INF_COMPOUND_DONE_EVENT(name) \ |
| 398 | DEFINE_EVENT(smb3_inf_compound_done_class, smb3_##name, \ |
| 399 | TP_PROTO(unsigned int xid, \ |
| 400 | __u32 tid, \ |
| 401 | __u64 sesid), \ |
| 402 | TP_ARGS(xid, tid, sesid)) |
| 403 | |
| 404 | DEFINE_SMB3_INF_COMPOUND_DONE_EVENT(query_info_compound_done); |
Steve French | e4bd7c4 | 2020-06-11 23:02:33 -0500 | [diff] [blame] | 405 | DEFINE_SMB3_INF_COMPOUND_DONE_EVENT(posix_query_info_compound_done); |
Steve French | 8191576 | 2019-03-13 00:02:47 -0500 | [diff] [blame] | 406 | DEFINE_SMB3_INF_COMPOUND_DONE_EVENT(hardlink_done); |
| 407 | DEFINE_SMB3_INF_COMPOUND_DONE_EVENT(rename_done); |
| 408 | DEFINE_SMB3_INF_COMPOUND_DONE_EVENT(rmdir_done); |
| 409 | DEFINE_SMB3_INF_COMPOUND_DONE_EVENT(set_eof_done); |
| 410 | DEFINE_SMB3_INF_COMPOUND_DONE_EVENT(set_info_compound_done); |
| 411 | DEFINE_SMB3_INF_COMPOUND_DONE_EVENT(delete_done); |
| 412 | DEFINE_SMB3_INF_COMPOUND_DONE_EVENT(mkdir_done); |
Steve French | 68e1456 | 2022-09-21 14:05:53 -0500 | [diff] [blame] | 413 | DEFINE_SMB3_INF_COMPOUND_DONE_EVENT(tdis_done); |
Steve French | 8191576 | 2019-03-13 00:02:47 -0500 | [diff] [blame] | 414 | |
| 415 | |
| 416 | DECLARE_EVENT_CLASS(smb3_inf_compound_err_class, |
| 417 | TP_PROTO(unsigned int xid, |
| 418 | __u32 tid, |
| 419 | __u64 sesid, |
| 420 | int rc), |
| 421 | TP_ARGS(xid, tid, sesid, rc), |
| 422 | TP_STRUCT__entry( |
| 423 | __field(unsigned int, xid) |
| 424 | __field(__u32, tid) |
| 425 | __field(__u64, sesid) |
| 426 | __field(int, rc) |
| 427 | ), |
| 428 | TP_fast_assign( |
| 429 | __entry->xid = xid; |
| 430 | __entry->tid = tid; |
| 431 | __entry->sesid = sesid; |
| 432 | __entry->rc = rc; |
| 433 | ), |
| 434 | TP_printk("xid=%u sid=0x%llx tid=0x%x rc=%d", |
| 435 | __entry->xid, __entry->sesid, __entry->tid, |
| 436 | __entry->rc) |
| 437 | ) |
| 438 | |
| 439 | #define DEFINE_SMB3_INF_COMPOUND_ERR_EVENT(name) \ |
| 440 | DEFINE_EVENT(smb3_inf_compound_err_class, smb3_##name, \ |
| 441 | TP_PROTO(unsigned int xid, \ |
| 442 | __u32 tid, \ |
| 443 | __u64 sesid, \ |
| 444 | int rc), \ |
| 445 | TP_ARGS(xid, tid, sesid, rc)) |
| 446 | |
| 447 | DEFINE_SMB3_INF_COMPOUND_ERR_EVENT(query_info_compound_err); |
Steve French | e4bd7c4 | 2020-06-11 23:02:33 -0500 | [diff] [blame] | 448 | DEFINE_SMB3_INF_COMPOUND_ERR_EVENT(posix_query_info_compound_err); |
Steve French | 8191576 | 2019-03-13 00:02:47 -0500 | [diff] [blame] | 449 | DEFINE_SMB3_INF_COMPOUND_ERR_EVENT(hardlink_err); |
| 450 | DEFINE_SMB3_INF_COMPOUND_ERR_EVENT(rename_err); |
| 451 | DEFINE_SMB3_INF_COMPOUND_ERR_EVENT(rmdir_err); |
| 452 | DEFINE_SMB3_INF_COMPOUND_ERR_EVENT(set_eof_err); |
| 453 | DEFINE_SMB3_INF_COMPOUND_ERR_EVENT(set_info_compound_err); |
| 454 | DEFINE_SMB3_INF_COMPOUND_ERR_EVENT(mkdir_err); |
| 455 | DEFINE_SMB3_INF_COMPOUND_ERR_EVENT(delete_err); |
Steve French | 68e1456 | 2022-09-21 14:05:53 -0500 | [diff] [blame] | 456 | DEFINE_SMB3_INF_COMPOUND_ERR_EVENT(tdis_err); |
Steve French | 8191576 | 2019-03-13 00:02:47 -0500 | [diff] [blame] | 457 | |
Steve French | eccb442 | 2018-05-17 21:16:55 -0500 | [diff] [blame] | 458 | /* |
| 459 | * For logging SMB3 Status code and Command for responses which return errors |
| 460 | */ |
| 461 | DECLARE_EVENT_CLASS(smb3_cmd_err_class, |
Steve French | d683bcd | 2018-05-19 02:28:53 -0500 | [diff] [blame] | 462 | TP_PROTO(__u32 tid, |
Steve French | eccb442 | 2018-05-17 21:16:55 -0500 | [diff] [blame] | 463 | __u64 sesid, |
| 464 | __u16 cmd, |
| 465 | __u64 mid, |
| 466 | __u32 status, |
| 467 | int rc), |
Steve French | d683bcd | 2018-05-19 02:28:53 -0500 | [diff] [blame] | 468 | TP_ARGS(tid, sesid, cmd, mid, status, rc), |
Steve French | eccb442 | 2018-05-17 21:16:55 -0500 | [diff] [blame] | 469 | TP_STRUCT__entry( |
Steve French | eccb442 | 2018-05-17 21:16:55 -0500 | [diff] [blame] | 470 | __field(__u32, tid) |
| 471 | __field(__u64, sesid) |
| 472 | __field(__u16, cmd) |
| 473 | __field(__u64, mid) |
| 474 | __field(__u32, status) |
| 475 | __field(int, rc) |
| 476 | ), |
| 477 | TP_fast_assign( |
Steve French | eccb442 | 2018-05-17 21:16:55 -0500 | [diff] [blame] | 478 | __entry->tid = tid; |
| 479 | __entry->sesid = sesid; |
| 480 | __entry->cmd = cmd; |
| 481 | __entry->mid = mid; |
| 482 | __entry->status = status; |
| 483 | __entry->rc = rc; |
| 484 | ), |
Steve French | d683bcd | 2018-05-19 02:28:53 -0500 | [diff] [blame] | 485 | TP_printk("\tsid=0x%llx tid=0x%x cmd=%u mid=%llu status=0x%x rc=%d", |
| 486 | __entry->sesid, __entry->tid, __entry->cmd, __entry->mid, |
| 487 | __entry->status, __entry->rc) |
Steve French | eccb442 | 2018-05-17 21:16:55 -0500 | [diff] [blame] | 488 | ) |
| 489 | |
| 490 | #define DEFINE_SMB3_CMD_ERR_EVENT(name) \ |
| 491 | DEFINE_EVENT(smb3_cmd_err_class, smb3_##name, \ |
Steve French | d683bcd | 2018-05-19 02:28:53 -0500 | [diff] [blame] | 492 | TP_PROTO(__u32 tid, \ |
Steve French | eccb442 | 2018-05-17 21:16:55 -0500 | [diff] [blame] | 493 | __u64 sesid, \ |
| 494 | __u16 cmd, \ |
| 495 | __u64 mid, \ |
| 496 | __u32 status, \ |
| 497 | int rc), \ |
Steve French | d683bcd | 2018-05-19 02:28:53 -0500 | [diff] [blame] | 498 | TP_ARGS(tid, sesid, cmd, mid, status, rc)) |
Steve French | eccb442 | 2018-05-17 21:16:55 -0500 | [diff] [blame] | 499 | |
| 500 | DEFINE_SMB3_CMD_ERR_EVENT(cmd_err); |
| 501 | |
| 502 | DECLARE_EVENT_CLASS(smb3_cmd_done_class, |
Steve French | d683bcd | 2018-05-19 02:28:53 -0500 | [diff] [blame] | 503 | TP_PROTO(__u32 tid, |
Steve French | eccb442 | 2018-05-17 21:16:55 -0500 | [diff] [blame] | 504 | __u64 sesid, |
| 505 | __u16 cmd, |
| 506 | __u64 mid), |
Steve French | d683bcd | 2018-05-19 02:28:53 -0500 | [diff] [blame] | 507 | TP_ARGS(tid, sesid, cmd, mid), |
Steve French | eccb442 | 2018-05-17 21:16:55 -0500 | [diff] [blame] | 508 | TP_STRUCT__entry( |
Steve French | eccb442 | 2018-05-17 21:16:55 -0500 | [diff] [blame] | 509 | __field(__u32, tid) |
| 510 | __field(__u64, sesid) |
| 511 | __field(__u16, cmd) |
| 512 | __field(__u64, mid) |
| 513 | ), |
| 514 | TP_fast_assign( |
Steve French | eccb442 | 2018-05-17 21:16:55 -0500 | [diff] [blame] | 515 | __entry->tid = tid; |
| 516 | __entry->sesid = sesid; |
| 517 | __entry->cmd = cmd; |
| 518 | __entry->mid = mid; |
| 519 | ), |
Steve French | d683bcd | 2018-05-19 02:28:53 -0500 | [diff] [blame] | 520 | TP_printk("\tsid=0x%llx tid=0x%x cmd=%u mid=%llu", |
| 521 | __entry->sesid, __entry->tid, |
Steve French | eccb442 | 2018-05-17 21:16:55 -0500 | [diff] [blame] | 522 | __entry->cmd, __entry->mid) |
| 523 | ) |
| 524 | |
| 525 | #define DEFINE_SMB3_CMD_DONE_EVENT(name) \ |
| 526 | DEFINE_EVENT(smb3_cmd_done_class, smb3_##name, \ |
Steve French | d683bcd | 2018-05-19 02:28:53 -0500 | [diff] [blame] | 527 | TP_PROTO(__u32 tid, \ |
Steve French | eccb442 | 2018-05-17 21:16:55 -0500 | [diff] [blame] | 528 | __u64 sesid, \ |
| 529 | __u16 cmd, \ |
| 530 | __u64 mid), \ |
Steve French | d683bcd | 2018-05-19 02:28:53 -0500 | [diff] [blame] | 531 | TP_ARGS(tid, sesid, cmd, mid)) |
Steve French | eccb442 | 2018-05-17 21:16:55 -0500 | [diff] [blame] | 532 | |
Steve French | 53a3e0d | 2019-02-26 21:26:20 -0600 | [diff] [blame] | 533 | DEFINE_SMB3_CMD_DONE_EVENT(cmd_enter); |
Steve French | eccb442 | 2018-05-17 21:16:55 -0500 | [diff] [blame] | 534 | DEFINE_SMB3_CMD_DONE_EVENT(cmd_done); |
Steve French | e68a932 | 2018-07-30 14:23:58 -0500 | [diff] [blame] | 535 | DEFINE_SMB3_CMD_DONE_EVENT(ses_expired); |
Steve French | eccb442 | 2018-05-17 21:16:55 -0500 | [diff] [blame] | 536 | |
Steve French | 020eec5 | 2018-08-01 16:38:07 -0500 | [diff] [blame] | 537 | DECLARE_EVENT_CLASS(smb3_mid_class, |
| 538 | TP_PROTO(__u16 cmd, |
| 539 | __u64 mid, |
| 540 | __u32 pid, |
| 541 | unsigned long when_sent, |
| 542 | unsigned long when_received), |
| 543 | TP_ARGS(cmd, mid, pid, when_sent, when_received), |
| 544 | TP_STRUCT__entry( |
| 545 | __field(__u16, cmd) |
| 546 | __field(__u64, mid) |
| 547 | __field(__u32, pid) |
| 548 | __field(unsigned long, when_sent) |
| 549 | __field(unsigned long, when_received) |
| 550 | ), |
| 551 | TP_fast_assign( |
| 552 | __entry->cmd = cmd; |
| 553 | __entry->mid = mid; |
| 554 | __entry->pid = pid; |
| 555 | __entry->when_sent = when_sent; |
| 556 | __entry->when_received = when_received; |
| 557 | ), |
| 558 | TP_printk("\tcmd=%u mid=%llu pid=%u, when_sent=%lu when_rcv=%lu", |
| 559 | __entry->cmd, __entry->mid, __entry->pid, __entry->when_sent, |
| 560 | __entry->when_received) |
| 561 | ) |
| 562 | |
| 563 | #define DEFINE_SMB3_MID_EVENT(name) \ |
| 564 | DEFINE_EVENT(smb3_mid_class, smb3_##name, \ |
| 565 | TP_PROTO(__u16 cmd, \ |
| 566 | __u64 mid, \ |
| 567 | __u32 pid, \ |
| 568 | unsigned long when_sent, \ |
| 569 | unsigned long when_received), \ |
| 570 | TP_ARGS(cmd, mid, pid, when_sent, when_received)) |
| 571 | |
| 572 | DEFINE_SMB3_MID_EVENT(slow_rsp); |
| 573 | |
Steve French | d683bcd | 2018-05-19 02:28:53 -0500 | [diff] [blame] | 574 | DECLARE_EVENT_CLASS(smb3_exit_err_class, |
| 575 | TP_PROTO(unsigned int xid, |
| 576 | const char *func_name, |
| 577 | int rc), |
| 578 | TP_ARGS(xid, func_name, rc), |
| 579 | TP_STRUCT__entry( |
| 580 | __field(unsigned int, xid) |
Shyam Prasad N | eb06881 | 2021-05-21 06:35:52 +0000 | [diff] [blame] | 581 | __string(func_name, func_name) |
Steve French | d683bcd | 2018-05-19 02:28:53 -0500 | [diff] [blame] | 582 | __field(int, rc) |
| 583 | ), |
| 584 | TP_fast_assign( |
| 585 | __entry->xid = xid; |
Shyam Prasad N | eb06881 | 2021-05-21 06:35:52 +0000 | [diff] [blame] | 586 | __assign_str(func_name, func_name); |
Steve French | d683bcd | 2018-05-19 02:28:53 -0500 | [diff] [blame] | 587 | __entry->rc = rc; |
| 588 | ), |
| 589 | TP_printk("\t%s: xid=%u rc=%d", |
Shyam Prasad N | eb06881 | 2021-05-21 06:35:52 +0000 | [diff] [blame] | 590 | __get_str(func_name), __entry->xid, __entry->rc) |
Steve French | d683bcd | 2018-05-19 02:28:53 -0500 | [diff] [blame] | 591 | ) |
| 592 | |
| 593 | #define DEFINE_SMB3_EXIT_ERR_EVENT(name) \ |
| 594 | DEFINE_EVENT(smb3_exit_err_class, smb3_##name, \ |
| 595 | TP_PROTO(unsigned int xid, \ |
| 596 | const char *func_name, \ |
| 597 | int rc), \ |
| 598 | TP_ARGS(xid, func_name, rc)) |
| 599 | |
| 600 | DEFINE_SMB3_EXIT_ERR_EVENT(exit_err); |
| 601 | |
Steve French | f2bf09e | 2020-02-05 18:22:37 -0600 | [diff] [blame] | 602 | |
| 603 | DECLARE_EVENT_CLASS(smb3_sync_err_class, |
| 604 | TP_PROTO(unsigned long ino, |
| 605 | int rc), |
| 606 | TP_ARGS(ino, rc), |
| 607 | TP_STRUCT__entry( |
| 608 | __field(unsigned long, ino) |
| 609 | __field(int, rc) |
| 610 | ), |
| 611 | TP_fast_assign( |
| 612 | __entry->ino = ino; |
| 613 | __entry->rc = rc; |
| 614 | ), |
| 615 | TP_printk("\tino=%lu rc=%d", |
| 616 | __entry->ino, __entry->rc) |
| 617 | ) |
| 618 | |
| 619 | #define DEFINE_SMB3_SYNC_ERR_EVENT(name) \ |
| 620 | DEFINE_EVENT(smb3_sync_err_class, cifs_##name, \ |
| 621 | TP_PROTO(unsigned long ino, \ |
| 622 | int rc), \ |
| 623 | TP_ARGS(ino, rc)) |
| 624 | |
| 625 | DEFINE_SMB3_SYNC_ERR_EVENT(fsync_err); |
| 626 | DEFINE_SMB3_SYNC_ERR_EVENT(flush_err); |
| 627 | |
| 628 | |
Steve French | d683bcd | 2018-05-19 02:28:53 -0500 | [diff] [blame] | 629 | DECLARE_EVENT_CLASS(smb3_enter_exit_class, |
| 630 | TP_PROTO(unsigned int xid, |
| 631 | const char *func_name), |
| 632 | TP_ARGS(xid, func_name), |
| 633 | TP_STRUCT__entry( |
| 634 | __field(unsigned int, xid) |
Shyam Prasad N | eb06881 | 2021-05-21 06:35:52 +0000 | [diff] [blame] | 635 | __string(func_name, func_name) |
Steve French | d683bcd | 2018-05-19 02:28:53 -0500 | [diff] [blame] | 636 | ), |
| 637 | TP_fast_assign( |
| 638 | __entry->xid = xid; |
Shyam Prasad N | eb06881 | 2021-05-21 06:35:52 +0000 | [diff] [blame] | 639 | __assign_str(func_name, func_name); |
Steve French | d683bcd | 2018-05-19 02:28:53 -0500 | [diff] [blame] | 640 | ), |
| 641 | TP_printk("\t%s: xid=%u", |
Shyam Prasad N | eb06881 | 2021-05-21 06:35:52 +0000 | [diff] [blame] | 642 | __get_str(func_name), __entry->xid) |
Steve French | d683bcd | 2018-05-19 02:28:53 -0500 | [diff] [blame] | 643 | ) |
| 644 | |
| 645 | #define DEFINE_SMB3_ENTER_EXIT_EVENT(name) \ |
| 646 | DEFINE_EVENT(smb3_enter_exit_class, smb3_##name, \ |
| 647 | TP_PROTO(unsigned int xid, \ |
| 648 | const char *func_name), \ |
| 649 | TP_ARGS(xid, func_name)) |
| 650 | |
| 651 | DEFINE_SMB3_ENTER_EXIT_EVENT(enter); |
| 652 | DEFINE_SMB3_ENTER_EXIT_EVENT(exit_done); |
| 653 | |
Steve French | 28d5936 | 2018-05-30 21:42:34 -0500 | [diff] [blame] | 654 | /* |
Steve French | f8af49d | 2018-10-28 00:47:11 -0500 | [diff] [blame] | 655 | * For SMB2/SMB3 tree connect |
| 656 | */ |
| 657 | |
| 658 | DECLARE_EVENT_CLASS(smb3_tcon_class, |
| 659 | TP_PROTO(unsigned int xid, |
| 660 | __u32 tid, |
| 661 | __u64 sesid, |
| 662 | const char *unc_name, |
| 663 | int rc), |
| 664 | TP_ARGS(xid, tid, sesid, unc_name, rc), |
| 665 | TP_STRUCT__entry( |
| 666 | __field(unsigned int, xid) |
| 667 | __field(__u32, tid) |
| 668 | __field(__u64, sesid) |
Paulo Alcantara (SUSE) | 68ddb49 | 2019-03-21 19:31:22 -0300 | [diff] [blame] | 669 | __string(name, unc_name) |
Steve French | f8af49d | 2018-10-28 00:47:11 -0500 | [diff] [blame] | 670 | __field(int, rc) |
| 671 | ), |
| 672 | TP_fast_assign( |
| 673 | __entry->xid = xid; |
| 674 | __entry->tid = tid; |
| 675 | __entry->sesid = sesid; |
Paulo Alcantara (SUSE) | 68ddb49 | 2019-03-21 19:31:22 -0300 | [diff] [blame] | 676 | __assign_str(name, unc_name); |
Steve French | f8af49d | 2018-10-28 00:47:11 -0500 | [diff] [blame] | 677 | __entry->rc = rc; |
| 678 | ), |
| 679 | TP_printk("xid=%u sid=0x%llx tid=0x%x unc_name=%s rc=%d", |
| 680 | __entry->xid, __entry->sesid, __entry->tid, |
Paulo Alcantara (SUSE) | 68ddb49 | 2019-03-21 19:31:22 -0300 | [diff] [blame] | 681 | __get_str(name), __entry->rc) |
Steve French | f8af49d | 2018-10-28 00:47:11 -0500 | [diff] [blame] | 682 | ) |
| 683 | |
| 684 | #define DEFINE_SMB3_TCON_EVENT(name) \ |
| 685 | DEFINE_EVENT(smb3_tcon_class, smb3_##name, \ |
| 686 | TP_PROTO(unsigned int xid, \ |
| 687 | __u32 tid, \ |
| 688 | __u64 sesid, \ |
| 689 | const char *unc_name, \ |
| 690 | int rc), \ |
| 691 | TP_ARGS(xid, tid, sesid, unc_name, rc)) |
| 692 | |
| 693 | DEFINE_SMB3_TCON_EVENT(tcon); |
| 694 | |
| 695 | |
| 696 | /* |
Steve French | efe2e9f | 2019-02-26 19:08:12 -0600 | [diff] [blame] | 697 | * For smb2/smb3 open (including create and mkdir) calls |
Steve French | 28d5936 | 2018-05-30 21:42:34 -0500 | [diff] [blame] | 698 | */ |
Steve French | efe2e9f | 2019-02-26 19:08:12 -0600 | [diff] [blame] | 699 | |
| 700 | DECLARE_EVENT_CLASS(smb3_open_enter_class, |
| 701 | TP_PROTO(unsigned int xid, |
| 702 | __u32 tid, |
| 703 | __u64 sesid, |
Shyam Prasad N | fddc6cc | 2023-03-17 12:51:17 +0000 | [diff] [blame] | 704 | const char *full_path, |
Steve French | efe2e9f | 2019-02-26 19:08:12 -0600 | [diff] [blame] | 705 | int create_options, |
| 706 | int desired_access), |
Shyam Prasad N | fddc6cc | 2023-03-17 12:51:17 +0000 | [diff] [blame] | 707 | TP_ARGS(xid, tid, sesid, full_path, create_options, desired_access), |
Steve French | efe2e9f | 2019-02-26 19:08:12 -0600 | [diff] [blame] | 708 | TP_STRUCT__entry( |
| 709 | __field(unsigned int, xid) |
| 710 | __field(__u32, tid) |
| 711 | __field(__u64, sesid) |
Shyam Prasad N | fddc6cc | 2023-03-17 12:51:17 +0000 | [diff] [blame] | 712 | __string(path, full_path) |
Steve French | efe2e9f | 2019-02-26 19:08:12 -0600 | [diff] [blame] | 713 | __field(int, create_options) |
| 714 | __field(int, desired_access) |
| 715 | ), |
| 716 | TP_fast_assign( |
| 717 | __entry->xid = xid; |
| 718 | __entry->tid = tid; |
| 719 | __entry->sesid = sesid; |
Shyam Prasad N | fddc6cc | 2023-03-17 12:51:17 +0000 | [diff] [blame] | 720 | __assign_str(path, full_path); |
Steve French | efe2e9f | 2019-02-26 19:08:12 -0600 | [diff] [blame] | 721 | __entry->create_options = create_options; |
| 722 | __entry->desired_access = desired_access; |
| 723 | ), |
Shyam Prasad N | fddc6cc | 2023-03-17 12:51:17 +0000 | [diff] [blame] | 724 | TP_printk("xid=%u sid=0x%llx tid=0x%x path=%s cr_opts=0x%x des_access=0x%x", |
| 725 | __entry->xid, __entry->sesid, __entry->tid, __get_str(path), |
Steve French | efe2e9f | 2019-02-26 19:08:12 -0600 | [diff] [blame] | 726 | __entry->create_options, __entry->desired_access) |
| 727 | ) |
| 728 | |
| 729 | #define DEFINE_SMB3_OPEN_ENTER_EVENT(name) \ |
| 730 | DEFINE_EVENT(smb3_open_enter_class, smb3_##name, \ |
| 731 | TP_PROTO(unsigned int xid, \ |
| 732 | __u32 tid, \ |
| 733 | __u64 sesid, \ |
Shyam Prasad N | fddc6cc | 2023-03-17 12:51:17 +0000 | [diff] [blame] | 734 | const char *full_path, \ |
Steve French | efe2e9f | 2019-02-26 19:08:12 -0600 | [diff] [blame] | 735 | int create_options, \ |
| 736 | int desired_access), \ |
Shyam Prasad N | fddc6cc | 2023-03-17 12:51:17 +0000 | [diff] [blame] | 737 | TP_ARGS(xid, tid, sesid, full_path, create_options, desired_access)) |
Steve French | efe2e9f | 2019-02-26 19:08:12 -0600 | [diff] [blame] | 738 | |
| 739 | DEFINE_SMB3_OPEN_ENTER_EVENT(open_enter); |
| 740 | DEFINE_SMB3_OPEN_ENTER_EVENT(posix_mkdir_enter); |
| 741 | |
Steve French | 28d5936 | 2018-05-30 21:42:34 -0500 | [diff] [blame] | 742 | DECLARE_EVENT_CLASS(smb3_open_err_class, |
| 743 | TP_PROTO(unsigned int xid, |
| 744 | __u32 tid, |
| 745 | __u64 sesid, |
| 746 | int create_options, |
| 747 | int desired_access, |
| 748 | int rc), |
| 749 | TP_ARGS(xid, tid, sesid, create_options, desired_access, rc), |
| 750 | TP_STRUCT__entry( |
| 751 | __field(unsigned int, xid) |
| 752 | __field(__u32, tid) |
| 753 | __field(__u64, sesid) |
| 754 | __field(int, create_options) |
| 755 | __field(int, desired_access) |
| 756 | __field(int, rc) |
| 757 | ), |
| 758 | TP_fast_assign( |
| 759 | __entry->xid = xid; |
| 760 | __entry->tid = tid; |
| 761 | __entry->sesid = sesid; |
| 762 | __entry->create_options = create_options; |
| 763 | __entry->desired_access = desired_access; |
| 764 | __entry->rc = rc; |
| 765 | ), |
| 766 | TP_printk("xid=%u sid=0x%llx tid=0x%x cr_opts=0x%x des_access=0x%x rc=%d", |
| 767 | __entry->xid, __entry->sesid, __entry->tid, |
| 768 | __entry->create_options, __entry->desired_access, __entry->rc) |
| 769 | ) |
| 770 | |
| 771 | #define DEFINE_SMB3_OPEN_ERR_EVENT(name) \ |
| 772 | DEFINE_EVENT(smb3_open_err_class, smb3_##name, \ |
| 773 | TP_PROTO(unsigned int xid, \ |
| 774 | __u32 tid, \ |
| 775 | __u64 sesid, \ |
| 776 | int create_options, \ |
| 777 | int desired_access, \ |
| 778 | int rc), \ |
| 779 | TP_ARGS(xid, tid, sesid, create_options, desired_access, rc)) |
| 780 | |
| 781 | DEFINE_SMB3_OPEN_ERR_EVENT(open_err); |
Steve French | bea851b | 2018-06-14 21:56:32 -0500 | [diff] [blame] | 782 | DEFINE_SMB3_OPEN_ERR_EVENT(posix_mkdir_err); |
Steve French | 28d5936 | 2018-05-30 21:42:34 -0500 | [diff] [blame] | 783 | |
| 784 | DECLARE_EVENT_CLASS(smb3_open_done_class, |
| 785 | TP_PROTO(unsigned int xid, |
| 786 | __u64 fid, |
| 787 | __u32 tid, |
| 788 | __u64 sesid, |
| 789 | int create_options, |
| 790 | int desired_access), |
| 791 | TP_ARGS(xid, fid, tid, sesid, create_options, desired_access), |
| 792 | TP_STRUCT__entry( |
| 793 | __field(unsigned int, xid) |
| 794 | __field(__u64, fid) |
| 795 | __field(__u32, tid) |
| 796 | __field(__u64, sesid) |
| 797 | __field(int, create_options) |
| 798 | __field(int, desired_access) |
| 799 | ), |
| 800 | TP_fast_assign( |
| 801 | __entry->xid = xid; |
| 802 | __entry->fid = fid; |
| 803 | __entry->tid = tid; |
| 804 | __entry->sesid = sesid; |
| 805 | __entry->create_options = create_options; |
| 806 | __entry->desired_access = desired_access; |
| 807 | ), |
| 808 | TP_printk("xid=%u sid=0x%llx tid=0x%x fid=0x%llx cr_opts=0x%x des_access=0x%x", |
| 809 | __entry->xid, __entry->sesid, __entry->tid, __entry->fid, |
| 810 | __entry->create_options, __entry->desired_access) |
| 811 | ) |
| 812 | |
| 813 | #define DEFINE_SMB3_OPEN_DONE_EVENT(name) \ |
| 814 | DEFINE_EVENT(smb3_open_done_class, smb3_##name, \ |
| 815 | TP_PROTO(unsigned int xid, \ |
| 816 | __u64 fid, \ |
| 817 | __u32 tid, \ |
| 818 | __u64 sesid, \ |
| 819 | int create_options, \ |
| 820 | int desired_access), \ |
| 821 | TP_ARGS(xid, fid, tid, sesid, create_options, desired_access)) |
| 822 | |
| 823 | DEFINE_SMB3_OPEN_DONE_EVENT(open_done); |
Steve French | bea851b | 2018-06-14 21:56:32 -0500 | [diff] [blame] | 824 | DEFINE_SMB3_OPEN_DONE_EVENT(posix_mkdir_done); |
Steve French | 28d5936 | 2018-05-30 21:42:34 -0500 | [diff] [blame] | 825 | |
Steve French | 179e44d | 2018-09-28 19:44:23 -0500 | [diff] [blame] | 826 | |
| 827 | DECLARE_EVENT_CLASS(smb3_lease_done_class, |
| 828 | TP_PROTO(__u32 lease_state, |
| 829 | __u32 tid, |
| 830 | __u64 sesid, |
| 831 | __u64 lease_key_low, |
| 832 | __u64 lease_key_high), |
| 833 | TP_ARGS(lease_state, tid, sesid, lease_key_low, lease_key_high), |
| 834 | TP_STRUCT__entry( |
| 835 | __field(__u32, lease_state) |
| 836 | __field(__u32, tid) |
| 837 | __field(__u64, sesid) |
| 838 | __field(__u64, lease_key_low) |
| 839 | __field(__u64, lease_key_high) |
| 840 | ), |
| 841 | TP_fast_assign( |
| 842 | __entry->lease_state = lease_state; |
| 843 | __entry->tid = tid; |
| 844 | __entry->sesid = sesid; |
| 845 | __entry->lease_key_low = lease_key_low; |
| 846 | __entry->lease_key_high = lease_key_high; |
| 847 | ), |
| 848 | TP_printk("sid=0x%llx tid=0x%x lease_key=0x%llx%llx lease_state=0x%x", |
| 849 | __entry->sesid, __entry->tid, __entry->lease_key_high, |
| 850 | __entry->lease_key_low, __entry->lease_state) |
| 851 | ) |
| 852 | |
| 853 | #define DEFINE_SMB3_LEASE_DONE_EVENT(name) \ |
| 854 | DEFINE_EVENT(smb3_lease_done_class, smb3_##name, \ |
| 855 | TP_PROTO(__u32 lease_state, \ |
| 856 | __u32 tid, \ |
| 857 | __u64 sesid, \ |
| 858 | __u64 lease_key_low, \ |
| 859 | __u64 lease_key_high), \ |
| 860 | TP_ARGS(lease_state, tid, sesid, lease_key_low, lease_key_high)) |
| 861 | |
| 862 | DEFINE_SMB3_LEASE_DONE_EVENT(lease_done); |
Steve French | fb253d5 | 2022-05-21 23:56:16 -0500 | [diff] [blame] | 863 | DEFINE_SMB3_LEASE_DONE_EVENT(lease_not_found); |
Steve French | 179e44d | 2018-09-28 19:44:23 -0500 | [diff] [blame] | 864 | |
| 865 | DECLARE_EVENT_CLASS(smb3_lease_err_class, |
| 866 | TP_PROTO(__u32 lease_state, |
| 867 | __u32 tid, |
| 868 | __u64 sesid, |
| 869 | __u64 lease_key_low, |
| 870 | __u64 lease_key_high, |
| 871 | int rc), |
| 872 | TP_ARGS(lease_state, tid, sesid, lease_key_low, lease_key_high, rc), |
| 873 | TP_STRUCT__entry( |
| 874 | __field(__u32, lease_state) |
| 875 | __field(__u32, tid) |
| 876 | __field(__u64, sesid) |
| 877 | __field(__u64, lease_key_low) |
| 878 | __field(__u64, lease_key_high) |
| 879 | __field(int, rc) |
| 880 | ), |
| 881 | TP_fast_assign( |
| 882 | __entry->lease_state = lease_state; |
| 883 | __entry->tid = tid; |
| 884 | __entry->sesid = sesid; |
| 885 | __entry->lease_key_low = lease_key_low; |
| 886 | __entry->lease_key_high = lease_key_high; |
| 887 | __entry->rc = rc; |
| 888 | ), |
| 889 | TP_printk("sid=0x%llx tid=0x%x lease_key=0x%llx%llx lease_state=0x%x rc=%d", |
| 890 | __entry->sesid, __entry->tid, __entry->lease_key_high, |
| 891 | __entry->lease_key_low, __entry->lease_state, __entry->rc) |
| 892 | ) |
| 893 | |
| 894 | #define DEFINE_SMB3_LEASE_ERR_EVENT(name) \ |
| 895 | DEFINE_EVENT(smb3_lease_err_class, smb3_##name, \ |
| 896 | TP_PROTO(__u32 lease_state, \ |
| 897 | __u32 tid, \ |
| 898 | __u64 sesid, \ |
| 899 | __u64 lease_key_low, \ |
| 900 | __u64 lease_key_high, \ |
| 901 | int rc), \ |
| 902 | TP_ARGS(lease_state, tid, sesid, lease_key_low, lease_key_high, rc)) |
| 903 | |
| 904 | DEFINE_SMB3_LEASE_ERR_EVENT(lease_err); |
| 905 | |
Steve French | d7171cd | 2021-11-04 15:56:37 -0500 | [diff] [blame] | 906 | DECLARE_EVENT_CLASS(smb3_connect_class, |
| 907 | TP_PROTO(char *hostname, |
| 908 | __u64 conn_id, |
| 909 | const struct __kernel_sockaddr_storage *dst_addr), |
| 910 | TP_ARGS(hostname, conn_id, dst_addr), |
| 911 | TP_STRUCT__entry( |
| 912 | __string(hostname, hostname) |
| 913 | __field(__u64, conn_id) |
| 914 | __array(__u8, dst_addr, sizeof(struct sockaddr_storage)) |
| 915 | ), |
| 916 | TP_fast_assign( |
| 917 | struct sockaddr_storage *pss = NULL; |
| 918 | |
| 919 | __entry->conn_id = conn_id; |
| 920 | pss = (struct sockaddr_storage *)__entry->dst_addr; |
| 921 | *pss = *dst_addr; |
| 922 | __assign_str(hostname, hostname); |
| 923 | ), |
| 924 | TP_printk("conn_id=0x%llx server=%s addr=%pISpsfc", |
| 925 | __entry->conn_id, |
| 926 | __get_str(hostname), |
| 927 | __entry->dst_addr) |
| 928 | ) |
| 929 | |
| 930 | #define DEFINE_SMB3_CONNECT_EVENT(name) \ |
| 931 | DEFINE_EVENT(smb3_connect_class, smb3_##name, \ |
| 932 | TP_PROTO(char *hostname, \ |
| 933 | __u64 conn_id, \ |
| 934 | const struct __kernel_sockaddr_storage *addr), \ |
| 935 | TP_ARGS(hostname, conn_id, addr)) |
| 936 | |
| 937 | DEFINE_SMB3_CONNECT_EVENT(connect_done); |
| 938 | |
| 939 | DECLARE_EVENT_CLASS(smb3_connect_err_class, |
| 940 | TP_PROTO(char *hostname, __u64 conn_id, |
| 941 | const struct __kernel_sockaddr_storage *dst_addr, int rc), |
| 942 | TP_ARGS(hostname, conn_id, dst_addr, rc), |
| 943 | TP_STRUCT__entry( |
| 944 | __string(hostname, hostname) |
| 945 | __field(__u64, conn_id) |
| 946 | __array(__u8, dst_addr, sizeof(struct sockaddr_storage)) |
| 947 | __field(int, rc) |
| 948 | ), |
| 949 | TP_fast_assign( |
| 950 | struct sockaddr_storage *pss = NULL; |
| 951 | |
| 952 | __entry->conn_id = conn_id; |
| 953 | __entry->rc = rc; |
| 954 | pss = (struct sockaddr_storage *)__entry->dst_addr; |
| 955 | *pss = *dst_addr; |
| 956 | __assign_str(hostname, hostname); |
| 957 | ), |
| 958 | TP_printk("rc=%d conn_id=0x%llx server=%s addr=%pISpsfc", |
| 959 | __entry->rc, |
| 960 | __entry->conn_id, |
| 961 | __get_str(hostname), |
| 962 | __entry->dst_addr) |
| 963 | ) |
| 964 | |
| 965 | #define DEFINE_SMB3_CONNECT_ERR_EVENT(name) \ |
| 966 | DEFINE_EVENT(smb3_connect_err_class, smb3_##name, \ |
| 967 | TP_PROTO(char *hostname, \ |
| 968 | __u64 conn_id, \ |
| 969 | const struct __kernel_sockaddr_storage *addr, \ |
| 970 | int rc), \ |
| 971 | TP_ARGS(hostname, conn_id, addr, rc)) |
| 972 | |
| 973 | DEFINE_SMB3_CONNECT_ERR_EVENT(connect_err); |
| 974 | |
Steve French | bf1fdeb | 2018-07-30 19:23:09 -0500 | [diff] [blame] | 975 | DECLARE_EVENT_CLASS(smb3_reconnect_class, |
| 976 | TP_PROTO(__u64 currmid, |
Shyam Prasad N | 6d82c27 | 2021-02-03 23:20:46 -0800 | [diff] [blame] | 977 | __u64 conn_id, |
Steve French | bf1fdeb | 2018-07-30 19:23:09 -0500 | [diff] [blame] | 978 | char *hostname), |
Shyam Prasad N | 6d82c27 | 2021-02-03 23:20:46 -0800 | [diff] [blame] | 979 | TP_ARGS(currmid, conn_id, hostname), |
Steve French | bf1fdeb | 2018-07-30 19:23:09 -0500 | [diff] [blame] | 980 | TP_STRUCT__entry( |
| 981 | __field(__u64, currmid) |
Shyam Prasad N | 6d82c27 | 2021-02-03 23:20:46 -0800 | [diff] [blame] | 982 | __field(__u64, conn_id) |
Shyam Prasad N | eb06881 | 2021-05-21 06:35:52 +0000 | [diff] [blame] | 983 | __string(hostname, hostname) |
Steve French | bf1fdeb | 2018-07-30 19:23:09 -0500 | [diff] [blame] | 984 | ), |
| 985 | TP_fast_assign( |
| 986 | __entry->currmid = currmid; |
Shyam Prasad N | 6d82c27 | 2021-02-03 23:20:46 -0800 | [diff] [blame] | 987 | __entry->conn_id = conn_id; |
Shyam Prasad N | eb06881 | 2021-05-21 06:35:52 +0000 | [diff] [blame] | 988 | __assign_str(hostname, hostname); |
Steve French | bf1fdeb | 2018-07-30 19:23:09 -0500 | [diff] [blame] | 989 | ), |
Shyam Prasad N | 6d82c27 | 2021-02-03 23:20:46 -0800 | [diff] [blame] | 990 | TP_printk("conn_id=0x%llx server=%s current_mid=%llu", |
| 991 | __entry->conn_id, |
Shyam Prasad N | eb06881 | 2021-05-21 06:35:52 +0000 | [diff] [blame] | 992 | __get_str(hostname), |
Steve French | bf1fdeb | 2018-07-30 19:23:09 -0500 | [diff] [blame] | 993 | __entry->currmid) |
| 994 | ) |
| 995 | |
| 996 | #define DEFINE_SMB3_RECONNECT_EVENT(name) \ |
| 997 | DEFINE_EVENT(smb3_reconnect_class, smb3_##name, \ |
| 998 | TP_PROTO(__u64 currmid, \ |
Shyam Prasad N | 6d82c27 | 2021-02-03 23:20:46 -0800 | [diff] [blame] | 999 | __u64 conn_id, \ |
| 1000 | char *hostname), \ |
| 1001 | TP_ARGS(currmid, conn_id, hostname)) |
Steve French | bf1fdeb | 2018-07-30 19:23:09 -0500 | [diff] [blame] | 1002 | |
| 1003 | DEFINE_SMB3_RECONNECT_EVENT(reconnect); |
| 1004 | DEFINE_SMB3_RECONNECT_EVENT(partial_send_reconnect); |
| 1005 | |
Steve French | b340a4d | 2018-09-01 01:10:17 -0500 | [diff] [blame] | 1006 | DECLARE_EVENT_CLASS(smb3_credit_class, |
| 1007 | TP_PROTO(__u64 currmid, |
Shyam Prasad N | 6d82c27 | 2021-02-03 23:20:46 -0800 | [diff] [blame] | 1008 | __u64 conn_id, |
Steve French | b340a4d | 2018-09-01 01:10:17 -0500 | [diff] [blame] | 1009 | char *hostname, |
Steve French | 9eec21b | 2020-10-19 18:18:15 -0500 | [diff] [blame] | 1010 | int credits, |
Shyam Prasad N | 6d82c27 | 2021-02-03 23:20:46 -0800 | [diff] [blame] | 1011 | int credits_to_add, |
| 1012 | int in_flight), |
| 1013 | TP_ARGS(currmid, conn_id, hostname, credits, credits_to_add, in_flight), |
Steve French | b340a4d | 2018-09-01 01:10:17 -0500 | [diff] [blame] | 1014 | TP_STRUCT__entry( |
| 1015 | __field(__u64, currmid) |
Shyam Prasad N | 6d82c27 | 2021-02-03 23:20:46 -0800 | [diff] [blame] | 1016 | __field(__u64, conn_id) |
Shyam Prasad N | eb06881 | 2021-05-21 06:35:52 +0000 | [diff] [blame] | 1017 | __string(hostname, hostname) |
Steve French | b340a4d | 2018-09-01 01:10:17 -0500 | [diff] [blame] | 1018 | __field(int, credits) |
Steve French | 9eec21b | 2020-10-19 18:18:15 -0500 | [diff] [blame] | 1019 | __field(int, credits_to_add) |
Shyam Prasad N | 6d82c27 | 2021-02-03 23:20:46 -0800 | [diff] [blame] | 1020 | __field(int, in_flight) |
Steve French | b340a4d | 2018-09-01 01:10:17 -0500 | [diff] [blame] | 1021 | ), |
| 1022 | TP_fast_assign( |
| 1023 | __entry->currmid = currmid; |
Shyam Prasad N | 6d82c27 | 2021-02-03 23:20:46 -0800 | [diff] [blame] | 1024 | __entry->conn_id = conn_id; |
Shyam Prasad N | eb06881 | 2021-05-21 06:35:52 +0000 | [diff] [blame] | 1025 | __assign_str(hostname, hostname); |
Steve French | b340a4d | 2018-09-01 01:10:17 -0500 | [diff] [blame] | 1026 | __entry->credits = credits; |
Steve French | 9eec21b | 2020-10-19 18:18:15 -0500 | [diff] [blame] | 1027 | __entry->credits_to_add = credits_to_add; |
Shyam Prasad N | 6d82c27 | 2021-02-03 23:20:46 -0800 | [diff] [blame] | 1028 | __entry->in_flight = in_flight; |
Steve French | b340a4d | 2018-09-01 01:10:17 -0500 | [diff] [blame] | 1029 | ), |
Shyam Prasad N | 6d82c27 | 2021-02-03 23:20:46 -0800 | [diff] [blame] | 1030 | TP_printk("conn_id=0x%llx server=%s current_mid=%llu " |
| 1031 | "credits=%d credit_change=%d in_flight=%d", |
| 1032 | __entry->conn_id, |
Shyam Prasad N | eb06881 | 2021-05-21 06:35:52 +0000 | [diff] [blame] | 1033 | __get_str(hostname), |
Steve French | b340a4d | 2018-09-01 01:10:17 -0500 | [diff] [blame] | 1034 | __entry->currmid, |
Steve French | 9eec21b | 2020-10-19 18:18:15 -0500 | [diff] [blame] | 1035 | __entry->credits, |
Shyam Prasad N | 6d82c27 | 2021-02-03 23:20:46 -0800 | [diff] [blame] | 1036 | __entry->credits_to_add, |
| 1037 | __entry->in_flight) |
Steve French | b340a4d | 2018-09-01 01:10:17 -0500 | [diff] [blame] | 1038 | ) |
| 1039 | |
| 1040 | #define DEFINE_SMB3_CREDIT_EVENT(name) \ |
| 1041 | DEFINE_EVENT(smb3_credit_class, smb3_##name, \ |
| 1042 | TP_PROTO(__u64 currmid, \ |
Shyam Prasad N | 6d82c27 | 2021-02-03 23:20:46 -0800 | [diff] [blame] | 1043 | __u64 conn_id, \ |
Steve French | b340a4d | 2018-09-01 01:10:17 -0500 | [diff] [blame] | 1044 | char *hostname, \ |
Steve French | 9eec21b | 2020-10-19 18:18:15 -0500 | [diff] [blame] | 1045 | int credits, \ |
Shyam Prasad N | 6d82c27 | 2021-02-03 23:20:46 -0800 | [diff] [blame] | 1046 | int credits_to_add, \ |
| 1047 | int in_flight), \ |
| 1048 | TP_ARGS(currmid, conn_id, hostname, credits, credits_to_add, in_flight)) |
Steve French | b340a4d | 2018-09-01 01:10:17 -0500 | [diff] [blame] | 1049 | |
| 1050 | DEFINE_SMB3_CREDIT_EVENT(reconnect_with_invalid_credits); |
Shyam Prasad N | cd7b699 | 2020-11-12 08:56:49 -0800 | [diff] [blame] | 1051 | DEFINE_SMB3_CREDIT_EVENT(reconnect_detected); |
Steve French | 7937ca9 | 2019-03-09 20:29:55 -0600 | [diff] [blame] | 1052 | DEFINE_SMB3_CREDIT_EVENT(credit_timeout); |
Shyam Prasad N | cd7b699 | 2020-11-12 08:56:49 -0800 | [diff] [blame] | 1053 | DEFINE_SMB3_CREDIT_EVENT(insufficient_credits); |
| 1054 | DEFINE_SMB3_CREDIT_EVENT(too_many_credits); |
Steve French | 9eec21b | 2020-10-19 18:18:15 -0500 | [diff] [blame] | 1055 | DEFINE_SMB3_CREDIT_EVENT(add_credits); |
David Howells | 1ddff77 | 2022-03-17 14:28:34 +0000 | [diff] [blame] | 1056 | DEFINE_SMB3_CREDIT_EVENT(adj_credits); |
| 1057 | DEFINE_SMB3_CREDIT_EVENT(hdr_credits); |
| 1058 | DEFINE_SMB3_CREDIT_EVENT(nblk_credits); |
| 1059 | DEFINE_SMB3_CREDIT_EVENT(pend_credits); |
| 1060 | DEFINE_SMB3_CREDIT_EVENT(wait_credits); |
| 1061 | DEFINE_SMB3_CREDIT_EVENT(waitff_credits); |
| 1062 | DEFINE_SMB3_CREDIT_EVENT(overflow_credits); |
Shyam Prasad N | cd7b699 | 2020-11-12 08:56:49 -0800 | [diff] [blame] | 1063 | DEFINE_SMB3_CREDIT_EVENT(set_credits); |
Steve French | b340a4d | 2018-09-01 01:10:17 -0500 | [diff] [blame] | 1064 | |
Steve French | eccb442 | 2018-05-17 21:16:55 -0500 | [diff] [blame] | 1065 | #endif /* _CIFS_TRACE_H */ |
| 1066 | |
| 1067 | #undef TRACE_INCLUDE_PATH |
| 1068 | #define TRACE_INCLUDE_PATH . |
| 1069 | #define TRACE_INCLUDE_FILE trace |
| 1070 | #include <trace/define_trace.h> |