1 /* SPDX-License-Identifier: GPL-2.0 */
3 * Copyright (C) 2018, Microsoft Corporation.
5 * Author(s): Steve French <stfrench@microsoft.com>
8 #define TRACE_SYSTEM cifs
10 #if !defined(_CIFS_TRACE_H) || defined(TRACE_HEADER_MULTI_READ)
13 #include <linux/tracepoint.h>
14 #include <linux/net.h>
15 #include <linux/inet.h>
18 * Please use this 3-part article as a reference for writing new tracepoints:
19 * https://lwn.net/Articles/379903/
22 /* For logging errors in read or write */
23 DECLARE_EVENT_CLASS(smb3_rw_err_class,
24 TP_PROTO(unsigned int xid,
31 TP_ARGS(xid, fid, tid, sesid, offset, len, rc),
33 __field(unsigned int, xid)
37 __field(__u64, offset)
45 __entry->sesid = sesid;
46 __entry->offset = offset;
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,
52 __entry->offset, __entry->len, __entry->rc)
55 #define DEFINE_SMB3_RW_ERR_EVENT(name) \
56 DEFINE_EVENT(smb3_rw_err_class, smb3_##name, \
57 TP_PROTO(unsigned int xid, \
64 TP_ARGS(xid, fid, tid, sesid, offset, len, rc))
66 DEFINE_SMB3_RW_ERR_EVENT(write_err);
67 DEFINE_SMB3_RW_ERR_EVENT(read_err);
68 DEFINE_SMB3_RW_ERR_EVENT(query_dir_err);
69 DEFINE_SMB3_RW_ERR_EVENT(zero_err);
70 DEFINE_SMB3_RW_ERR_EVENT(falloc_err);
73 /* For logging successful read or write */
74 DECLARE_EVENT_CLASS(smb3_rw_done_class,
75 TP_PROTO(unsigned int xid,
81 TP_ARGS(xid, fid, tid, sesid, offset, len),
83 __field(unsigned int, xid)
87 __field(__u64, offset)
94 __entry->sesid = sesid;
95 __entry->offset = offset;
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,
100 __entry->offset, __entry->len)
103 #define DEFINE_SMB3_RW_DONE_EVENT(name) \
104 DEFINE_EVENT(smb3_rw_done_class, smb3_##name, \
105 TP_PROTO(unsigned int xid, \
111 TP_ARGS(xid, fid, tid, sesid, offset, len))
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);
116 DEFINE_SMB3_RW_DONE_EVENT(zero_enter);
117 DEFINE_SMB3_RW_DONE_EVENT(falloc_enter);
118 DEFINE_SMB3_RW_DONE_EVENT(write_done);
119 DEFINE_SMB3_RW_DONE_EVENT(read_done);
120 DEFINE_SMB3_RW_DONE_EVENT(query_dir_done);
121 DEFINE_SMB3_RW_DONE_EVENT(zero_done);
122 DEFINE_SMB3_RW_DONE_EVENT(falloc_done);
124 /* For logging successful set EOF (truncate) */
125 DECLARE_EVENT_CLASS(smb3_eof_class,
126 TP_PROTO(unsigned int xid,
131 TP_ARGS(xid, fid, tid, sesid, offset),
133 __field(unsigned int, xid)
136 __field(__u64, sesid)
137 __field(__u64, offset)
143 __entry->sesid = sesid;
144 __entry->offset = offset;
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,
151 #define DEFINE_SMB3_EOF_EVENT(name) \
152 DEFINE_EVENT(smb3_eof_class, smb3_##name, \
153 TP_PROTO(unsigned int xid, \
158 TP_ARGS(xid, fid, tid, sesid, offset))
160 DEFINE_SMB3_EOF_EVENT(set_eof);
163 * For handle based calls other than read and write, and get/set info
165 DECLARE_EVENT_CLASS(smb3_fd_class,
166 TP_PROTO(unsigned int xid,
170 TP_ARGS(xid, fid, tid, sesid),
172 __field(unsigned int, xid)
175 __field(__u64, sesid)
181 __entry->sesid = sesid;
183 TP_printk("\txid=%u sid=0x%llx tid=0x%x fid=0x%llx",
184 __entry->xid, __entry->sesid, __entry->tid, __entry->fid)
187 #define DEFINE_SMB3_FD_EVENT(name) \
188 DEFINE_EVENT(smb3_fd_class, smb3_##name, \
189 TP_PROTO(unsigned int xid, \
193 TP_ARGS(xid, fid, tid, sesid))
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);
199 DEFINE_SMB3_FD_EVENT(oplock_not_found);
201 DECLARE_EVENT_CLASS(smb3_fd_err_class,
202 TP_PROTO(unsigned int xid,
207 TP_ARGS(xid, fid, tid, sesid, rc),
209 __field(unsigned int, xid)
212 __field(__u64, sesid)
219 __entry->sesid = sesid;
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,
227 #define DEFINE_SMB3_FD_ERR_EVENT(name) \
228 DEFINE_EVENT(smb3_fd_err_class, smb3_##name, \
229 TP_PROTO(unsigned int xid, \
234 TP_ARGS(xid, fid, tid, sesid, rc))
236 DEFINE_SMB3_FD_ERR_EVENT(flush_err);
237 DEFINE_SMB3_FD_ERR_EVENT(lock_err);
238 DEFINE_SMB3_FD_ERR_EVENT(close_err);
241 * For handle based query/set info calls
243 DECLARE_EVENT_CLASS(smb3_inf_enter_class,
244 TP_PROTO(unsigned int xid,
250 TP_ARGS(xid, fid, tid, sesid, infclass, type),
252 __field(unsigned int, xid)
255 __field(__u64, sesid)
256 __field(__u8, infclass)
263 __entry->sesid = sesid;
264 __entry->infclass = infclass;
265 __entry->type = type;
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)
272 #define DEFINE_SMB3_INF_ENTER_EVENT(name) \
273 DEFINE_EVENT(smb3_inf_enter_class, smb3_##name, \
274 TP_PROTO(unsigned int xid, \
280 TP_ARGS(xid, fid, tid, sesid, infclass, type))
282 DEFINE_SMB3_INF_ENTER_EVENT(query_info_enter);
283 DEFINE_SMB3_INF_ENTER_EVENT(query_info_done);
284 DEFINE_SMB3_INF_ENTER_EVENT(notify_enter);
285 DEFINE_SMB3_INF_ENTER_EVENT(notify_done);
287 DECLARE_EVENT_CLASS(smb3_inf_err_class,
288 TP_PROTO(unsigned int xid,
295 TP_ARGS(xid, fid, tid, sesid, infclass, type, rc),
297 __field(unsigned int, xid)
300 __field(__u64, sesid)
301 __field(__u8, infclass)
309 __entry->sesid = sesid;
310 __entry->infclass = infclass;
311 __entry->type = type;
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,
316 __entry->infclass, __entry->type, __entry->rc)
319 #define DEFINE_SMB3_INF_ERR_EVENT(name) \
320 DEFINE_EVENT(smb3_inf_err_class, smb3_##name, \
321 TP_PROTO(unsigned int xid, \
328 TP_ARGS(xid, fid, tid, sesid, infclass, type, rc))
330 DEFINE_SMB3_INF_ERR_EVENT(query_info_err);
331 DEFINE_SMB3_INF_ERR_EVENT(set_info_err);
332 DEFINE_SMB3_INF_ERR_EVENT(notify_err);
333 DEFINE_SMB3_INF_ERR_EVENT(fsctl_err);
335 DECLARE_EVENT_CLASS(smb3_inf_compound_enter_class,
336 TP_PROTO(unsigned int xid,
339 const char *full_path),
340 TP_ARGS(xid, tid, sesid, full_path),
342 __field(unsigned int, xid)
344 __field(__u64, sesid)
345 __string(path, full_path)
350 __entry->sesid = sesid;
351 __assign_str(path, full_path);
353 TP_printk("xid=%u sid=0x%llx tid=0x%x path=%s",
354 __entry->xid, __entry->sesid, __entry->tid,
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, \
363 const char *full_path), \
364 TP_ARGS(xid, tid, sesid, full_path))
366 DEFINE_SMB3_INF_COMPOUND_ENTER_EVENT(query_info_compound_enter);
367 DEFINE_SMB3_INF_COMPOUND_ENTER_EVENT(posix_query_info_compound_enter);
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);
375 DEFINE_SMB3_INF_COMPOUND_ENTER_EVENT(tdis_enter);
378 DECLARE_EVENT_CLASS(smb3_inf_compound_done_class,
379 TP_PROTO(unsigned int xid,
382 TP_ARGS(xid, tid, sesid),
384 __field(unsigned int, xid)
386 __field(__u64, sesid)
391 __entry->sesid = sesid;
393 TP_printk("xid=%u sid=0x%llx tid=0x%x",
394 __entry->xid, __entry->sesid, __entry->tid)
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, \
402 TP_ARGS(xid, tid, sesid))
404 DEFINE_SMB3_INF_COMPOUND_DONE_EVENT(query_info_compound_done);
405 DEFINE_SMB3_INF_COMPOUND_DONE_EVENT(posix_query_info_compound_done);
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);
413 DEFINE_SMB3_INF_COMPOUND_DONE_EVENT(tdis_done);
416 DECLARE_EVENT_CLASS(smb3_inf_compound_err_class,
417 TP_PROTO(unsigned int xid,
421 TP_ARGS(xid, tid, sesid, rc),
423 __field(unsigned int, xid)
425 __field(__u64, sesid)
431 __entry->sesid = sesid;
434 TP_printk("xid=%u sid=0x%llx tid=0x%x rc=%d",
435 __entry->xid, __entry->sesid, __entry->tid,
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, \
445 TP_ARGS(xid, tid, sesid, rc))
447 DEFINE_SMB3_INF_COMPOUND_ERR_EVENT(query_info_compound_err);
448 DEFINE_SMB3_INF_COMPOUND_ERR_EVENT(posix_query_info_compound_err);
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);
456 DEFINE_SMB3_INF_COMPOUND_ERR_EVENT(tdis_err);
459 * For logging SMB3 Status code and Command for responses which return errors
461 DECLARE_EVENT_CLASS(smb3_cmd_err_class,
468 TP_ARGS(tid, sesid, cmd, mid, status, rc),
471 __field(__u64, sesid)
474 __field(__u32, status)
479 __entry->sesid = sesid;
482 __entry->status = status;
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)
490 #define DEFINE_SMB3_CMD_ERR_EVENT(name) \
491 DEFINE_EVENT(smb3_cmd_err_class, smb3_##name, \
492 TP_PROTO(__u32 tid, \
498 TP_ARGS(tid, sesid, cmd, mid, status, rc))
500 DEFINE_SMB3_CMD_ERR_EVENT(cmd_err);
502 DECLARE_EVENT_CLASS(smb3_cmd_done_class,
507 TP_ARGS(tid, sesid, cmd, mid),
510 __field(__u64, sesid)
516 __entry->sesid = sesid;
520 TP_printk("\tsid=0x%llx tid=0x%x cmd=%u mid=%llu",
521 __entry->sesid, __entry->tid,
522 __entry->cmd, __entry->mid)
525 #define DEFINE_SMB3_CMD_DONE_EVENT(name) \
526 DEFINE_EVENT(smb3_cmd_done_class, smb3_##name, \
527 TP_PROTO(__u32 tid, \
531 TP_ARGS(tid, sesid, cmd, mid))
533 DEFINE_SMB3_CMD_DONE_EVENT(cmd_enter);
534 DEFINE_SMB3_CMD_DONE_EVENT(cmd_done);
535 DEFINE_SMB3_CMD_DONE_EVENT(ses_expired);
537 DECLARE_EVENT_CLASS(smb3_mid_class,
541 unsigned long when_sent,
542 unsigned long when_received),
543 TP_ARGS(cmd, mid, pid, when_sent, when_received),
548 __field(unsigned long, when_sent)
549 __field(unsigned long, when_received)
555 __entry->when_sent = when_sent;
556 __entry->when_received = when_received;
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)
563 #define DEFINE_SMB3_MID_EVENT(name) \
564 DEFINE_EVENT(smb3_mid_class, smb3_##name, \
565 TP_PROTO(__u16 cmd, \
568 unsigned long when_sent, \
569 unsigned long when_received), \
570 TP_ARGS(cmd, mid, pid, when_sent, when_received))
572 DEFINE_SMB3_MID_EVENT(slow_rsp);
574 DECLARE_EVENT_CLASS(smb3_exit_err_class,
575 TP_PROTO(unsigned int xid,
576 const char *func_name,
578 TP_ARGS(xid, func_name, rc),
580 __field(unsigned int, xid)
581 __string(func_name, func_name)
586 __assign_str(func_name, func_name);
589 TP_printk("\t%s: xid=%u rc=%d",
590 __get_str(func_name), __entry->xid, __entry->rc)
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, \
598 TP_ARGS(xid, func_name, rc))
600 DEFINE_SMB3_EXIT_ERR_EVENT(exit_err);
603 DECLARE_EVENT_CLASS(smb3_sync_err_class,
604 TP_PROTO(unsigned long ino,
608 __field(unsigned long, ino)
615 TP_printk("\tino=%lu rc=%d",
616 __entry->ino, __entry->rc)
619 #define DEFINE_SMB3_SYNC_ERR_EVENT(name) \
620 DEFINE_EVENT(smb3_sync_err_class, cifs_##name, \
621 TP_PROTO(unsigned long ino, \
625 DEFINE_SMB3_SYNC_ERR_EVENT(fsync_err);
626 DEFINE_SMB3_SYNC_ERR_EVENT(flush_err);
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),
634 __field(unsigned int, xid)
635 __string(func_name, func_name)
639 __assign_str(func_name, func_name);
641 TP_printk("\t%s: xid=%u",
642 __get_str(func_name), __entry->xid)
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))
651 DEFINE_SMB3_ENTER_EXIT_EVENT(enter);
652 DEFINE_SMB3_ENTER_EXIT_EVENT(exit_done);
655 * For SMB2/SMB3 tree connect
658 DECLARE_EVENT_CLASS(smb3_tcon_class,
659 TP_PROTO(unsigned int xid,
662 const char *unc_name,
664 TP_ARGS(xid, tid, sesid, unc_name, rc),
666 __field(unsigned int, xid)
668 __field(__u64, sesid)
669 __string(name, unc_name)
675 __entry->sesid = sesid;
676 __assign_str(name, unc_name);
679 TP_printk("xid=%u sid=0x%llx tid=0x%x unc_name=%s rc=%d",
680 __entry->xid, __entry->sesid, __entry->tid,
681 __get_str(name), __entry->rc)
684 #define DEFINE_SMB3_TCON_EVENT(name) \
685 DEFINE_EVENT(smb3_tcon_class, smb3_##name, \
686 TP_PROTO(unsigned int xid, \
689 const char *unc_name, \
691 TP_ARGS(xid, tid, sesid, unc_name, rc))
693 DEFINE_SMB3_TCON_EVENT(tcon);
697 * For smb2/smb3 open (including create and mkdir) calls
700 DECLARE_EVENT_CLASS(smb3_open_enter_class,
701 TP_PROTO(unsigned int xid,
704 const char *full_path,
707 TP_ARGS(xid, tid, sesid, full_path, create_options, desired_access),
709 __field(unsigned int, xid)
711 __field(__u64, sesid)
712 __string(path, full_path)
713 __field(int, create_options)
714 __field(int, desired_access)
719 __entry->sesid = sesid;
720 __assign_str(path, full_path);
721 __entry->create_options = create_options;
722 __entry->desired_access = desired_access;
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),
726 __entry->create_options, __entry->desired_access)
729 #define DEFINE_SMB3_OPEN_ENTER_EVENT(name) \
730 DEFINE_EVENT(smb3_open_enter_class, smb3_##name, \
731 TP_PROTO(unsigned int xid, \
734 const char *full_path, \
735 int create_options, \
736 int desired_access), \
737 TP_ARGS(xid, tid, sesid, full_path, create_options, desired_access))
739 DEFINE_SMB3_OPEN_ENTER_EVENT(open_enter);
740 DEFINE_SMB3_OPEN_ENTER_EVENT(posix_mkdir_enter);
742 DECLARE_EVENT_CLASS(smb3_open_err_class,
743 TP_PROTO(unsigned int xid,
749 TP_ARGS(xid, tid, sesid, create_options, desired_access, rc),
751 __field(unsigned int, xid)
753 __field(__u64, sesid)
754 __field(int, create_options)
755 __field(int, desired_access)
761 __entry->sesid = sesid;
762 __entry->create_options = create_options;
763 __entry->desired_access = desired_access;
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)
771 #define DEFINE_SMB3_OPEN_ERR_EVENT(name) \
772 DEFINE_EVENT(smb3_open_err_class, smb3_##name, \
773 TP_PROTO(unsigned int xid, \
776 int create_options, \
777 int desired_access, \
779 TP_ARGS(xid, tid, sesid, create_options, desired_access, rc))
781 DEFINE_SMB3_OPEN_ERR_EVENT(open_err);
782 DEFINE_SMB3_OPEN_ERR_EVENT(posix_mkdir_err);
784 DECLARE_EVENT_CLASS(smb3_open_done_class,
785 TP_PROTO(unsigned int xid,
791 TP_ARGS(xid, fid, tid, sesid, create_options, desired_access),
793 __field(unsigned int, xid)
796 __field(__u64, sesid)
797 __field(int, create_options)
798 __field(int, desired_access)
804 __entry->sesid = sesid;
805 __entry->create_options = create_options;
806 __entry->desired_access = desired_access;
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)
813 #define DEFINE_SMB3_OPEN_DONE_EVENT(name) \
814 DEFINE_EVENT(smb3_open_done_class, smb3_##name, \
815 TP_PROTO(unsigned int xid, \
819 int create_options, \
820 int desired_access), \
821 TP_ARGS(xid, fid, tid, sesid, create_options, desired_access))
823 DEFINE_SMB3_OPEN_DONE_EVENT(open_done);
824 DEFINE_SMB3_OPEN_DONE_EVENT(posix_mkdir_done);
827 DECLARE_EVENT_CLASS(smb3_lease_done_class,
828 TP_PROTO(__u32 lease_state,
832 __u64 lease_key_high),
833 TP_ARGS(lease_state, tid, sesid, lease_key_low, lease_key_high),
835 __field(__u32, lease_state)
837 __field(__u64, sesid)
838 __field(__u64, lease_key_low)
839 __field(__u64, lease_key_high)
842 __entry->lease_state = lease_state;
844 __entry->sesid = sesid;
845 __entry->lease_key_low = lease_key_low;
846 __entry->lease_key_high = lease_key_high;
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)
853 #define DEFINE_SMB3_LEASE_DONE_EVENT(name) \
854 DEFINE_EVENT(smb3_lease_done_class, smb3_##name, \
855 TP_PROTO(__u32 lease_state, \
858 __u64 lease_key_low, \
859 __u64 lease_key_high), \
860 TP_ARGS(lease_state, tid, sesid, lease_key_low, lease_key_high))
862 DEFINE_SMB3_LEASE_DONE_EVENT(lease_done);
863 DEFINE_SMB3_LEASE_DONE_EVENT(lease_not_found);
865 DECLARE_EVENT_CLASS(smb3_lease_err_class,
866 TP_PROTO(__u32 lease_state,
870 __u64 lease_key_high,
872 TP_ARGS(lease_state, tid, sesid, lease_key_low, lease_key_high, rc),
874 __field(__u32, lease_state)
876 __field(__u64, sesid)
877 __field(__u64, lease_key_low)
878 __field(__u64, lease_key_high)
882 __entry->lease_state = lease_state;
884 __entry->sesid = sesid;
885 __entry->lease_key_low = lease_key_low;
886 __entry->lease_key_high = lease_key_high;
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)
894 #define DEFINE_SMB3_LEASE_ERR_EVENT(name) \
895 DEFINE_EVENT(smb3_lease_err_class, smb3_##name, \
896 TP_PROTO(__u32 lease_state, \
899 __u64 lease_key_low, \
900 __u64 lease_key_high, \
902 TP_ARGS(lease_state, tid, sesid, lease_key_low, lease_key_high, rc))
904 DEFINE_SMB3_LEASE_ERR_EVENT(lease_err);
906 DECLARE_EVENT_CLASS(smb3_connect_class,
907 TP_PROTO(char *hostname,
909 const struct __kernel_sockaddr_storage *dst_addr),
910 TP_ARGS(hostname, conn_id, dst_addr),
912 __string(hostname, hostname)
913 __field(__u64, conn_id)
914 __array(__u8, dst_addr, sizeof(struct sockaddr_storage))
917 struct sockaddr_storage *pss = NULL;
919 __entry->conn_id = conn_id;
920 pss = (struct sockaddr_storage *)__entry->dst_addr;
922 __assign_str(hostname, hostname);
924 TP_printk("conn_id=0x%llx server=%s addr=%pISpsfc",
930 #define DEFINE_SMB3_CONNECT_EVENT(name) \
931 DEFINE_EVENT(smb3_connect_class, smb3_##name, \
932 TP_PROTO(char *hostname, \
934 const struct __kernel_sockaddr_storage *addr), \
935 TP_ARGS(hostname, conn_id, addr))
937 DEFINE_SMB3_CONNECT_EVENT(connect_done);
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),
944 __string(hostname, hostname)
945 __field(__u64, conn_id)
946 __array(__u8, dst_addr, sizeof(struct sockaddr_storage))
950 struct sockaddr_storage *pss = NULL;
952 __entry->conn_id = conn_id;
954 pss = (struct sockaddr_storage *)__entry->dst_addr;
956 __assign_str(hostname, hostname);
958 TP_printk("rc=%d conn_id=0x%llx server=%s addr=%pISpsfc",
965 #define DEFINE_SMB3_CONNECT_ERR_EVENT(name) \
966 DEFINE_EVENT(smb3_connect_err_class, smb3_##name, \
967 TP_PROTO(char *hostname, \
969 const struct __kernel_sockaddr_storage *addr, \
971 TP_ARGS(hostname, conn_id, addr, rc))
973 DEFINE_SMB3_CONNECT_ERR_EVENT(connect_err);
975 DECLARE_EVENT_CLASS(smb3_reconnect_class,
976 TP_PROTO(__u64 currmid,
979 TP_ARGS(currmid, conn_id, hostname),
981 __field(__u64, currmid)
982 __field(__u64, conn_id)
983 __string(hostname, hostname)
986 __entry->currmid = currmid;
987 __entry->conn_id = conn_id;
988 __assign_str(hostname, hostname);
990 TP_printk("conn_id=0x%llx server=%s current_mid=%llu",
996 #define DEFINE_SMB3_RECONNECT_EVENT(name) \
997 DEFINE_EVENT(smb3_reconnect_class, smb3_##name, \
998 TP_PROTO(__u64 currmid, \
1001 TP_ARGS(currmid, conn_id, hostname))
1003 DEFINE_SMB3_RECONNECT_EVENT(reconnect);
1004 DEFINE_SMB3_RECONNECT_EVENT(partial_send_reconnect);
1006 DECLARE_EVENT_CLASS(smb3_ses_class,
1007 TP_PROTO(__u64 sesid),
1010 __field(__u64, sesid)
1013 __entry->sesid = sesid;
1015 TP_printk("sid=0x%llx",
1019 #define DEFINE_SMB3_SES_EVENT(name) \
1020 DEFINE_EVENT(smb3_ses_class, smb3_##name, \
1021 TP_PROTO(__u64 sesid), \
1024 DEFINE_SMB3_SES_EVENT(ses_not_found);
1026 DECLARE_EVENT_CLASS(smb3_credit_class,
1027 TP_PROTO(__u64 currmid,
1033 TP_ARGS(currmid, conn_id, hostname, credits, credits_to_add, in_flight),
1035 __field(__u64, currmid)
1036 __field(__u64, conn_id)
1037 __string(hostname, hostname)
1038 __field(int, credits)
1039 __field(int, credits_to_add)
1040 __field(int, in_flight)
1043 __entry->currmid = currmid;
1044 __entry->conn_id = conn_id;
1045 __assign_str(hostname, hostname);
1046 __entry->credits = credits;
1047 __entry->credits_to_add = credits_to_add;
1048 __entry->in_flight = in_flight;
1050 TP_printk("conn_id=0x%llx server=%s current_mid=%llu "
1051 "credits=%d credit_change=%d in_flight=%d",
1053 __get_str(hostname),
1056 __entry->credits_to_add,
1060 #define DEFINE_SMB3_CREDIT_EVENT(name) \
1061 DEFINE_EVENT(smb3_credit_class, smb3_##name, \
1062 TP_PROTO(__u64 currmid, \
1066 int credits_to_add, \
1068 TP_ARGS(currmid, conn_id, hostname, credits, credits_to_add, in_flight))
1070 DEFINE_SMB3_CREDIT_EVENT(reconnect_with_invalid_credits);
1071 DEFINE_SMB3_CREDIT_EVENT(reconnect_detected);
1072 DEFINE_SMB3_CREDIT_EVENT(credit_timeout);
1073 DEFINE_SMB3_CREDIT_EVENT(insufficient_credits);
1074 DEFINE_SMB3_CREDIT_EVENT(too_many_credits);
1075 DEFINE_SMB3_CREDIT_EVENT(add_credits);
1076 DEFINE_SMB3_CREDIT_EVENT(adj_credits);
1077 DEFINE_SMB3_CREDIT_EVENT(hdr_credits);
1078 DEFINE_SMB3_CREDIT_EVENT(nblk_credits);
1079 DEFINE_SMB3_CREDIT_EVENT(pend_credits);
1080 DEFINE_SMB3_CREDIT_EVENT(wait_credits);
1081 DEFINE_SMB3_CREDIT_EVENT(waitff_credits);
1082 DEFINE_SMB3_CREDIT_EVENT(overflow_credits);
1083 DEFINE_SMB3_CREDIT_EVENT(set_credits);
1085 #endif /* _CIFS_TRACE_H */
1087 #undef TRACE_INCLUDE_PATH
1088 #define TRACE_INCLUDE_PATH .
1089 #define TRACE_INCLUDE_FILE trace
1090 #include <trace/define_trace.h>