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