1 /* SPDX-License-Identifier: GPL-2.0 */
3 * Copyright (C) 2018, Microsoft Corporation.
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,
706 TP_ARGS(xid, tid, sesid, create_options, desired_access),
708 __field(unsigned int, xid)
710 __field(__u64, sesid)
711 __field(int, create_options)
712 __field(int, desired_access)
717 __entry->sesid = sesid;
718 __entry->create_options = create_options;
719 __entry->desired_access = desired_access;
721 TP_printk("xid=%u sid=0x%llx tid=0x%x cr_opts=0x%x des_access=0x%x",
722 __entry->xid, __entry->sesid, __entry->tid,
723 __entry->create_options, __entry->desired_access)
726 #define DEFINE_SMB3_OPEN_ENTER_EVENT(name) \
727 DEFINE_EVENT(smb3_open_enter_class, smb3_##name, \
728 TP_PROTO(unsigned int xid, \
731 int create_options, \
732 int desired_access), \
733 TP_ARGS(xid, tid, sesid, create_options, desired_access))
735 DEFINE_SMB3_OPEN_ENTER_EVENT(open_enter);
736 DEFINE_SMB3_OPEN_ENTER_EVENT(posix_mkdir_enter);
738 DECLARE_EVENT_CLASS(smb3_open_err_class,
739 TP_PROTO(unsigned int xid,
745 TP_ARGS(xid, tid, sesid, create_options, desired_access, rc),
747 __field(unsigned int, xid)
749 __field(__u64, sesid)
750 __field(int, create_options)
751 __field(int, desired_access)
757 __entry->sesid = sesid;
758 __entry->create_options = create_options;
759 __entry->desired_access = desired_access;
762 TP_printk("xid=%u sid=0x%llx tid=0x%x cr_opts=0x%x des_access=0x%x rc=%d",
763 __entry->xid, __entry->sesid, __entry->tid,
764 __entry->create_options, __entry->desired_access, __entry->rc)
767 #define DEFINE_SMB3_OPEN_ERR_EVENT(name) \
768 DEFINE_EVENT(smb3_open_err_class, smb3_##name, \
769 TP_PROTO(unsigned int xid, \
772 int create_options, \
773 int desired_access, \
775 TP_ARGS(xid, tid, sesid, create_options, desired_access, rc))
777 DEFINE_SMB3_OPEN_ERR_EVENT(open_err);
778 DEFINE_SMB3_OPEN_ERR_EVENT(posix_mkdir_err);
780 DECLARE_EVENT_CLASS(smb3_open_done_class,
781 TP_PROTO(unsigned int xid,
787 TP_ARGS(xid, fid, tid, sesid, create_options, desired_access),
789 __field(unsigned int, xid)
792 __field(__u64, sesid)
793 __field(int, create_options)
794 __field(int, desired_access)
800 __entry->sesid = sesid;
801 __entry->create_options = create_options;
802 __entry->desired_access = desired_access;
804 TP_printk("xid=%u sid=0x%llx tid=0x%x fid=0x%llx cr_opts=0x%x des_access=0x%x",
805 __entry->xid, __entry->sesid, __entry->tid, __entry->fid,
806 __entry->create_options, __entry->desired_access)
809 #define DEFINE_SMB3_OPEN_DONE_EVENT(name) \
810 DEFINE_EVENT(smb3_open_done_class, smb3_##name, \
811 TP_PROTO(unsigned int xid, \
815 int create_options, \
816 int desired_access), \
817 TP_ARGS(xid, fid, tid, sesid, create_options, desired_access))
819 DEFINE_SMB3_OPEN_DONE_EVENT(open_done);
820 DEFINE_SMB3_OPEN_DONE_EVENT(posix_mkdir_done);
823 DECLARE_EVENT_CLASS(smb3_lease_done_class,
824 TP_PROTO(__u32 lease_state,
828 __u64 lease_key_high),
829 TP_ARGS(lease_state, tid, sesid, lease_key_low, lease_key_high),
831 __field(__u32, lease_state)
833 __field(__u64, sesid)
834 __field(__u64, lease_key_low)
835 __field(__u64, lease_key_high)
838 __entry->lease_state = lease_state;
840 __entry->sesid = sesid;
841 __entry->lease_key_low = lease_key_low;
842 __entry->lease_key_high = lease_key_high;
844 TP_printk("sid=0x%llx tid=0x%x lease_key=0x%llx%llx lease_state=0x%x",
845 __entry->sesid, __entry->tid, __entry->lease_key_high,
846 __entry->lease_key_low, __entry->lease_state)
849 #define DEFINE_SMB3_LEASE_DONE_EVENT(name) \
850 DEFINE_EVENT(smb3_lease_done_class, smb3_##name, \
851 TP_PROTO(__u32 lease_state, \
854 __u64 lease_key_low, \
855 __u64 lease_key_high), \
856 TP_ARGS(lease_state, tid, sesid, lease_key_low, lease_key_high))
858 DEFINE_SMB3_LEASE_DONE_EVENT(lease_done);
859 DEFINE_SMB3_LEASE_DONE_EVENT(lease_not_found);
861 DECLARE_EVENT_CLASS(smb3_lease_err_class,
862 TP_PROTO(__u32 lease_state,
866 __u64 lease_key_high,
868 TP_ARGS(lease_state, tid, sesid, lease_key_low, lease_key_high, rc),
870 __field(__u32, lease_state)
872 __field(__u64, sesid)
873 __field(__u64, lease_key_low)
874 __field(__u64, lease_key_high)
878 __entry->lease_state = lease_state;
880 __entry->sesid = sesid;
881 __entry->lease_key_low = lease_key_low;
882 __entry->lease_key_high = lease_key_high;
885 TP_printk("sid=0x%llx tid=0x%x lease_key=0x%llx%llx lease_state=0x%x rc=%d",
886 __entry->sesid, __entry->tid, __entry->lease_key_high,
887 __entry->lease_key_low, __entry->lease_state, __entry->rc)
890 #define DEFINE_SMB3_LEASE_ERR_EVENT(name) \
891 DEFINE_EVENT(smb3_lease_err_class, smb3_##name, \
892 TP_PROTO(__u32 lease_state, \
895 __u64 lease_key_low, \
896 __u64 lease_key_high, \
898 TP_ARGS(lease_state, tid, sesid, lease_key_low, lease_key_high, rc))
900 DEFINE_SMB3_LEASE_ERR_EVENT(lease_err);
902 DECLARE_EVENT_CLASS(smb3_connect_class,
903 TP_PROTO(char *hostname,
905 const struct __kernel_sockaddr_storage *dst_addr),
906 TP_ARGS(hostname, conn_id, dst_addr),
908 __string(hostname, hostname)
909 __field(__u64, conn_id)
910 __array(__u8, dst_addr, sizeof(struct sockaddr_storage))
913 struct sockaddr_storage *pss = NULL;
915 __entry->conn_id = conn_id;
916 pss = (struct sockaddr_storage *)__entry->dst_addr;
918 __assign_str(hostname, hostname);
920 TP_printk("conn_id=0x%llx server=%s addr=%pISpsfc",
926 #define DEFINE_SMB3_CONNECT_EVENT(name) \
927 DEFINE_EVENT(smb3_connect_class, smb3_##name, \
928 TP_PROTO(char *hostname, \
930 const struct __kernel_sockaddr_storage *addr), \
931 TP_ARGS(hostname, conn_id, addr))
933 DEFINE_SMB3_CONNECT_EVENT(connect_done);
935 DECLARE_EVENT_CLASS(smb3_connect_err_class,
936 TP_PROTO(char *hostname, __u64 conn_id,
937 const struct __kernel_sockaddr_storage *dst_addr, int rc),
938 TP_ARGS(hostname, conn_id, dst_addr, rc),
940 __string(hostname, hostname)
941 __field(__u64, conn_id)
942 __array(__u8, dst_addr, sizeof(struct sockaddr_storage))
946 struct sockaddr_storage *pss = NULL;
948 __entry->conn_id = conn_id;
950 pss = (struct sockaddr_storage *)__entry->dst_addr;
952 __assign_str(hostname, hostname);
954 TP_printk("rc=%d conn_id=0x%llx server=%s addr=%pISpsfc",
961 #define DEFINE_SMB3_CONNECT_ERR_EVENT(name) \
962 DEFINE_EVENT(smb3_connect_err_class, smb3_##name, \
963 TP_PROTO(char *hostname, \
965 const struct __kernel_sockaddr_storage *addr, \
967 TP_ARGS(hostname, conn_id, addr, rc))
969 DEFINE_SMB3_CONNECT_ERR_EVENT(connect_err);
971 DECLARE_EVENT_CLASS(smb3_reconnect_class,
972 TP_PROTO(__u64 currmid,
975 TP_ARGS(currmid, conn_id, hostname),
977 __field(__u64, currmid)
978 __field(__u64, conn_id)
979 __string(hostname, hostname)
982 __entry->currmid = currmid;
983 __entry->conn_id = conn_id;
984 __assign_str(hostname, hostname);
986 TP_printk("conn_id=0x%llx server=%s current_mid=%llu",
992 #define DEFINE_SMB3_RECONNECT_EVENT(name) \
993 DEFINE_EVENT(smb3_reconnect_class, smb3_##name, \
994 TP_PROTO(__u64 currmid, \
997 TP_ARGS(currmid, conn_id, hostname))
999 DEFINE_SMB3_RECONNECT_EVENT(reconnect);
1000 DEFINE_SMB3_RECONNECT_EVENT(partial_send_reconnect);
1002 DECLARE_EVENT_CLASS(smb3_credit_class,
1003 TP_PROTO(__u64 currmid,
1009 TP_ARGS(currmid, conn_id, hostname, credits, credits_to_add, in_flight),
1011 __field(__u64, currmid)
1012 __field(__u64, conn_id)
1013 __string(hostname, hostname)
1014 __field(int, credits)
1015 __field(int, credits_to_add)
1016 __field(int, in_flight)
1019 __entry->currmid = currmid;
1020 __entry->conn_id = conn_id;
1021 __assign_str(hostname, hostname);
1022 __entry->credits = credits;
1023 __entry->credits_to_add = credits_to_add;
1024 __entry->in_flight = in_flight;
1026 TP_printk("conn_id=0x%llx server=%s current_mid=%llu "
1027 "credits=%d credit_change=%d in_flight=%d",
1029 __get_str(hostname),
1032 __entry->credits_to_add,
1036 #define DEFINE_SMB3_CREDIT_EVENT(name) \
1037 DEFINE_EVENT(smb3_credit_class, smb3_##name, \
1038 TP_PROTO(__u64 currmid, \
1042 int credits_to_add, \
1044 TP_ARGS(currmid, conn_id, hostname, credits, credits_to_add, in_flight))
1046 DEFINE_SMB3_CREDIT_EVENT(reconnect_with_invalid_credits);
1047 DEFINE_SMB3_CREDIT_EVENT(reconnect_detected);
1048 DEFINE_SMB3_CREDIT_EVENT(credit_timeout);
1049 DEFINE_SMB3_CREDIT_EVENT(insufficient_credits);
1050 DEFINE_SMB3_CREDIT_EVENT(too_many_credits);
1051 DEFINE_SMB3_CREDIT_EVENT(add_credits);
1052 DEFINE_SMB3_CREDIT_EVENT(adj_credits);
1053 DEFINE_SMB3_CREDIT_EVENT(hdr_credits);
1054 DEFINE_SMB3_CREDIT_EVENT(nblk_credits);
1055 DEFINE_SMB3_CREDIT_EVENT(pend_credits);
1056 DEFINE_SMB3_CREDIT_EVENT(wait_credits);
1057 DEFINE_SMB3_CREDIT_EVENT(waitff_credits);
1058 DEFINE_SMB3_CREDIT_EVENT(overflow_credits);
1059 DEFINE_SMB3_CREDIT_EVENT(set_credits);
1061 #endif /* _CIFS_TRACE_H */
1063 #undef TRACE_INCLUDE_PATH
1064 #define TRACE_INCLUDE_PATH .
1065 #define TRACE_INCLUDE_FILE trace
1066 #include <trace/define_trace.h>