blob: fb049809555fea9b3e2cc072b735ac0adfdfe1ae [file] [log] [blame]
Steve Frencheccb4422018-05-17 21:16:55 -05001/* 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 */
26DECLARE_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 ),
Steve Frenchd683bcd2018-05-19 02:28:53 -050053 TP_printk("\txid=%u sid=0x%llx tid=0x%x fid=0x%llx offset=0x%llx len=0x%x rc=%d",
54 __entry->xid, __entry->sesid, __entry->tid, __entry->fid,
Steve Frencheccb4422018-05-17 21:16:55 -050055 __entry->offset, __entry->len, __entry->rc)
56)
57
58#define DEFINE_SMB3_RW_ERR_EVENT(name) \
59DEFINE_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
69DEFINE_SMB3_RW_ERR_EVENT(write_err);
70DEFINE_SMB3_RW_ERR_EVENT(read_err);
71
72
73/* For logging successful read or write */
74DECLARE_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 ),
Steve Frenchd683bcd2018-05-19 02:28:53 -050098 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,
Steve Frencheccb4422018-05-17 21:16:55 -0500100 __entry->offset, __entry->len)
101)
102
103#define DEFINE_SMB3_RW_DONE_EVENT(name) \
104DEFINE_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
113DEFINE_SMB3_RW_DONE_EVENT(write_done);
114DEFINE_SMB3_RW_DONE_EVENT(read_done);
115
116/*
117 * For handle based calls other than read and write, and get/set info
118 */
119DECLARE_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 ),
Steve Frenchd683bcd2018-05-19 02:28:53 -0500140 TP_printk("\txid=%u sid=0x%llx tid=0x%x fid=0x%llx rc=%d",
141 __entry->xid, __entry->sesid, __entry->tid, __entry->fid,
Steve Frencheccb4422018-05-17 21:16:55 -0500142 __entry->rc)
143)
144
145#define DEFINE_SMB3_FD_ERR_EVENT(name) \
146DEFINE_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
154DEFINE_SMB3_FD_ERR_EVENT(flush_err);
155DEFINE_SMB3_FD_ERR_EVENT(lock_err);
156DEFINE_SMB3_FD_ERR_EVENT(close_err);
157
158/*
159 * For handle based query/set info calls
160 */
161DECLARE_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 ),
Steve Frenchd683bcd2018-05-19 02:28:53 -0500188 TP_printk("xid=%u sid=0x%llx tid=0x%x fid=0x%llx class=%u type=0x%x rc=%d",
189 __entry->xid, __entry->sesid, __entry->tid, __entry->fid,
Steve Frencheccb4422018-05-17 21:16:55 -0500190 __entry->infclass, __entry->type, __entry->rc)
191)
192
193#define DEFINE_SMB3_INF_ERR_EVENT(name) \
194DEFINE_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
204DEFINE_SMB3_INF_ERR_EVENT(query_info_err);
205DEFINE_SMB3_INF_ERR_EVENT(set_info_err);
206DEFINE_SMB3_INF_ERR_EVENT(fsctl_err);
207
208/*
209 * For logging SMB3 Status code and Command for responses which return errors
210 */
211DECLARE_EVENT_CLASS(smb3_cmd_err_class,
Steve Frenchd683bcd2018-05-19 02:28:53 -0500212 TP_PROTO(__u32 tid,
Steve Frencheccb4422018-05-17 21:16:55 -0500213 __u64 sesid,
214 __u16 cmd,
215 __u64 mid,
216 __u32 status,
217 int rc),
Steve Frenchd683bcd2018-05-19 02:28:53 -0500218 TP_ARGS(tid, sesid, cmd, mid, status, rc),
Steve Frencheccb4422018-05-17 21:16:55 -0500219 TP_STRUCT__entry(
Steve Frencheccb4422018-05-17 21:16:55 -0500220 __field(__u32, tid)
221 __field(__u64, sesid)
222 __field(__u16, cmd)
223 __field(__u64, mid)
224 __field(__u32, status)
225 __field(int, rc)
226 ),
227 TP_fast_assign(
Steve Frencheccb4422018-05-17 21:16:55 -0500228 __entry->tid = tid;
229 __entry->sesid = sesid;
230 __entry->cmd = cmd;
231 __entry->mid = mid;
232 __entry->status = status;
233 __entry->rc = rc;
234 ),
Steve Frenchd683bcd2018-05-19 02:28:53 -0500235 TP_printk("\tsid=0x%llx tid=0x%x cmd=%u mid=%llu status=0x%x rc=%d",
236 __entry->sesid, __entry->tid, __entry->cmd, __entry->mid,
237 __entry->status, __entry->rc)
Steve Frencheccb4422018-05-17 21:16:55 -0500238)
239
240#define DEFINE_SMB3_CMD_ERR_EVENT(name) \
241DEFINE_EVENT(smb3_cmd_err_class, smb3_##name, \
Steve Frenchd683bcd2018-05-19 02:28:53 -0500242 TP_PROTO(__u32 tid, \
Steve Frencheccb4422018-05-17 21:16:55 -0500243 __u64 sesid, \
244 __u16 cmd, \
245 __u64 mid, \
246 __u32 status, \
247 int rc), \
Steve Frenchd683bcd2018-05-19 02:28:53 -0500248 TP_ARGS(tid, sesid, cmd, mid, status, rc))
Steve Frencheccb4422018-05-17 21:16:55 -0500249
250DEFINE_SMB3_CMD_ERR_EVENT(cmd_err);
251
252DECLARE_EVENT_CLASS(smb3_cmd_done_class,
Steve Frenchd683bcd2018-05-19 02:28:53 -0500253 TP_PROTO(__u32 tid,
Steve Frencheccb4422018-05-17 21:16:55 -0500254 __u64 sesid,
255 __u16 cmd,
256 __u64 mid),
Steve Frenchd683bcd2018-05-19 02:28:53 -0500257 TP_ARGS(tid, sesid, cmd, mid),
Steve Frencheccb4422018-05-17 21:16:55 -0500258 TP_STRUCT__entry(
Steve Frencheccb4422018-05-17 21:16:55 -0500259 __field(__u32, tid)
260 __field(__u64, sesid)
261 __field(__u16, cmd)
262 __field(__u64, mid)
263 ),
264 TP_fast_assign(
Steve Frencheccb4422018-05-17 21:16:55 -0500265 __entry->tid = tid;
266 __entry->sesid = sesid;
267 __entry->cmd = cmd;
268 __entry->mid = mid;
269 ),
Steve Frenchd683bcd2018-05-19 02:28:53 -0500270 TP_printk("\tsid=0x%llx tid=0x%x cmd=%u mid=%llu",
271 __entry->sesid, __entry->tid,
Steve Frencheccb4422018-05-17 21:16:55 -0500272 __entry->cmd, __entry->mid)
273)
274
275#define DEFINE_SMB3_CMD_DONE_EVENT(name) \
276DEFINE_EVENT(smb3_cmd_done_class, smb3_##name, \
Steve Frenchd683bcd2018-05-19 02:28:53 -0500277 TP_PROTO(__u32 tid, \
Steve Frencheccb4422018-05-17 21:16:55 -0500278 __u64 sesid, \
279 __u16 cmd, \
280 __u64 mid), \
Steve Frenchd683bcd2018-05-19 02:28:53 -0500281 TP_ARGS(tid, sesid, cmd, mid))
Steve Frencheccb4422018-05-17 21:16:55 -0500282
283DEFINE_SMB3_CMD_DONE_EVENT(cmd_done);
Steve Frenche68a9322018-07-30 14:23:58 -0500284DEFINE_SMB3_CMD_DONE_EVENT(ses_expired);
Steve Frencheccb4422018-05-17 21:16:55 -0500285
Steve French020eec52018-08-01 16:38:07 -0500286DECLARE_EVENT_CLASS(smb3_mid_class,
287 TP_PROTO(__u16 cmd,
288 __u64 mid,
289 __u32 pid,
290 unsigned long when_sent,
291 unsigned long when_received),
292 TP_ARGS(cmd, mid, pid, when_sent, when_received),
293 TP_STRUCT__entry(
294 __field(__u16, cmd)
295 __field(__u64, mid)
296 __field(__u32, pid)
297 __field(unsigned long, when_sent)
298 __field(unsigned long, when_received)
299 ),
300 TP_fast_assign(
301 __entry->cmd = cmd;
302 __entry->mid = mid;
303 __entry->pid = pid;
304 __entry->when_sent = when_sent;
305 __entry->when_received = when_received;
306 ),
307 TP_printk("\tcmd=%u mid=%llu pid=%u, when_sent=%lu when_rcv=%lu",
308 __entry->cmd, __entry->mid, __entry->pid, __entry->when_sent,
309 __entry->when_received)
310)
311
312#define DEFINE_SMB3_MID_EVENT(name) \
313DEFINE_EVENT(smb3_mid_class, smb3_##name, \
314 TP_PROTO(__u16 cmd, \
315 __u64 mid, \
316 __u32 pid, \
317 unsigned long when_sent, \
318 unsigned long when_received), \
319 TP_ARGS(cmd, mid, pid, when_sent, when_received))
320
321DEFINE_SMB3_MID_EVENT(slow_rsp);
322
Steve Frenchd683bcd2018-05-19 02:28:53 -0500323DECLARE_EVENT_CLASS(smb3_exit_err_class,
324 TP_PROTO(unsigned int xid,
325 const char *func_name,
326 int rc),
327 TP_ARGS(xid, func_name, rc),
328 TP_STRUCT__entry(
329 __field(unsigned int, xid)
330 __field(const char *, func_name)
331 __field(int, rc)
332 ),
333 TP_fast_assign(
334 __entry->xid = xid;
335 __entry->func_name = func_name;
336 __entry->rc = rc;
337 ),
338 TP_printk("\t%s: xid=%u rc=%d",
339 __entry->func_name, __entry->xid, __entry->rc)
340)
341
342#define DEFINE_SMB3_EXIT_ERR_EVENT(name) \
343DEFINE_EVENT(smb3_exit_err_class, smb3_##name, \
344 TP_PROTO(unsigned int xid, \
345 const char *func_name, \
346 int rc), \
347 TP_ARGS(xid, func_name, rc))
348
349DEFINE_SMB3_EXIT_ERR_EVENT(exit_err);
350
351DECLARE_EVENT_CLASS(smb3_enter_exit_class,
352 TP_PROTO(unsigned int xid,
353 const char *func_name),
354 TP_ARGS(xid, func_name),
355 TP_STRUCT__entry(
356 __field(unsigned int, xid)
357 __field(const char *, func_name)
358 ),
359 TP_fast_assign(
360 __entry->xid = xid;
361 __entry->func_name = func_name;
362 ),
363 TP_printk("\t%s: xid=%u",
364 __entry->func_name, __entry->xid)
365)
366
367#define DEFINE_SMB3_ENTER_EXIT_EVENT(name) \
368DEFINE_EVENT(smb3_enter_exit_class, smb3_##name, \
369 TP_PROTO(unsigned int xid, \
370 const char *func_name), \
371 TP_ARGS(xid, func_name))
372
373DEFINE_SMB3_ENTER_EXIT_EVENT(enter);
374DEFINE_SMB3_ENTER_EXIT_EVENT(exit_done);
375
Steve French28d59362018-05-30 21:42:34 -0500376/*
Steve Frenchf8af49d2018-10-28 00:47:11 -0500377 * For SMB2/SMB3 tree connect
378 */
379
380DECLARE_EVENT_CLASS(smb3_tcon_class,
381 TP_PROTO(unsigned int xid,
382 __u32 tid,
383 __u64 sesid,
384 const char *unc_name,
385 int rc),
386 TP_ARGS(xid, tid, sesid, unc_name, rc),
387 TP_STRUCT__entry(
388 __field(unsigned int, xid)
389 __field(__u32, tid)
390 __field(__u64, sesid)
391 __field(const char *, unc_name)
392 __field(int, rc)
393 ),
394 TP_fast_assign(
395 __entry->xid = xid;
396 __entry->tid = tid;
397 __entry->sesid = sesid;
398 __entry->unc_name = unc_name;
399 __entry->rc = rc;
400 ),
401 TP_printk("xid=%u sid=0x%llx tid=0x%x unc_name=%s rc=%d",
402 __entry->xid, __entry->sesid, __entry->tid,
403 __entry->unc_name, __entry->rc)
404)
405
406#define DEFINE_SMB3_TCON_EVENT(name) \
407DEFINE_EVENT(smb3_tcon_class, smb3_##name, \
408 TP_PROTO(unsigned int xid, \
409 __u32 tid, \
410 __u64 sesid, \
411 const char *unc_name, \
412 int rc), \
413 TP_ARGS(xid, tid, sesid, unc_name, rc))
414
415DEFINE_SMB3_TCON_EVENT(tcon);
416
417
418/*
Steve French28d59362018-05-30 21:42:34 -0500419 * For smb2/smb3 open call
420 */
421DECLARE_EVENT_CLASS(smb3_open_err_class,
422 TP_PROTO(unsigned int xid,
423 __u32 tid,
424 __u64 sesid,
425 int create_options,
426 int desired_access,
427 int rc),
428 TP_ARGS(xid, tid, sesid, create_options, desired_access, rc),
429 TP_STRUCT__entry(
430 __field(unsigned int, xid)
431 __field(__u32, tid)
432 __field(__u64, sesid)
433 __field(int, create_options)
434 __field(int, desired_access)
435 __field(int, rc)
436 ),
437 TP_fast_assign(
438 __entry->xid = xid;
439 __entry->tid = tid;
440 __entry->sesid = sesid;
441 __entry->create_options = create_options;
442 __entry->desired_access = desired_access;
443 __entry->rc = rc;
444 ),
445 TP_printk("xid=%u sid=0x%llx tid=0x%x cr_opts=0x%x des_access=0x%x rc=%d",
446 __entry->xid, __entry->sesid, __entry->tid,
447 __entry->create_options, __entry->desired_access, __entry->rc)
448)
449
450#define DEFINE_SMB3_OPEN_ERR_EVENT(name) \
451DEFINE_EVENT(smb3_open_err_class, smb3_##name, \
452 TP_PROTO(unsigned int xid, \
453 __u32 tid, \
454 __u64 sesid, \
455 int create_options, \
456 int desired_access, \
457 int rc), \
458 TP_ARGS(xid, tid, sesid, create_options, desired_access, rc))
459
460DEFINE_SMB3_OPEN_ERR_EVENT(open_err);
Steve Frenchbea851b2018-06-14 21:56:32 -0500461DEFINE_SMB3_OPEN_ERR_EVENT(posix_mkdir_err);
Steve French28d59362018-05-30 21:42:34 -0500462
463DECLARE_EVENT_CLASS(smb3_open_done_class,
464 TP_PROTO(unsigned int xid,
465 __u64 fid,
466 __u32 tid,
467 __u64 sesid,
468 int create_options,
469 int desired_access),
470 TP_ARGS(xid, fid, tid, sesid, create_options, desired_access),
471 TP_STRUCT__entry(
472 __field(unsigned int, xid)
473 __field(__u64, fid)
474 __field(__u32, tid)
475 __field(__u64, sesid)
476 __field(int, create_options)
477 __field(int, desired_access)
478 ),
479 TP_fast_assign(
480 __entry->xid = xid;
481 __entry->fid = fid;
482 __entry->tid = tid;
483 __entry->sesid = sesid;
484 __entry->create_options = create_options;
485 __entry->desired_access = desired_access;
486 ),
487 TP_printk("xid=%u sid=0x%llx tid=0x%x fid=0x%llx cr_opts=0x%x des_access=0x%x",
488 __entry->xid, __entry->sesid, __entry->tid, __entry->fid,
489 __entry->create_options, __entry->desired_access)
490)
491
492#define DEFINE_SMB3_OPEN_DONE_EVENT(name) \
493DEFINE_EVENT(smb3_open_done_class, smb3_##name, \
494 TP_PROTO(unsigned int xid, \
495 __u64 fid, \
496 __u32 tid, \
497 __u64 sesid, \
498 int create_options, \
499 int desired_access), \
500 TP_ARGS(xid, fid, tid, sesid, create_options, desired_access))
501
502DEFINE_SMB3_OPEN_DONE_EVENT(open_done);
Steve Frenchbea851b2018-06-14 21:56:32 -0500503DEFINE_SMB3_OPEN_DONE_EVENT(posix_mkdir_done);
Steve French28d59362018-05-30 21:42:34 -0500504
Steve French179e44d2018-09-28 19:44:23 -0500505
506DECLARE_EVENT_CLASS(smb3_lease_done_class,
507 TP_PROTO(__u32 lease_state,
508 __u32 tid,
509 __u64 sesid,
510 __u64 lease_key_low,
511 __u64 lease_key_high),
512 TP_ARGS(lease_state, tid, sesid, lease_key_low, lease_key_high),
513 TP_STRUCT__entry(
514 __field(__u32, lease_state)
515 __field(__u32, tid)
516 __field(__u64, sesid)
517 __field(__u64, lease_key_low)
518 __field(__u64, lease_key_high)
519 ),
520 TP_fast_assign(
521 __entry->lease_state = lease_state;
522 __entry->tid = tid;
523 __entry->sesid = sesid;
524 __entry->lease_key_low = lease_key_low;
525 __entry->lease_key_high = lease_key_high;
526 ),
527 TP_printk("sid=0x%llx tid=0x%x lease_key=0x%llx%llx lease_state=0x%x",
528 __entry->sesid, __entry->tid, __entry->lease_key_high,
529 __entry->lease_key_low, __entry->lease_state)
530)
531
532#define DEFINE_SMB3_LEASE_DONE_EVENT(name) \
533DEFINE_EVENT(smb3_lease_done_class, smb3_##name, \
534 TP_PROTO(__u32 lease_state, \
535 __u32 tid, \
536 __u64 sesid, \
537 __u64 lease_key_low, \
538 __u64 lease_key_high), \
539 TP_ARGS(lease_state, tid, sesid, lease_key_low, lease_key_high))
540
541DEFINE_SMB3_LEASE_DONE_EVENT(lease_done);
542
543DECLARE_EVENT_CLASS(smb3_lease_err_class,
544 TP_PROTO(__u32 lease_state,
545 __u32 tid,
546 __u64 sesid,
547 __u64 lease_key_low,
548 __u64 lease_key_high,
549 int rc),
550 TP_ARGS(lease_state, tid, sesid, lease_key_low, lease_key_high, rc),
551 TP_STRUCT__entry(
552 __field(__u32, lease_state)
553 __field(__u32, tid)
554 __field(__u64, sesid)
555 __field(__u64, lease_key_low)
556 __field(__u64, lease_key_high)
557 __field(int, rc)
558 ),
559 TP_fast_assign(
560 __entry->lease_state = lease_state;
561 __entry->tid = tid;
562 __entry->sesid = sesid;
563 __entry->lease_key_low = lease_key_low;
564 __entry->lease_key_high = lease_key_high;
565 __entry->rc = rc;
566 ),
567 TP_printk("sid=0x%llx tid=0x%x lease_key=0x%llx%llx lease_state=0x%x rc=%d",
568 __entry->sesid, __entry->tid, __entry->lease_key_high,
569 __entry->lease_key_low, __entry->lease_state, __entry->rc)
570)
571
572#define DEFINE_SMB3_LEASE_ERR_EVENT(name) \
573DEFINE_EVENT(smb3_lease_err_class, smb3_##name, \
574 TP_PROTO(__u32 lease_state, \
575 __u32 tid, \
576 __u64 sesid, \
577 __u64 lease_key_low, \
578 __u64 lease_key_high, \
579 int rc), \
580 TP_ARGS(lease_state, tid, sesid, lease_key_low, lease_key_high, rc))
581
582DEFINE_SMB3_LEASE_ERR_EVENT(lease_err);
583
Steve Frenchbf1fdeb2018-07-30 19:23:09 -0500584DECLARE_EVENT_CLASS(smb3_reconnect_class,
585 TP_PROTO(__u64 currmid,
586 char *hostname),
587 TP_ARGS(currmid, hostname),
588 TP_STRUCT__entry(
589 __field(__u64, currmid)
590 __field(char *, hostname)
591 ),
592 TP_fast_assign(
593 __entry->currmid = currmid;
594 __entry->hostname = hostname;
595 ),
596 TP_printk("server=%s current_mid=0x%llx",
597 __entry->hostname,
598 __entry->currmid)
599)
600
601#define DEFINE_SMB3_RECONNECT_EVENT(name) \
602DEFINE_EVENT(smb3_reconnect_class, smb3_##name, \
603 TP_PROTO(__u64 currmid, \
604 char *hostname), \
605 TP_ARGS(currmid, hostname))
606
607DEFINE_SMB3_RECONNECT_EVENT(reconnect);
608DEFINE_SMB3_RECONNECT_EVENT(partial_send_reconnect);
609
Steve Frenchb340a4d2018-09-01 01:10:17 -0500610DECLARE_EVENT_CLASS(smb3_credit_class,
611 TP_PROTO(__u64 currmid,
612 char *hostname,
613 int credits),
614 TP_ARGS(currmid, hostname, credits),
615 TP_STRUCT__entry(
616 __field(__u64, currmid)
617 __field(char *, hostname)
618 __field(int, credits)
619 ),
620 TP_fast_assign(
621 __entry->currmid = currmid;
622 __entry->hostname = hostname;
623 __entry->credits = credits;
624 ),
625 TP_printk("server=%s current_mid=0x%llx credits=%d",
626 __entry->hostname,
627 __entry->currmid,
628 __entry->credits)
629)
630
631#define DEFINE_SMB3_CREDIT_EVENT(name) \
632DEFINE_EVENT(smb3_credit_class, smb3_##name, \
633 TP_PROTO(__u64 currmid, \
634 char *hostname, \
635 int credits), \
636 TP_ARGS(currmid, hostname, credits))
637
638DEFINE_SMB3_CREDIT_EVENT(reconnect_with_invalid_credits);
639
Steve Frencheccb4422018-05-17 21:16:55 -0500640#endif /* _CIFS_TRACE_H */
641
642#undef TRACE_INCLUDE_PATH
643#define TRACE_INCLUDE_PATH .
644#define TRACE_INCLUDE_FILE trace
645#include <trace/define_trace.h>