Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

smb3: Add ftrace tracepoints for improved SMB3 debugging

Although dmesg logs and wireshark network traces can be
helpful, being able to dynamically enable/disable tracepoints
(in this case via the kernel ftrace mechanism) can also be
helpful in more quickly debugging problems, and more
selectively tracing the events related to the bug report.

This patch adds 12 ftrace tracepoints to cifs.ko for SMB3 events
in some obvious locations. Subsequent patches will add more
as needed.

Example use:
trace-cmd record -e cifs
<run test case>
trace-cmd show

Various trace events can be filtered. See:
trace-cmd list | grep cifs
for the current list of cifs tracepoints.

Sample output (from mount and writing to a file):

root@smf:/sys/kernel/debug/tracing/events/cifs# trace-cmd show
<snip>
mount.cifs-6633 [006] .... 7246.936461: smb3_cmd_done: pid=6633 tid=0x0 sid=0x0 cmd=0 mid=0
mount.cifs-6633 [006] .... 7246.936701: smb3_cmd_err: pid=6633 tid=0x0 sid=0x3d9cf8e5 cmd=1 mid=1 status=0xc0000016 rc=-5
mount.cifs-6633 [006] .... 7246.943055: smb3_cmd_done: pid=6633 tid=0x0 sid=0x3d9cf8e5 cmd=1 mid=2
mount.cifs-6633 [006] .... 7246.943298: smb3_cmd_done: pid=6633 tid=0xf9447636 sid=0x3d9cf8e5 cmd=3 mid=3
mount.cifs-6633 [006] .... 7246.943446: smb3_cmd_done: pid=6633 tid=0xf9447636 sid=0x3d9cf8e5 cmd=11 mid=4
mount.cifs-6633 [006] .... 7246.943659: smb3_cmd_done: pid=6633 tid=0xe1b781a sid=0x3d9cf8e5 cmd=3 mid=5
mount.cifs-6633 [006] .... 7246.943766: smb3_cmd_done: pid=6633 tid=0xe1b781a sid=0x3d9cf8e5 cmd=11 mid=6
mount.cifs-6633 [006] .... 7246.943937: smb3_cmd_done: pid=6633 tid=0xe1b781a sid=0x3d9cf8e5 cmd=5 mid=7
mount.cifs-6633 [006] .... 7246.944020: smb3_cmd_done: pid=6633 tid=0xe1b781a sid=0x3d9cf8e5 cmd=16 mid=8
mount.cifs-6633 [006] .... 7246.944091: smb3_cmd_done: pid=6633 tid=0xe1b781a sid=0x3d9cf8e5 cmd=16 mid=9
mount.cifs-6633 [006] .... 7246.944163: smb3_cmd_done: pid=6633 tid=0xe1b781a sid=0x3d9cf8e5 cmd=16 mid=10
mount.cifs-6633 [006] .... 7246.944218: smb3_cmd_err: pid=6633 tid=0xf9447636 sid=0x3d9cf8e5 cmd=11 mid=11 status=0xc0000225 rc=-2
mount.cifs-6633 [006] .... 7246.944219: smb3_fsctl_err: xid=0 fid=0xffffffffffffffff tid=0xf9447636 sid=0x3d9cf8e5 class=0 type=393620 rc=-2
mount.cifs-6633 [007] .... 7246.944353: smb3_cmd_done: pid=6633 tid=0xe1b781a sid=0x3d9cf8e5 cmd=16 mid=12
bash-2071 [000] .... 7256.903844: smb3_cmd_done: pid=2071 tid=0xe1b781a sid=0x3d9cf8e5 cmd=5 mid=13
bash-2071 [000] .... 7256.904172: smb3_cmd_done: pid=2071 tid=0xe1b781a sid=0x3d9cf8e5 cmd=16 mid=14
bash-2071 [000] .... 7256.904471: smb3_cmd_done: pid=2071 tid=0xe1b781a sid=0x3d9cf8e5 cmd=17 mid=15
bash-2071 [000] .... 7256.904950: smb3_cmd_done: pid=2071 tid=0xe1b781a sid=0x3d9cf8e5 cmd=5 mid=16
bash-2071 [000] .... 7256.905305: smb3_cmd_done: pid=2071 tid=0xe1b781a sid=0x3d9cf8e5 cmd=17 mid=17
bash-2071 [000] .... 7256.905688: smb3_cmd_done: pid=2071 tid=0xe1b781a sid=0x3d9cf8e5 cmd=6 mid=18
bash-2071 [000] .... 7256.905809: smb3_write_done: xid=0 fid=0xd628f511 tid=0xe1b781a sid=0x3d9cf8e5 offset=0x0 len=0x1b

