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