Commit | Line | Data |
---|---|---|
eccb4422 SF |
1 | /* SPDX-License-Identifier: GPL-2.0 */ |
2 | /* | |
3 | * Copyright (C) 2018, Microsoft Corporation. | |
4 | * | |
5 | * Author(s): Steve French <stfrench@microsoft.com> | |
afc23feb DH |
6 | * |
7 | * Please use this 3-part article as a reference for writing new tracepoints: | |
8 | * https://lwn.net/Articles/379903/ | |
eccb4422 SF |
9 | */ |
10 | #undef TRACE_SYSTEM | |
11 | #define TRACE_SYSTEM cifs | |
12 | ||
13 | #if !defined(_CIFS_TRACE_H) || defined(TRACE_HEADER_MULTI_READ) | |
14 | #define _CIFS_TRACE_H | |
15 | ||
16 | #include <linux/tracepoint.h> | |
d7171cd1 SF |
17 | #include <linux/net.h> |
18 | #include <linux/inet.h> | |
eccb4422 | 19 | |
eb068818 | 20 | /* |
afc23feb DH |
21 | * Specify enums for tracing information. |
22 | */ | |
519be989 DH |
23 | #define smb3_rw_credits_traces \ |
24 | EM(cifs_trace_rw_credits_call_readv_adjust, "rd-call-adj") \ | |
25 | EM(cifs_trace_rw_credits_call_writev_adjust, "wr-call-adj") \ | |
26 | EM(cifs_trace_rw_credits_free_subreq, "free-subreq") \ | |
27 | EM(cifs_trace_rw_credits_issue_read_adjust, "rd-issu-adj") \ | |
28 | EM(cifs_trace_rw_credits_issue_write_adjust, "wr-issu-adj") \ | |
29 | EM(cifs_trace_rw_credits_no_adjust_up, "no-adj-up ") \ | |
30 | EM(cifs_trace_rw_credits_old_session, "old-session") \ | |
31 | EM(cifs_trace_rw_credits_read_response_add, "rd-resp-add") \ | |
32 | EM(cifs_trace_rw_credits_read_response_clear, "rd-resp-clr") \ | |
6a5dcd48 | 33 | EM(cifs_trace_rw_credits_read_resubmit, "rd-resubmit") \ |
519be989 DH |
34 | EM(cifs_trace_rw_credits_read_submit, "rd-submit ") \ |
35 | EM(cifs_trace_rw_credits_write_prepare, "wr-prepare ") \ | |
36 | EM(cifs_trace_rw_credits_write_response_add, "wr-resp-add") \ | |
37 | EM(cifs_trace_rw_credits_write_response_clear, "wr-resp-clr") \ | |
38 | E_(cifs_trace_rw_credits_zero_in_flight, "ZERO-IN-FLT") | |
39 | ||
afc23feb DH |
40 | #define smb3_tcon_ref_traces \ |
41 | EM(netfs_trace_tcon_ref_dec_dfs_refer, "DEC DfsRef") \ | |
42 | EM(netfs_trace_tcon_ref_free, "FRE ") \ | |
43 | EM(netfs_trace_tcon_ref_free_fail, "FRE Fail ") \ | |
44 | EM(netfs_trace_tcon_ref_free_ipc, "FRE Ipc ") \ | |
45 | EM(netfs_trace_tcon_ref_free_ipc_fail, "FRE Ipc-F ") \ | |
46 | EM(netfs_trace_tcon_ref_free_reconnect_server, "FRE Reconn") \ | |
3fa640d0 PA |
47 | EM(netfs_trace_tcon_ref_get_cached_laundromat, "GET Ch-Lau") \ |
48 | EM(netfs_trace_tcon_ref_get_cached_lease_break, "GET Ch-Lea") \ | |
afc23feb DH |
49 | EM(netfs_trace_tcon_ref_get_cancelled_close, "GET Cn-Cls") \ |
50 | EM(netfs_trace_tcon_ref_get_dfs_refer, "GET DfsRef") \ | |
51 | EM(netfs_trace_tcon_ref_get_find, "GET Find ") \ | |
52 | EM(netfs_trace_tcon_ref_get_find_sess_tcon, "GET FndSes") \ | |
53 | EM(netfs_trace_tcon_ref_get_reconnect_server, "GET Reconn") \ | |
54 | EM(netfs_trace_tcon_ref_new, "NEW ") \ | |
55 | EM(netfs_trace_tcon_ref_new_ipc, "NEW Ipc ") \ | |
56 | EM(netfs_trace_tcon_ref_new_reconnect_server, "NEW Reconn") \ | |
3fa640d0 | 57 | EM(netfs_trace_tcon_ref_put_cached_close, "PUT Ch-Cls") \ |
afc23feb DH |
58 | EM(netfs_trace_tcon_ref_put_cancelled_close, "PUT Cn-Cls") \ |
59 | EM(netfs_trace_tcon_ref_put_cancelled_close_fid, "PUT Cn-Fid") \ | |
60 | EM(netfs_trace_tcon_ref_put_cancelled_mid, "PUT Cn-Mid") \ | |
61 | EM(netfs_trace_tcon_ref_put_mnt_ctx, "PUT MntCtx") \ | |
62 | EM(netfs_trace_tcon_ref_put_reconnect_server, "PUT Reconn") \ | |
63 | EM(netfs_trace_tcon_ref_put_tlink, "PUT Tlink ") \ | |
64 | EM(netfs_trace_tcon_ref_see_cancelled_close, "SEE Cn-Cls") \ | |
65 | EM(netfs_trace_tcon_ref_see_fscache_collision, "SEE FV-CO!") \ | |
66 | EM(netfs_trace_tcon_ref_see_fscache_okay, "SEE FV-Ok ") \ | |
67 | EM(netfs_trace_tcon_ref_see_fscache_relinq, "SEE FV-Rlq") \ | |
68 | E_(netfs_trace_tcon_ref_see_umount, "SEE Umount") | |
69 | ||
70 | #undef EM | |
71 | #undef E_ | |
72 | ||
73 | /* | |
74 | * Define those tracing enums. | |
75 | */ | |
76 | #ifndef __SMB3_DECLARE_TRACE_ENUMS_ONCE_ONLY | |
77 | #define __SMB3_DECLARE_TRACE_ENUMS_ONCE_ONLY | |
78 | ||
79 | #define EM(a, b) a, | |
80 | #define E_(a, b) a | |
81 | ||
519be989 DH |
82 | enum smb3_rw_credits_trace { smb3_rw_credits_traces } __mode(byte); |
83 | enum smb3_tcon_ref_trace { smb3_tcon_ref_traces } __mode(byte); | |
afc23feb DH |
84 | |
85 | #undef EM | |
86 | #undef E_ | |
87 | #endif | |
88 | ||
89 | /* | |
90 | * Export enum symbols via userspace. | |
91 | */ | |
92 | #define EM(a, b) TRACE_DEFINE_ENUM(a); | |
93 | #define E_(a, b) TRACE_DEFINE_ENUM(a); | |
94 | ||
519be989 | 95 | smb3_rw_credits_traces; |
afc23feb DH |
96 | smb3_tcon_ref_traces; |
97 | ||
98 | #undef EM | |
99 | #undef E_ | |
100 | ||
101 | /* | |
102 | * Now redefine the EM() and E_() macros to map the enums to the strings that | |
103 | * will be printed in the output. | |
eb068818 | 104 | */ |
afc23feb DH |
105 | #define EM(a, b) { a, b }, |
106 | #define E_(a, b) { a, b } | |
eb068818 | 107 | |
eccb4422 SF |
108 | /* For logging errors in read or write */ |
109 | DECLARE_EVENT_CLASS(smb3_rw_err_class, | |
3ee1a1fc DH |
110 | TP_PROTO(unsigned int rreq_debug_id, |
111 | unsigned int rreq_debug_index, | |
112 | unsigned int xid, | |
113 | __u64 fid, | |
114 | __u32 tid, | |
115 | __u64 sesid, | |
116 | __u64 offset, | |
117 | __u32 len, | |
118 | int rc), | |
119 | TP_ARGS(rreq_debug_id, rreq_debug_index, | |
120 | xid, fid, tid, sesid, offset, len, rc), | |
121 | TP_STRUCT__entry( | |
122 | __field(unsigned int, rreq_debug_id) | |
123 | __field(unsigned int, rreq_debug_index) | |
124 | __field(unsigned int, xid) | |
125 | __field(__u64, fid) | |
126 | __field(__u32, tid) | |
127 | __field(__u64, sesid) | |
128 | __field(__u64, offset) | |
129 | __field(__u32, len) | |
130 | __field(int, rc) | |
131 | ), | |
132 | TP_fast_assign( | |
133 | __entry->rreq_debug_id = rreq_debug_id; | |
134 | __entry->rreq_debug_index = rreq_debug_index; | |
135 | __entry->xid = xid; | |
136 | __entry->fid = fid; | |
137 | __entry->tid = tid; | |
138 | __entry->sesid = sesid; | |
139 | __entry->offset = offset; | |
140 | __entry->len = len; | |
141 | __entry->rc = rc; | |
142 | ), | |
143 | TP_printk("\tR=%08x[%x] xid=%u sid=0x%llx tid=0x%x fid=0x%llx offset=0x%llx len=0x%x rc=%d", | |
144 | __entry->rreq_debug_id, __entry->rreq_debug_index, | |
145 | __entry->xid, __entry->sesid, __entry->tid, __entry->fid, | |
146 | __entry->offset, __entry->len, __entry->rc) | |
147 | ) | |
148 | ||
149 | #define DEFINE_SMB3_RW_ERR_EVENT(name) \ | |
150 | DEFINE_EVENT(smb3_rw_err_class, smb3_##name, \ | |
151 | TP_PROTO(unsigned int rreq_debug_id, \ | |
152 | unsigned int rreq_debug_index, \ | |
153 | unsigned int xid, \ | |
154 | __u64 fid, \ | |
155 | __u32 tid, \ | |
156 | __u64 sesid, \ | |
157 | __u64 offset, \ | |
158 | __u32 len, \ | |
159 | int rc), \ | |
160 | TP_ARGS(rreq_debug_id, rreq_debug_index, xid, fid, tid, sesid, offset, len, rc)) | |
161 | ||
162 | DEFINE_SMB3_RW_ERR_EVENT(read_err); | |
85633c00 | 163 | DEFINE_SMB3_RW_ERR_EVENT(write_err); |
3ee1a1fc DH |
164 | |
165 | /* For logging errors in other file I/O ops */ | |
166 | DECLARE_EVENT_CLASS(smb3_other_err_class, | |
eccb4422 SF |
167 | TP_PROTO(unsigned int xid, |
168 | __u64 fid, | |
169 | __u32 tid, | |
170 | __u64 sesid, | |
171 | __u64 offset, | |
172 | __u32 len, | |
173 | int rc), | |
174 | TP_ARGS(xid, fid, tid, sesid, offset, len, rc), | |
175 | TP_STRUCT__entry( | |
176 | __field(unsigned int, xid) | |
177 | __field(__u64, fid) | |
178 | __field(__u32, tid) | |
179 | __field(__u64, sesid) | |
180 | __field(__u64, offset) | |
181 | __field(__u32, len) | |
182 | __field(int, rc) | |
183 | ), | |
184 | TP_fast_assign( | |
185 | __entry->xid = xid; | |
186 | __entry->fid = fid; | |
187 | __entry->tid = tid; | |
188 | __entry->sesid = sesid; | |
189 | __entry->offset = offset; | |
190 | __entry->len = len; | |
191 | __entry->rc = rc; | |
192 | ), | |
d683bcd3 SF |
193 | TP_printk("\txid=%u sid=0x%llx tid=0x%x fid=0x%llx offset=0x%llx len=0x%x rc=%d", |
194 | __entry->xid, __entry->sesid, __entry->tid, __entry->fid, | |
eccb4422 SF |
195 | __entry->offset, __entry->len, __entry->rc) |
196 | ) | |
197 | ||
3ee1a1fc DH |
198 | #define DEFINE_SMB3_OTHER_ERR_EVENT(name) \ |
199 | DEFINE_EVENT(smb3_other_err_class, smb3_##name, \ | |
eccb4422 SF |
200 | TP_PROTO(unsigned int xid, \ |
201 | __u64 fid, \ | |
202 | __u32 tid, \ | |
203 | __u64 sesid, \ | |
204 | __u64 offset, \ | |
205 | __u32 len, \ | |
206 | int rc), \ | |
207 | TP_ARGS(xid, fid, tid, sesid, offset, len, rc)) | |
208 | ||
3ee1a1fc DH |
209 | DEFINE_SMB3_OTHER_ERR_EVENT(query_dir_err); |
210 | DEFINE_SMB3_OTHER_ERR_EVENT(zero_err); | |
211 | DEFINE_SMB3_OTHER_ERR_EVENT(falloc_err); | |
eccb4422 | 212 | |
5779d398 SF |
213 | /* |
214 | * For logging errors in reflink and copy_range ops e.g. smb2_copychunk_range | |
215 | * and smb2_duplicate_extents | |
216 | */ | |
217 | DECLARE_EVENT_CLASS(smb3_copy_range_err_class, | |
218 | TP_PROTO(unsigned int xid, | |
219 | __u64 src_fid, | |
220 | __u64 target_fid, | |
221 | __u32 tid, | |
222 | __u64 sesid, | |
223 | __u64 src_offset, | |
224 | __u64 target_offset, | |
225 | __u32 len, | |
226 | int rc), | |
227 | TP_ARGS(xid, src_fid, target_fid, tid, sesid, src_offset, target_offset, len, rc), | |
228 | TP_STRUCT__entry( | |
229 | __field(unsigned int, xid) | |
230 | __field(__u64, src_fid) | |
231 | __field(__u64, target_fid) | |
232 | __field(__u32, tid) | |
233 | __field(__u64, sesid) | |
234 | __field(__u64, src_offset) | |
235 | __field(__u64, target_offset) | |
236 | __field(__u32, len) | |
237 | __field(int, rc) | |
238 | ), | |
239 | TP_fast_assign( | |
240 | __entry->xid = xid; | |
241 | __entry->src_fid = src_fid; | |
242 | __entry->target_fid = target_fid; | |
243 | __entry->tid = tid; | |
244 | __entry->sesid = sesid; | |
245 | __entry->src_offset = src_offset; | |
246 | __entry->target_offset = target_offset; | |
247 | __entry->len = len; | |
248 | __entry->rc = rc; | |
249 | ), | |
250 | TP_printk("\txid=%u sid=0x%llx tid=0x%x source fid=0x%llx source offset=0x%llx target fid=0x%llx target offset=0x%llx len=0x%x rc=%d", | |
251 | __entry->xid, __entry->sesid, __entry->tid, __entry->target_fid, | |
252 | __entry->src_offset, __entry->target_fid, __entry->target_offset, __entry->len, __entry->rc) | |
253 | ) | |
254 | ||
255 | #define DEFINE_SMB3_COPY_RANGE_ERR_EVENT(name) \ | |
256 | DEFINE_EVENT(smb3_copy_range_err_class, smb3_##name, \ | |
257 | TP_PROTO(unsigned int xid, \ | |
258 | __u64 src_fid, \ | |
259 | __u64 target_fid, \ | |
260 | __u32 tid, \ | |
261 | __u64 sesid, \ | |
262 | __u64 src_offset, \ | |
263 | __u64 target_offset, \ | |
264 | __u32 len, \ | |
265 | int rc), \ | |
266 | TP_ARGS(xid, src_fid, target_fid, tid, sesid, src_offset, target_offset, len, rc)) | |
267 | ||
268 | DEFINE_SMB3_COPY_RANGE_ERR_EVENT(clone_err); | |
269 | /* TODO: Add SMB3_COPY_RANGE_ERR_EVENT(copychunk_err) */ | |
eccb4422 | 270 | |
6629f87b SF |
271 | DECLARE_EVENT_CLASS(smb3_copy_range_done_class, |
272 | TP_PROTO(unsigned int xid, | |
273 | __u64 src_fid, | |
274 | __u64 target_fid, | |
275 | __u32 tid, | |
276 | __u64 sesid, | |
277 | __u64 src_offset, | |
278 | __u64 target_offset, | |
279 | __u32 len), | |
280 | TP_ARGS(xid, src_fid, target_fid, tid, sesid, src_offset, target_offset, len), | |
281 | TP_STRUCT__entry( | |
282 | __field(unsigned int, xid) | |
283 | __field(__u64, src_fid) | |
284 | __field(__u64, target_fid) | |
285 | __field(__u32, tid) | |
286 | __field(__u64, sesid) | |
287 | __field(__u64, src_offset) | |
288 | __field(__u64, target_offset) | |
289 | __field(__u32, len) | |
290 | ), | |
291 | TP_fast_assign( | |
292 | __entry->xid = xid; | |
293 | __entry->src_fid = src_fid; | |
294 | __entry->target_fid = target_fid; | |
295 | __entry->tid = tid; | |
296 | __entry->sesid = sesid; | |
297 | __entry->src_offset = src_offset; | |
298 | __entry->target_offset = target_offset; | |
299 | __entry->len = len; | |
300 | ), | |
301 | TP_printk("\txid=%u sid=0x%llx tid=0x%x source fid=0x%llx source offset=0x%llx target fid=0x%llx target offset=0x%llx len=0x%x", | |
302 | __entry->xid, __entry->sesid, __entry->tid, __entry->target_fid, | |
303 | __entry->src_offset, __entry->target_fid, __entry->target_offset, __entry->len) | |
304 | ) | |
305 | ||
306 | #define DEFINE_SMB3_COPY_RANGE_DONE_EVENT(name) \ | |
307 | DEFINE_EVENT(smb3_copy_range_done_class, smb3_##name, \ | |
308 | TP_PROTO(unsigned int xid, \ | |
309 | __u64 src_fid, \ | |
310 | __u64 target_fid, \ | |
311 | __u32 tid, \ | |
312 | __u64 sesid, \ | |
313 | __u64 src_offset, \ | |
314 | __u64 target_offset, \ | |
315 | __u32 len), \ | |
316 | TP_ARGS(xid, src_fid, target_fid, tid, sesid, src_offset, target_offset, len)) | |
317 | ||
318 | DEFINE_SMB3_COPY_RANGE_DONE_EVENT(copychunk_enter); | |
319 | DEFINE_SMB3_COPY_RANGE_DONE_EVENT(clone_enter); | |
320 | DEFINE_SMB3_COPY_RANGE_DONE_EVENT(copychunk_done); | |
321 | DEFINE_SMB3_COPY_RANGE_DONE_EVENT(clone_done); | |
322 | ||
323 | ||
eccb4422 SF |
324 | /* For logging successful read or write */ |
325 | DECLARE_EVENT_CLASS(smb3_rw_done_class, | |
3ee1a1fc DH |
326 | TP_PROTO(unsigned int rreq_debug_id, |
327 | unsigned int rreq_debug_index, | |
328 | unsigned int xid, | |
329 | __u64 fid, | |
330 | __u32 tid, | |
331 | __u64 sesid, | |
332 | __u64 offset, | |
333 | __u32 len), | |
334 | TP_ARGS(rreq_debug_id, rreq_debug_index, | |
335 | xid, fid, tid, sesid, offset, len), | |
336 | TP_STRUCT__entry( | |
337 | __field(unsigned int, rreq_debug_id) | |
338 | __field(unsigned int, rreq_debug_index) | |
339 | __field(unsigned int, xid) | |
340 | __field(__u64, fid) | |
341 | __field(__u32, tid) | |
342 | __field(__u64, sesid) | |
343 | __field(__u64, offset) | |
344 | __field(__u32, len) | |
345 | ), | |
346 | TP_fast_assign( | |
347 | __entry->rreq_debug_id = rreq_debug_id; | |
348 | __entry->rreq_debug_index = rreq_debug_index; | |
349 | __entry->xid = xid; | |
350 | __entry->fid = fid; | |
351 | __entry->tid = tid; | |
352 | __entry->sesid = sesid; | |
353 | __entry->offset = offset; | |
354 | __entry->len = len; | |
355 | ), | |
356 | TP_printk("R=%08x[%x] xid=%u sid=0x%llx tid=0x%x fid=0x%llx offset=0x%llx len=0x%x", | |
357 | __entry->rreq_debug_id, __entry->rreq_debug_index, | |
358 | __entry->xid, __entry->sesid, __entry->tid, __entry->fid, | |
359 | __entry->offset, __entry->len) | |
360 | ) | |
361 | ||
362 | #define DEFINE_SMB3_RW_DONE_EVENT(name) \ | |
363 | DEFINE_EVENT(smb3_rw_done_class, smb3_##name, \ | |
364 | TP_PROTO(unsigned int rreq_debug_id, \ | |
365 | unsigned int rreq_debug_index, \ | |
366 | unsigned int xid, \ | |
367 | __u64 fid, \ | |
368 | __u32 tid, \ | |
369 | __u64 sesid, \ | |
370 | __u64 offset, \ | |
371 | __u32 len), \ | |
372 | TP_ARGS(rreq_debug_id, rreq_debug_index, xid, fid, tid, sesid, offset, len)) | |
373 | ||
374 | DEFINE_SMB3_RW_DONE_EVENT(read_enter); | |
375 | DEFINE_SMB3_RW_DONE_EVENT(read_done); | |
85633c00 DH |
376 | DEFINE_SMB3_RW_DONE_EVENT(write_enter); |
377 | DEFINE_SMB3_RW_DONE_EVENT(write_done); | |
3ee1a1fc DH |
378 | |
379 | /* For logging successful other op */ | |
380 | DECLARE_EVENT_CLASS(smb3_other_done_class, | |
eccb4422 SF |
381 | TP_PROTO(unsigned int xid, |
382 | __u64 fid, | |
383 | __u32 tid, | |
384 | __u64 sesid, | |
385 | __u64 offset, | |
386 | __u32 len), | |
387 | TP_ARGS(xid, fid, tid, sesid, offset, len), | |
388 | TP_STRUCT__entry( | |
389 | __field(unsigned int, xid) | |
390 | __field(__u64, fid) | |
391 | __field(__u32, tid) | |
392 | __field(__u64, sesid) | |
393 | __field(__u64, offset) | |
394 | __field(__u32, len) | |
395 | ), | |
396 | TP_fast_assign( | |
397 | __entry->xid = xid; | |
398 | __entry->fid = fid; | |
399 | __entry->tid = tid; | |
400 | __entry->sesid = sesid; | |
401 | __entry->offset = offset; | |
402 | __entry->len = len; | |
403 | ), | |
d683bcd3 SF |
404 | TP_printk("xid=%u sid=0x%llx tid=0x%x fid=0x%llx offset=0x%llx len=0x%x", |
405 | __entry->xid, __entry->sesid, __entry->tid, __entry->fid, | |
eccb4422 SF |
406 | __entry->offset, __entry->len) |
407 | ) | |
408 | ||
3ee1a1fc DH |
409 | #define DEFINE_SMB3_OTHER_DONE_EVENT(name) \ |
410 | DEFINE_EVENT(smb3_other_done_class, smb3_##name, \ | |
eccb4422 SF |
411 | TP_PROTO(unsigned int xid, \ |
412 | __u64 fid, \ | |
413 | __u32 tid, \ | |
414 | __u64 sesid, \ | |
415 | __u64 offset, \ | |
416 | __u32 len), \ | |
417 | TP_ARGS(xid, fid, tid, sesid, offset, len)) | |
418 | ||
3ee1a1fc DH |
419 | DEFINE_SMB3_OTHER_DONE_EVENT(query_dir_enter); |
420 | DEFINE_SMB3_OTHER_DONE_EVENT(zero_enter); | |
421 | DEFINE_SMB3_OTHER_DONE_EVENT(falloc_enter); | |
3ee1a1fc DH |
422 | DEFINE_SMB3_OTHER_DONE_EVENT(query_dir_done); |
423 | DEFINE_SMB3_OTHER_DONE_EVENT(zero_done); | |
424 | DEFINE_SMB3_OTHER_DONE_EVENT(falloc_done); | |
eccb4422 | 425 | |
7c05eae8 SF |
426 | /* For logging successful set EOF (truncate) */ |
427 | DECLARE_EVENT_CLASS(smb3_eof_class, | |
428 | TP_PROTO(unsigned int xid, | |
429 | __u64 fid, | |
430 | __u32 tid, | |
431 | __u64 sesid, | |
432 | __u64 offset), | |
433 | TP_ARGS(xid, fid, tid, sesid, offset), | |
434 | TP_STRUCT__entry( | |
435 | __field(unsigned int, xid) | |
436 | __field(__u64, fid) | |
437 | __field(__u32, tid) | |
438 | __field(__u64, sesid) | |
439 | __field(__u64, offset) | |
440 | ), | |
441 | TP_fast_assign( | |
442 | __entry->xid = xid; | |
443 | __entry->fid = fid; | |
444 | __entry->tid = tid; | |
445 | __entry->sesid = sesid; | |
446 | __entry->offset = offset; | |
447 | ), | |
448 | TP_printk("xid=%u sid=0x%llx tid=0x%x fid=0x%llx offset=0x%llx", | |
449 | __entry->xid, __entry->sesid, __entry->tid, __entry->fid, | |
450 | __entry->offset) | |
451 | ) | |
452 | ||
453 | #define DEFINE_SMB3_EOF_EVENT(name) \ | |
454 | DEFINE_EVENT(smb3_eof_class, smb3_##name, \ | |
455 | TP_PROTO(unsigned int xid, \ | |
456 | __u64 fid, \ | |
457 | __u32 tid, \ | |
458 | __u64 sesid, \ | |
459 | __u64 offset), \ | |
460 | TP_ARGS(xid, fid, tid, sesid, offset)) | |
461 | ||
462 | DEFINE_SMB3_EOF_EVENT(set_eof); | |
463 | ||
eccb4422 SF |
464 | /* |
465 | * For handle based calls other than read and write, and get/set info | |
466 | */ | |
f90f9797 SF |
467 | DECLARE_EVENT_CLASS(smb3_fd_class, |
468 | TP_PROTO(unsigned int xid, | |
469 | __u64 fid, | |
470 | __u32 tid, | |
471 | __u64 sesid), | |
472 | TP_ARGS(xid, fid, tid, sesid), | |
473 | TP_STRUCT__entry( | |
474 | __field(unsigned int, xid) | |
475 | __field(__u64, fid) | |
476 | __field(__u32, tid) | |
477 | __field(__u64, sesid) | |
478 | ), | |
479 | TP_fast_assign( | |
480 | __entry->xid = xid; | |
481 | __entry->fid = fid; | |
482 | __entry->tid = tid; | |
483 | __entry->sesid = sesid; | |
484 | ), | |
485 | TP_printk("\txid=%u sid=0x%llx tid=0x%x fid=0x%llx", | |
486 | __entry->xid, __entry->sesid, __entry->tid, __entry->fid) | |
487 | ) | |
488 | ||
489 | #define DEFINE_SMB3_FD_EVENT(name) \ | |
490 | DEFINE_EVENT(smb3_fd_class, smb3_##name, \ | |
491 | TP_PROTO(unsigned int xid, \ | |
492 | __u64 fid, \ | |
493 | __u32 tid, \ | |
494 | __u64 sesid), \ | |
495 | TP_ARGS(xid, fid, tid, sesid)) | |
496 | ||
497 | DEFINE_SMB3_FD_EVENT(flush_enter); | |
498 | DEFINE_SMB3_FD_EVENT(flush_done); | |
499 | DEFINE_SMB3_FD_EVENT(close_enter); | |
500 | DEFINE_SMB3_FD_EVENT(close_done); | |
35a2b533 | 501 | DEFINE_SMB3_FD_EVENT(oplock_not_found); |
f90f9797 | 502 | |
eccb4422 SF |
503 | DECLARE_EVENT_CLASS(smb3_fd_err_class, |
504 | TP_PROTO(unsigned int xid, | |
505 | __u64 fid, | |
506 | __u32 tid, | |
507 | __u64 sesid, | |
508 | int rc), | |
509 | TP_ARGS(xid, fid, tid, sesid, rc), | |
510 | TP_STRUCT__entry( | |
511 | __field(unsigned int, xid) | |
512 | __field(__u64, fid) | |
513 | __field(__u32, tid) | |
514 | __field(__u64, sesid) | |
515 | __field(int, rc) | |
516 | ), | |
517 | TP_fast_assign( | |
518 | __entry->xid = xid; | |
519 | __entry->fid = fid; | |
520 | __entry->tid = tid; | |
521 | __entry->sesid = sesid; | |
522 | __entry->rc = rc; | |
523 | ), | |
d683bcd3 SF |
524 | TP_printk("\txid=%u sid=0x%llx tid=0x%x fid=0x%llx rc=%d", |
525 | __entry->xid, __entry->sesid, __entry->tid, __entry->fid, | |
eccb4422 SF |
526 | __entry->rc) |
527 | ) | |
528 | ||
529 | #define DEFINE_SMB3_FD_ERR_EVENT(name) \ | |
530 | DEFINE_EVENT(smb3_fd_err_class, smb3_##name, \ | |
531 | TP_PROTO(unsigned int xid, \ | |
532 | __u64 fid, \ | |
533 | __u32 tid, \ | |
534 | __u64 sesid, \ | |
535 | int rc), \ | |
536 | TP_ARGS(xid, fid, tid, sesid, rc)) | |
537 | ||
538 | DEFINE_SMB3_FD_ERR_EVENT(flush_err); | |
539 | DEFINE_SMB3_FD_ERR_EVENT(lock_err); | |
540 | DEFINE_SMB3_FD_ERR_EVENT(close_err); | |
541 | ||
542 | /* | |
543 | * For handle based query/set info calls | |
544 | */ | |
d42043a6 SF |
545 | DECLARE_EVENT_CLASS(smb3_inf_enter_class, |
546 | TP_PROTO(unsigned int xid, | |
547 | __u64 fid, | |
548 | __u32 tid, | |
549 | __u64 sesid, | |
550 | __u8 infclass, | |
551 | __u32 type), | |
552 | TP_ARGS(xid, fid, tid, sesid, infclass, type), | |
553 | TP_STRUCT__entry( | |
554 | __field(unsigned int, xid) | |
555 | __field(__u64, fid) | |
556 | __field(__u32, tid) | |
557 | __field(__u64, sesid) | |
558 | __field(__u8, infclass) | |
559 | __field(__u32, type) | |
560 | ), | |
561 | TP_fast_assign( | |
562 | __entry->xid = xid; | |
563 | __entry->fid = fid; | |
564 | __entry->tid = tid; | |
565 | __entry->sesid = sesid; | |
566 | __entry->infclass = infclass; | |
567 | __entry->type = type; | |
568 | ), | |
569 | TP_printk("xid=%u sid=0x%llx tid=0x%x fid=0x%llx class=%u type=0x%x", | |
570 | __entry->xid, __entry->sesid, __entry->tid, __entry->fid, | |
571 | __entry->infclass, __entry->type) | |
572 | ) | |
573 | ||
574 | #define DEFINE_SMB3_INF_ENTER_EVENT(name) \ | |
575 | DEFINE_EVENT(smb3_inf_enter_class, smb3_##name, \ | |
576 | TP_PROTO(unsigned int xid, \ | |
577 | __u64 fid, \ | |
578 | __u32 tid, \ | |
579 | __u64 sesid, \ | |
580 | __u8 infclass, \ | |
581 | __u32 type), \ | |
582 | TP_ARGS(xid, fid, tid, sesid, infclass, type)) | |
583 | ||
584 | DEFINE_SMB3_INF_ENTER_EVENT(query_info_enter); | |
585 | DEFINE_SMB3_INF_ENTER_EVENT(query_info_done); | |
c3498185 SF |
586 | DEFINE_SMB3_INF_ENTER_EVENT(notify_enter); |
587 | DEFINE_SMB3_INF_ENTER_EVENT(notify_done); | |
d42043a6 | 588 | |
eccb4422 SF |
589 | DECLARE_EVENT_CLASS(smb3_inf_err_class, |
590 | TP_PROTO(unsigned int xid, | |
591 | __u64 fid, | |
592 | __u32 tid, | |
593 | __u64 sesid, | |
594 | __u8 infclass, | |
595 | __u32 type, | |
596 | int rc), | |
597 | TP_ARGS(xid, fid, tid, sesid, infclass, type, rc), | |
598 | TP_STRUCT__entry( | |
599 | __field(unsigned int, xid) | |
600 | __field(__u64, fid) | |
601 | __field(__u32, tid) | |
602 | __field(__u64, sesid) | |
603 | __field(__u8, infclass) | |
604 | __field(__u32, type) | |
605 | __field(int, rc) | |
606 | ), | |
607 | TP_fast_assign( | |
608 | __entry->xid = xid; | |
609 | __entry->fid = fid; | |
610 | __entry->tid = tid; | |
611 | __entry->sesid = sesid; | |
612 | __entry->infclass = infclass; | |
613 | __entry->type = type; | |
614 | __entry->rc = rc; | |
615 | ), | |
d683bcd3 SF |
616 | TP_printk("xid=%u sid=0x%llx tid=0x%x fid=0x%llx class=%u type=0x%x rc=%d", |
617 | __entry->xid, __entry->sesid, __entry->tid, __entry->fid, | |
eccb4422 SF |
618 | __entry->infclass, __entry->type, __entry->rc) |
619 | ) | |
620 | ||
621 | #define DEFINE_SMB3_INF_ERR_EVENT(name) \ | |
622 | DEFINE_EVENT(smb3_inf_err_class, smb3_##name, \ | |
623 | TP_PROTO(unsigned int xid, \ | |
624 | __u64 fid, \ | |
625 | __u32 tid, \ | |
626 | __u64 sesid, \ | |
627 | __u8 infclass, \ | |
628 | __u32 type, \ | |
629 | int rc), \ | |
630 | TP_ARGS(xid, fid, tid, sesid, infclass, type, rc)) | |
631 | ||
632 | DEFINE_SMB3_INF_ERR_EVENT(query_info_err); | |
633 | DEFINE_SMB3_INF_ERR_EVENT(set_info_err); | |
c3498185 | 634 | DEFINE_SMB3_INF_ERR_EVENT(notify_err); |
eccb4422 SF |
635 | DEFINE_SMB3_INF_ERR_EVENT(fsctl_err); |
636 | ||
8191576a SF |
637 | DECLARE_EVENT_CLASS(smb3_inf_compound_enter_class, |
638 | TP_PROTO(unsigned int xid, | |
639 | __u32 tid, | |
640 | __u64 sesid, | |
641 | const char *full_path), | |
642 | TP_ARGS(xid, tid, sesid, full_path), | |
643 | TP_STRUCT__entry( | |
644 | __field(unsigned int, xid) | |
645 | __field(__u32, tid) | |
646 | __field(__u64, sesid) | |
647 | __string(path, full_path) | |
648 | ), | |
649 | TP_fast_assign( | |
650 | __entry->xid = xid; | |
651 | __entry->tid = tid; | |
652 | __entry->sesid = sesid; | |
2c92ca84 | 653 | __assign_str(path); |
8191576a SF |
654 | ), |
655 | TP_printk("xid=%u sid=0x%llx tid=0x%x path=%s", | |
656 | __entry->xid, __entry->sesid, __entry->tid, | |
657 | __get_str(path)) | |
658 | ) | |
659 | ||
660 | #define DEFINE_SMB3_INF_COMPOUND_ENTER_EVENT(name) \ | |
661 | DEFINE_EVENT(smb3_inf_compound_enter_class, smb3_##name, \ | |
662 | TP_PROTO(unsigned int xid, \ | |
663 | __u32 tid, \ | |
664 | __u64 sesid, \ | |
665 | const char *full_path), \ | |
666 | TP_ARGS(xid, tid, sesid, full_path)) | |
667 | ||
668 | DEFINE_SMB3_INF_COMPOUND_ENTER_EVENT(query_info_compound_enter); | |
e4bd7c4a | 669 | DEFINE_SMB3_INF_COMPOUND_ENTER_EVENT(posix_query_info_compound_enter); |
8191576a SF |
670 | DEFINE_SMB3_INF_COMPOUND_ENTER_EVENT(hardlink_enter); |
671 | DEFINE_SMB3_INF_COMPOUND_ENTER_EVENT(rename_enter); | |
672 | DEFINE_SMB3_INF_COMPOUND_ENTER_EVENT(rmdir_enter); | |
673 | DEFINE_SMB3_INF_COMPOUND_ENTER_EVENT(set_eof_enter); | |
674 | DEFINE_SMB3_INF_COMPOUND_ENTER_EVENT(set_info_compound_enter); | |
102466f3 | 675 | DEFINE_SMB3_INF_COMPOUND_ENTER_EVENT(set_reparse_compound_enter); |
67ec9949 | 676 | DEFINE_SMB3_INF_COMPOUND_ENTER_EVENT(get_reparse_compound_enter); |
72cf9e94 | 677 | DEFINE_SMB3_INF_COMPOUND_ENTER_EVENT(query_wsl_ea_compound_enter); |
8191576a SF |
678 | DEFINE_SMB3_INF_COMPOUND_ENTER_EVENT(delete_enter); |
679 | DEFINE_SMB3_INF_COMPOUND_ENTER_EVENT(mkdir_enter); | |
68e14569 | 680 | DEFINE_SMB3_INF_COMPOUND_ENTER_EVENT(tdis_enter); |
e9e9fbeb | 681 | DEFINE_SMB3_INF_COMPOUND_ENTER_EVENT(mknod_enter); |
8191576a | 682 | |
8191576a SF |
683 | DECLARE_EVENT_CLASS(smb3_inf_compound_done_class, |
684 | TP_PROTO(unsigned int xid, | |
685 | __u32 tid, | |
686 | __u64 sesid), | |
687 | TP_ARGS(xid, tid, sesid), | |
688 | TP_STRUCT__entry( | |
689 | __field(unsigned int, xid) | |
690 | __field(__u32, tid) | |
691 | __field(__u64, sesid) | |
692 | ), | |
693 | TP_fast_assign( | |
694 | __entry->xid = xid; | |
695 | __entry->tid = tid; | |
696 | __entry->sesid = sesid; | |
697 | ), | |
698 | TP_printk("xid=%u sid=0x%llx tid=0x%x", | |
699 | __entry->xid, __entry->sesid, __entry->tid) | |
700 | ) | |
701 | ||
702 | #define DEFINE_SMB3_INF_COMPOUND_DONE_EVENT(name) \ | |
703 | DEFINE_EVENT(smb3_inf_compound_done_class, smb3_##name, \ | |
704 | TP_PROTO(unsigned int xid, \ | |
705 | __u32 tid, \ | |
706 | __u64 sesid), \ | |
707 | TP_ARGS(xid, tid, sesid)) | |
708 | ||
709 | DEFINE_SMB3_INF_COMPOUND_DONE_EVENT(query_info_compound_done); | |
e4bd7c4a | 710 | DEFINE_SMB3_INF_COMPOUND_DONE_EVENT(posix_query_info_compound_done); |
8191576a SF |
711 | DEFINE_SMB3_INF_COMPOUND_DONE_EVENT(hardlink_done); |
712 | DEFINE_SMB3_INF_COMPOUND_DONE_EVENT(rename_done); | |
713 | DEFINE_SMB3_INF_COMPOUND_DONE_EVENT(rmdir_done); | |
714 | DEFINE_SMB3_INF_COMPOUND_DONE_EVENT(set_eof_done); | |
715 | DEFINE_SMB3_INF_COMPOUND_DONE_EVENT(set_info_compound_done); | |
102466f3 | 716 | DEFINE_SMB3_INF_COMPOUND_DONE_EVENT(set_reparse_compound_done); |
67ec9949 | 717 | DEFINE_SMB3_INF_COMPOUND_DONE_EVENT(get_reparse_compound_done); |
ea41367b | 718 | DEFINE_SMB3_INF_COMPOUND_DONE_EVENT(query_wsl_ea_compound_done); |
8191576a SF |
719 | DEFINE_SMB3_INF_COMPOUND_DONE_EVENT(delete_done); |
720 | DEFINE_SMB3_INF_COMPOUND_DONE_EVENT(mkdir_done); | |
68e14569 | 721 | DEFINE_SMB3_INF_COMPOUND_DONE_EVENT(tdis_done); |
e9e9fbeb | 722 | DEFINE_SMB3_INF_COMPOUND_DONE_EVENT(mknod_done); |
8191576a SF |
723 | |
724 | DECLARE_EVENT_CLASS(smb3_inf_compound_err_class, | |
725 | TP_PROTO(unsigned int xid, | |
726 | __u32 tid, | |
727 | __u64 sesid, | |
728 | int rc), | |
729 | TP_ARGS(xid, tid, sesid, rc), | |
730 | TP_STRUCT__entry( | |
731 | __field(unsigned int, xid) | |
732 | __field(__u32, tid) | |
733 | __field(__u64, sesid) | |
734 | __field(int, rc) | |
735 | ), | |
736 | TP_fast_assign( | |
737 | __entry->xid = xid; | |
738 | __entry->tid = tid; | |
739 | __entry->sesid = sesid; | |
740 | __entry->rc = rc; | |
741 | ), | |
742 | TP_printk("xid=%u sid=0x%llx tid=0x%x rc=%d", | |
743 | __entry->xid, __entry->sesid, __entry->tid, | |
744 | __entry->rc) | |
745 | ) | |
746 | ||
747 | #define DEFINE_SMB3_INF_COMPOUND_ERR_EVENT(name) \ | |
748 | DEFINE_EVENT(smb3_inf_compound_err_class, smb3_##name, \ | |
749 | TP_PROTO(unsigned int xid, \ | |
750 | __u32 tid, \ | |
751 | __u64 sesid, \ | |
752 | int rc), \ | |
753 | TP_ARGS(xid, tid, sesid, rc)) | |
754 | ||
755 | DEFINE_SMB3_INF_COMPOUND_ERR_EVENT(query_info_compound_err); | |
e4bd7c4a | 756 | DEFINE_SMB3_INF_COMPOUND_ERR_EVENT(posix_query_info_compound_err); |
8191576a SF |
757 | DEFINE_SMB3_INF_COMPOUND_ERR_EVENT(hardlink_err); |
758 | DEFINE_SMB3_INF_COMPOUND_ERR_EVENT(rename_err); | |
759 | DEFINE_SMB3_INF_COMPOUND_ERR_EVENT(rmdir_err); | |
760 | DEFINE_SMB3_INF_COMPOUND_ERR_EVENT(set_eof_err); | |
761 | DEFINE_SMB3_INF_COMPOUND_ERR_EVENT(set_info_compound_err); | |
102466f3 | 762 | DEFINE_SMB3_INF_COMPOUND_ERR_EVENT(set_reparse_compound_err); |
67ec9949 | 763 | DEFINE_SMB3_INF_COMPOUND_ERR_EVENT(get_reparse_compound_err); |
ea41367b | 764 | DEFINE_SMB3_INF_COMPOUND_ERR_EVENT(query_wsl_ea_compound_err); |
8191576a SF |
765 | DEFINE_SMB3_INF_COMPOUND_ERR_EVENT(mkdir_err); |
766 | DEFINE_SMB3_INF_COMPOUND_ERR_EVENT(delete_err); | |
68e14569 | 767 | DEFINE_SMB3_INF_COMPOUND_ERR_EVENT(tdis_err); |
e9e9fbeb | 768 | DEFINE_SMB3_INF_COMPOUND_ERR_EVENT(mknod_err); |
8191576a | 769 | |
eccb4422 SF |
770 | /* |
771 | * For logging SMB3 Status code and Command for responses which return errors | |
772 | */ | |
773 | DECLARE_EVENT_CLASS(smb3_cmd_err_class, | |
d683bcd3 | 774 | TP_PROTO(__u32 tid, |
eccb4422 SF |
775 | __u64 sesid, |
776 | __u16 cmd, | |
777 | __u64 mid, | |
778 | __u32 status, | |
779 | int rc), | |
d683bcd3 | 780 | TP_ARGS(tid, sesid, cmd, mid, status, rc), |
eccb4422 | 781 | TP_STRUCT__entry( |
eccb4422 SF |
782 | __field(__u32, tid) |
783 | __field(__u64, sesid) | |
784 | __field(__u16, cmd) | |
785 | __field(__u64, mid) | |
786 | __field(__u32, status) | |
787 | __field(int, rc) | |
788 | ), | |
789 | TP_fast_assign( | |
eccb4422 SF |
790 | __entry->tid = tid; |
791 | __entry->sesid = sesid; | |
792 | __entry->cmd = cmd; | |
793 | __entry->mid = mid; | |
794 | __entry->status = status; | |
795 | __entry->rc = rc; | |
796 | ), | |
d683bcd3 SF |
797 | TP_printk("\tsid=0x%llx tid=0x%x cmd=%u mid=%llu status=0x%x rc=%d", |
798 | __entry->sesid, __entry->tid, __entry->cmd, __entry->mid, | |
799 | __entry->status, __entry->rc) | |
eccb4422 SF |
800 | ) |
801 | ||
802 | #define DEFINE_SMB3_CMD_ERR_EVENT(name) \ | |
803 | DEFINE_EVENT(smb3_cmd_err_class, smb3_##name, \ | |
d683bcd3 | 804 | TP_PROTO(__u32 tid, \ |
eccb4422 SF |
805 | __u64 sesid, \ |
806 | __u16 cmd, \ | |
807 | __u64 mid, \ | |
808 | __u32 status, \ | |
809 | int rc), \ | |
d683bcd3 | 810 | TP_ARGS(tid, sesid, cmd, mid, status, rc)) |
eccb4422 SF |
811 | |
812 | DEFINE_SMB3_CMD_ERR_EVENT(cmd_err); | |
813 | ||
814 | DECLARE_EVENT_CLASS(smb3_cmd_done_class, | |
d683bcd3 | 815 | TP_PROTO(__u32 tid, |
eccb4422 SF |
816 | __u64 sesid, |
817 | __u16 cmd, | |
818 | __u64 mid), | |
d683bcd3 | 819 | TP_ARGS(tid, sesid, cmd, mid), |
eccb4422 | 820 | TP_STRUCT__entry( |
eccb4422 SF |
821 | __field(__u32, tid) |
822 | __field(__u64, sesid) | |
823 | __field(__u16, cmd) | |
824 | __field(__u64, mid) | |
825 | ), | |
826 | TP_fast_assign( | |
eccb4422 SF |
827 | __entry->tid = tid; |
828 | __entry->sesid = sesid; | |
829 | __entry->cmd = cmd; | |
830 | __entry->mid = mid; | |
831 | ), | |
d683bcd3 SF |
832 | TP_printk("\tsid=0x%llx tid=0x%x cmd=%u mid=%llu", |
833 | __entry->sesid, __entry->tid, | |
eccb4422 SF |
834 | __entry->cmd, __entry->mid) |
835 | ) | |
836 | ||
837 | #define DEFINE_SMB3_CMD_DONE_EVENT(name) \ | |
838 | DEFINE_EVENT(smb3_cmd_done_class, smb3_##name, \ | |
d683bcd3 | 839 | TP_PROTO(__u32 tid, \ |
eccb4422 SF |
840 | __u64 sesid, \ |
841 | __u16 cmd, \ | |
842 | __u64 mid), \ | |
d683bcd3 | 843 | TP_ARGS(tid, sesid, cmd, mid)) |
eccb4422 | 844 | |
53a3e0d9 | 845 | DEFINE_SMB3_CMD_DONE_EVENT(cmd_enter); |
eccb4422 | 846 | DEFINE_SMB3_CMD_DONE_EVENT(cmd_done); |
e68a932b | 847 | DEFINE_SMB3_CMD_DONE_EVENT(ses_expired); |
eccb4422 | 848 | |
020eec5f SF |
849 | DECLARE_EVENT_CLASS(smb3_mid_class, |
850 | TP_PROTO(__u16 cmd, | |
851 | __u64 mid, | |
852 | __u32 pid, | |
853 | unsigned long when_sent, | |
854 | unsigned long when_received), | |
855 | TP_ARGS(cmd, mid, pid, when_sent, when_received), | |
856 | TP_STRUCT__entry( | |
857 | __field(__u16, cmd) | |
858 | __field(__u64, mid) | |
859 | __field(__u32, pid) | |
860 | __field(unsigned long, when_sent) | |
861 | __field(unsigned long, when_received) | |
862 | ), | |
863 | TP_fast_assign( | |
864 | __entry->cmd = cmd; | |
865 | __entry->mid = mid; | |
866 | __entry->pid = pid; | |
867 | __entry->when_sent = when_sent; | |
868 | __entry->when_received = when_received; | |
869 | ), | |
870 | TP_printk("\tcmd=%u mid=%llu pid=%u, when_sent=%lu when_rcv=%lu", | |
871 | __entry->cmd, __entry->mid, __entry->pid, __entry->when_sent, | |
872 | __entry->when_received) | |
873 | ) | |
874 | ||
875 | #define DEFINE_SMB3_MID_EVENT(name) \ | |
876 | DEFINE_EVENT(smb3_mid_class, smb3_##name, \ | |
877 | TP_PROTO(__u16 cmd, \ | |
878 | __u64 mid, \ | |
879 | __u32 pid, \ | |
880 | unsigned long when_sent, \ | |
881 | unsigned long when_received), \ | |
882 | TP_ARGS(cmd, mid, pid, when_sent, when_received)) | |
883 | ||
884 | DEFINE_SMB3_MID_EVENT(slow_rsp); | |
885 | ||
d683bcd3 SF |
886 | DECLARE_EVENT_CLASS(smb3_exit_err_class, |
887 | TP_PROTO(unsigned int xid, | |
888 | const char *func_name, | |
889 | int rc), | |
890 | TP_ARGS(xid, func_name, rc), | |
891 | TP_STRUCT__entry( | |
892 | __field(unsigned int, xid) | |
eb068818 | 893 | __string(func_name, func_name) |
d683bcd3 SF |
894 | __field(int, rc) |
895 | ), | |
896 | TP_fast_assign( | |
897 | __entry->xid = xid; | |
2c92ca84 | 898 | __assign_str(func_name); |
d683bcd3 SF |
899 | __entry->rc = rc; |
900 | ), | |
901 | TP_printk("\t%s: xid=%u rc=%d", | |
eb068818 | 902 | __get_str(func_name), __entry->xid, __entry->rc) |
d683bcd3 SF |
903 | ) |
904 | ||
905 | #define DEFINE_SMB3_EXIT_ERR_EVENT(name) \ | |
906 | DEFINE_EVENT(smb3_exit_err_class, smb3_##name, \ | |
907 | TP_PROTO(unsigned int xid, \ | |
908 | const char *func_name, \ | |
909 | int rc), \ | |
910 | TP_ARGS(xid, func_name, rc)) | |
911 | ||
912 | DEFINE_SMB3_EXIT_ERR_EVENT(exit_err); | |
913 | ||
f2bf09e9 SF |
914 | |
915 | DECLARE_EVENT_CLASS(smb3_sync_err_class, | |
916 | TP_PROTO(unsigned long ino, | |
917 | int rc), | |
918 | TP_ARGS(ino, rc), | |
919 | TP_STRUCT__entry( | |
920 | __field(unsigned long, ino) | |
921 | __field(int, rc) | |
922 | ), | |
923 | TP_fast_assign( | |
924 | __entry->ino = ino; | |
925 | __entry->rc = rc; | |
926 | ), | |
927 | TP_printk("\tino=%lu rc=%d", | |
928 | __entry->ino, __entry->rc) | |
929 | ) | |
930 | ||
931 | #define DEFINE_SMB3_SYNC_ERR_EVENT(name) \ | |
932 | DEFINE_EVENT(smb3_sync_err_class, cifs_##name, \ | |
933 | TP_PROTO(unsigned long ino, \ | |
934 | int rc), \ | |
935 | TP_ARGS(ino, rc)) | |
936 | ||
937 | DEFINE_SMB3_SYNC_ERR_EVENT(fsync_err); | |
938 | DEFINE_SMB3_SYNC_ERR_EVENT(flush_err); | |
939 | ||
940 | ||
d683bcd3 SF |
941 | DECLARE_EVENT_CLASS(smb3_enter_exit_class, |
942 | TP_PROTO(unsigned int xid, | |
943 | const char *func_name), | |
944 | TP_ARGS(xid, func_name), | |
945 | TP_STRUCT__entry( | |
946 | __field(unsigned int, xid) | |
eb068818 | 947 | __string(func_name, func_name) |
d683bcd3 SF |
948 | ), |
949 | TP_fast_assign( | |
950 | __entry->xid = xid; | |
2c92ca84 | 951 | __assign_str(func_name); |
d683bcd3 SF |
952 | ), |
953 | TP_printk("\t%s: xid=%u", | |
eb068818 | 954 | __get_str(func_name), __entry->xid) |
d683bcd3 SF |
955 | ) |
956 | ||
957 | #define DEFINE_SMB3_ENTER_EXIT_EVENT(name) \ | |
958 | DEFINE_EVENT(smb3_enter_exit_class, smb3_##name, \ | |
959 | TP_PROTO(unsigned int xid, \ | |
960 | const char *func_name), \ | |
961 | TP_ARGS(xid, func_name)) | |
962 | ||
963 | DEFINE_SMB3_ENTER_EXIT_EVENT(enter); | |
964 | DEFINE_SMB3_ENTER_EXIT_EVENT(exit_done); | |
965 | ||
f8af49dd SF |
966 | /* |
967 | * For SMB2/SMB3 tree connect | |
968 | */ | |
969 | ||
970 | DECLARE_EVENT_CLASS(smb3_tcon_class, | |
971 | TP_PROTO(unsigned int xid, | |
972 | __u32 tid, | |
973 | __u64 sesid, | |
974 | const char *unc_name, | |
975 | int rc), | |
976 | TP_ARGS(xid, tid, sesid, unc_name, rc), | |
977 | TP_STRUCT__entry( | |
978 | __field(unsigned int, xid) | |
979 | __field(__u32, tid) | |
980 | __field(__u64, sesid) | |
68ddb496 | 981 | __string(name, unc_name) |
f8af49dd SF |
982 | __field(int, rc) |
983 | ), | |
984 | TP_fast_assign( | |
985 | __entry->xid = xid; | |
986 | __entry->tid = tid; | |
987 | __entry->sesid = sesid; | |
2c92ca84 | 988 | __assign_str(name); |
f8af49dd SF |
989 | __entry->rc = rc; |
990 | ), | |
991 | TP_printk("xid=%u sid=0x%llx tid=0x%x unc_name=%s rc=%d", | |
992 | __entry->xid, __entry->sesid, __entry->tid, | |
68ddb496 | 993 | __get_str(name), __entry->rc) |
f8af49dd SF |
994 | ) |
995 | ||
996 | #define DEFINE_SMB3_TCON_EVENT(name) \ | |
997 | DEFINE_EVENT(smb3_tcon_class, smb3_##name, \ | |
998 | TP_PROTO(unsigned int xid, \ | |
999 | __u32 tid, \ | |
1000 | __u64 sesid, \ | |
1001 | const char *unc_name, \ | |
1002 | int rc), \ | |
1003 | TP_ARGS(xid, tid, sesid, unc_name, rc)) | |
1004 | ||
1005 | DEFINE_SMB3_TCON_EVENT(tcon); | |
feeec636 | 1006 | DEFINE_SMB3_TCON_EVENT(qfs_done); |
f8af49dd | 1007 | |
28d59363 | 1008 | /* |
efe2e9f3 | 1009 | * For smb2/smb3 open (including create and mkdir) calls |
28d59363 | 1010 | */ |
efe2e9f3 SF |
1011 | |
1012 | DECLARE_EVENT_CLASS(smb3_open_enter_class, | |
1013 | TP_PROTO(unsigned int xid, | |
1014 | __u32 tid, | |
1015 | __u64 sesid, | |
fddc6ccc | 1016 | const char *full_path, |
efe2e9f3 SF |
1017 | int create_options, |
1018 | int desired_access), | |
fddc6ccc | 1019 | TP_ARGS(xid, tid, sesid, full_path, create_options, desired_access), |
efe2e9f3 SF |
1020 | TP_STRUCT__entry( |
1021 | __field(unsigned int, xid) | |
1022 | __field(__u32, tid) | |
1023 | __field(__u64, sesid) | |
fddc6ccc | 1024 | __string(path, full_path) |
efe2e9f3 SF |
1025 | __field(int, create_options) |
1026 | __field(int, desired_access) | |
1027 | ), | |
1028 | TP_fast_assign( | |
1029 | __entry->xid = xid; | |
1030 | __entry->tid = tid; | |
1031 | __entry->sesid = sesid; | |
2c92ca84 | 1032 | __assign_str(path); |
efe2e9f3 SF |
1033 | __entry->create_options = create_options; |
1034 | __entry->desired_access = desired_access; | |
1035 | ), | |
fddc6ccc SP |
1036 | TP_printk("xid=%u sid=0x%llx tid=0x%x path=%s cr_opts=0x%x des_access=0x%x", |
1037 | __entry->xid, __entry->sesid, __entry->tid, __get_str(path), | |
efe2e9f3 SF |
1038 | __entry->create_options, __entry->desired_access) |
1039 | ) | |
1040 | ||
1041 | #define DEFINE_SMB3_OPEN_ENTER_EVENT(name) \ | |
1042 | DEFINE_EVENT(smb3_open_enter_class, smb3_##name, \ | |
1043 | TP_PROTO(unsigned int xid, \ | |
1044 | __u32 tid, \ | |
1045 | __u64 sesid, \ | |
fddc6ccc | 1046 | const char *full_path, \ |
efe2e9f3 SF |
1047 | int create_options, \ |
1048 | int desired_access), \ | |
fddc6ccc | 1049 | TP_ARGS(xid, tid, sesid, full_path, create_options, desired_access)) |
efe2e9f3 SF |
1050 | |
1051 | DEFINE_SMB3_OPEN_ENTER_EVENT(open_enter); | |
1052 | DEFINE_SMB3_OPEN_ENTER_EVENT(posix_mkdir_enter); | |
1053 | ||
28d59363 SF |
1054 | DECLARE_EVENT_CLASS(smb3_open_err_class, |
1055 | TP_PROTO(unsigned int xid, | |
1056 | __u32 tid, | |
1057 | __u64 sesid, | |
1058 | int create_options, | |
1059 | int desired_access, | |
1060 | int rc), | |
1061 | TP_ARGS(xid, tid, sesid, create_options, desired_access, rc), | |
1062 | TP_STRUCT__entry( | |
1063 | __field(unsigned int, xid) | |
1064 | __field(__u32, tid) | |
1065 | __field(__u64, sesid) | |
1066 | __field(int, create_options) | |
1067 | __field(int, desired_access) | |
1068 | __field(int, rc) | |
1069 | ), | |
1070 | TP_fast_assign( | |
1071 | __entry->xid = xid; | |
1072 | __entry->tid = tid; | |
1073 | __entry->sesid = sesid; | |
1074 | __entry->create_options = create_options; | |
1075 | __entry->desired_access = desired_access; | |
1076 | __entry->rc = rc; | |
1077 | ), | |
1078 | TP_printk("xid=%u sid=0x%llx tid=0x%x cr_opts=0x%x des_access=0x%x rc=%d", | |
1079 | __entry->xid, __entry->sesid, __entry->tid, | |
1080 | __entry->create_options, __entry->desired_access, __entry->rc) | |
1081 | ) | |
1082 | ||
1083 | #define DEFINE_SMB3_OPEN_ERR_EVENT(name) \ | |
1084 | DEFINE_EVENT(smb3_open_err_class, smb3_##name, \ | |
1085 | TP_PROTO(unsigned int xid, \ | |
1086 | __u32 tid, \ | |
1087 | __u64 sesid, \ | |
1088 | int create_options, \ | |
1089 | int desired_access, \ | |
1090 | int rc), \ | |
1091 | TP_ARGS(xid, tid, sesid, create_options, desired_access, rc)) | |
1092 | ||
1093 | DEFINE_SMB3_OPEN_ERR_EVENT(open_err); | |
bea851b8 | 1094 | DEFINE_SMB3_OPEN_ERR_EVENT(posix_mkdir_err); |
28d59363 SF |
1095 | |
1096 | DECLARE_EVENT_CLASS(smb3_open_done_class, | |
1097 | TP_PROTO(unsigned int xid, | |
1098 | __u64 fid, | |
1099 | __u32 tid, | |
1100 | __u64 sesid, | |
1101 | int create_options, | |
1102 | int desired_access), | |
1103 | TP_ARGS(xid, fid, tid, sesid, create_options, desired_access), | |
1104 | TP_STRUCT__entry( | |
1105 | __field(unsigned int, xid) | |
1106 | __field(__u64, fid) | |
1107 | __field(__u32, tid) | |
1108 | __field(__u64, sesid) | |
1109 | __field(int, create_options) | |
1110 | __field(int, desired_access) | |
1111 | ), | |
1112 | TP_fast_assign( | |
1113 | __entry->xid = xid; | |
1114 | __entry->fid = fid; | |
1115 | __entry->tid = tid; | |
1116 | __entry->sesid = sesid; | |
1117 | __entry->create_options = create_options; | |
1118 | __entry->desired_access = desired_access; | |
1119 | ), | |
1120 | TP_printk("xid=%u sid=0x%llx tid=0x%x fid=0x%llx cr_opts=0x%x des_access=0x%x", | |
1121 | __entry->xid, __entry->sesid, __entry->tid, __entry->fid, | |
1122 | __entry->create_options, __entry->desired_access) | |
1123 | ) | |
1124 | ||
1125 | #define DEFINE_SMB3_OPEN_DONE_EVENT(name) \ | |
1126 | DEFINE_EVENT(smb3_open_done_class, smb3_##name, \ | |
1127 | TP_PROTO(unsigned int xid, \ | |
1128 | __u64 fid, \ | |
1129 | __u32 tid, \ | |
1130 | __u64 sesid, \ | |
1131 | int create_options, \ | |
1132 | int desired_access), \ | |
1133 | TP_ARGS(xid, fid, tid, sesid, create_options, desired_access)) | |
1134 | ||
1135 | DEFINE_SMB3_OPEN_DONE_EVENT(open_done); | |
bea851b8 | 1136 | DEFINE_SMB3_OPEN_DONE_EVENT(posix_mkdir_done); |
28d59363 | 1137 | |
179e44d4 SF |
1138 | |
1139 | DECLARE_EVENT_CLASS(smb3_lease_done_class, | |
1140 | TP_PROTO(__u32 lease_state, | |
1141 | __u32 tid, | |
1142 | __u64 sesid, | |
1143 | __u64 lease_key_low, | |
1144 | __u64 lease_key_high), | |
1145 | TP_ARGS(lease_state, tid, sesid, lease_key_low, lease_key_high), | |
1146 | TP_STRUCT__entry( | |
1147 | __field(__u32, lease_state) | |
1148 | __field(__u32, tid) | |
1149 | __field(__u64, sesid) | |
1150 | __field(__u64, lease_key_low) | |
1151 | __field(__u64, lease_key_high) | |
1152 | ), | |
1153 | TP_fast_assign( | |
1154 | __entry->lease_state = lease_state; | |
1155 | __entry->tid = tid; | |
1156 | __entry->sesid = sesid; | |
1157 | __entry->lease_key_low = lease_key_low; | |
1158 | __entry->lease_key_high = lease_key_high; | |
1159 | ), | |
1160 | TP_printk("sid=0x%llx tid=0x%x lease_key=0x%llx%llx lease_state=0x%x", | |
1161 | __entry->sesid, __entry->tid, __entry->lease_key_high, | |
1162 | __entry->lease_key_low, __entry->lease_state) | |
1163 | ) | |
1164 | ||
1165 | #define DEFINE_SMB3_LEASE_DONE_EVENT(name) \ | |
1166 | DEFINE_EVENT(smb3_lease_done_class, smb3_##name, \ | |
1167 | TP_PROTO(__u32 lease_state, \ | |
1168 | __u32 tid, \ | |
1169 | __u64 sesid, \ | |
1170 | __u64 lease_key_low, \ | |
1171 | __u64 lease_key_high), \ | |
1172 | TP_ARGS(lease_state, tid, sesid, lease_key_low, lease_key_high)) | |
1173 | ||
1174 | DEFINE_SMB3_LEASE_DONE_EVENT(lease_done); | |
fb253d5b | 1175 | DEFINE_SMB3_LEASE_DONE_EVENT(lease_not_found); |
179e44d4 SF |
1176 | |
1177 | DECLARE_EVENT_CLASS(smb3_lease_err_class, | |
1178 | TP_PROTO(__u32 lease_state, | |
1179 | __u32 tid, | |
1180 | __u64 sesid, | |
1181 | __u64 lease_key_low, | |
1182 | __u64 lease_key_high, | |
1183 | int rc), | |
1184 | TP_ARGS(lease_state, tid, sesid, lease_key_low, lease_key_high, rc), | |
1185 | TP_STRUCT__entry( | |
1186 | __field(__u32, lease_state) | |
1187 | __field(__u32, tid) | |
1188 | __field(__u64, sesid) | |
1189 | __field(__u64, lease_key_low) | |
1190 | __field(__u64, lease_key_high) | |
1191 | __field(int, rc) | |
1192 | ), | |
1193 | TP_fast_assign( | |
1194 | __entry->lease_state = lease_state; | |
1195 | __entry->tid = tid; | |
1196 | __entry->sesid = sesid; | |
1197 | __entry->lease_key_low = lease_key_low; | |
1198 | __entry->lease_key_high = lease_key_high; | |
1199 | __entry->rc = rc; | |
1200 | ), | |
1201 | TP_printk("sid=0x%llx tid=0x%x lease_key=0x%llx%llx lease_state=0x%x rc=%d", | |
1202 | __entry->sesid, __entry->tid, __entry->lease_key_high, | |
1203 | __entry->lease_key_low, __entry->lease_state, __entry->rc) | |
1204 | ) | |
1205 | ||
1206 | #define DEFINE_SMB3_LEASE_ERR_EVENT(name) \ | |
1207 | DEFINE_EVENT(smb3_lease_err_class, smb3_##name, \ | |
1208 | TP_PROTO(__u32 lease_state, \ | |
1209 | __u32 tid, \ | |
1210 | __u64 sesid, \ | |
1211 | __u64 lease_key_low, \ | |
1212 | __u64 lease_key_high, \ | |
1213 | int rc), \ | |
1214 | TP_ARGS(lease_state, tid, sesid, lease_key_low, lease_key_high, rc)) | |
1215 | ||
1216 | DEFINE_SMB3_LEASE_ERR_EVENT(lease_err); | |
1217 | ||
d7171cd1 SF |
1218 | DECLARE_EVENT_CLASS(smb3_connect_class, |
1219 | TP_PROTO(char *hostname, | |
1220 | __u64 conn_id, | |
1221 | const struct __kernel_sockaddr_storage *dst_addr), | |
1222 | TP_ARGS(hostname, conn_id, dst_addr), | |
1223 | TP_STRUCT__entry( | |
1224 | __string(hostname, hostname) | |
1225 | __field(__u64, conn_id) | |
1226 | __array(__u8, dst_addr, sizeof(struct sockaddr_storage)) | |
1227 | ), | |
1228 | TP_fast_assign( | |
1229 | struct sockaddr_storage *pss = NULL; | |
1230 | ||
1231 | __entry->conn_id = conn_id; | |
1232 | pss = (struct sockaddr_storage *)__entry->dst_addr; | |
1233 | *pss = *dst_addr; | |
2c92ca84 | 1234 | __assign_str(hostname); |
d7171cd1 SF |
1235 | ), |
1236 | TP_printk("conn_id=0x%llx server=%s addr=%pISpsfc", | |
1237 | __entry->conn_id, | |
1238 | __get_str(hostname), | |
1239 | __entry->dst_addr) | |
1240 | ) | |
1241 | ||
1242 | #define DEFINE_SMB3_CONNECT_EVENT(name) \ | |
1243 | DEFINE_EVENT(smb3_connect_class, smb3_##name, \ | |
1244 | TP_PROTO(char *hostname, \ | |
1245 | __u64 conn_id, \ | |
1246 | const struct __kernel_sockaddr_storage *addr), \ | |
1247 | TP_ARGS(hostname, conn_id, addr)) | |
1248 | ||
1249 | DEFINE_SMB3_CONNECT_EVENT(connect_done); | |
e3603ccf SF |
1250 | DEFINE_SMB3_CONNECT_EVENT(smbd_connect_done); |
1251 | DEFINE_SMB3_CONNECT_EVENT(smbd_connect_err); | |
d7171cd1 SF |
1252 | |
1253 | DECLARE_EVENT_CLASS(smb3_connect_err_class, | |
1254 | TP_PROTO(char *hostname, __u64 conn_id, | |
1255 | const struct __kernel_sockaddr_storage *dst_addr, int rc), | |
1256 | TP_ARGS(hostname, conn_id, dst_addr, rc), | |
1257 | TP_STRUCT__entry( | |
1258 | __string(hostname, hostname) | |
1259 | __field(__u64, conn_id) | |
1260 | __array(__u8, dst_addr, sizeof(struct sockaddr_storage)) | |
1261 | __field(int, rc) | |
1262 | ), | |
1263 | TP_fast_assign( | |
1264 | struct sockaddr_storage *pss = NULL; | |
1265 | ||
1266 | __entry->conn_id = conn_id; | |
1267 | __entry->rc = rc; | |
1268 | pss = (struct sockaddr_storage *)__entry->dst_addr; | |
1269 | *pss = *dst_addr; | |
2c92ca84 | 1270 | __assign_str(hostname); |
d7171cd1 SF |
1271 | ), |
1272 | TP_printk("rc=%d conn_id=0x%llx server=%s addr=%pISpsfc", | |
1273 | __entry->rc, | |
1274 | __entry->conn_id, | |
1275 | __get_str(hostname), | |
1276 | __entry->dst_addr) | |
1277 | ) | |
1278 | ||
1279 | #define DEFINE_SMB3_CONNECT_ERR_EVENT(name) \ | |
1280 | DEFINE_EVENT(smb3_connect_err_class, smb3_##name, \ | |
1281 | TP_PROTO(char *hostname, \ | |
1282 | __u64 conn_id, \ | |
1283 | const struct __kernel_sockaddr_storage *addr, \ | |
1284 | int rc), \ | |
1285 | TP_ARGS(hostname, conn_id, addr, rc)) | |
1286 | ||
1287 | DEFINE_SMB3_CONNECT_ERR_EVENT(connect_err); | |
1288 | ||
b6f6a7aa SF |
1289 | DECLARE_EVENT_CLASS(smb3_sess_setup_err_class, |
1290 | TP_PROTO(char *hostname, char *username, __u64 conn_id, | |
1291 | const struct __kernel_sockaddr_storage *dst_addr, int rc), | |
1292 | TP_ARGS(hostname, username, conn_id, dst_addr, rc), | |
1293 | TP_STRUCT__entry( | |
1294 | __string(hostname, hostname) | |
1295 | __string(username, username) | |
1296 | __field(__u64, conn_id) | |
1297 | __array(__u8, dst_addr, sizeof(struct sockaddr_storage)) | |
1298 | __field(int, rc) | |
1299 | ), | |
1300 | TP_fast_assign( | |
1301 | struct sockaddr_storage *pss = NULL; | |
1302 | ||
1303 | __entry->conn_id = conn_id; | |
1304 | __entry->rc = rc; | |
1305 | pss = (struct sockaddr_storage *)__entry->dst_addr; | |
1306 | *pss = *dst_addr; | |
1307 | __assign_str(hostname); | |
1308 | __assign_str(username); | |
1309 | ), | |
1310 | TP_printk("rc=%d user=%s conn_id=0x%llx server=%s addr=%pISpsfc", | |
1311 | __entry->rc, | |
1312 | __get_str(username), | |
1313 | __entry->conn_id, | |
1314 | __get_str(hostname), | |
1315 | __entry->dst_addr) | |
1316 | ) | |
1317 | ||
1318 | #define DEFINE_SMB3_SES_SETUP_ERR_EVENT(name) \ | |
1319 | DEFINE_EVENT(smb3_sess_setup_err_class, smb3_##name, \ | |
1320 | TP_PROTO(char *hostname, \ | |
1321 | char *username, \ | |
1322 | __u64 conn_id, \ | |
1323 | const struct __kernel_sockaddr_storage *addr, \ | |
1324 | int rc), \ | |
1325 | TP_ARGS(hostname, username, conn_id, addr, rc)) | |
1326 | ||
1327 | DEFINE_SMB3_SES_SETUP_ERR_EVENT(key_expired); | |
1328 | ||
bf1fdeb7 SF |
1329 | DECLARE_EVENT_CLASS(smb3_reconnect_class, |
1330 | TP_PROTO(__u64 currmid, | |
6d82c27a | 1331 | __u64 conn_id, |
bf1fdeb7 | 1332 | char *hostname), |
6d82c27a | 1333 | TP_ARGS(currmid, conn_id, hostname), |
bf1fdeb7 SF |
1334 | TP_STRUCT__entry( |
1335 | __field(__u64, currmid) | |
6d82c27a | 1336 | __field(__u64, conn_id) |
eb068818 | 1337 | __string(hostname, hostname) |
bf1fdeb7 SF |
1338 | ), |
1339 | TP_fast_assign( | |
1340 | __entry->currmid = currmid; | |
6d82c27a | 1341 | __entry->conn_id = conn_id; |
2c92ca84 | 1342 | __assign_str(hostname); |
bf1fdeb7 | 1343 | ), |
6d82c27a SP |
1344 | TP_printk("conn_id=0x%llx server=%s current_mid=%llu", |
1345 | __entry->conn_id, | |
eb068818 | 1346 | __get_str(hostname), |
bf1fdeb7 SF |
1347 | __entry->currmid) |
1348 | ) | |
1349 | ||
1350 | #define DEFINE_SMB3_RECONNECT_EVENT(name) \ | |
1351 | DEFINE_EVENT(smb3_reconnect_class, smb3_##name, \ | |
1352 | TP_PROTO(__u64 currmid, \ | |
6d82c27a SP |
1353 | __u64 conn_id, \ |
1354 | char *hostname), \ | |
1355 | TP_ARGS(currmid, conn_id, hostname)) | |
bf1fdeb7 SF |
1356 | |
1357 | DEFINE_SMB3_RECONNECT_EVENT(reconnect); | |
1358 | DEFINE_SMB3_RECONNECT_EVENT(partial_send_reconnect); | |
1359 | ||
61986a58 SP |
1360 | DECLARE_EVENT_CLASS(smb3_ses_class, |
1361 | TP_PROTO(__u64 sesid), | |
1362 | TP_ARGS(sesid), | |
1363 | TP_STRUCT__entry( | |
1364 | __field(__u64, sesid) | |
1365 | ), | |
1366 | TP_fast_assign( | |
1367 | __entry->sesid = sesid; | |
1368 | ), | |
1369 | TP_printk("sid=0x%llx", | |
1370 | __entry->sesid) | |
1371 | ) | |
1372 | ||
1373 | #define DEFINE_SMB3_SES_EVENT(name) \ | |
1374 | DEFINE_EVENT(smb3_ses_class, smb3_##name, \ | |
1375 | TP_PROTO(__u64 sesid), \ | |
1376 | TP_ARGS(sesid)) | |
1377 | ||
1378 | DEFINE_SMB3_SES_EVENT(ses_not_found); | |
1379 | ||
073dd87c SF |
1380 | DECLARE_EVENT_CLASS(smb3_ioctl_class, |
1381 | TP_PROTO(unsigned int xid, | |
1382 | __u64 fid, | |
1383 | unsigned int command), | |
1384 | TP_ARGS(xid, fid, command), | |
1385 | TP_STRUCT__entry( | |
1386 | __field(unsigned int, xid) | |
1387 | __field(__u64, fid) | |
1388 | __field(unsigned int, command) | |
1389 | ), | |
1390 | TP_fast_assign( | |
1391 | __entry->xid = xid; | |
1392 | __entry->fid = fid; | |
1393 | __entry->command = command; | |
1394 | ), | |
1395 | TP_printk("xid=%u fid=0x%llx ioctl cmd=0x%x", | |
69ca1f57 | 1396 | __entry->xid, __entry->fid, __entry->command) |
073dd87c SF |
1397 | ) |
1398 | ||
1399 | #define DEFINE_SMB3_IOCTL_EVENT(name) \ | |
1400 | DEFINE_EVENT(smb3_ioctl_class, smb3_##name, \ | |
1401 | TP_PROTO(unsigned int xid, \ | |
1402 | __u64 fid, \ | |
1403 | unsigned int command), \ | |
1404 | TP_ARGS(xid, fid, command)) | |
1405 | ||
1406 | DEFINE_SMB3_IOCTL_EVENT(ioctl); | |
1407 | ||
69ca1f57 SF |
1408 | DECLARE_EVENT_CLASS(smb3_shutdown_class, |
1409 | TP_PROTO(__u32 flags, | |
1410 | __u32 tid), | |
1411 | TP_ARGS(flags, tid), | |
1412 | TP_STRUCT__entry( | |
1413 | __field(__u32, flags) | |
1414 | __field(__u32, tid) | |
1415 | ), | |
1416 | TP_fast_assign( | |
1417 | __entry->flags = flags; | |
1418 | __entry->tid = tid; | |
1419 | ), | |
1420 | TP_printk("flags=0x%x tid=0x%x", | |
1421 | __entry->flags, __entry->tid) | |
1422 | ) | |
1423 | ||
1424 | #define DEFINE_SMB3_SHUTDOWN_EVENT(name) \ | |
1425 | DEFINE_EVENT(smb3_shutdown_class, smb3_##name, \ | |
1426 | TP_PROTO(__u32 flags, \ | |
1427 | __u32 tid), \ | |
1428 | TP_ARGS(flags, tid)) | |
1429 | ||
1430 | DEFINE_SMB3_SHUTDOWN_EVENT(shutdown_enter); | |
1431 | DEFINE_SMB3_SHUTDOWN_EVENT(shutdown_done); | |
073dd87c | 1432 | |
69ca1f57 SF |
1433 | DECLARE_EVENT_CLASS(smb3_shutdown_err_class, |
1434 | TP_PROTO(int rc, | |
1435 | __u32 flags, | |
1436 | __u32 tid), | |
1437 | TP_ARGS(rc, flags, tid), | |
1438 | TP_STRUCT__entry( | |
1439 | __field(int, rc) | |
1440 | __field(__u32, flags) | |
1441 | __field(__u32, tid) | |
1442 | ), | |
1443 | TP_fast_assign( | |
1444 | __entry->rc = rc; | |
1445 | __entry->flags = flags; | |
1446 | __entry->tid = tid; | |
1447 | ), | |
1448 | TP_printk("rc=%d flags=0x%x tid=0x%x", | |
1449 | __entry->rc, __entry->flags, __entry->tid) | |
1450 | ) | |
073dd87c | 1451 | |
69ca1f57 SF |
1452 | #define DEFINE_SMB3_SHUTDOWN_ERR_EVENT(name) \ |
1453 | DEFINE_EVENT(smb3_shutdown_err_class, smb3_##name, \ | |
1454 | TP_PROTO(int rc, \ | |
1455 | __u32 flags, \ | |
1456 | __u32 tid), \ | |
1457 | TP_ARGS(rc, flags, tid)) | |
073dd87c | 1458 | |
69ca1f57 | 1459 | DEFINE_SMB3_SHUTDOWN_ERR_EVENT(shutdown_err); |
073dd87c | 1460 | |
b340a4d4 SF |
1461 | DECLARE_EVENT_CLASS(smb3_credit_class, |
1462 | TP_PROTO(__u64 currmid, | |
6d82c27a | 1463 | __u64 conn_id, |
b340a4d4 | 1464 | char *hostname, |
9eec21bf | 1465 | int credits, |
6d82c27a SP |
1466 | int credits_to_add, |
1467 | int in_flight), | |
1468 | TP_ARGS(currmid, conn_id, hostname, credits, credits_to_add, in_flight), | |
b340a4d4 SF |
1469 | TP_STRUCT__entry( |
1470 | __field(__u64, currmid) | |
6d82c27a | 1471 | __field(__u64, conn_id) |
eb068818 | 1472 | __string(hostname, hostname) |
b340a4d4 | 1473 | __field(int, credits) |
9eec21bf | 1474 | __field(int, credits_to_add) |
6d82c27a | 1475 | __field(int, in_flight) |
b340a4d4 SF |
1476 | ), |
1477 | TP_fast_assign( | |
1478 | __entry->currmid = currmid; | |
6d82c27a | 1479 | __entry->conn_id = conn_id; |
2c92ca84 | 1480 | __assign_str(hostname); |
b340a4d4 | 1481 | __entry->credits = credits; |
9eec21bf | 1482 | __entry->credits_to_add = credits_to_add; |
6d82c27a | 1483 | __entry->in_flight = in_flight; |
b340a4d4 | 1484 | ), |
6d82c27a SP |
1485 | TP_printk("conn_id=0x%llx server=%s current_mid=%llu " |
1486 | "credits=%d credit_change=%d in_flight=%d", | |
1487 | __entry->conn_id, | |
eb068818 | 1488 | __get_str(hostname), |
b340a4d4 | 1489 | __entry->currmid, |
9eec21bf | 1490 | __entry->credits, |
6d82c27a SP |
1491 | __entry->credits_to_add, |
1492 | __entry->in_flight) | |
b340a4d4 SF |
1493 | ) |
1494 | ||
1495 | #define DEFINE_SMB3_CREDIT_EVENT(name) \ | |
1496 | DEFINE_EVENT(smb3_credit_class, smb3_##name, \ | |
1497 | TP_PROTO(__u64 currmid, \ | |
6d82c27a | 1498 | __u64 conn_id, \ |
b340a4d4 | 1499 | char *hostname, \ |
9eec21bf | 1500 | int credits, \ |
6d82c27a SP |
1501 | int credits_to_add, \ |
1502 | int in_flight), \ | |
1503 | TP_ARGS(currmid, conn_id, hostname, credits, credits_to_add, in_flight)) | |
b340a4d4 SF |
1504 | |
1505 | DEFINE_SMB3_CREDIT_EVENT(reconnect_with_invalid_credits); | |
cd7b699b | 1506 | DEFINE_SMB3_CREDIT_EVENT(reconnect_detected); |
7937ca96 | 1507 | DEFINE_SMB3_CREDIT_EVENT(credit_timeout); |
cd7b699b SP |
1508 | DEFINE_SMB3_CREDIT_EVENT(insufficient_credits); |
1509 | DEFINE_SMB3_CREDIT_EVENT(too_many_credits); | |
9eec21bf | 1510 | DEFINE_SMB3_CREDIT_EVENT(add_credits); |
1ddff774 DH |
1511 | DEFINE_SMB3_CREDIT_EVENT(adj_credits); |
1512 | DEFINE_SMB3_CREDIT_EVENT(hdr_credits); | |
1513 | DEFINE_SMB3_CREDIT_EVENT(nblk_credits); | |
1514 | DEFINE_SMB3_CREDIT_EVENT(pend_credits); | |
1515 | DEFINE_SMB3_CREDIT_EVENT(wait_credits); | |
1516 | DEFINE_SMB3_CREDIT_EVENT(waitff_credits); | |
1517 | DEFINE_SMB3_CREDIT_EVENT(overflow_credits); | |
cd7b699b | 1518 | DEFINE_SMB3_CREDIT_EVENT(set_credits); |
b340a4d4 | 1519 | |
afc23feb DH |
1520 | |
1521 | TRACE_EVENT(smb3_tcon_ref, | |
1522 | TP_PROTO(unsigned int tcon_debug_id, int ref, | |
1523 | enum smb3_tcon_ref_trace trace), | |
1524 | TP_ARGS(tcon_debug_id, ref, trace), | |
1525 | TP_STRUCT__entry( | |
1526 | __field(unsigned int, tcon) | |
1527 | __field(int, ref) | |
1528 | __field(enum smb3_tcon_ref_trace, trace) | |
1529 | ), | |
1530 | TP_fast_assign( | |
1531 | __entry->tcon = tcon_debug_id; | |
1532 | __entry->ref = ref; | |
1533 | __entry->trace = trace; | |
1534 | ), | |
1535 | TP_printk("TC=%08x %s r=%u", | |
1536 | __entry->tcon, | |
1537 | __print_symbolic(__entry->trace, smb3_tcon_ref_traces), | |
1538 | __entry->ref) | |
1539 | ); | |
1540 | ||
519be989 DH |
1541 | TRACE_EVENT(smb3_rw_credits, |
1542 | TP_PROTO(unsigned int rreq_debug_id, | |
1543 | unsigned int subreq_debug_index, | |
1544 | unsigned int subreq_credits, | |
1545 | unsigned int server_credits, | |
1546 | int server_in_flight, | |
1547 | int credit_change, | |
1548 | enum smb3_rw_credits_trace trace), | |
1549 | TP_ARGS(rreq_debug_id, subreq_debug_index, subreq_credits, | |
1550 | server_credits, server_in_flight, credit_change, trace), | |
1551 | TP_STRUCT__entry( | |
1552 | __field(unsigned int, rreq_debug_id) | |
1553 | __field(unsigned int, subreq_debug_index) | |
1554 | __field(unsigned int, subreq_credits) | |
1555 | __field(unsigned int, server_credits) | |
1556 | __field(int, in_flight) | |
1557 | __field(int, credit_change) | |
1558 | __field(enum smb3_rw_credits_trace, trace) | |
1559 | ), | |
1560 | TP_fast_assign( | |
1561 | __entry->rreq_debug_id = rreq_debug_id; | |
1562 | __entry->subreq_debug_index = subreq_debug_index; | |
1563 | __entry->subreq_credits = subreq_credits; | |
1564 | __entry->server_credits = server_credits; | |
1565 | __entry->in_flight = server_in_flight; | |
1566 | __entry->credit_change = credit_change; | |
1567 | __entry->trace = trace; | |
1568 | ), | |
1569 | TP_printk("R=%08x[%x] %s cred=%u chg=%d pool=%u ifl=%d", | |
1570 | __entry->rreq_debug_id, __entry->subreq_debug_index, | |
1571 | __print_symbolic(__entry->trace, smb3_rw_credits_traces), | |
1572 | __entry->subreq_credits, __entry->credit_change, | |
1573 | __entry->server_credits, __entry->in_flight) | |
1574 | ); | |
1575 | ||
afc23feb DH |
1576 | |
1577 | #undef EM | |
1578 | #undef E_ | |
eccb4422 SF |
1579 | #endif /* _CIFS_TRACE_H */ |
1580 | ||
1581 | #undef TRACE_INCLUDE_PATH | |
1582 | #define TRACE_INCLUDE_PATH . | |
1583 | #define TRACE_INCLUDE_FILE trace | |
1584 | #include <trace/define_trace.h> |