Signed-off-by: Steve French <stfrench@microsoft.com>
Acked-by: Ronnie Sahlberg <lsahlber@redhat.com>

+379 -10
+4 -3
fs/cifs/Makefile
··· 1 1 # SPDX-License-Identifier: GPL-2.0 2 2 # 3 - # Makefile for Linux CIFS VFS client 3 + # Makefile for Linux CIFS/SMB2/SMB3 VFS client 4 4 # 5 + ccflags-y += -I$(src) # needed for trace events 5 6 obj-$(CONFIG_CIFS) += cifs.o 6 7 7 - cifs-y := cifsfs.o cifssmb.o cifs_debug.o connect.o dir.o file.o inode.o \ 8 - link.o misc.o netmisc.o smbencrypt.o transport.o asn1.o \ 8 + cifs-y := trace.o cifsfs.o cifssmb.o cifs_debug.o connect.o dir.o file.o \ 9 + inode.o link.o misc.o netmisc.o smbencrypt.o transport.o asn1.o \ 9 10 cifs_unicode.o nterr.o cifsencrypt.o \ 10 11 readdir.o ioctl.o sess.o export.o smb1ops.o winucase.o \ 11 12 smb2ops.o smb2maperror.o smb2transport.o \
+9 -1
fs/cifs/smb2maperror.c
··· 27 27 #include "smb2proto.h" 28 28 #include "smb2status.h" 29 29 #include "smb2glob.h" 30 + #include "trace.h" 30 31 31 32 struct status_to_posix_error { 32 33 __le32 smb2_status; ··· 2456 2455 int rc = -EIO; 2457 2456 __le32 smb2err = shdr->Status; 2458 2457 2459 - if (smb2err == 0) 2458 + if (smb2err == 0) { 2459 + trace_smb3_cmd_done(le32_to_cpu(shdr->ProcessId), shdr->TreeId, 2460 + shdr->SessionId, le16_to_cpu(shdr->Command), 2461 + le64_to_cpu(shdr->MessageId)); 2460 2462 return 0; 2463 + } 2461 2464 2462 2465 /* mask facility */ 2463 2466 if (log_err && (smb2err != STATUS_MORE_PROCESSING_REQUIRED) && ··· 2483 2478 cifs_dbg(FYI, "Mapping SMB2 status code 0x%08x to POSIX err %d\n", 2484 2479 __le32_to_cpu(smb2err), rc); 2485 2480 2481 + trace_smb3_cmd_err(le32_to_cpu(shdr->ProcessId), shdr->TreeId, 2482 + shdr->SessionId, le16_to_cpu(shdr->Command), 2483 + le64_to_cpu(shdr->MessageId), le32_to_cpu(smb2err), rc); 2486 2484 return rc; 2487 2485 }
+50 -6
fs/cifs/smb2pdu.c
··· 49 49 #include "cifspdu.h" 50 50 #include "cifs_spnego.h" 51 51 #include "smbdirect.h" 52 + #include "trace.h" 52 53 53 54 /* 54 55 * The following table defines the expected "StructureSize" of SMB2 requests ··· 2091 2090 cifs_small_buf_release(req); 2092 2091 rsp = (struct smb2_ioctl_rsp *)rsp_iov.iov_base; 2093 2092 2093 + if (rc != 0) 2094 + trace_smb3_fsctl_err(xid, persistent_fid, tcon->tid, 2095 + ses->Suid, 0, opcode, rc); 2096 + 2094 2097 if ((rc != 0) && (rc != -EINVAL)) { 2095 2098 cifs_stats_fail_inc(tcon, SMB2_IOCTL_HE); 2096 2099 goto ioctl_exit; ··· 2205 2200 2206 2201 if (rc != 0) { 2207 2202 cifs_stats_fail_inc(tcon, SMB2_CLOSE_HE); 2203 + trace_smb3_close_err(xid, persistent_fid, tcon->tid, ses->Suid, 2204 + rc); 2208 2205 goto close_exit; 2209 2206 } 2210 2207 ··· 2333 2326 2334 2327 if (rc) { 2335 2328 cifs_stats_fail_inc(tcon, SMB2_QUERY_INFO_HE); 2329 + trace_smb3_query_info_err(xid, persistent_fid, tcon->tid, 2330 + ses->Suid, info_class, (__u32)info_type, rc); 2336 2331 goto qinf_exit; 2337 2332 } 2338 2333 ··· 2565 2556 rc = smb2_send_recv(xid, ses, iov, 1, &resp_buftype, flags, &rsp_iov); 2566 2557 cifs_small_buf_release(req); 2567 2558 2568 - if (rc != 0) 2559 + if (rc != 0) { 2569 2560 cifs_stats_fail_inc(tcon, SMB2_FLUSH_HE); 2561 + trace_smb3_flush_err(xid, persistent_fid, tcon->tid, ses->Suid, 2562 + rc); 2563 + } 2570 2564 2571 2565 free_rsp_buf(resp_buftype, rsp_iov.iov_base); 2572 2566 return rc; ··· 2811 2799 if (rc) { 2812 2800 kref_put(&rdata->refcount, cifs_readdata_release); 2813 2801 cifs_stats_fail_inc(io_parms.tcon, SMB2_READ_HE); 2814 - } 2802 + trace_smb3_read_err(rc, 0 /* xid */, io_parms.persistent_fid, 2803 + io_parms.tcon->tid, io_parms.tcon->ses->Suid, 2804 + io_parms.offset, io_parms.length); 2805 + } else 2806 + trace_smb3_read_done(0 /* xid */, io_parms.persistent_fid, 2807 + io_parms.tcon->tid, io_parms.tcon->ses->Suid, 2808 + io_parms.offset, io_parms.length); 2815 2809 2816 2810 cifs_small_buf_release(buf); 2817 2811 return rc; ··· 2858 2840 cifs_stats_fail_inc(io_parms->tcon, SMB2_READ_HE); 2859 2841 cifs_dbg(VFS, "Send error in read = %d\n", rc); 2860 2842 } 2843 + trace_smb3_read_err(rc, xid, req->PersistentFileId, 2844 + io_parms->tcon->tid, ses->Suid, 2845 + io_parms->offset, io_parms->length); 2861 2846 free_rsp_buf(resp_buftype, rsp_iov.iov_base); 2862 2847 return rc == -ENODATA ? 0 : rc; 2863 - } 2848 + } else 2849 + trace_smb3_read_done(xid, req->PersistentFileId, 2850 + io_parms->tcon->tid, ses->Suid, 2851 + io_parms->offset, io_parms->length); 2864 2852 2865 2853 *nbytes = le32_to_cpu(rsp->DataLength); 2866 2854 if ((*nbytes > CIFS_MAX_MSGSIZE) || ··· 3082 3058 wdata, flags); 3083 3059 3084 3060 if (rc) { 3061 + trace_smb3_write_err(0 /* no xid */, req->PersistentFileId, 3062 + tcon->tid, tcon->ses->Suid, wdata->offset, 3063 + wdata->bytes, rc); 3085 3064 kref_put(&wdata->refcount, release); 3086 3065 cifs_stats_fail_inc(tcon, SMB2_WRITE_HE); 3087 - } 3066 + } else 3067 + trace_smb3_write_done(0 /* no xid */, req->PersistentFileId, 3068 + tcon->tid, tcon->ses->Suid, wdata->offset, 3069 + wdata->bytes); 3088 3070 3089 3071 async_writev_out: 3090 3072 cifs_small_buf_release(req); ··· 3154 3124 rsp = (struct smb2_write_rsp *)rsp_iov.iov_base; 3155 3125 3156 3126 if (rc) { 3127 + trace_smb3_write_err(xid, req->PersistentFileId, 3128 + io_parms->tcon->tid, 3129 + io_parms->tcon->ses->Suid, 3130 + io_parms->offset, io_parms->length, rc); 3157 3131 cifs_stats_fail_inc(io_parms->tcon, SMB2_WRITE_HE); 3158 3132 cifs_dbg(VFS, "Send error in write = %d\n", rc); 3159 - } else 3133 + } else { 3160 3134 *nbytes = le32_to_cpu(rsp->DataLength); 3135 + trace_smb3_write_done(xid, req->PersistentFileId, 3136 + io_parms->tcon->tid, 3137 + io_parms->tcon->ses->Suid, 3138 + io_parms->offset, *nbytes); 3139 + } 3161 3140 3162 3141 free_rsp_buf(resp_buftype, rsp); 3163 3142 return rc; ··· 3413 3374 cifs_small_buf_release(req); 3414 3375 rsp = (struct smb2_set_info_rsp *)rsp_iov.iov_base; 3415 3376 3416 - if (rc != 0) 3377 + if (rc != 0) { 3417 3378 cifs_stats_fail_inc(tcon, SMB2_SET_INFO_HE); 3379 + trace_smb3_set_info_err(xid, persistent_fid, tcon->tid, 3380 + ses->Suid, info_class, (__u32)info_type, rc); 3381 + } 3418 3382 3419 3383 free_rsp_buf(resp_buftype, rsp); 3420 3384 kfree(iov); ··· 3808 3766 if (rc) { 3809 3767 cifs_dbg(FYI, "Send error in smb2_lockv = %d\n", rc); 3810 3768 cifs_stats_fail_inc(tcon, SMB2_LOCK_HE); 3769 + trace_smb3_lock_err(xid, persist_fid, tcon->tid, 3770 + tcon->ses->Suid, rc); 3811 3771 } 3812 3772 3813 3773 return rc;
+18
fs/cifs/trace.c
··· 1 + // SPDX-License-Identifier: GPL-2.0 2 + /* 3 + * Copyright (C) 2018, Microsoft Corporation. 4 + * 5 + * Author(s): Steve French <stfrench@microsoft.com> 6 + * 7 + * This program is free software; you can redistribute it and/or modify 8 + * it under the terms of the GNU General Public License as published by 9 + * the Free Software Foundation; either version 2 of the License, or 10 + * (at your option) any later version. 11 + * 12 + * This program is distributed in the hope that it will be useful, 13 + * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See 15 + * the GNU General Public License for more details. 16 + */ 17 + #define CREATE_TRACE_POINTS 18 + #include "trace.h"
+298
fs/cifs/trace.h
··· 1 + /* SPDX-License-Identifier: GPL-2.0 */ 2 + /* 3 + * Copyright (C) 2018, Microsoft Corporation. 4 + * 5 + * Author(s): Steve French <stfrench@microsoft.com> 6 + * 7 + * This program is free software; you can redistribute it and/or modify 8 + * it under the terms of the GNU General Public License as published by 9 + * the Free Software Foundation; either version 2 of the License, or 10 + * (at your option) any later version. 11 + * 12 + * This program is distributed in the hope that it will be useful, 13 + * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See 15 + * the GNU General Public License for more details. 16 + */ 17 + #undef TRACE_SYSTEM 18 + #define TRACE_SYSTEM cifs 19 + 20 + #if !defined(_CIFS_TRACE_H) || defined(TRACE_HEADER_MULTI_READ) 21 + #define _CIFS_TRACE_H 22 + 23 + #include <linux/tracepoint.h> 24 + 25 + /* For logging errors in read or write */ 26 + DECLARE_EVENT_CLASS(smb3_rw_err_class, 27 + TP_PROTO(unsigned int xid, 28 + __u64 fid, 29 + __u32 tid, 30 + __u64 sesid, 31 + __u64 offset, 32 + __u32 len, 33 + int rc), 34 + TP_ARGS(xid, fid, tid, sesid, offset, len, rc), 35 + TP_STRUCT__entry( 36 + __field(unsigned int, xid) 37 + __field(__u64, fid) 38 + __field(__u32, tid) 39 + __field(__u64, sesid) 40 + __field(__u64, offset) 41 + __field(__u32, len) 42 + __field(int, rc) 43 + ), 44 + TP_fast_assign( 45 + __entry->xid = xid; 46 + __entry->fid = fid; 47 + __entry->tid = tid; 48 + __entry->sesid = sesid; 49 + __entry->offset = offset; 50 + __entry->len = len; 51 + __entry->rc = rc; 52 + ), 53 + TP_printk("xid=%u fid=0x%llx tid=0x%x sid=0x%llx offset=0x%llx len=0x%x rc=%d", 54 + __entry->xid, __entry->fid, __entry->tid, __entry->sesid, 55 + __entry->offset, __entry->len, __entry->rc) 56 + ) 57 + 58 + #define DEFINE_SMB3_RW_ERR_EVENT(name) \ 59 + DEFINE_EVENT(smb3_rw_err_class, smb3_##name, \ 60 + TP_PROTO(unsigned int xid, \ 61 + __u64 fid, \ 62 + __u32 tid, \ 63 + __u64 sesid, \ 64 + __u64 offset, \ 65 + __u32 len, \ 66 + int rc), \ 67 + TP_ARGS(xid, fid, tid, sesid, offset, len, rc)) 68 + 69 + DEFINE_SMB3_RW_ERR_EVENT(write_err); 70 + DEFINE_SMB3_RW_ERR_EVENT(read_err); 71 + 72 + 73 + /* For logging successful read or write */ 74 + DECLARE_EVENT_CLASS(smb3_rw_done_class, 75 + TP_PROTO(unsigned int xid, 76 + __u64 fid, 77 + __u32 tid, 78 + __u64 sesid, 79 + __u64 offset, 80 + __u32 len), 81 + TP_ARGS(xid, fid, tid, sesid, offset, len), 82 + TP_STRUCT__entry( 83 + __field(unsigned int, xid) 84 + __field(__u64, fid) 85 + __field(__u32, tid) 86 + __field(__u64, sesid) 87 + __field(__u64, offset) 88 + __field(__u32, len) 89 + ), 90 + TP_fast_assign( 91 + __entry->xid = xid; 92 + __entry->fid = fid; 93 + __entry->tid = tid; 94 + __entry->sesid = sesid; 95 + __entry->offset = offset; 96 + __entry->len = len; 97 + ), 98 + TP_printk("xid=%u fid=0x%llx tid=0x%x sid=0x%llx offset=0x%llx len=0x%x", 99 + __entry->xid, __entry->fid, __entry->tid, __entry->sesid, 100 + __entry->offset, __entry->len) 101 + ) 102 + 103 + #define DEFINE_SMB3_RW_DONE_EVENT(name) \ 104 + DEFINE_EVENT(smb3_rw_done_class, smb3_##name, \ 105 + TP_PROTO(unsigned int xid, \ 106 + __u64 fid, \ 107 + __u32 tid, \ 108 + __u64 sesid, \ 109 + __u64 offset, \ 110 + __u32 len), \ 111 + TP_ARGS(xid, fid, tid, sesid, offset, len)) 112 + 113 + DEFINE_SMB3_RW_DONE_EVENT(write_done); 114 + DEFINE_SMB3_RW_DONE_EVENT(read_done); 115 + 116 + /* 117 + * For handle based calls other than read and write, and get/set info 118 + */ 119 + DECLARE_EVENT_CLASS(smb3_fd_err_class, 120 + TP_PROTO(unsigned int xid, 121 + __u64 fid, 122 + __u32 tid, 123 + __u64 sesid, 124 + int rc), 125 + TP_ARGS(xid, fid, tid, sesid, rc), 126 + TP_STRUCT__entry( 127 + __field(unsigned int, xid) 128 + __field(__u64, fid) 129 + __field(__u32, tid) 130 + __field(__u64, sesid) 131 + __field(int, rc) 132 + ), 133 + TP_fast_assign( 134 + __entry->xid = xid; 135 + __entry->fid = fid; 136 + __entry->tid = tid; 137 + __entry->sesid = sesid; 138 + __entry->rc = rc; 139 + ), 140 + TP_printk("xid=%u fid=0x%llx tid=0x%x sid=0x%llx rc=%d", 141 + __entry->xid, __entry->fid, __entry->tid, __entry->sesid, 142 + __entry->rc) 143 + ) 144 + 145 + #define DEFINE_SMB3_FD_ERR_EVENT(name) \ 146 + DEFINE_EVENT(smb3_fd_err_class, smb3_##name, \ 147 + TP_PROTO(unsigned int xid, \ 148 + __u64 fid, \ 149 + __u32 tid, \ 150 + __u64 sesid, \ 151 + int rc), \ 152 + TP_ARGS(xid, fid, tid, sesid, rc)) 153 + 154 + DEFINE_SMB3_FD_ERR_EVENT(flush_err); 155 + DEFINE_SMB3_FD_ERR_EVENT(lock_err); 156 + DEFINE_SMB3_FD_ERR_EVENT(close_err); 157 + 158 + /* 159 + * For handle based query/set info calls 160 + */ 161 + DECLARE_EVENT_CLASS(smb3_inf_err_class, 162 + TP_PROTO(unsigned int xid, 163 + __u64 fid, 164 + __u32 tid, 165 + __u64 sesid, 166 + __u8 infclass, 167 + __u32 type, 168 + int rc), 169 + TP_ARGS(xid, fid, tid, sesid, infclass, type, rc), 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 + __field(int, rc) 178 + ), 179 + TP_fast_assign( 180 + __entry->xid = xid; 181 + __entry->fid = fid; 182 + __entry->tid = tid; 183 + __entry->sesid = sesid; 184 + __entry->infclass = infclass; 185 + __entry->type = type; 186 + __entry->rc = rc; 187 + ), 188 + TP_printk("xid=%u fid=0x%llx tid=0x%x sid=0x%llx class=%u type=0x%x rc=%d", 189 + __entry->xid, __entry->fid, __entry->tid, __entry->sesid, 190 + __entry->infclass, __entry->type, __entry->rc) 191 + ) 192 + 193 + #define DEFINE_SMB3_INF_ERR_EVENT(name) \ 194 + DEFINE_EVENT(smb3_inf_err_class, smb3_##name, \ 195 + TP_PROTO(unsigned int xid, \ 196 + __u64 fid, \ 197 + __u32 tid, \ 198 + __u64 sesid, \ 199 + __u8 infclass, \ 200 + __u32 type, \ 201 + int rc), \ 202 + TP_ARGS(xid, fid, tid, sesid, infclass, type, rc)) 203 + 204 + DEFINE_SMB3_INF_ERR_EVENT(query_info_err); 205 + DEFINE_SMB3_INF_ERR_EVENT(set_info_err); 206 + DEFINE_SMB3_INF_ERR_EVENT(fsctl_err); 207 + 208 + /* 209 + * For logging SMB3 Status code and Command for responses which return errors 210 + */ 211 + DECLARE_EVENT_CLASS(smb3_cmd_err_class, 212 + TP_PROTO(__u32 pid, 213 + __u32 tid, 214 + __u64 sesid, 215 + __u16 cmd, 216 + __u64 mid, 217 + __u32 status, 218 + int rc), 219 + TP_ARGS(pid, tid, sesid, cmd, mid, status, rc), 220 + TP_STRUCT__entry( 221 + __field(__u32, pid) 222 + __field(__u32, tid) 223 + __field(__u64, sesid) 224 + __field(__u16, cmd) 225 + __field(__u64, mid) 226 + __field(__u32, status) 227 + __field(int, rc) 228 + ), 229 + TP_fast_assign( 230 + __entry->pid = pid; 231 + __entry->tid = tid; 232 + __entry->sesid = sesid; 233 + __entry->cmd = cmd; 234 + __entry->mid = mid; 235 + __entry->status = status; 236 + __entry->rc = rc; 237 + ), 238 + TP_printk(" pid=%u tid=0x%x sid=0x%llx cmd=%u mid=%llu status=0x%x rc=%d", 239 + __entry->pid, __entry->tid, __entry->sesid, 240 + __entry->cmd, __entry->mid, __entry->status, __entry->rc) 241 + ) 242 + 243 + #define DEFINE_SMB3_CMD_ERR_EVENT(name) \ 244 + DEFINE_EVENT(smb3_cmd_err_class, smb3_##name, \ 245 + TP_PROTO(unsigned int pid, \ 246 + __u32 tid, \ 247 + __u64 sesid, \ 248 + __u16 cmd, \ 249 + __u64 mid, \ 250 + __u32 status, \ 251 + int rc), \ 252 + TP_ARGS(pid, tid, sesid, cmd, mid, status, rc)) 253 + 254 + DEFINE_SMB3_CMD_ERR_EVENT(cmd_err); 255 + 256 + DECLARE_EVENT_CLASS(smb3_cmd_done_class, 257 + TP_PROTO(__u32 pid, 258 + __u32 tid, 259 + __u64 sesid, 260 + __u16 cmd, 261 + __u64 mid), 262 + TP_ARGS(pid, tid, sesid, cmd, mid), 263 + TP_STRUCT__entry( 264 + __field(__u32, pid) 265 + __field(__u32, tid) 266 + __field(__u64, sesid) 267 + __field(__u16, cmd) 268 + __field(__u64, mid) 269 + ), 270 + TP_fast_assign( 271 + __entry->pid = pid; 272 + __entry->tid = tid; 273 + __entry->sesid = sesid; 274 + __entry->cmd = cmd; 275 + __entry->mid = mid; 276 + ), 277 + TP_printk("pid=%u tid=0x%x sid=0x%llx cmd=%u mid=%llu", 278 + __entry->pid, __entry->tid, __entry->sesid, 279 + __entry->cmd, __entry->mid) 280 + ) 281 + 282 + #define DEFINE_SMB3_CMD_DONE_EVENT(name) \ 283 + DEFINE_EVENT(smb3_cmd_done_class, smb3_##name, \ 284 + TP_PROTO(unsigned int pid, \ 285 + __u32 tid, \ 286 + __u64 sesid, \ 287 + __u16 cmd, \ 288 + __u64 mid), \ 289 + TP_ARGS(pid, tid, sesid, cmd, mid)) 290 + 291 + DEFINE_SMB3_CMD_DONE_EVENT(cmd_done); 292 + 293 + #endif /* _CIFS_TRACE_H */ 294 + 295 + #undef TRACE_INCLUDE_PATH 296 + #define TRACE_INCLUDE_PATH . 297 + #define TRACE_INCLUDE_FILE trace 298 + #include <trace/define_trace.h>