1 /* SPDX-License-Identifier: GPL-2.0 */
3 * Copyright (c) 2013 Trond Myklebust <Trond.Myklebust@netapp.com>
6 #define TRACE_SYSTEM nfs
8 #if !defined(_TRACE_NFS_H) || defined(TRACE_HEADER_MULTI_READ)
11 #include <linux/tracepoint.h>
12 #include <linux/iversion.h>
14 TRACE_DEFINE_ENUM(DT_UNKNOWN
);
15 TRACE_DEFINE_ENUM(DT_FIFO
);
16 TRACE_DEFINE_ENUM(DT_CHR
);
17 TRACE_DEFINE_ENUM(DT_DIR
);
18 TRACE_DEFINE_ENUM(DT_BLK
);
19 TRACE_DEFINE_ENUM(DT_REG
);
20 TRACE_DEFINE_ENUM(DT_LNK
);
21 TRACE_DEFINE_ENUM(DT_SOCK
);
22 TRACE_DEFINE_ENUM(DT_WHT
);
24 #define nfs_show_file_type(ftype) \
25 __print_symbolic(ftype, \
26 { DT_UNKNOWN, "UNKNOWN" }, \
27 { DT_FIFO, "FIFO" }, \
33 { DT_SOCK, "SOCK" }, \
36 TRACE_DEFINE_ENUM(NFS_INO_INVALID_DATA
);
37 TRACE_DEFINE_ENUM(NFS_INO_INVALID_ATIME
);
38 TRACE_DEFINE_ENUM(NFS_INO_INVALID_ACCESS
);
39 TRACE_DEFINE_ENUM(NFS_INO_INVALID_ACL
);
40 TRACE_DEFINE_ENUM(NFS_INO_REVAL_PAGECACHE
);
41 TRACE_DEFINE_ENUM(NFS_INO_REVAL_FORCED
);
42 TRACE_DEFINE_ENUM(NFS_INO_INVALID_LABEL
);
43 TRACE_DEFINE_ENUM(NFS_INO_INVALID_CHANGE
);
44 TRACE_DEFINE_ENUM(NFS_INO_INVALID_CTIME
);
45 TRACE_DEFINE_ENUM(NFS_INO_INVALID_MTIME
);
46 TRACE_DEFINE_ENUM(NFS_INO_INVALID_SIZE
);
47 TRACE_DEFINE_ENUM(NFS_INO_INVALID_OTHER
);
49 #define nfs_show_cache_validity(v) \
50 __print_flags(v, "|", \
51 { NFS_INO_INVALID_DATA, "INVALID_DATA" }, \
52 { NFS_INO_INVALID_ATIME, "INVALID_ATIME" }, \
53 { NFS_INO_INVALID_ACCESS, "INVALID_ACCESS" }, \
54 { NFS_INO_INVALID_ACL, "INVALID_ACL" }, \
55 { NFS_INO_REVAL_PAGECACHE, "REVAL_PAGECACHE" }, \
56 { NFS_INO_REVAL_FORCED, "REVAL_FORCED" }, \
57 { NFS_INO_INVALID_LABEL, "INVALID_LABEL" }, \
58 { NFS_INO_INVALID_CHANGE, "INVALID_CHANGE" }, \
59 { NFS_INO_INVALID_CTIME, "INVALID_CTIME" }, \
60 { NFS_INO_INVALID_MTIME, "INVALID_MTIME" }, \
61 { NFS_INO_INVALID_SIZE, "INVALID_SIZE" }, \
62 { NFS_INO_INVALID_OTHER, "INVALID_OTHER" }, \
63 { NFS_INO_INVALID_XATTR, "INVALID_XATTR" })
65 TRACE_DEFINE_ENUM(NFS_INO_ADVISE_RDPLUS
);
66 TRACE_DEFINE_ENUM(NFS_INO_STALE
);
67 TRACE_DEFINE_ENUM(NFS_INO_ACL_LRU_SET
);
68 TRACE_DEFINE_ENUM(NFS_INO_INVALIDATING
);
69 TRACE_DEFINE_ENUM(NFS_INO_FSCACHE
);
70 TRACE_DEFINE_ENUM(NFS_INO_FSCACHE_LOCK
);
71 TRACE_DEFINE_ENUM(NFS_INO_LAYOUTCOMMIT
);
72 TRACE_DEFINE_ENUM(NFS_INO_LAYOUTCOMMITTING
);
73 TRACE_DEFINE_ENUM(NFS_INO_LAYOUTSTATS
);
74 TRACE_DEFINE_ENUM(NFS_INO_ODIRECT
);
76 #define nfs_show_nfsi_flags(v) \
77 __print_flags(v, "|", \
78 { BIT(NFS_INO_ADVISE_RDPLUS), "ADVISE_RDPLUS" }, \
79 { BIT(NFS_INO_STALE), "STALE" }, \
80 { BIT(NFS_INO_ACL_LRU_SET), "ACL_LRU_SET" }, \
81 { BIT(NFS_INO_INVALIDATING), "INVALIDATING" }, \
82 { BIT(NFS_INO_FSCACHE), "FSCACHE" }, \
83 { BIT(NFS_INO_FSCACHE_LOCK), "FSCACHE_LOCK" }, \
84 { BIT(NFS_INO_LAYOUTCOMMIT), "NEED_LAYOUTCOMMIT" }, \
85 { BIT(NFS_INO_LAYOUTCOMMITTING), "LAYOUTCOMMIT" }, \
86 { BIT(NFS_INO_LAYOUTSTATS), "LAYOUTSTATS" }, \
87 { BIT(NFS_INO_ODIRECT), "ODIRECT" })
89 DECLARE_EVENT_CLASS(nfs_inode_event
,
91 const struct inode
*inode
100 __field(u64
, version
)
104 const struct nfs_inode
*nfsi
= NFS_I(inode
);
105 __entry
->dev
= inode
->i_sb
->s_dev
;
106 __entry
->fileid
= nfsi
->fileid
;
107 __entry
->fhandle
= nfs_fhandle_hash(&nfsi
->fh
);
108 __entry
->version
= inode_peek_iversion_raw(inode
);
112 "fileid=%02x:%02x:%llu fhandle=0x%08x version=%llu ",
113 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
114 (unsigned long long)__entry
->fileid
,
116 (unsigned long long)__entry
->version
120 DECLARE_EVENT_CLASS(nfs_inode_event_done
,
122 const struct inode
*inode
,
126 TP_ARGS(inode
, error
),
129 __field(unsigned long, error
)
131 __field(u32
, fhandle
)
132 __field(unsigned char, type
)
134 __field(u64
, version
)
135 __field(loff_t
, size
)
136 __field(unsigned long, nfsi_flags
)
137 __field(unsigned long, cache_validity
)
141 const struct nfs_inode
*nfsi
= NFS_I(inode
);
142 __entry
->error
= error
< 0 ? -error
: 0;
143 __entry
->dev
= inode
->i_sb
->s_dev
;
144 __entry
->fileid
= nfsi
->fileid
;
145 __entry
->fhandle
= nfs_fhandle_hash(&nfsi
->fh
);
146 __entry
->type
= nfs_umode_to_dtype(inode
->i_mode
);
147 __entry
->version
= inode_peek_iversion_raw(inode
);
148 __entry
->size
= i_size_read(inode
);
149 __entry
->nfsi_flags
= nfsi
->flags
;
150 __entry
->cache_validity
= nfsi
->cache_validity
;
154 "error=%ld (%s) fileid=%02x:%02x:%llu fhandle=0x%08x "
155 "type=%u (%s) version=%llu size=%lld "
156 "cache_validity=0x%lx (%s) nfs_flags=0x%lx (%s)",
157 -__entry
->error
, nfs_show_status(__entry
->error
),
158 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
159 (unsigned long long)__entry
->fileid
,
162 nfs_show_file_type(__entry
->type
),
163 (unsigned long long)__entry
->version
,
164 (long long)__entry
->size
,
165 __entry
->cache_validity
,
166 nfs_show_cache_validity(__entry
->cache_validity
),
168 nfs_show_nfsi_flags(__entry
->nfsi_flags
)
172 #define DEFINE_NFS_INODE_EVENT(name) \
173 DEFINE_EVENT(nfs_inode_event, name, \
175 const struct inode *inode \
178 #define DEFINE_NFS_INODE_EVENT_DONE(name) \
179 DEFINE_EVENT(nfs_inode_event_done, name, \
181 const struct inode *inode, \
184 TP_ARGS(inode, error))
185 DEFINE_NFS_INODE_EVENT(nfs_set_inode_stale
);
186 DEFINE_NFS_INODE_EVENT(nfs_refresh_inode_enter
);
187 DEFINE_NFS_INODE_EVENT_DONE(nfs_refresh_inode_exit
);
188 DEFINE_NFS_INODE_EVENT(nfs_revalidate_inode_enter
);
189 DEFINE_NFS_INODE_EVENT_DONE(nfs_revalidate_inode_exit
);
190 DEFINE_NFS_INODE_EVENT(nfs_invalidate_mapping_enter
);
191 DEFINE_NFS_INODE_EVENT_DONE(nfs_invalidate_mapping_exit
);
192 DEFINE_NFS_INODE_EVENT(nfs_getattr_enter
);
193 DEFINE_NFS_INODE_EVENT_DONE(nfs_getattr_exit
);
194 DEFINE_NFS_INODE_EVENT(nfs_setattr_enter
);
195 DEFINE_NFS_INODE_EVENT_DONE(nfs_setattr_exit
);
196 DEFINE_NFS_INODE_EVENT(nfs_writeback_page_enter
);
197 DEFINE_NFS_INODE_EVENT_DONE(nfs_writeback_page_exit
);
198 DEFINE_NFS_INODE_EVENT(nfs_writeback_inode_enter
);
199 DEFINE_NFS_INODE_EVENT_DONE(nfs_writeback_inode_exit
);
200 DEFINE_NFS_INODE_EVENT(nfs_fsync_enter
);
201 DEFINE_NFS_INODE_EVENT_DONE(nfs_fsync_exit
);
202 DEFINE_NFS_INODE_EVENT(nfs_access_enter
);
204 TRACE_EVENT(nfs_access_exit
,
206 const struct inode
*inode
,
208 unsigned int permitted
,
212 TP_ARGS(inode
, mask
, permitted
, error
),
215 __field(unsigned long, error
)
217 __field(u32
, fhandle
)
218 __field(unsigned char, type
)
220 __field(u64
, version
)
221 __field(loff_t
, size
)
222 __field(unsigned long, nfsi_flags
)
223 __field(unsigned long, cache_validity
)
224 __field(unsigned int, mask
)
225 __field(unsigned int, permitted
)
229 const struct nfs_inode
*nfsi
= NFS_I(inode
);
230 __entry
->error
= error
< 0 ? -error
: 0;
231 __entry
->dev
= inode
->i_sb
->s_dev
;
232 __entry
->fileid
= nfsi
->fileid
;
233 __entry
->fhandle
= nfs_fhandle_hash(&nfsi
->fh
);
234 __entry
->type
= nfs_umode_to_dtype(inode
->i_mode
);
235 __entry
->version
= inode_peek_iversion_raw(inode
);
236 __entry
->size
= i_size_read(inode
);
237 __entry
->nfsi_flags
= nfsi
->flags
;
238 __entry
->cache_validity
= nfsi
->cache_validity
;
239 __entry
->mask
= mask
;
240 __entry
->permitted
= permitted
;
244 "error=%ld (%s) fileid=%02x:%02x:%llu fhandle=0x%08x "
245 "type=%u (%s) version=%llu size=%lld "
246 "cache_validity=0x%lx (%s) nfs_flags=0x%lx (%s) "
247 "mask=0x%x permitted=0x%x",
248 -__entry
->error
, nfs_show_status(__entry
->error
),
249 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
250 (unsigned long long)__entry
->fileid
,
253 nfs_show_file_type(__entry
->type
),
254 (unsigned long long)__entry
->version
,
255 (long long)__entry
->size
,
256 __entry
->cache_validity
,
257 nfs_show_cache_validity(__entry
->cache_validity
),
259 nfs_show_nfsi_flags(__entry
->nfsi_flags
),
260 __entry
->mask
, __entry
->permitted
264 TRACE_DEFINE_ENUM(LOOKUP_FOLLOW
);
265 TRACE_DEFINE_ENUM(LOOKUP_DIRECTORY
);
266 TRACE_DEFINE_ENUM(LOOKUP_AUTOMOUNT
);
267 TRACE_DEFINE_ENUM(LOOKUP_PARENT
);
268 TRACE_DEFINE_ENUM(LOOKUP_REVAL
);
269 TRACE_DEFINE_ENUM(LOOKUP_RCU
);
270 TRACE_DEFINE_ENUM(LOOKUP_OPEN
);
271 TRACE_DEFINE_ENUM(LOOKUP_CREATE
);
272 TRACE_DEFINE_ENUM(LOOKUP_EXCL
);
273 TRACE_DEFINE_ENUM(LOOKUP_RENAME_TARGET
);
274 TRACE_DEFINE_ENUM(LOOKUP_JUMPED
);
275 TRACE_DEFINE_ENUM(LOOKUP_ROOT
);
276 TRACE_DEFINE_ENUM(LOOKUP_EMPTY
);
277 TRACE_DEFINE_ENUM(LOOKUP_DOWN
);
279 #define show_lookup_flags(flags) \
280 __print_flags(flags, "|", \
281 { LOOKUP_FOLLOW, "FOLLOW" }, \
282 { LOOKUP_DIRECTORY, "DIRECTORY" }, \
283 { LOOKUP_AUTOMOUNT, "AUTOMOUNT" }, \
284 { LOOKUP_PARENT, "PARENT" }, \
285 { LOOKUP_REVAL, "REVAL" }, \
286 { LOOKUP_RCU, "RCU" }, \
287 { LOOKUP_OPEN, "OPEN" }, \
288 { LOOKUP_CREATE, "CREATE" }, \
289 { LOOKUP_EXCL, "EXCL" }, \
290 { LOOKUP_RENAME_TARGET, "RENAME_TARGET" }, \
291 { LOOKUP_JUMPED, "JUMPED" }, \
292 { LOOKUP_ROOT, "ROOT" }, \
293 { LOOKUP_EMPTY, "EMPTY" }, \
294 { LOOKUP_DOWN, "DOWN" })
296 DECLARE_EVENT_CLASS(nfs_lookup_event
,
298 const struct inode
*dir
,
299 const struct dentry
*dentry
,
303 TP_ARGS(dir
, dentry
, flags
),
306 __field(unsigned long, flags
)
309 __string(name
, dentry
->d_name
.name
)
313 __entry
->dev
= dir
->i_sb
->s_dev
;
314 __entry
->dir
= NFS_FILEID(dir
);
315 __entry
->flags
= flags
;
316 __assign_str(name
, dentry
->d_name
.name
);
320 "flags=0x%lx (%s) name=%02x:%02x:%llu/%s",
322 show_lookup_flags(__entry
->flags
),
323 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
324 (unsigned long long)__entry
->dir
,
329 #define DEFINE_NFS_LOOKUP_EVENT(name) \
330 DEFINE_EVENT(nfs_lookup_event, name, \
332 const struct inode *dir, \
333 const struct dentry *dentry, \
336 TP_ARGS(dir, dentry, flags))
338 DECLARE_EVENT_CLASS(nfs_lookup_event_done
,
340 const struct inode
*dir
,
341 const struct dentry
*dentry
,
346 TP_ARGS(dir
, dentry
, flags
, error
),
349 __field(unsigned long, error
)
350 __field(unsigned long, flags
)
353 __string(name
, dentry
->d_name
.name
)
357 __entry
->dev
= dir
->i_sb
->s_dev
;
358 __entry
->dir
= NFS_FILEID(dir
);
359 __entry
->error
= error
< 0 ? -error
: 0;
360 __entry
->flags
= flags
;
361 __assign_str(name
, dentry
->d_name
.name
);
365 "error=%ld (%s) flags=0x%lx (%s) name=%02x:%02x:%llu/%s",
366 -__entry
->error
, nfs_show_status(__entry
->error
),
368 show_lookup_flags(__entry
->flags
),
369 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
370 (unsigned long long)__entry
->dir
,
375 #define DEFINE_NFS_LOOKUP_EVENT_DONE(name) \
376 DEFINE_EVENT(nfs_lookup_event_done, name, \
378 const struct inode *dir, \
379 const struct dentry *dentry, \
380 unsigned int flags, \
383 TP_ARGS(dir, dentry, flags, error))
385 DEFINE_NFS_LOOKUP_EVENT(nfs_lookup_enter
);
386 DEFINE_NFS_LOOKUP_EVENT_DONE(nfs_lookup_exit
);
387 DEFINE_NFS_LOOKUP_EVENT(nfs_lookup_revalidate_enter
);
388 DEFINE_NFS_LOOKUP_EVENT_DONE(nfs_lookup_revalidate_exit
);
390 TRACE_DEFINE_ENUM(O_WRONLY
);
391 TRACE_DEFINE_ENUM(O_RDWR
);
392 TRACE_DEFINE_ENUM(O_CREAT
);
393 TRACE_DEFINE_ENUM(O_EXCL
);
394 TRACE_DEFINE_ENUM(O_NOCTTY
);
395 TRACE_DEFINE_ENUM(O_TRUNC
);
396 TRACE_DEFINE_ENUM(O_APPEND
);
397 TRACE_DEFINE_ENUM(O_NONBLOCK
);
398 TRACE_DEFINE_ENUM(O_DSYNC
);
399 TRACE_DEFINE_ENUM(O_DIRECT
);
400 TRACE_DEFINE_ENUM(O_LARGEFILE
);
401 TRACE_DEFINE_ENUM(O_DIRECTORY
);
402 TRACE_DEFINE_ENUM(O_NOFOLLOW
);
403 TRACE_DEFINE_ENUM(O_NOATIME
);
404 TRACE_DEFINE_ENUM(O_CLOEXEC
);
406 #define show_open_flags(flags) \
407 __print_flags(flags, "|", \
408 { O_WRONLY, "O_WRONLY" }, \
409 { O_RDWR, "O_RDWR" }, \
410 { O_CREAT, "O_CREAT" }, \
411 { O_EXCL, "O_EXCL" }, \
412 { O_NOCTTY, "O_NOCTTY" }, \
413 { O_TRUNC, "O_TRUNC" }, \
414 { O_APPEND, "O_APPEND" }, \
415 { O_NONBLOCK, "O_NONBLOCK" }, \
416 { O_DSYNC, "O_DSYNC" }, \
417 { O_DIRECT, "O_DIRECT" }, \
418 { O_LARGEFILE, "O_LARGEFILE" }, \
419 { O_DIRECTORY, "O_DIRECTORY" }, \
420 { O_NOFOLLOW, "O_NOFOLLOW" }, \
421 { O_NOATIME, "O_NOATIME" }, \
422 { O_CLOEXEC, "O_CLOEXEC" })
424 TRACE_DEFINE_ENUM(FMODE_READ
);
425 TRACE_DEFINE_ENUM(FMODE_WRITE
);
426 TRACE_DEFINE_ENUM(FMODE_EXEC
);
428 #define show_fmode_flags(mode) \
429 __print_flags(mode, "|", \
430 { ((__force unsigned long)FMODE_READ), "READ" }, \
431 { ((__force unsigned long)FMODE_WRITE), "WRITE" }, \
432 { ((__force unsigned long)FMODE_EXEC), "EXEC" })
434 TRACE_EVENT(nfs_atomic_open_enter
,
436 const struct inode
*dir
,
437 const struct nfs_open_context
*ctx
,
441 TP_ARGS(dir
, ctx
, flags
),
444 __field(unsigned long, flags
)
445 __field(unsigned int, fmode
)
448 __string(name
, ctx
->dentry
->d_name
.name
)
452 __entry
->dev
= dir
->i_sb
->s_dev
;
453 __entry
->dir
= NFS_FILEID(dir
);
454 __entry
->flags
= flags
;
455 __entry
->fmode
= (__force
unsigned int)ctx
->mode
;
456 __assign_str(name
, ctx
->dentry
->d_name
.name
);
460 "flags=0x%lx (%s) fmode=%s name=%02x:%02x:%llu/%s",
462 show_open_flags(__entry
->flags
),
463 show_fmode_flags(__entry
->fmode
),
464 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
465 (unsigned long long)__entry
->dir
,
470 TRACE_EVENT(nfs_atomic_open_exit
,
472 const struct inode
*dir
,
473 const struct nfs_open_context
*ctx
,
478 TP_ARGS(dir
, ctx
, flags
, error
),
481 __field(unsigned long, error
)
482 __field(unsigned long, flags
)
483 __field(unsigned int, fmode
)
486 __string(name
, ctx
->dentry
->d_name
.name
)
490 __entry
->error
= -error
;
491 __entry
->dev
= dir
->i_sb
->s_dev
;
492 __entry
->dir
= NFS_FILEID(dir
);
493 __entry
->flags
= flags
;
494 __entry
->fmode
= (__force
unsigned int)ctx
->mode
;
495 __assign_str(name
, ctx
->dentry
->d_name
.name
);
499 "error=%ld (%s) flags=0x%lx (%s) fmode=%s "
500 "name=%02x:%02x:%llu/%s",
501 -__entry
->error
, nfs_show_status(__entry
->error
),
503 show_open_flags(__entry
->flags
),
504 show_fmode_flags(__entry
->fmode
),
505 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
506 (unsigned long long)__entry
->dir
,
511 TRACE_EVENT(nfs_create_enter
,
513 const struct inode
*dir
,
514 const struct dentry
*dentry
,
518 TP_ARGS(dir
, dentry
, flags
),
521 __field(unsigned long, flags
)
524 __string(name
, dentry
->d_name
.name
)
528 __entry
->dev
= dir
->i_sb
->s_dev
;
529 __entry
->dir
= NFS_FILEID(dir
);
530 __entry
->flags
= flags
;
531 __assign_str(name
, dentry
->d_name
.name
);
535 "flags=0x%lx (%s) name=%02x:%02x:%llu/%s",
537 show_open_flags(__entry
->flags
),
538 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
539 (unsigned long long)__entry
->dir
,
544 TRACE_EVENT(nfs_create_exit
,
546 const struct inode
*dir
,
547 const struct dentry
*dentry
,
552 TP_ARGS(dir
, dentry
, flags
, error
),
555 __field(unsigned long, error
)
556 __field(unsigned long, flags
)
559 __string(name
, dentry
->d_name
.name
)
563 __entry
->error
= -error
;
564 __entry
->dev
= dir
->i_sb
->s_dev
;
565 __entry
->dir
= NFS_FILEID(dir
);
566 __entry
->flags
= flags
;
567 __assign_str(name
, dentry
->d_name
.name
);
571 "error=%ld (%s) flags=0x%lx (%s) name=%02x:%02x:%llu/%s",
572 -__entry
->error
, nfs_show_status(__entry
->error
),
574 show_open_flags(__entry
->flags
),
575 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
576 (unsigned long long)__entry
->dir
,
581 DECLARE_EVENT_CLASS(nfs_directory_event
,
583 const struct inode
*dir
,
584 const struct dentry
*dentry
587 TP_ARGS(dir
, dentry
),
592 __string(name
, dentry
->d_name
.name
)
596 __entry
->dev
= dir
->i_sb
->s_dev
;
597 __entry
->dir
= NFS_FILEID(dir
);
598 __assign_str(name
, dentry
->d_name
.name
);
602 "name=%02x:%02x:%llu/%s",
603 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
604 (unsigned long long)__entry
->dir
,
609 #define DEFINE_NFS_DIRECTORY_EVENT(name) \
610 DEFINE_EVENT(nfs_directory_event, name, \
612 const struct inode *dir, \
613 const struct dentry *dentry \
615 TP_ARGS(dir, dentry))
617 DECLARE_EVENT_CLASS(nfs_directory_event_done
,
619 const struct inode
*dir
,
620 const struct dentry
*dentry
,
624 TP_ARGS(dir
, dentry
, error
),
627 __field(unsigned long, error
)
630 __string(name
, dentry
->d_name
.name
)
634 __entry
->dev
= dir
->i_sb
->s_dev
;
635 __entry
->dir
= NFS_FILEID(dir
);
636 __entry
->error
= error
< 0 ? -error
: 0;
637 __assign_str(name
, dentry
->d_name
.name
);
641 "error=%ld (%s) name=%02x:%02x:%llu/%s",
642 -__entry
->error
, nfs_show_status(__entry
->error
),
643 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
644 (unsigned long long)__entry
->dir
,
649 #define DEFINE_NFS_DIRECTORY_EVENT_DONE(name) \
650 DEFINE_EVENT(nfs_directory_event_done, name, \
652 const struct inode *dir, \
653 const struct dentry *dentry, \
656 TP_ARGS(dir, dentry, error))
658 DEFINE_NFS_DIRECTORY_EVENT(nfs_mknod_enter
);
659 DEFINE_NFS_DIRECTORY_EVENT_DONE(nfs_mknod_exit
);
660 DEFINE_NFS_DIRECTORY_EVENT(nfs_mkdir_enter
);
661 DEFINE_NFS_DIRECTORY_EVENT_DONE(nfs_mkdir_exit
);
662 DEFINE_NFS_DIRECTORY_EVENT(nfs_rmdir_enter
);
663 DEFINE_NFS_DIRECTORY_EVENT_DONE(nfs_rmdir_exit
);
664 DEFINE_NFS_DIRECTORY_EVENT(nfs_remove_enter
);
665 DEFINE_NFS_DIRECTORY_EVENT_DONE(nfs_remove_exit
);
666 DEFINE_NFS_DIRECTORY_EVENT(nfs_unlink_enter
);
667 DEFINE_NFS_DIRECTORY_EVENT_DONE(nfs_unlink_exit
);
668 DEFINE_NFS_DIRECTORY_EVENT(nfs_symlink_enter
);
669 DEFINE_NFS_DIRECTORY_EVENT_DONE(nfs_symlink_exit
);
671 TRACE_EVENT(nfs_link_enter
,
673 const struct inode
*inode
,
674 const struct inode
*dir
,
675 const struct dentry
*dentry
678 TP_ARGS(inode
, dir
, dentry
),
684 __string(name
, dentry
->d_name
.name
)
688 __entry
->dev
= inode
->i_sb
->s_dev
;
689 __entry
->fileid
= NFS_FILEID(inode
);
690 __entry
->dir
= NFS_FILEID(dir
);
691 __assign_str(name
, dentry
->d_name
.name
);
695 "fileid=%02x:%02x:%llu name=%02x:%02x:%llu/%s",
696 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
698 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
699 (unsigned long long)__entry
->dir
,
704 TRACE_EVENT(nfs_link_exit
,
706 const struct inode
*inode
,
707 const struct inode
*dir
,
708 const struct dentry
*dentry
,
712 TP_ARGS(inode
, dir
, dentry
, error
),
715 __field(unsigned long, error
)
719 __string(name
, dentry
->d_name
.name
)
723 __entry
->dev
= inode
->i_sb
->s_dev
;
724 __entry
->fileid
= NFS_FILEID(inode
);
725 __entry
->dir
= NFS_FILEID(dir
);
726 __entry
->error
= error
< 0 ? -error
: 0;
727 __assign_str(name
, dentry
->d_name
.name
);
731 "error=%ld (%s) fileid=%02x:%02x:%llu name=%02x:%02x:%llu/%s",
732 -__entry
->error
, nfs_show_status(__entry
->error
),
733 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
735 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
736 (unsigned long long)__entry
->dir
,
741 DECLARE_EVENT_CLASS(nfs_rename_event
,
743 const struct inode
*old_dir
,
744 const struct dentry
*old_dentry
,
745 const struct inode
*new_dir
,
746 const struct dentry
*new_dentry
749 TP_ARGS(old_dir
, old_dentry
, new_dir
, new_dentry
),
753 __field(u64
, old_dir
)
754 __field(u64
, new_dir
)
755 __string(old_name
, old_dentry
->d_name
.name
)
756 __string(new_name
, new_dentry
->d_name
.name
)
760 __entry
->dev
= old_dir
->i_sb
->s_dev
;
761 __entry
->old_dir
= NFS_FILEID(old_dir
);
762 __entry
->new_dir
= NFS_FILEID(new_dir
);
763 __assign_str(old_name
, old_dentry
->d_name
.name
);
764 __assign_str(new_name
, new_dentry
->d_name
.name
);
768 "old_name=%02x:%02x:%llu/%s new_name=%02x:%02x:%llu/%s",
769 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
770 (unsigned long long)__entry
->old_dir
,
772 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
773 (unsigned long long)__entry
->new_dir
,
777 #define DEFINE_NFS_RENAME_EVENT(name) \
778 DEFINE_EVENT(nfs_rename_event, name, \
780 const struct inode *old_dir, \
781 const struct dentry *old_dentry, \
782 const struct inode *new_dir, \
783 const struct dentry *new_dentry \
785 TP_ARGS(old_dir, old_dentry, new_dir, new_dentry))
787 DECLARE_EVENT_CLASS(nfs_rename_event_done
,
789 const struct inode
*old_dir
,
790 const struct dentry
*old_dentry
,
791 const struct inode
*new_dir
,
792 const struct dentry
*new_dentry
,
796 TP_ARGS(old_dir
, old_dentry
, new_dir
, new_dentry
, error
),
800 __field(unsigned long, error
)
801 __field(u64
, old_dir
)
802 __string(old_name
, old_dentry
->d_name
.name
)
803 __field(u64
, new_dir
)
804 __string(new_name
, new_dentry
->d_name
.name
)
808 __entry
->dev
= old_dir
->i_sb
->s_dev
;
809 __entry
->error
= -error
;
810 __entry
->old_dir
= NFS_FILEID(old_dir
);
811 __entry
->new_dir
= NFS_FILEID(new_dir
);
812 __assign_str(old_name
, old_dentry
->d_name
.name
);
813 __assign_str(new_name
, new_dentry
->d_name
.name
);
817 "error=%ld (%s) old_name=%02x:%02x:%llu/%s "
818 "new_name=%02x:%02x:%llu/%s",
819 -__entry
->error
, nfs_show_status(__entry
->error
),
820 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
821 (unsigned long long)__entry
->old_dir
,
823 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
824 (unsigned long long)__entry
->new_dir
,
828 #define DEFINE_NFS_RENAME_EVENT_DONE(name) \
829 DEFINE_EVENT(nfs_rename_event_done, name, \
831 const struct inode *old_dir, \
832 const struct dentry *old_dentry, \
833 const struct inode *new_dir, \
834 const struct dentry *new_dentry, \
837 TP_ARGS(old_dir, old_dentry, new_dir, \
840 DEFINE_NFS_RENAME_EVENT(nfs_rename_enter
);
841 DEFINE_NFS_RENAME_EVENT_DONE(nfs_rename_exit
);
843 DEFINE_NFS_RENAME_EVENT_DONE(nfs_sillyrename_rename
);
845 TRACE_EVENT(nfs_sillyrename_unlink
,
847 const struct nfs_unlinkdata
*data
,
851 TP_ARGS(data
, error
),
855 __field(unsigned long, error
)
857 __dynamic_array(char, name
, data
->args
.name
.len
+ 1)
861 struct inode
*dir
= d_inode(data
->dentry
->d_parent
);
862 size_t len
= data
->args
.name
.len
;
863 __entry
->dev
= dir
->i_sb
->s_dev
;
864 __entry
->dir
= NFS_FILEID(dir
);
865 __entry
->error
= -error
;
866 memcpy(__get_str(name
),
867 data
->args
.name
.name
, len
);
868 __get_str(name
)[len
] = 0;
872 "error=%ld (%s) name=%02x:%02x:%llu/%s",
873 -__entry
->error
, nfs_show_status(__entry
->error
),
874 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
875 (unsigned long long)__entry
->dir
,
880 TRACE_EVENT(nfs_initiate_read
,
882 const struct nfs_pgio_header
*hdr
889 __field(u32
, fhandle
)
891 __field(loff_t
, offset
)
896 const struct inode
*inode
= hdr
->inode
;
897 const struct nfs_inode
*nfsi
= NFS_I(inode
);
898 const struct nfs_fh
*fh
= hdr
->args
.fh
?
899 hdr
->args
.fh
: &nfsi
->fh
;
901 __entry
->offset
= hdr
->args
.offset
;
902 __entry
->count
= hdr
->args
.count
;
903 __entry
->dev
= inode
->i_sb
->s_dev
;
904 __entry
->fileid
= nfsi
->fileid
;
905 __entry
->fhandle
= nfs_fhandle_hash(fh
);
909 "fileid=%02x:%02x:%llu fhandle=0x%08x "
910 "offset=%lld count=%u",
911 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
912 (unsigned long long)__entry
->fileid
,
914 (long long)__entry
->offset
, __entry
->count
918 TRACE_EVENT(nfs_readpage_done
,
920 const struct rpc_task
*task
,
921 const struct nfs_pgio_header
*hdr
928 __field(u32
, fhandle
)
930 __field(loff_t
, offset
)
931 __field(u32
, arg_count
)
932 __field(u32
, res_count
)
938 const struct inode
*inode
= hdr
->inode
;
939 const struct nfs_inode
*nfsi
= NFS_I(inode
);
940 const struct nfs_fh
*fh
= hdr
->args
.fh
?
941 hdr
->args
.fh
: &nfsi
->fh
;
943 __entry
->status
= task
->tk_status
;
944 __entry
->offset
= hdr
->args
.offset
;
945 __entry
->arg_count
= hdr
->args
.count
;
946 __entry
->res_count
= hdr
->res
.count
;
947 __entry
->eof
= hdr
->res
.eof
;
948 __entry
->dev
= inode
->i_sb
->s_dev
;
949 __entry
->fileid
= nfsi
->fileid
;
950 __entry
->fhandle
= nfs_fhandle_hash(fh
);
954 "fileid=%02x:%02x:%llu fhandle=0x%08x "
955 "offset=%lld count=%u res=%u status=%d%s",
956 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
957 (unsigned long long)__entry
->fileid
,
959 (long long)__entry
->offset
, __entry
->arg_count
,
960 __entry
->res_count
, __entry
->status
,
961 __entry
->eof
? " eof" : ""
965 TRACE_EVENT(nfs_readpage_short
,
967 const struct rpc_task
*task
,
968 const struct nfs_pgio_header
*hdr
975 __field(u32
, fhandle
)
977 __field(loff_t
, offset
)
978 __field(u32
, arg_count
)
979 __field(u32
, res_count
)
985 const struct inode
*inode
= hdr
->inode
;
986 const struct nfs_inode
*nfsi
= NFS_I(inode
);
987 const struct nfs_fh
*fh
= hdr
->args
.fh
?
988 hdr
->args
.fh
: &nfsi
->fh
;
990 __entry
->status
= task
->tk_status
;
991 __entry
->offset
= hdr
->args
.offset
;
992 __entry
->arg_count
= hdr
->args
.count
;
993 __entry
->res_count
= hdr
->res
.count
;
994 __entry
->eof
= hdr
->res
.eof
;
995 __entry
->dev
= inode
->i_sb
->s_dev
;
996 __entry
->fileid
= nfsi
->fileid
;
997 __entry
->fhandle
= nfs_fhandle_hash(fh
);
1001 "fileid=%02x:%02x:%llu fhandle=0x%08x "
1002 "offset=%lld count=%u res=%u status=%d%s",
1003 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1004 (unsigned long long)__entry
->fileid
,
1006 (long long)__entry
->offset
, __entry
->arg_count
,
1007 __entry
->res_count
, __entry
->status
,
1008 __entry
->eof
? " eof" : ""
1012 TRACE_EVENT(nfs_pgio_error
,
1014 const struct nfs_pgio_header
*hdr
,
1019 TP_ARGS(hdr
, error
, pos
),
1023 __field(u32
, fhandle
)
1024 __field(u64
, fileid
)
1025 __field(loff_t
, offset
)
1026 __field(u32
, arg_count
)
1027 __field(u32
, res_count
)
1028 __field(loff_t
, pos
)
1029 __field(int, status
)
1033 const struct inode
*inode
= hdr
->inode
;
1034 const struct nfs_inode
*nfsi
= NFS_I(inode
);
1035 const struct nfs_fh
*fh
= hdr
->args
.fh
?
1036 hdr
->args
.fh
: &nfsi
->fh
;
1038 __entry
->status
= error
;
1039 __entry
->offset
= hdr
->args
.offset
;
1040 __entry
->arg_count
= hdr
->args
.count
;
1041 __entry
->res_count
= hdr
->res
.count
;
1042 __entry
->dev
= inode
->i_sb
->s_dev
;
1043 __entry
->fileid
= nfsi
->fileid
;
1044 __entry
->fhandle
= nfs_fhandle_hash(fh
);
1047 TP_printk("fileid=%02x:%02x:%llu fhandle=0x%08x "
1048 "offset=%lld count=%u res=%u pos=%llu status=%d",
1049 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1050 (unsigned long long)__entry
->fileid
, __entry
->fhandle
,
1051 (long long)__entry
->offset
, __entry
->arg_count
, __entry
->res_count
,
1052 __entry
->pos
, __entry
->status
1056 TRACE_DEFINE_ENUM(NFS_UNSTABLE
);
1057 TRACE_DEFINE_ENUM(NFS_DATA_SYNC
);
1058 TRACE_DEFINE_ENUM(NFS_FILE_SYNC
);
1060 #define nfs_show_stable(stable) \
1061 __print_symbolic(stable, \
1062 { NFS_UNSTABLE, "UNSTABLE" }, \
1063 { NFS_DATA_SYNC, "DATA_SYNC" }, \
1064 { NFS_FILE_SYNC, "FILE_SYNC" })
1066 TRACE_EVENT(nfs_initiate_write
,
1068 const struct nfs_pgio_header
*hdr
1075 __field(u32
, fhandle
)
1076 __field(u64
, fileid
)
1077 __field(loff_t
, offset
)
1079 __field(enum nfs3_stable_how
, stable
)
1083 const struct inode
*inode
= hdr
->inode
;
1084 const struct nfs_inode
*nfsi
= NFS_I(inode
);
1085 const struct nfs_fh
*fh
= hdr
->args
.fh
?
1086 hdr
->args
.fh
: &nfsi
->fh
;
1088 __entry
->offset
= hdr
->args
.offset
;
1089 __entry
->count
= hdr
->args
.count
;
1090 __entry
->stable
= hdr
->args
.stable
;
1091 __entry
->dev
= inode
->i_sb
->s_dev
;
1092 __entry
->fileid
= nfsi
->fileid
;
1093 __entry
->fhandle
= nfs_fhandle_hash(fh
);
1097 "fileid=%02x:%02x:%llu fhandle=0x%08x "
1098 "offset=%lld count=%u stable=%s",
1099 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1100 (unsigned long long)__entry
->fileid
,
1102 (long long)__entry
->offset
, __entry
->count
,
1103 nfs_show_stable(__entry
->stable
)
1107 TRACE_EVENT(nfs_writeback_done
,
1109 const struct rpc_task
*task
,
1110 const struct nfs_pgio_header
*hdr
1117 __field(u32
, fhandle
)
1118 __field(u64
, fileid
)
1119 __field(loff_t
, offset
)
1120 __field(u32
, arg_count
)
1121 __field(u32
, res_count
)
1122 __field(int, status
)
1123 __field(enum nfs3_stable_how
, stable
)
1124 __array(char, verifier
, NFS4_VERIFIER_SIZE
)
1128 const struct inode
*inode
= hdr
->inode
;
1129 const struct nfs_inode
*nfsi
= NFS_I(inode
);
1130 const struct nfs_fh
*fh
= hdr
->args
.fh
?
1131 hdr
->args
.fh
: &nfsi
->fh
;
1132 const struct nfs_writeverf
*verf
= hdr
->res
.verf
;
1134 __entry
->status
= task
->tk_status
;
1135 __entry
->offset
= hdr
->args
.offset
;
1136 __entry
->arg_count
= hdr
->args
.count
;
1137 __entry
->res_count
= hdr
->res
.count
;
1138 __entry
->stable
= verf
->committed
;
1139 memcpy(__entry
->verifier
,
1141 NFS4_VERIFIER_SIZE
);
1142 __entry
->dev
= inode
->i_sb
->s_dev
;
1143 __entry
->fileid
= nfsi
->fileid
;
1144 __entry
->fhandle
= nfs_fhandle_hash(fh
);
1148 "fileid=%02x:%02x:%llu fhandle=0x%08x "
1149 "offset=%lld count=%u res=%u status=%d stable=%s "
1151 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1152 (unsigned long long)__entry
->fileid
,
1154 (long long)__entry
->offset
, __entry
->arg_count
,
1155 __entry
->res_count
, __entry
->status
,
1156 nfs_show_stable(__entry
->stable
),
1157 __print_hex_str(__entry
->verifier
, NFS4_VERIFIER_SIZE
)
1161 DECLARE_EVENT_CLASS(nfs_page_error_class
,
1163 const struct nfs_page
*req
,
1167 TP_ARGS(req
, error
),
1170 __field(const void *, req
)
1171 __field(pgoff_t
, index
)
1172 __field(unsigned int, offset
)
1173 __field(unsigned int, pgbase
)
1174 __field(unsigned int, bytes
)
1180 __entry
->index
= req
->wb_index
;
1181 __entry
->offset
= req
->wb_offset
;
1182 __entry
->pgbase
= req
->wb_pgbase
;
1183 __entry
->bytes
= req
->wb_bytes
;
1184 __entry
->error
= error
;
1188 "req=%p index=%lu offset=%u pgbase=%u bytes=%u error=%d",
1189 __entry
->req
, __entry
->index
, __entry
->offset
,
1190 __entry
->pgbase
, __entry
->bytes
, __entry
->error
1194 #define DEFINE_NFS_PAGEERR_EVENT(name) \
1195 DEFINE_EVENT(nfs_page_error_class, name, \
1197 const struct nfs_page *req, \
1200 TP_ARGS(req, error))
1202 DEFINE_NFS_PAGEERR_EVENT(nfs_write_error
);
1203 DEFINE_NFS_PAGEERR_EVENT(nfs_comp_error
);
1204 DEFINE_NFS_PAGEERR_EVENT(nfs_commit_error
);
1206 TRACE_EVENT(nfs_initiate_commit
,
1208 const struct nfs_commit_data
*data
1215 __field(u32
, fhandle
)
1216 __field(u64
, fileid
)
1217 __field(loff_t
, offset
)
1222 const struct inode
*inode
= data
->inode
;
1223 const struct nfs_inode
*nfsi
= NFS_I(inode
);
1224 const struct nfs_fh
*fh
= data
->args
.fh
?
1225 data
->args
.fh
: &nfsi
->fh
;
1227 __entry
->offset
= data
->args
.offset
;
1228 __entry
->count
= data
->args
.count
;
1229 __entry
->dev
= inode
->i_sb
->s_dev
;
1230 __entry
->fileid
= nfsi
->fileid
;
1231 __entry
->fhandle
= nfs_fhandle_hash(fh
);
1235 "fileid=%02x:%02x:%llu fhandle=0x%08x "
1236 "offset=%lld count=%u",
1237 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1238 (unsigned long long)__entry
->fileid
,
1240 (long long)__entry
->offset
, __entry
->count
1244 TRACE_EVENT(nfs_commit_done
,
1246 const struct rpc_task
*task
,
1247 const struct nfs_commit_data
*data
1250 TP_ARGS(task
, data
),
1254 __field(u32
, fhandle
)
1255 __field(u64
, fileid
)
1256 __field(loff_t
, offset
)
1257 __field(int, status
)
1258 __field(enum nfs3_stable_how
, stable
)
1259 __array(char, verifier
, NFS4_VERIFIER_SIZE
)
1263 const struct inode
*inode
= data
->inode
;
1264 const struct nfs_inode
*nfsi
= NFS_I(inode
);
1265 const struct nfs_fh
*fh
= data
->args
.fh
?
1266 data
->args
.fh
: &nfsi
->fh
;
1267 const struct nfs_writeverf
*verf
= data
->res
.verf
;
1269 __entry
->status
= task
->tk_status
;
1270 __entry
->offset
= data
->args
.offset
;
1271 __entry
->stable
= verf
->committed
;
1272 memcpy(__entry
->verifier
,
1274 NFS4_VERIFIER_SIZE
);
1275 __entry
->dev
= inode
->i_sb
->s_dev
;
1276 __entry
->fileid
= nfsi
->fileid
;
1277 __entry
->fhandle
= nfs_fhandle_hash(fh
);
1281 "fileid=%02x:%02x:%llu fhandle=0x%08x "
1282 "offset=%lld status=%d stable=%s verifier=%s",
1283 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1284 (unsigned long long)__entry
->fileid
,
1286 (long long)__entry
->offset
, __entry
->status
,
1287 nfs_show_stable(__entry
->stable
),
1288 __print_hex_str(__entry
->verifier
, NFS4_VERIFIER_SIZE
)
1292 TRACE_EVENT(nfs_fh_to_dentry
,
1294 const struct super_block
*sb
,
1295 const struct nfs_fh
*fh
,
1300 TP_ARGS(sb
, fh
, fileid
, error
),
1305 __field(u32
, fhandle
)
1306 __field(u64
, fileid
)
1310 __entry
->error
= error
;
1311 __entry
->dev
= sb
->s_dev
;
1312 __entry
->fileid
= fileid
;
1313 __entry
->fhandle
= nfs_fhandle_hash(fh
);
1317 "error=%d fileid=%02x:%02x:%llu fhandle=0x%08x ",
1319 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1320 (unsigned long long)__entry
->fileid
,
1325 TRACE_DEFINE_ENUM(NFS_OK
);
1326 TRACE_DEFINE_ENUM(NFSERR_PERM
);
1327 TRACE_DEFINE_ENUM(NFSERR_NOENT
);
1328 TRACE_DEFINE_ENUM(NFSERR_IO
);
1329 TRACE_DEFINE_ENUM(NFSERR_NXIO
);
1330 TRACE_DEFINE_ENUM(ECHILD
);
1331 TRACE_DEFINE_ENUM(NFSERR_EAGAIN
);
1332 TRACE_DEFINE_ENUM(NFSERR_ACCES
);
1333 TRACE_DEFINE_ENUM(NFSERR_EXIST
);
1334 TRACE_DEFINE_ENUM(NFSERR_XDEV
);
1335 TRACE_DEFINE_ENUM(NFSERR_NODEV
);
1336 TRACE_DEFINE_ENUM(NFSERR_NOTDIR
);
1337 TRACE_DEFINE_ENUM(NFSERR_ISDIR
);
1338 TRACE_DEFINE_ENUM(NFSERR_INVAL
);
1339 TRACE_DEFINE_ENUM(NFSERR_FBIG
);
1340 TRACE_DEFINE_ENUM(NFSERR_NOSPC
);
1341 TRACE_DEFINE_ENUM(NFSERR_ROFS
);
1342 TRACE_DEFINE_ENUM(NFSERR_MLINK
);
1343 TRACE_DEFINE_ENUM(NFSERR_OPNOTSUPP
);
1344 TRACE_DEFINE_ENUM(NFSERR_NAMETOOLONG
);
1345 TRACE_DEFINE_ENUM(NFSERR_NOTEMPTY
);
1346 TRACE_DEFINE_ENUM(NFSERR_DQUOT
);
1347 TRACE_DEFINE_ENUM(NFSERR_STALE
);
1348 TRACE_DEFINE_ENUM(NFSERR_REMOTE
);
1349 TRACE_DEFINE_ENUM(NFSERR_WFLUSH
);
1350 TRACE_DEFINE_ENUM(NFSERR_BADHANDLE
);
1351 TRACE_DEFINE_ENUM(NFSERR_NOT_SYNC
);
1352 TRACE_DEFINE_ENUM(NFSERR_BAD_COOKIE
);
1353 TRACE_DEFINE_ENUM(NFSERR_NOTSUPP
);
1354 TRACE_DEFINE_ENUM(NFSERR_TOOSMALL
);
1355 TRACE_DEFINE_ENUM(NFSERR_SERVERFAULT
);
1356 TRACE_DEFINE_ENUM(NFSERR_BADTYPE
);
1357 TRACE_DEFINE_ENUM(NFSERR_JUKEBOX
);
1359 #define nfs_show_status(x) \
1360 __print_symbolic(x, \
1362 { NFSERR_PERM, "PERM" }, \
1363 { NFSERR_NOENT, "NOENT" }, \
1364 { NFSERR_IO, "IO" }, \
1365 { NFSERR_NXIO, "NXIO" }, \
1366 { ECHILD, "CHILD" }, \
1367 { NFSERR_EAGAIN, "AGAIN" }, \
1368 { NFSERR_ACCES, "ACCES" }, \
1369 { NFSERR_EXIST, "EXIST" }, \
1370 { NFSERR_XDEV, "XDEV" }, \
1371 { NFSERR_NODEV, "NODEV" }, \
1372 { NFSERR_NOTDIR, "NOTDIR" }, \
1373 { NFSERR_ISDIR, "ISDIR" }, \
1374 { NFSERR_INVAL, "INVAL" }, \
1375 { NFSERR_FBIG, "FBIG" }, \
1376 { NFSERR_NOSPC, "NOSPC" }, \
1377 { NFSERR_ROFS, "ROFS" }, \
1378 { NFSERR_MLINK, "MLINK" }, \
1379 { NFSERR_OPNOTSUPP, "OPNOTSUPP" }, \
1380 { NFSERR_NAMETOOLONG, "NAMETOOLONG" }, \
1381 { NFSERR_NOTEMPTY, "NOTEMPTY" }, \
1382 { NFSERR_DQUOT, "DQUOT" }, \
1383 { NFSERR_STALE, "STALE" }, \
1384 { NFSERR_REMOTE, "REMOTE" }, \
1385 { NFSERR_WFLUSH, "WFLUSH" }, \
1386 { NFSERR_BADHANDLE, "BADHANDLE" }, \
1387 { NFSERR_NOT_SYNC, "NOTSYNC" }, \
1388 { NFSERR_BAD_COOKIE, "BADCOOKIE" }, \
1389 { NFSERR_NOTSUPP, "NOTSUPP" }, \
1390 { NFSERR_TOOSMALL, "TOOSMALL" }, \
1391 { NFSERR_SERVERFAULT, "REMOTEIO" }, \
1392 { NFSERR_BADTYPE, "BADTYPE" }, \
1393 { NFSERR_JUKEBOX, "JUKEBOX" })
1395 TRACE_EVENT(nfs_xdr_status
,
1397 const struct xdr_stream
*xdr
,
1401 TP_ARGS(xdr
, error
),
1404 __field(unsigned int, task_id
)
1405 __field(unsigned int, client_id
)
1407 __field(int, version
)
1408 __field(unsigned long, error
)
1410 xdr
->rqst
->rq_task
->tk_client
->cl_program
->name
)
1412 xdr
->rqst
->rq_task
->tk_msg
.rpc_proc
->p_name
)
1416 const struct rpc_rqst
*rqstp
= xdr
->rqst
;
1417 const struct rpc_task
*task
= rqstp
->rq_task
;
1419 __entry
->task_id
= task
->tk_pid
;
1420 __entry
->client_id
= task
->tk_client
->cl_clid
;
1421 __entry
->xid
= be32_to_cpu(rqstp
->rq_xid
);
1422 __entry
->version
= task
->tk_client
->cl_vers
;
1423 __entry
->error
= error
;
1424 __assign_str(program
,
1425 task
->tk_client
->cl_program
->name
)
1426 __assign_str(procedure
, task
->tk_msg
.rpc_proc
->p_name
)
1430 "task:%u@%d xid=0x%08x %sv%d %s error=%ld (%s)",
1431 __entry
->task_id
, __entry
->client_id
, __entry
->xid
,
1432 __get_str(program
), __entry
->version
,
1433 __get_str(procedure
), -__entry
->error
,
1434 nfs_show_status(__entry
->error
)
1438 #endif /* _TRACE_NFS_H */
1440 #undef TRACE_INCLUDE_PATH
1441 #define TRACE_INCLUDE_PATH .
1442 #define TRACE_INCLUDE_FILE nfstrace
1443 /* This part must be outside protection */
1444 #include <trace/define_trace.h>