OSDN Git Service

Merge tag 'nios2-v5.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/lftan...
[uclinux-h8/linux.git] / 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 #undef TRACE_SYSTEM
8 #define TRACE_SYSTEM cifs
9
10 #if !defined(_CIFS_TRACE_H) || defined(TRACE_HEADER_MULTI_READ)
11 #define _CIFS_TRACE_H
12
13 #include <linux/tracepoint.h>
14
15 /* For logging errors in read or write */
16 DECLARE_EVENT_CLASS(smb3_rw_err_class,
17         TP_PROTO(unsigned int xid,
18                 __u64   fid,
19                 __u32   tid,
20                 __u64   sesid,
21                 __u64   offset,
22                 __u32   len,
23                 int     rc),
24         TP_ARGS(xid, fid, tid, sesid, offset, len, rc),
25         TP_STRUCT__entry(
26                 __field(unsigned int, xid)
27                 __field(__u64, fid)
28                 __field(__u32, tid)
29                 __field(__u64, sesid)
30                 __field(__u64, offset)
31                 __field(__u32, len)
32                 __field(int, rc)
33         ),
34         TP_fast_assign(
35                 __entry->xid = xid;
36                 __entry->fid = fid;
37                 __entry->tid = tid;
38                 __entry->sesid = sesid;
39                 __entry->offset = offset;
40                 __entry->len = len;
41                 __entry->rc = rc;
42         ),
43         TP_printk("\txid=%u sid=0x%llx tid=0x%x fid=0x%llx offset=0x%llx len=0x%x rc=%d",
44                 __entry->xid, __entry->sesid, __entry->tid, __entry->fid,
45                 __entry->offset, __entry->len, __entry->rc)
46 )
47
48 #define DEFINE_SMB3_RW_ERR_EVENT(name)          \
49 DEFINE_EVENT(smb3_rw_err_class, smb3_##name,    \
50         TP_PROTO(unsigned int xid,              \
51                 __u64   fid,                    \
52                 __u32   tid,                    \
53                 __u64   sesid,                  \
54                 __u64   offset,                 \
55                 __u32   len,                    \
56                 int     rc),                    \
57         TP_ARGS(xid, fid, tid, sesid, offset, len, rc))
58
59 DEFINE_SMB3_RW_ERR_EVENT(write_err);
60 DEFINE_SMB3_RW_ERR_EVENT(read_err);
61 DEFINE_SMB3_RW_ERR_EVENT(query_dir_err);
62
63
64 /* For logging successful read or write */
65 DECLARE_EVENT_CLASS(smb3_rw_done_class,
66         TP_PROTO(unsigned int xid,
67                 __u64   fid,
68                 __u32   tid,
69                 __u64   sesid,
70                 __u64   offset,
71                 __u32   len),
72         TP_ARGS(xid, fid, tid, sesid, offset, len),
73         TP_STRUCT__entry(
74                 __field(unsigned int, xid)
75                 __field(__u64, fid)
76                 __field(__u32, tid)
77                 __field(__u64, sesid)
78                 __field(__u64, offset)
79                 __field(__u32, len)
80         ),
81         TP_fast_assign(
82                 __entry->xid = xid;
83                 __entry->fid = fid;
84                 __entry->tid = tid;
85                 __entry->sesid = sesid;
86                 __entry->offset = offset;
87                 __entry->len = len;
88         ),
89         TP_printk("xid=%u sid=0x%llx tid=0x%x fid=0x%llx offset=0x%llx len=0x%x",
90                 __entry->xid, __entry->sesid, __entry->tid, __entry->fid,
91                 __entry->offset, __entry->len)
92 )
93
94 #define DEFINE_SMB3_RW_DONE_EVENT(name)         \
95 DEFINE_EVENT(smb3_rw_done_class, smb3_##name,   \
96         TP_PROTO(unsigned int xid,              \
97                 __u64   fid,                    \
98                 __u32   tid,                    \
99                 __u64   sesid,                  \
100                 __u64   offset,                 \
101                 __u32   len),                   \
102         TP_ARGS(xid, fid, tid, sesid, offset, len))
103
104 DEFINE_SMB3_RW_DONE_EVENT(write_enter);
105 DEFINE_SMB3_RW_DONE_EVENT(read_enter);
106 DEFINE_SMB3_RW_DONE_EVENT(query_dir_enter);
107 DEFINE_SMB3_RW_DONE_EVENT(write_done);
108 DEFINE_SMB3_RW_DONE_EVENT(read_done);
109 DEFINE_SMB3_RW_DONE_EVENT(query_dir_done);
110
111 /*
112  * For handle based calls other than read and write, and get/set info
113  */
114 DECLARE_EVENT_CLASS(smb3_fd_err_class,
115         TP_PROTO(unsigned int xid,
116                 __u64   fid,
117                 __u32   tid,
118                 __u64   sesid,
119                 int     rc),
120         TP_ARGS(xid, fid, tid, sesid, rc),
121         TP_STRUCT__entry(
122                 __field(unsigned int, xid)
123                 __field(__u64, fid)
124                 __field(__u32, tid)
125                 __field(__u64, sesid)
126                 __field(int, rc)
127         ),
128         TP_fast_assign(
129                 __entry->xid = xid;
130                 __entry->fid = fid;
131                 __entry->tid = tid;
132                 __entry->sesid = sesid;
133                 __entry->rc = rc;
134         ),
135         TP_printk("\txid=%u sid=0x%llx tid=0x%x fid=0x%llx rc=%d",
136                 __entry->xid, __entry->sesid, __entry->tid, __entry->fid,
137                 __entry->rc)
138 )
139
140 #define DEFINE_SMB3_FD_ERR_EVENT(name)          \
141 DEFINE_EVENT(smb3_fd_err_class, smb3_##name,    \
142         TP_PROTO(unsigned int xid,              \
143                 __u64   fid,                    \
144                 __u32   tid,                    \
145                 __u64   sesid,                  \
146                 int     rc),                    \
147         TP_ARGS(xid, fid, tid, sesid, rc))
148
149 DEFINE_SMB3_FD_ERR_EVENT(flush_err);
150 DEFINE_SMB3_FD_ERR_EVENT(lock_err);
151 DEFINE_SMB3_FD_ERR_EVENT(close_err);
152
153 /*
154  * For handle based query/set info calls
155  */
156 DECLARE_EVENT_CLASS(smb3_inf_enter_class,
157         TP_PROTO(unsigned int xid,
158                 __u64   fid,
159                 __u32   tid,
160                 __u64   sesid,
161                 __u8    infclass,
162                 __u32   type),
163         TP_ARGS(xid, fid, tid, sesid, infclass, type),
164         TP_STRUCT__entry(
165                 __field(unsigned int, xid)
166                 __field(__u64, fid)
167                 __field(__u32, tid)
168                 __field(__u64, sesid)
169                 __field(__u8, infclass)
170                 __field(__u32, type)
171         ),
172         TP_fast_assign(
173                 __entry->xid = xid;
174                 __entry->fid = fid;
175                 __entry->tid = tid;
176                 __entry->sesid = sesid;
177                 __entry->infclass = infclass;
178                 __entry->type = type;
179         ),
180         TP_printk("xid=%u sid=0x%llx tid=0x%x fid=0x%llx class=%u type=0x%x",
181                 __entry->xid, __entry->sesid, __entry->tid, __entry->fid,
182                 __entry->infclass, __entry->type)
183 )
184
185 #define DEFINE_SMB3_INF_ENTER_EVENT(name)          \
186 DEFINE_EVENT(smb3_inf_enter_class, smb3_##name,    \
187         TP_PROTO(unsigned int xid,              \
188                 __u64   fid,                    \
189                 __u32   tid,                    \
190                 __u64   sesid,                  \
191                 __u8    infclass,               \
192                 __u32   type),                  \
193         TP_ARGS(xid, fid, tid, sesid, infclass, type))
194
195 DEFINE_SMB3_INF_ENTER_EVENT(query_info_enter);
196 DEFINE_SMB3_INF_ENTER_EVENT(query_info_done);
197
198 DECLARE_EVENT_CLASS(smb3_inf_err_class,
199         TP_PROTO(unsigned int xid,
200                 __u64   fid,
201                 __u32   tid,
202                 __u64   sesid,
203                 __u8    infclass,
204                 __u32   type,
205                 int     rc),
206         TP_ARGS(xid, fid, tid, sesid, infclass, type, rc),
207         TP_STRUCT__entry(
208                 __field(unsigned int, xid)
209                 __field(__u64, fid)
210                 __field(__u32, tid)
211                 __field(__u64, sesid)
212                 __field(__u8, infclass)
213                 __field(__u32, type)
214                 __field(int, rc)
215         ),
216         TP_fast_assign(
217                 __entry->xid = xid;
218                 __entry->fid = fid;
219                 __entry->tid = tid;
220                 __entry->sesid = sesid;
221                 __entry->infclass = infclass;
222                 __entry->type = type;
223                 __entry->rc = rc;
224         ),
225         TP_printk("xid=%u sid=0x%llx tid=0x%x fid=0x%llx class=%u type=0x%x rc=%d",
226                 __entry->xid, __entry->sesid, __entry->tid, __entry->fid,
227                 __entry->infclass, __entry->type, __entry->rc)
228 )
229
230 #define DEFINE_SMB3_INF_ERR_EVENT(name)          \
231 DEFINE_EVENT(smb3_inf_err_class, smb3_##name,    \
232         TP_PROTO(unsigned int xid,              \
233                 __u64   fid,                    \
234                 __u32   tid,                    \
235                 __u64   sesid,                  \
236                 __u8    infclass,               \
237                 __u32   type,                   \
238                 int     rc),                    \
239         TP_ARGS(xid, fid, tid, sesid, infclass, type, rc))
240
241 DEFINE_SMB3_INF_ERR_EVENT(query_info_err);
242 DEFINE_SMB3_INF_ERR_EVENT(set_info_err);
243 DEFINE_SMB3_INF_ERR_EVENT(fsctl_err);
244
245 /*
246  * For logging SMB3 Status code and Command for responses which return errors
247  */
248 DECLARE_EVENT_CLASS(smb3_cmd_err_class,
249         TP_PROTO(__u32  tid,
250                 __u64   sesid,
251                 __u16   cmd,
252                 __u64   mid,
253                 __u32   status,
254                 int     rc),
255         TP_ARGS(tid, sesid, cmd, mid, status, rc),
256         TP_STRUCT__entry(
257                 __field(__u32, tid)
258                 __field(__u64, sesid)
259                 __field(__u16, cmd)
260                 __field(__u64, mid)
261                 __field(__u32, status)
262                 __field(int, rc)
263         ),
264         TP_fast_assign(
265                 __entry->tid = tid;
266                 __entry->sesid = sesid;
267                 __entry->cmd = cmd;
268                 __entry->mid = mid;
269                 __entry->status = status;
270                 __entry->rc = rc;
271         ),
272         TP_printk("\tsid=0x%llx tid=0x%x cmd=%u mid=%llu status=0x%x rc=%d",
273                 __entry->sesid, __entry->tid, __entry->cmd, __entry->mid,
274                 __entry->status, __entry->rc)
275 )
276
277 #define DEFINE_SMB3_CMD_ERR_EVENT(name)          \
278 DEFINE_EVENT(smb3_cmd_err_class, smb3_##name,    \
279         TP_PROTO(__u32  tid,                    \
280                 __u64   sesid,                  \
281                 __u16   cmd,                    \
282                 __u64   mid,                    \
283                 __u32   status,                 \
284                 int     rc),                    \
285         TP_ARGS(tid, sesid, cmd, mid, status, rc))
286
287 DEFINE_SMB3_CMD_ERR_EVENT(cmd_err);
288
289 DECLARE_EVENT_CLASS(smb3_cmd_done_class,
290         TP_PROTO(__u32  tid,
291                 __u64   sesid,
292                 __u16   cmd,
293                 __u64   mid),
294         TP_ARGS(tid, sesid, cmd, mid),
295         TP_STRUCT__entry(
296                 __field(__u32, tid)
297                 __field(__u64, sesid)
298                 __field(__u16, cmd)
299                 __field(__u64, mid)
300         ),
301         TP_fast_assign(
302                 __entry->tid = tid;
303                 __entry->sesid = sesid;
304                 __entry->cmd = cmd;
305                 __entry->mid = mid;
306         ),
307         TP_printk("\tsid=0x%llx tid=0x%x cmd=%u mid=%llu",
308                 __entry->sesid, __entry->tid,
309                 __entry->cmd, __entry->mid)
310 )
311
312 #define DEFINE_SMB3_CMD_DONE_EVENT(name)          \
313 DEFINE_EVENT(smb3_cmd_done_class, smb3_##name,    \
314         TP_PROTO(__u32  tid,                    \
315                 __u64   sesid,                  \
316                 __u16   cmd,                    \
317                 __u64   mid),                   \
318         TP_ARGS(tid, sesid, cmd, mid))
319
320 DEFINE_SMB3_CMD_DONE_EVENT(cmd_enter);
321 DEFINE_SMB3_CMD_DONE_EVENT(cmd_done);
322 DEFINE_SMB3_CMD_DONE_EVENT(ses_expired);
323
324 DECLARE_EVENT_CLASS(smb3_mid_class,
325         TP_PROTO(__u16  cmd,
326                 __u64   mid,
327                 __u32   pid,
328                 unsigned long when_sent,
329                 unsigned long when_received),
330         TP_ARGS(cmd, mid, pid, when_sent, when_received),
331         TP_STRUCT__entry(
332                 __field(__u16, cmd)
333                 __field(__u64, mid)
334                 __field(__u32, pid)
335                 __field(unsigned long, when_sent)
336                 __field(unsigned long, when_received)
337         ),
338         TP_fast_assign(
339                 __entry->cmd = cmd;
340                 __entry->mid = mid;
341                 __entry->pid = pid;
342                 __entry->when_sent = when_sent;
343                 __entry->when_received = when_received;
344         ),
345         TP_printk("\tcmd=%u mid=%llu pid=%u, when_sent=%lu when_rcv=%lu",
346                 __entry->cmd, __entry->mid, __entry->pid, __entry->when_sent,
347                 __entry->when_received)
348 )
349
350 #define DEFINE_SMB3_MID_EVENT(name)          \
351 DEFINE_EVENT(smb3_mid_class, smb3_##name,    \
352         TP_PROTO(__u16  cmd,                    \
353                 __u64   mid,                    \
354                 __u32   pid,                    \
355                 unsigned long when_sent,        \
356                 unsigned long when_received),   \
357         TP_ARGS(cmd, mid, pid, when_sent, when_received))
358
359 DEFINE_SMB3_MID_EVENT(slow_rsp);
360
361 DECLARE_EVENT_CLASS(smb3_exit_err_class,
362         TP_PROTO(unsigned int xid,
363                 const char *func_name,
364                 int     rc),
365         TP_ARGS(xid, func_name, rc),
366         TP_STRUCT__entry(
367                 __field(unsigned int, xid)
368                 __field(const char *, func_name)
369                 __field(int, rc)
370         ),
371         TP_fast_assign(
372                 __entry->xid = xid;
373                 __entry->func_name = func_name;
374                 __entry->rc = rc;
375         ),
376         TP_printk("\t%s: xid=%u rc=%d",
377                 __entry->func_name, __entry->xid, __entry->rc)
378 )
379
380 #define DEFINE_SMB3_EXIT_ERR_EVENT(name)          \
381 DEFINE_EVENT(smb3_exit_err_class, smb3_##name,    \
382         TP_PROTO(unsigned int xid,              \
383                 const char *func_name,          \
384                 int     rc),                    \
385         TP_ARGS(xid, func_name, rc))
386
387 DEFINE_SMB3_EXIT_ERR_EVENT(exit_err);
388
389 DECLARE_EVENT_CLASS(smb3_enter_exit_class,
390         TP_PROTO(unsigned int xid,
391                 const char *func_name),
392         TP_ARGS(xid, func_name),
393         TP_STRUCT__entry(
394                 __field(unsigned int, xid)
395                 __field(const char *, func_name)
396         ),
397         TP_fast_assign(
398                 __entry->xid = xid;
399                 __entry->func_name = func_name;
400         ),
401         TP_printk("\t%s: xid=%u",
402                 __entry->func_name, __entry->xid)
403 )
404
405 #define DEFINE_SMB3_ENTER_EXIT_EVENT(name)        \
406 DEFINE_EVENT(smb3_enter_exit_class, smb3_##name,  \
407         TP_PROTO(unsigned int xid,              \
408                 const char *func_name),         \
409         TP_ARGS(xid, func_name))
410
411 DEFINE_SMB3_ENTER_EXIT_EVENT(enter);
412 DEFINE_SMB3_ENTER_EXIT_EVENT(exit_done);
413
414 /*
415  * For SMB2/SMB3 tree connect
416  */
417
418 DECLARE_EVENT_CLASS(smb3_tcon_class,
419         TP_PROTO(unsigned int xid,
420                 __u32   tid,
421                 __u64   sesid,
422                 const char *unc_name,
423                 int     rc),
424         TP_ARGS(xid, tid, sesid, unc_name, rc),
425         TP_STRUCT__entry(
426                 __field(unsigned int, xid)
427                 __field(__u32, tid)
428                 __field(__u64, sesid)
429                 __field(const char *,  unc_name)
430                 __field(int, rc)
431         ),
432         TP_fast_assign(
433                 __entry->xid = xid;
434                 __entry->tid = tid;
435                 __entry->sesid = sesid;
436                 __entry->unc_name = unc_name;
437                 __entry->rc = rc;
438         ),
439         TP_printk("xid=%u sid=0x%llx tid=0x%x unc_name=%s rc=%d",
440                 __entry->xid, __entry->sesid, __entry->tid,
441                 __entry->unc_name, __entry->rc)
442 )
443
444 #define DEFINE_SMB3_TCON_EVENT(name)          \
445 DEFINE_EVENT(smb3_tcon_class, smb3_##name,    \
446         TP_PROTO(unsigned int xid,              \
447                 __u32   tid,                    \
448                 __u64   sesid,                  \
449                 const char *unc_name,           \
450                 int     rc),                    \
451         TP_ARGS(xid, tid, sesid, unc_name, rc))
452
453 DEFINE_SMB3_TCON_EVENT(tcon);
454
455
456 /*
457  * For smb2/smb3 open (including create and mkdir) calls
458  */
459
460 DECLARE_EVENT_CLASS(smb3_open_enter_class,
461         TP_PROTO(unsigned int xid,
462                 __u32   tid,
463                 __u64   sesid,
464                 int     create_options,
465                 int     desired_access),
466         TP_ARGS(xid, tid, sesid, create_options, desired_access),
467         TP_STRUCT__entry(
468                 __field(unsigned int, xid)
469                 __field(__u32, tid)
470                 __field(__u64, sesid)
471                 __field(int, create_options)
472                 __field(int, desired_access)
473         ),
474         TP_fast_assign(
475                 __entry->xid = xid;
476                 __entry->tid = tid;
477                 __entry->sesid = sesid;
478                 __entry->create_options = create_options;
479                 __entry->desired_access = desired_access;
480         ),
481         TP_printk("xid=%u sid=0x%llx tid=0x%x cr_opts=0x%x des_access=0x%x",
482                 __entry->xid, __entry->sesid, __entry->tid,
483                 __entry->create_options, __entry->desired_access)
484 )
485
486 #define DEFINE_SMB3_OPEN_ENTER_EVENT(name)        \
487 DEFINE_EVENT(smb3_open_enter_class, smb3_##name,  \
488         TP_PROTO(unsigned int xid,              \
489                 __u32   tid,                    \
490                 __u64   sesid,                  \
491                 int     create_options,         \
492                 int     desired_access),        \
493         TP_ARGS(xid, tid, sesid, create_options, desired_access))
494
495 DEFINE_SMB3_OPEN_ENTER_EVENT(open_enter);
496 DEFINE_SMB3_OPEN_ENTER_EVENT(posix_mkdir_enter);
497
498 DECLARE_EVENT_CLASS(smb3_open_err_class,
499         TP_PROTO(unsigned int xid,
500                 __u32   tid,
501                 __u64   sesid,
502                 int     create_options,
503                 int     desired_access,
504                 int     rc),
505         TP_ARGS(xid, tid, sesid, create_options, desired_access, rc),
506         TP_STRUCT__entry(
507                 __field(unsigned int, xid)
508                 __field(__u32, tid)
509                 __field(__u64, sesid)
510                 __field(int,   create_options)
511                 __field(int, desired_access)
512                 __field(int, rc)
513         ),
514         TP_fast_assign(
515                 __entry->xid = xid;
516                 __entry->tid = tid;
517                 __entry->sesid = sesid;
518                 __entry->create_options = create_options;
519                 __entry->desired_access = desired_access;
520                 __entry->rc = rc;
521         ),
522         TP_printk("xid=%u sid=0x%llx tid=0x%x cr_opts=0x%x des_access=0x%x rc=%d",
523                 __entry->xid, __entry->sesid, __entry->tid,
524                 __entry->create_options, __entry->desired_access, __entry->rc)
525 )
526
527 #define DEFINE_SMB3_OPEN_ERR_EVENT(name)          \
528 DEFINE_EVENT(smb3_open_err_class, smb3_##name,    \
529         TP_PROTO(unsigned int xid,              \
530                 __u32   tid,                    \
531                 __u64   sesid,                  \
532                 int     create_options,         \
533                 int     desired_access,         \
534                 int     rc),                    \
535         TP_ARGS(xid, tid, sesid, create_options, desired_access, rc))
536
537 DEFINE_SMB3_OPEN_ERR_EVENT(open_err);
538 DEFINE_SMB3_OPEN_ERR_EVENT(posix_mkdir_err);
539
540 DECLARE_EVENT_CLASS(smb3_open_done_class,
541         TP_PROTO(unsigned int xid,
542                 __u64   fid,
543                 __u32   tid,
544                 __u64   sesid,
545                 int     create_options,
546                 int     desired_access),
547         TP_ARGS(xid, fid, tid, sesid, create_options, desired_access),
548         TP_STRUCT__entry(
549                 __field(unsigned int, xid)
550                 __field(__u64, fid)
551                 __field(__u32, tid)
552                 __field(__u64, sesid)
553                 __field(int, create_options)
554                 __field(int, desired_access)
555         ),
556         TP_fast_assign(
557                 __entry->xid = xid;
558                 __entry->fid = fid;
559                 __entry->tid = tid;
560                 __entry->sesid = sesid;
561                 __entry->create_options = create_options;
562                 __entry->desired_access = desired_access;
563         ),
564         TP_printk("xid=%u sid=0x%llx tid=0x%x fid=0x%llx cr_opts=0x%x des_access=0x%x",
565                 __entry->xid, __entry->sesid, __entry->tid, __entry->fid,
566                 __entry->create_options, __entry->desired_access)
567 )
568
569 #define DEFINE_SMB3_OPEN_DONE_EVENT(name)        \
570 DEFINE_EVENT(smb3_open_done_class, smb3_##name,  \
571         TP_PROTO(unsigned int xid,              \
572                 __u64   fid,                    \
573                 __u32   tid,                    \
574                 __u64   sesid,                  \
575                 int     create_options,         \
576                 int     desired_access),        \
577         TP_ARGS(xid, fid, tid, sesid, create_options, desired_access))
578
579 DEFINE_SMB3_OPEN_DONE_EVENT(open_done);
580 DEFINE_SMB3_OPEN_DONE_EVENT(posix_mkdir_done);
581
582
583 DECLARE_EVENT_CLASS(smb3_lease_done_class,
584         TP_PROTO(__u32  lease_state,
585                 __u32   tid,
586                 __u64   sesid,
587                 __u64   lease_key_low,
588                 __u64   lease_key_high),
589         TP_ARGS(lease_state, tid, sesid, lease_key_low, lease_key_high),
590         TP_STRUCT__entry(
591                 __field(__u32, lease_state)
592                 __field(__u32, tid)
593                 __field(__u64, sesid)
594                 __field(__u64, lease_key_low)
595                 __field(__u64, lease_key_high)
596         ),
597         TP_fast_assign(
598                 __entry->lease_state = lease_state;
599                 __entry->tid = tid;
600                 __entry->sesid = sesid;
601                 __entry->lease_key_low = lease_key_low;
602                 __entry->lease_key_high = lease_key_high;
603         ),
604         TP_printk("sid=0x%llx tid=0x%x lease_key=0x%llx%llx lease_state=0x%x",
605                 __entry->sesid, __entry->tid, __entry->lease_key_high,
606                 __entry->lease_key_low, __entry->lease_state)
607 )
608
609 #define DEFINE_SMB3_LEASE_DONE_EVENT(name)        \
610 DEFINE_EVENT(smb3_lease_done_class, smb3_##name,  \
611         TP_PROTO(__u32  lease_state,            \
612                 __u32   tid,                    \
613                 __u64   sesid,                  \
614                 __u64   lease_key_low,          \
615                 __u64   lease_key_high),        \
616         TP_ARGS(lease_state, tid, sesid, lease_key_low, lease_key_high))
617
618 DEFINE_SMB3_LEASE_DONE_EVENT(lease_done);
619
620 DECLARE_EVENT_CLASS(smb3_lease_err_class,
621         TP_PROTO(__u32  lease_state,
622                 __u32   tid,
623                 __u64   sesid,
624                 __u64   lease_key_low,
625                 __u64   lease_key_high,
626                 int     rc),
627         TP_ARGS(lease_state, tid, sesid, lease_key_low, lease_key_high, rc),
628         TP_STRUCT__entry(
629                 __field(__u32, lease_state)
630                 __field(__u32, tid)
631                 __field(__u64, sesid)
632                 __field(__u64, lease_key_low)
633                 __field(__u64, lease_key_high)
634                 __field(int, rc)
635         ),
636         TP_fast_assign(
637                 __entry->lease_state = lease_state;
638                 __entry->tid = tid;
639                 __entry->sesid = sesid;
640                 __entry->lease_key_low = lease_key_low;
641                 __entry->lease_key_high = lease_key_high;
642                 __entry->rc = rc;
643         ),
644         TP_printk("sid=0x%llx tid=0x%x lease_key=0x%llx%llx lease_state=0x%x rc=%d",
645                 __entry->sesid, __entry->tid, __entry->lease_key_high,
646                 __entry->lease_key_low, __entry->lease_state, __entry->rc)
647 )
648
649 #define DEFINE_SMB3_LEASE_ERR_EVENT(name)        \
650 DEFINE_EVENT(smb3_lease_err_class, smb3_##name,  \
651         TP_PROTO(__u32  lease_state,            \
652                 __u32   tid,                    \
653                 __u64   sesid,                  \
654                 __u64   lease_key_low,          \
655                 __u64   lease_key_high,         \
656                 int     rc),                    \
657         TP_ARGS(lease_state, tid, sesid, lease_key_low, lease_key_high, rc))
658
659 DEFINE_SMB3_LEASE_ERR_EVENT(lease_err);
660
661 DECLARE_EVENT_CLASS(smb3_reconnect_class,
662         TP_PROTO(__u64  currmid,
663                 char *hostname),
664         TP_ARGS(currmid, hostname),
665         TP_STRUCT__entry(
666                 __field(__u64, currmid)
667                 __field(char *, hostname)
668         ),
669         TP_fast_assign(
670                 __entry->currmid = currmid;
671                 __entry->hostname = hostname;
672         ),
673         TP_printk("server=%s current_mid=0x%llx",
674                 __entry->hostname,
675                 __entry->currmid)
676 )
677
678 #define DEFINE_SMB3_RECONNECT_EVENT(name)        \
679 DEFINE_EVENT(smb3_reconnect_class, smb3_##name,  \
680         TP_PROTO(__u64  currmid,                \
681                 char *hostname),                \
682         TP_ARGS(currmid, hostname))
683
684 DEFINE_SMB3_RECONNECT_EVENT(reconnect);
685 DEFINE_SMB3_RECONNECT_EVENT(partial_send_reconnect);
686
687 DECLARE_EVENT_CLASS(smb3_credit_class,
688         TP_PROTO(__u64  currmid,
689                 char *hostname,
690                 int credits),
691         TP_ARGS(currmid, hostname, credits),
692         TP_STRUCT__entry(
693                 __field(__u64, currmid)
694                 __field(char *, hostname)
695                 __field(int, credits)
696         ),
697         TP_fast_assign(
698                 __entry->currmid = currmid;
699                 __entry->hostname = hostname;
700                 __entry->credits = credits;
701         ),
702         TP_printk("server=%s current_mid=0x%llx credits=%d",
703                 __entry->hostname,
704                 __entry->currmid,
705                 __entry->credits)
706 )
707
708 #define DEFINE_SMB3_CREDIT_EVENT(name)        \
709 DEFINE_EVENT(smb3_credit_class, smb3_##name,  \
710         TP_PROTO(__u64  currmid,                \
711                 char *hostname,                 \
712                 int  credits),                  \
713         TP_ARGS(currmid, hostname, credits))
714
715 DEFINE_SMB3_CREDIT_EVENT(reconnect_with_invalid_credits);
716
717 #endif /* _CIFS_TRACE_H */
718
719 #undef TRACE_INCLUDE_PATH
720 #define TRACE_INCLUDE_PATH .
721 #define TRACE_INCLUDE_FILE trace
722 #include <trace/define_trace.h>