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 #include <trace/misc/fs.h>
15 #include <trace/misc/nfs.h>
16 #include <trace/misc/sunrpc.h>
18 #define nfs_show_cache_validity(v) \
19 __print_flags(v, "|", \
20 { NFS_INO_INVALID_DATA, "INVALID_DATA" }, \
21 { NFS_INO_INVALID_ATIME, "INVALID_ATIME" }, \
22 { NFS_INO_INVALID_ACCESS, "INVALID_ACCESS" }, \
23 { NFS_INO_INVALID_ACL, "INVALID_ACL" }, \
24 { NFS_INO_REVAL_FORCED, "REVAL_FORCED" }, \
25 { NFS_INO_INVALID_LABEL, "INVALID_LABEL" }, \
26 { NFS_INO_INVALID_CHANGE, "INVALID_CHANGE" }, \
27 { NFS_INO_INVALID_CTIME, "INVALID_CTIME" }, \
28 { NFS_INO_INVALID_MTIME, "INVALID_MTIME" }, \
29 { NFS_INO_INVALID_SIZE, "INVALID_SIZE" }, \
30 { NFS_INO_INVALID_OTHER, "INVALID_OTHER" }, \
31 { NFS_INO_DATA_INVAL_DEFER, "DATA_INVAL_DEFER" }, \
32 { NFS_INO_INVALID_BLOCKS, "INVALID_BLOCKS" }, \
33 { NFS_INO_INVALID_XATTR, "INVALID_XATTR" }, \
34 { NFS_INO_INVALID_NLINK, "INVALID_NLINK" }, \
35 { NFS_INO_INVALID_MODE, "INVALID_MODE" })
37 #define nfs_show_nfsi_flags(v) \
38 __print_flags(v, "|", \
39 { BIT(NFS_INO_STALE), "STALE" }, \
40 { BIT(NFS_INO_ACL_LRU_SET), "ACL_LRU_SET" }, \
41 { BIT(NFS_INO_INVALIDATING), "INVALIDATING" }, \
42 { BIT(NFS_INO_LAYOUTCOMMIT), "NEED_LAYOUTCOMMIT" }, \
43 { BIT(NFS_INO_LAYOUTCOMMITTING), "LAYOUTCOMMIT" }, \
44 { BIT(NFS_INO_LAYOUTSTATS), "LAYOUTSTATS" }, \
45 { BIT(NFS_INO_ODIRECT), "ODIRECT" })
47 DECLARE_EVENT_CLASS(nfs_inode_event
,
49 const struct inode
*inode
62 const struct nfs_inode
*nfsi
= NFS_I(inode
);
63 __entry
->dev
= inode
->i_sb
->s_dev
;
64 __entry
->fileid
= nfsi
->fileid
;
65 __entry
->fhandle
= nfs_fhandle_hash(&nfsi
->fh
);
66 __entry
->version
= inode_peek_iversion_raw(inode
);
70 "fileid=%02x:%02x:%llu fhandle=0x%08x version=%llu ",
71 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
72 (unsigned long long)__entry
->fileid
,
74 (unsigned long long)__entry
->version
78 DECLARE_EVENT_CLASS(nfs_inode_event_done
,
80 const struct inode
*inode
,
84 TP_ARGS(inode
, error
),
87 __field(unsigned long, error
)
90 __field(unsigned char, type
)
94 __field(unsigned long, nfsi_flags
)
95 __field(unsigned long, cache_validity
)
99 const struct nfs_inode
*nfsi
= NFS_I(inode
);
100 __entry
->error
= error
< 0 ? -error
: 0;
101 __entry
->dev
= inode
->i_sb
->s_dev
;
102 __entry
->fileid
= nfsi
->fileid
;
103 __entry
->fhandle
= nfs_fhandle_hash(&nfsi
->fh
);
104 __entry
->type
= nfs_umode_to_dtype(inode
->i_mode
);
105 __entry
->version
= inode_peek_iversion_raw(inode
);
106 __entry
->size
= i_size_read(inode
);
107 __entry
->nfsi_flags
= nfsi
->flags
;
108 __entry
->cache_validity
= nfsi
->cache_validity
;
112 "error=%ld (%s) fileid=%02x:%02x:%llu fhandle=0x%08x "
113 "type=%u (%s) version=%llu size=%lld "
114 "cache_validity=0x%lx (%s) nfs_flags=0x%lx (%s)",
115 -__entry
->error
, show_nfs_status(__entry
->error
),
116 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
117 (unsigned long long)__entry
->fileid
,
120 show_fs_dirent_type(__entry
->type
),
121 (unsigned long long)__entry
->version
,
122 (long long)__entry
->size
,
123 __entry
->cache_validity
,
124 nfs_show_cache_validity(__entry
->cache_validity
),
126 nfs_show_nfsi_flags(__entry
->nfsi_flags
)
130 #define DEFINE_NFS_INODE_EVENT(name) \
131 DEFINE_EVENT(nfs_inode_event, name, \
133 const struct inode *inode \
136 #define DEFINE_NFS_INODE_EVENT_DONE(name) \
137 DEFINE_EVENT(nfs_inode_event_done, name, \
139 const struct inode *inode, \
142 TP_ARGS(inode, error))
143 DEFINE_NFS_INODE_EVENT(nfs_set_inode_stale
);
144 DEFINE_NFS_INODE_EVENT(nfs_refresh_inode_enter
);
145 DEFINE_NFS_INODE_EVENT_DONE(nfs_refresh_inode_exit
);
146 DEFINE_NFS_INODE_EVENT(nfs_revalidate_inode_enter
);
147 DEFINE_NFS_INODE_EVENT_DONE(nfs_revalidate_inode_exit
);
148 DEFINE_NFS_INODE_EVENT(nfs_invalidate_mapping_enter
);
149 DEFINE_NFS_INODE_EVENT_DONE(nfs_invalidate_mapping_exit
);
150 DEFINE_NFS_INODE_EVENT(nfs_getattr_enter
);
151 DEFINE_NFS_INODE_EVENT_DONE(nfs_getattr_exit
);
152 DEFINE_NFS_INODE_EVENT(nfs_setattr_enter
);
153 DEFINE_NFS_INODE_EVENT_DONE(nfs_setattr_exit
);
154 DEFINE_NFS_INODE_EVENT(nfs_writeback_inode_enter
);
155 DEFINE_NFS_INODE_EVENT_DONE(nfs_writeback_inode_exit
);
156 DEFINE_NFS_INODE_EVENT(nfs_fsync_enter
);
157 DEFINE_NFS_INODE_EVENT_DONE(nfs_fsync_exit
);
158 DEFINE_NFS_INODE_EVENT(nfs_access_enter
);
159 DEFINE_NFS_INODE_EVENT_DONE(nfs_set_cache_invalid
);
160 DEFINE_NFS_INODE_EVENT(nfs_readdir_force_readdirplus
);
161 DEFINE_NFS_INODE_EVENT_DONE(nfs_readdir_cache_fill_done
);
162 DEFINE_NFS_INODE_EVENT_DONE(nfs_readdir_uncached_done
);
164 TRACE_EVENT(nfs_access_exit
,
166 const struct inode
*inode
,
168 unsigned int permitted
,
172 TP_ARGS(inode
, mask
, permitted
, error
),
175 __field(unsigned long, error
)
177 __field(u32
, fhandle
)
178 __field(unsigned char, type
)
180 __field(u64
, version
)
181 __field(loff_t
, size
)
182 __field(unsigned long, nfsi_flags
)
183 __field(unsigned long, cache_validity
)
184 __field(unsigned int, mask
)
185 __field(unsigned int, permitted
)
189 const struct nfs_inode
*nfsi
= NFS_I(inode
);
190 __entry
->error
= error
< 0 ? -error
: 0;
191 __entry
->dev
= inode
->i_sb
->s_dev
;
192 __entry
->fileid
= nfsi
->fileid
;
193 __entry
->fhandle
= nfs_fhandle_hash(&nfsi
->fh
);
194 __entry
->type
= nfs_umode_to_dtype(inode
->i_mode
);
195 __entry
->version
= inode_peek_iversion_raw(inode
);
196 __entry
->size
= i_size_read(inode
);
197 __entry
->nfsi_flags
= nfsi
->flags
;
198 __entry
->cache_validity
= nfsi
->cache_validity
;
199 __entry
->mask
= mask
;
200 __entry
->permitted
= permitted
;
204 "error=%ld (%s) fileid=%02x:%02x:%llu fhandle=0x%08x "
205 "type=%u (%s) version=%llu size=%lld "
206 "cache_validity=0x%lx (%s) nfs_flags=0x%lx (%s) "
207 "mask=0x%x permitted=0x%x",
208 -__entry
->error
, show_nfs_status(__entry
->error
),
209 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
210 (unsigned long long)__entry
->fileid
,
213 show_fs_dirent_type(__entry
->type
),
214 (unsigned long long)__entry
->version
,
215 (long long)__entry
->size
,
216 __entry
->cache_validity
,
217 nfs_show_cache_validity(__entry
->cache_validity
),
219 nfs_show_nfsi_flags(__entry
->nfsi_flags
),
220 __entry
->mask
, __entry
->permitted
224 DECLARE_EVENT_CLASS(nfs_update_size_class
,
226 const struct inode
*inode
,
230 TP_ARGS(inode
, new_size
),
234 __field(u32
, fhandle
)
236 __field(u64
, version
)
237 __field(loff_t
, cur_size
)
238 __field(loff_t
, new_size
)
242 const struct nfs_inode
*nfsi
= NFS_I(inode
);
244 __entry
->dev
= inode
->i_sb
->s_dev
;
245 __entry
->fhandle
= nfs_fhandle_hash(&nfsi
->fh
);
246 __entry
->fileid
= nfsi
->fileid
;
247 __entry
->version
= inode_peek_iversion_raw(inode
);
248 __entry
->cur_size
= i_size_read(inode
);
249 __entry
->new_size
= new_size
;
253 "fileid=%02x:%02x:%llu fhandle=0x%08x version=%llu cursize=%lld newsize=%lld",
254 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
255 (unsigned long long)__entry
->fileid
,
256 __entry
->fhandle
, __entry
->version
,
257 __entry
->cur_size
, __entry
->new_size
261 #define DEFINE_NFS_UPDATE_SIZE_EVENT(name) \
262 DEFINE_EVENT(nfs_update_size_class, nfs_size_##name, \
264 const struct inode *inode, \
267 TP_ARGS(inode, new_size))
269 DEFINE_NFS_UPDATE_SIZE_EVENT(truncate
);
270 DEFINE_NFS_UPDATE_SIZE_EVENT(wcc
);
271 DEFINE_NFS_UPDATE_SIZE_EVENT(update
);
272 DEFINE_NFS_UPDATE_SIZE_EVENT(grow
);
274 DECLARE_EVENT_CLASS(nfs_inode_range_event
,
276 const struct inode
*inode
,
281 TP_ARGS(inode
, range_start
, range_end
),
285 __field(u32
, fhandle
)
287 __field(u64
, version
)
288 __field(loff_t
, range_start
)
289 __field(loff_t
, range_end
)
293 const struct nfs_inode
*nfsi
= NFS_I(inode
);
295 __entry
->dev
= inode
->i_sb
->s_dev
;
296 __entry
->fhandle
= nfs_fhandle_hash(&nfsi
->fh
);
297 __entry
->fileid
= nfsi
->fileid
;
298 __entry
->version
= inode_peek_iversion_raw(inode
);
299 __entry
->range_start
= range_start
;
300 __entry
->range_end
= range_end
;
304 "fileid=%02x:%02x:%llu fhandle=0x%08x version=%llu "
305 "range=[%lld, %lld]",
306 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
307 (unsigned long long)__entry
->fileid
,
308 __entry
->fhandle
, __entry
->version
,
309 __entry
->range_start
, __entry
->range_end
313 #define DEFINE_NFS_INODE_RANGE_EVENT(name) \
314 DEFINE_EVENT(nfs_inode_range_event, name, \
316 const struct inode *inode, \
317 loff_t range_start, \
320 TP_ARGS(inode, range_start, range_end))
322 DEFINE_NFS_INODE_RANGE_EVENT(nfs_readdir_invalidate_cache_range
);
324 DECLARE_EVENT_CLASS(nfs_readdir_event
,
326 const struct file
*file
,
327 const __be32
*verifier
,
333 TP_ARGS(file
, verifier
, cookie
, page_index
, dtsize
),
337 __field(u32
, fhandle
)
339 __field(u64
, version
)
340 __array(char, verifier
, NFS4_VERIFIER_SIZE
)
342 __field(pgoff_t
, index
)
343 __field(unsigned int, dtsize
)
347 const struct inode
*dir
= file_inode(file
);
348 const struct nfs_inode
*nfsi
= NFS_I(dir
);
350 __entry
->dev
= dir
->i_sb
->s_dev
;
351 __entry
->fileid
= nfsi
->fileid
;
352 __entry
->fhandle
= nfs_fhandle_hash(&nfsi
->fh
);
353 __entry
->version
= inode_peek_iversion_raw(dir
);
355 memcpy(__entry
->verifier
, verifier
,
358 memset(__entry
->verifier
, 0,
360 __entry
->cookie
= cookie
;
361 __entry
->index
= page_index
;
362 __entry
->dtsize
= dtsize
;
366 "fileid=%02x:%02x:%llu fhandle=0x%08x version=%llu "
367 "cookie=%s:0x%llx cache_index=%lu dtsize=%u",
368 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
369 (unsigned long long)__entry
->fileid
, __entry
->fhandle
,
370 __entry
->version
, show_nfs4_verifier(__entry
->verifier
),
371 (unsigned long long)__entry
->cookie
, __entry
->index
,
376 #define DEFINE_NFS_READDIR_EVENT(name) \
377 DEFINE_EVENT(nfs_readdir_event, name, \
379 const struct file *file, \
380 const __be32 *verifier, \
382 pgoff_t page_index, \
383 unsigned int dtsize \
385 TP_ARGS(file, verifier, cookie, page_index, dtsize))
387 DEFINE_NFS_READDIR_EVENT(nfs_readdir_cache_fill
);
388 DEFINE_NFS_READDIR_EVENT(nfs_readdir_uncached
);
390 DECLARE_EVENT_CLASS(nfs_lookup_event
,
392 const struct inode
*dir
,
393 const struct dentry
*dentry
,
397 TP_ARGS(dir
, dentry
, flags
),
400 __field(unsigned long, flags
)
404 __string(name
, dentry
->d_name
.name
)
408 __entry
->dev
= dir
->i_sb
->s_dev
;
409 __entry
->dir
= NFS_FILEID(dir
);
410 __entry
->flags
= flags
;
411 __entry
->fileid
= d_is_negative(dentry
) ? 0 : NFS_FILEID(d_inode(dentry
));
416 "flags=0x%lx (%s) name=%02x:%02x:%llu/%s fileid=%llu",
418 show_fs_lookup_flags(__entry
->flags
),
419 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
420 (unsigned long long)__entry
->dir
,
426 #define DEFINE_NFS_LOOKUP_EVENT(name) \
427 DEFINE_EVENT(nfs_lookup_event, name, \
429 const struct inode *dir, \
430 const struct dentry *dentry, \
433 TP_ARGS(dir, dentry, flags))
435 DECLARE_EVENT_CLASS(nfs_lookup_event_done
,
437 const struct inode
*dir
,
438 const struct dentry
*dentry
,
443 TP_ARGS(dir
, dentry
, flags
, error
),
446 __field(unsigned long, error
)
447 __field(unsigned long, flags
)
451 __string(name
, dentry
->d_name
.name
)
455 __entry
->dev
= dir
->i_sb
->s_dev
;
456 __entry
->dir
= NFS_FILEID(dir
);
457 __entry
->error
= error
< 0 ? -error
: 0;
458 __entry
->flags
= flags
;
459 __entry
->fileid
= d_is_negative(dentry
) ? 0 : NFS_FILEID(d_inode(dentry
));
464 "error=%ld (%s) flags=0x%lx (%s) name=%02x:%02x:%llu/%s fileid=%llu",
465 -__entry
->error
, show_nfs_status(__entry
->error
),
467 show_fs_lookup_flags(__entry
->flags
),
468 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
469 (unsigned long long)__entry
->dir
,
475 #define DEFINE_NFS_LOOKUP_EVENT_DONE(name) \
476 DEFINE_EVENT(nfs_lookup_event_done, name, \
478 const struct inode *dir, \
479 const struct dentry *dentry, \
480 unsigned int flags, \
483 TP_ARGS(dir, dentry, flags, error))
485 DEFINE_NFS_LOOKUP_EVENT(nfs_lookup_enter
);
486 DEFINE_NFS_LOOKUP_EVENT_DONE(nfs_lookup_exit
);
487 DEFINE_NFS_LOOKUP_EVENT(nfs_lookup_revalidate_enter
);
488 DEFINE_NFS_LOOKUP_EVENT_DONE(nfs_lookup_revalidate_exit
);
489 DEFINE_NFS_LOOKUP_EVENT(nfs_readdir_lookup
);
490 DEFINE_NFS_LOOKUP_EVENT(nfs_readdir_lookup_revalidate_failed
);
491 DEFINE_NFS_LOOKUP_EVENT_DONE(nfs_readdir_lookup_revalidate
);
493 TRACE_EVENT(nfs_atomic_open_enter
,
495 const struct inode
*dir
,
496 const struct nfs_open_context
*ctx
,
500 TP_ARGS(dir
, ctx
, flags
),
503 __field(unsigned long, flags
)
504 __field(unsigned long, fmode
)
507 __string(name
, ctx
->dentry
->d_name
.name
)
511 __entry
->dev
= dir
->i_sb
->s_dev
;
512 __entry
->dir
= NFS_FILEID(dir
);
513 __entry
->flags
= flags
;
514 __entry
->fmode
= (__force
unsigned long)ctx
->mode
;
519 "flags=0x%lx (%s) fmode=%s name=%02x:%02x:%llu/%s",
521 show_fs_fcntl_open_flags(__entry
->flags
),
522 show_fs_fmode_flags(__entry
->fmode
),
523 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
524 (unsigned long long)__entry
->dir
,
529 TRACE_EVENT(nfs_atomic_open_exit
,
531 const struct inode
*dir
,
532 const struct nfs_open_context
*ctx
,
537 TP_ARGS(dir
, ctx
, flags
, error
),
540 __field(unsigned long, error
)
541 __field(unsigned long, flags
)
542 __field(unsigned long, fmode
)
545 __string(name
, ctx
->dentry
->d_name
.name
)
549 __entry
->error
= -error
;
550 __entry
->dev
= dir
->i_sb
->s_dev
;
551 __entry
->dir
= NFS_FILEID(dir
);
552 __entry
->flags
= flags
;
553 __entry
->fmode
= (__force
unsigned long)ctx
->mode
;
558 "error=%ld (%s) flags=0x%lx (%s) fmode=%s "
559 "name=%02x:%02x:%llu/%s",
560 -__entry
->error
, show_nfs_status(__entry
->error
),
562 show_fs_fcntl_open_flags(__entry
->flags
),
563 show_fs_fmode_flags(__entry
->fmode
),
564 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
565 (unsigned long long)__entry
->dir
,
570 TRACE_EVENT(nfs_create_enter
,
572 const struct inode
*dir
,
573 const struct dentry
*dentry
,
577 TP_ARGS(dir
, dentry
, flags
),
580 __field(unsigned long, flags
)
583 __string(name
, dentry
->d_name
.name
)
587 __entry
->dev
= dir
->i_sb
->s_dev
;
588 __entry
->dir
= NFS_FILEID(dir
);
589 __entry
->flags
= flags
;
594 "flags=0x%lx (%s) name=%02x:%02x:%llu/%s",
596 show_fs_fcntl_open_flags(__entry
->flags
),
597 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
598 (unsigned long long)__entry
->dir
,
603 TRACE_EVENT(nfs_create_exit
,
605 const struct inode
*dir
,
606 const struct dentry
*dentry
,
611 TP_ARGS(dir
, dentry
, flags
, error
),
614 __field(unsigned long, error
)
615 __field(unsigned long, flags
)
618 __string(name
, dentry
->d_name
.name
)
622 __entry
->error
= -error
;
623 __entry
->dev
= dir
->i_sb
->s_dev
;
624 __entry
->dir
= NFS_FILEID(dir
);
625 __entry
->flags
= flags
;
630 "error=%ld (%s) flags=0x%lx (%s) name=%02x:%02x:%llu/%s",
631 -__entry
->error
, show_nfs_status(__entry
->error
),
633 show_fs_fcntl_open_flags(__entry
->flags
),
634 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
635 (unsigned long long)__entry
->dir
,
640 DECLARE_EVENT_CLASS(nfs_directory_event
,
642 const struct inode
*dir
,
643 const struct dentry
*dentry
646 TP_ARGS(dir
, dentry
),
651 __string(name
, dentry
->d_name
.name
)
655 __entry
->dev
= dir
->i_sb
->s_dev
;
656 __entry
->dir
= NFS_FILEID(dir
);
661 "name=%02x:%02x:%llu/%s",
662 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
663 (unsigned long long)__entry
->dir
,
668 #define DEFINE_NFS_DIRECTORY_EVENT(name) \
669 DEFINE_EVENT(nfs_directory_event, name, \
671 const struct inode *dir, \
672 const struct dentry *dentry \
674 TP_ARGS(dir, dentry))
676 DECLARE_EVENT_CLASS(nfs_directory_event_done
,
678 const struct inode
*dir
,
679 const struct dentry
*dentry
,
683 TP_ARGS(dir
, dentry
, error
),
686 __field(unsigned long, error
)
689 __string(name
, dentry
->d_name
.name
)
693 __entry
->dev
= dir
->i_sb
->s_dev
;
694 __entry
->dir
= NFS_FILEID(dir
);
695 __entry
->error
= error
< 0 ? -error
: 0;
700 "error=%ld (%s) name=%02x:%02x:%llu/%s",
701 -__entry
->error
, show_nfs_status(__entry
->error
),
702 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
703 (unsigned long long)__entry
->dir
,
708 #define DEFINE_NFS_DIRECTORY_EVENT_DONE(name) \
709 DEFINE_EVENT(nfs_directory_event_done, name, \
711 const struct inode *dir, \
712 const struct dentry *dentry, \
715 TP_ARGS(dir, dentry, error))
717 DEFINE_NFS_DIRECTORY_EVENT(nfs_mknod_enter
);
718 DEFINE_NFS_DIRECTORY_EVENT_DONE(nfs_mknod_exit
);
719 DEFINE_NFS_DIRECTORY_EVENT(nfs_mkdir_enter
);
720 DEFINE_NFS_DIRECTORY_EVENT_DONE(nfs_mkdir_exit
);
721 DEFINE_NFS_DIRECTORY_EVENT(nfs_rmdir_enter
);
722 DEFINE_NFS_DIRECTORY_EVENT_DONE(nfs_rmdir_exit
);
723 DEFINE_NFS_DIRECTORY_EVENT(nfs_remove_enter
);
724 DEFINE_NFS_DIRECTORY_EVENT_DONE(nfs_remove_exit
);
725 DEFINE_NFS_DIRECTORY_EVENT(nfs_unlink_enter
);
726 DEFINE_NFS_DIRECTORY_EVENT_DONE(nfs_unlink_exit
);
727 DEFINE_NFS_DIRECTORY_EVENT(nfs_symlink_enter
);
728 DEFINE_NFS_DIRECTORY_EVENT_DONE(nfs_symlink_exit
);
730 TRACE_EVENT(nfs_link_enter
,
732 const struct inode
*inode
,
733 const struct inode
*dir
,
734 const struct dentry
*dentry
737 TP_ARGS(inode
, dir
, dentry
),
743 __string(name
, dentry
->d_name
.name
)
747 __entry
->dev
= inode
->i_sb
->s_dev
;
748 __entry
->fileid
= NFS_FILEID(inode
);
749 __entry
->dir
= NFS_FILEID(dir
);
754 "fileid=%02x:%02x:%llu name=%02x:%02x:%llu/%s",
755 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
757 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
758 (unsigned long long)__entry
->dir
,
763 TRACE_EVENT(nfs_link_exit
,
765 const struct inode
*inode
,
766 const struct inode
*dir
,
767 const struct dentry
*dentry
,
771 TP_ARGS(inode
, dir
, dentry
, error
),
774 __field(unsigned long, error
)
778 __string(name
, dentry
->d_name
.name
)
782 __entry
->dev
= inode
->i_sb
->s_dev
;
783 __entry
->fileid
= NFS_FILEID(inode
);
784 __entry
->dir
= NFS_FILEID(dir
);
785 __entry
->error
= error
< 0 ? -error
: 0;
790 "error=%ld (%s) fileid=%02x:%02x:%llu name=%02x:%02x:%llu/%s",
791 -__entry
->error
, show_nfs_status(__entry
->error
),
792 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
794 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
795 (unsigned long long)__entry
->dir
,
800 DECLARE_EVENT_CLASS(nfs_rename_event
,
802 const struct inode
*old_dir
,
803 const struct dentry
*old_dentry
,
804 const struct inode
*new_dir
,
805 const struct dentry
*new_dentry
808 TP_ARGS(old_dir
, old_dentry
, new_dir
, new_dentry
),
812 __field(u64
, old_dir
)
813 __field(u64
, new_dir
)
814 __string(old_name
, old_dentry
->d_name
.name
)
815 __string(new_name
, new_dentry
->d_name
.name
)
819 __entry
->dev
= old_dir
->i_sb
->s_dev
;
820 __entry
->old_dir
= NFS_FILEID(old_dir
);
821 __entry
->new_dir
= NFS_FILEID(new_dir
);
822 __assign_str(old_name
);
823 __assign_str(new_name
);
827 "old_name=%02x:%02x:%llu/%s new_name=%02x:%02x:%llu/%s",
828 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
829 (unsigned long long)__entry
->old_dir
,
831 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
832 (unsigned long long)__entry
->new_dir
,
836 #define DEFINE_NFS_RENAME_EVENT(name) \
837 DEFINE_EVENT(nfs_rename_event, name, \
839 const struct inode *old_dir, \
840 const struct dentry *old_dentry, \
841 const struct inode *new_dir, \
842 const struct dentry *new_dentry \
844 TP_ARGS(old_dir, old_dentry, new_dir, new_dentry))
846 DECLARE_EVENT_CLASS(nfs_rename_event_done
,
848 const struct inode
*old_dir
,
849 const struct dentry
*old_dentry
,
850 const struct inode
*new_dir
,
851 const struct dentry
*new_dentry
,
855 TP_ARGS(old_dir
, old_dentry
, new_dir
, new_dentry
, error
),
859 __field(unsigned long, error
)
860 __field(u64
, old_dir
)
861 __string(old_name
, old_dentry
->d_name
.name
)
862 __field(u64
, new_dir
)
863 __string(new_name
, new_dentry
->d_name
.name
)
867 __entry
->dev
= old_dir
->i_sb
->s_dev
;
868 __entry
->error
= -error
;
869 __entry
->old_dir
= NFS_FILEID(old_dir
);
870 __entry
->new_dir
= NFS_FILEID(new_dir
);
871 __assign_str(old_name
);
872 __assign_str(new_name
);
876 "error=%ld (%s) old_name=%02x:%02x:%llu/%s "
877 "new_name=%02x:%02x:%llu/%s",
878 -__entry
->error
, show_nfs_status(__entry
->error
),
879 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
880 (unsigned long long)__entry
->old_dir
,
882 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
883 (unsigned long long)__entry
->new_dir
,
887 #define DEFINE_NFS_RENAME_EVENT_DONE(name) \
888 DEFINE_EVENT(nfs_rename_event_done, name, \
890 const struct inode *old_dir, \
891 const struct dentry *old_dentry, \
892 const struct inode *new_dir, \
893 const struct dentry *new_dentry, \
896 TP_ARGS(old_dir, old_dentry, new_dir, \
899 DEFINE_NFS_RENAME_EVENT(nfs_rename_enter
);
900 DEFINE_NFS_RENAME_EVENT_DONE(nfs_rename_exit
);
902 DEFINE_NFS_RENAME_EVENT_DONE(nfs_async_rename_done
);
904 TRACE_EVENT(nfs_sillyrename_unlink
,
906 const struct nfs_unlinkdata
*data
,
910 TP_ARGS(data
, error
),
914 __field(unsigned long, error
)
916 __dynamic_array(char, name
, data
->args
.name
.len
+ 1)
920 struct inode
*dir
= d_inode(data
->dentry
->d_parent
);
921 size_t len
= data
->args
.name
.len
;
922 __entry
->dev
= dir
->i_sb
->s_dev
;
923 __entry
->dir
= NFS_FILEID(dir
);
924 __entry
->error
= -error
;
925 memcpy(__get_str(name
),
926 data
->args
.name
.name
, len
);
927 __get_str(name
)[len
] = 0;
931 "error=%ld (%s) name=%02x:%02x:%llu/%s",
932 -__entry
->error
, show_nfs_status(__entry
->error
),
933 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
934 (unsigned long long)__entry
->dir
,
939 DECLARE_EVENT_CLASS(nfs_folio_event
,
941 const struct inode
*inode
,
946 TP_ARGS(inode
, offset
, count
),
950 __field(u32
, fhandle
)
952 __field(u64
, version
)
953 __field(loff_t
, offset
)
954 __field(size_t, count
)
958 const struct nfs_inode
*nfsi
= NFS_I(inode
);
960 __entry
->dev
= inode
->i_sb
->s_dev
;
961 __entry
->fileid
= nfsi
->fileid
;
962 __entry
->fhandle
= nfs_fhandle_hash(&nfsi
->fh
);
963 __entry
->version
= inode_peek_iversion_raw(inode
);
964 __entry
->offset
= offset
,
965 __entry
->count
= count
;
969 "fileid=%02x:%02x:%llu fhandle=0x%08x version=%llu "
970 "offset=%lld count=%zu",
971 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
972 (unsigned long long)__entry
->fileid
,
973 __entry
->fhandle
, __entry
->version
,
974 __entry
->offset
, __entry
->count
978 #define DEFINE_NFS_FOLIO_EVENT(name) \
979 DEFINE_EVENT(nfs_folio_event, name, \
981 const struct inode *inode, \
985 TP_ARGS(inode, offset, count))
987 DECLARE_EVENT_CLASS(nfs_folio_event_done
,
989 const struct inode
*inode
,
995 TP_ARGS(inode
, offset
, count
, ret
),
999 __field(u32
, fhandle
)
1001 __field(u64
, fileid
)
1002 __field(u64
, version
)
1003 __field(loff_t
, offset
)
1004 __field(size_t, count
)
1008 const struct nfs_inode
*nfsi
= NFS_I(inode
);
1010 __entry
->dev
= inode
->i_sb
->s_dev
;
1011 __entry
->fileid
= nfsi
->fileid
;
1012 __entry
->fhandle
= nfs_fhandle_hash(&nfsi
->fh
);
1013 __entry
->version
= inode_peek_iversion_raw(inode
);
1014 __entry
->offset
= offset
,
1015 __entry
->count
= count
,
1020 "fileid=%02x:%02x:%llu fhandle=0x%08x version=%llu "
1021 "offset=%lld count=%zu ret=%d",
1022 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1023 (unsigned long long)__entry
->fileid
,
1024 __entry
->fhandle
, __entry
->version
,
1025 __entry
->offset
, __entry
->count
, __entry
->ret
1029 #define DEFINE_NFS_FOLIO_EVENT_DONE(name) \
1030 DEFINE_EVENT(nfs_folio_event_done, name, \
1032 const struct inode *inode, \
1037 TP_ARGS(inode, offset, count, ret))
1039 DEFINE_NFS_FOLIO_EVENT(nfs_aop_readpage
);
1040 DEFINE_NFS_FOLIO_EVENT_DONE(nfs_aop_readpage_done
);
1042 DEFINE_NFS_FOLIO_EVENT(nfs_writeback_folio
);
1043 DEFINE_NFS_FOLIO_EVENT_DONE(nfs_writeback_folio_done
);
1045 DEFINE_NFS_FOLIO_EVENT(nfs_invalidate_folio
);
1046 DEFINE_NFS_FOLIO_EVENT_DONE(nfs_launder_folio_done
);
1048 TRACE_EVENT(nfs_aop_readahead
,
1050 const struct inode
*inode
,
1052 unsigned int nr_pages
1055 TP_ARGS(inode
, pos
, nr_pages
),
1059 __field(u32
, fhandle
)
1060 __field(u64
, fileid
)
1061 __field(u64
, version
)
1062 __field(loff_t
, offset
)
1063 __field(unsigned int, nr_pages
)
1067 const struct nfs_inode
*nfsi
= NFS_I(inode
);
1069 __entry
->dev
= inode
->i_sb
->s_dev
;
1070 __entry
->fileid
= nfsi
->fileid
;
1071 __entry
->fhandle
= nfs_fhandle_hash(&nfsi
->fh
);
1072 __entry
->version
= inode_peek_iversion_raw(inode
);
1073 __entry
->offset
= pos
;
1074 __entry
->nr_pages
= nr_pages
;
1078 "fileid=%02x:%02x:%llu fhandle=0x%08x version=%llu offset=%lld nr_pages=%u",
1079 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1080 (unsigned long long)__entry
->fileid
,
1081 __entry
->fhandle
, __entry
->version
,
1082 __entry
->offset
, __entry
->nr_pages
1086 TRACE_EVENT(nfs_aop_readahead_done
,
1088 const struct inode
*inode
,
1089 unsigned int nr_pages
,
1093 TP_ARGS(inode
, nr_pages
, ret
),
1097 __field(u32
, fhandle
)
1099 __field(u64
, fileid
)
1100 __field(u64
, version
)
1101 __field(loff_t
, offset
)
1102 __field(unsigned int, nr_pages
)
1106 const struct nfs_inode
*nfsi
= NFS_I(inode
);
1108 __entry
->dev
= inode
->i_sb
->s_dev
;
1109 __entry
->fileid
= nfsi
->fileid
;
1110 __entry
->fhandle
= nfs_fhandle_hash(&nfsi
->fh
);
1111 __entry
->version
= inode_peek_iversion_raw(inode
);
1112 __entry
->nr_pages
= nr_pages
;
1117 "fileid=%02x:%02x:%llu fhandle=0x%08x version=%llu nr_pages=%u ret=%d",
1118 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1119 (unsigned long long)__entry
->fileid
,
1120 __entry
->fhandle
, __entry
->version
,
1121 __entry
->nr_pages
, __entry
->ret
1125 TRACE_EVENT(nfs_initiate_read
,
1127 const struct nfs_pgio_header
*hdr
1134 __field(u32
, fhandle
)
1135 __field(u64
, fileid
)
1136 __field(loff_t
, offset
)
1141 const struct inode
*inode
= hdr
->inode
;
1142 const struct nfs_inode
*nfsi
= NFS_I(inode
);
1143 const struct nfs_fh
*fh
= hdr
->args
.fh
?
1144 hdr
->args
.fh
: &nfsi
->fh
;
1146 __entry
->offset
= hdr
->args
.offset
;
1147 __entry
->count
= hdr
->args
.count
;
1148 __entry
->dev
= inode
->i_sb
->s_dev
;
1149 __entry
->fileid
= nfsi
->fileid
;
1150 __entry
->fhandle
= nfs_fhandle_hash(fh
);
1154 "fileid=%02x:%02x:%llu fhandle=0x%08x "
1155 "offset=%lld count=%u",
1156 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1157 (unsigned long long)__entry
->fileid
,
1159 (long long)__entry
->offset
, __entry
->count
1163 TRACE_EVENT(nfs_readpage_done
,
1165 const struct rpc_task
*task
,
1166 const struct nfs_pgio_header
*hdr
1173 __field(u32
, fhandle
)
1174 __field(u64
, fileid
)
1175 __field(loff_t
, offset
)
1176 __field(u32
, arg_count
)
1177 __field(u32
, res_count
)
1183 const struct inode
*inode
= hdr
->inode
;
1184 const struct nfs_inode
*nfsi
= NFS_I(inode
);
1185 const struct nfs_fh
*fh
= hdr
->args
.fh
?
1186 hdr
->args
.fh
: &nfsi
->fh
;
1188 __entry
->error
= task
->tk_status
;
1189 __entry
->offset
= hdr
->args
.offset
;
1190 __entry
->arg_count
= hdr
->args
.count
;
1191 __entry
->res_count
= hdr
->res
.count
;
1192 __entry
->eof
= hdr
->res
.eof
;
1193 __entry
->dev
= inode
->i_sb
->s_dev
;
1194 __entry
->fileid
= nfsi
->fileid
;
1195 __entry
->fhandle
= nfs_fhandle_hash(fh
);
1199 "error=%d fileid=%02x:%02x:%llu fhandle=0x%08x "
1200 "offset=%lld count=%u res=%u%s", __entry
->error
,
1201 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1202 (unsigned long long)__entry
->fileid
,
1204 (long long)__entry
->offset
, __entry
->arg_count
,
1205 __entry
->res_count
, __entry
->eof
? " eof" : ""
1209 TRACE_EVENT(nfs_readpage_short
,
1211 const struct rpc_task
*task
,
1212 const struct nfs_pgio_header
*hdr
1219 __field(u32
, fhandle
)
1220 __field(u64
, fileid
)
1221 __field(loff_t
, offset
)
1222 __field(u32
, arg_count
)
1223 __field(u32
, res_count
)
1229 const struct inode
*inode
= hdr
->inode
;
1230 const struct nfs_inode
*nfsi
= NFS_I(inode
);
1231 const struct nfs_fh
*fh
= hdr
->args
.fh
?
1232 hdr
->args
.fh
: &nfsi
->fh
;
1234 __entry
->error
= task
->tk_status
;
1235 __entry
->offset
= hdr
->args
.offset
;
1236 __entry
->arg_count
= hdr
->args
.count
;
1237 __entry
->res_count
= hdr
->res
.count
;
1238 __entry
->eof
= hdr
->res
.eof
;
1239 __entry
->dev
= inode
->i_sb
->s_dev
;
1240 __entry
->fileid
= nfsi
->fileid
;
1241 __entry
->fhandle
= nfs_fhandle_hash(fh
);
1245 "error=%d fileid=%02x:%02x:%llu fhandle=0x%08x "
1246 "offset=%lld count=%u res=%u%s", __entry
->error
,
1247 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1248 (unsigned long long)__entry
->fileid
,
1250 (long long)__entry
->offset
, __entry
->arg_count
,
1251 __entry
->res_count
, __entry
->eof
? " eof" : ""
1256 TRACE_EVENT(nfs_pgio_error
,
1258 const struct nfs_pgio_header
*hdr
,
1263 TP_ARGS(hdr
, error
, pos
),
1267 __field(u32
, fhandle
)
1268 __field(u64
, fileid
)
1269 __field(loff_t
, offset
)
1270 __field(u32
, arg_count
)
1271 __field(u32
, res_count
)
1272 __field(loff_t
, pos
)
1277 const struct inode
*inode
= hdr
->inode
;
1278 const struct nfs_inode
*nfsi
= NFS_I(inode
);
1279 const struct nfs_fh
*fh
= hdr
->args
.fh
?
1280 hdr
->args
.fh
: &nfsi
->fh
;
1282 __entry
->error
= error
;
1283 __entry
->offset
= hdr
->args
.offset
;
1284 __entry
->arg_count
= hdr
->args
.count
;
1285 __entry
->res_count
= hdr
->res
.count
;
1286 __entry
->dev
= inode
->i_sb
->s_dev
;
1287 __entry
->fileid
= nfsi
->fileid
;
1288 __entry
->fhandle
= nfs_fhandle_hash(fh
);
1291 TP_printk("error=%d fileid=%02x:%02x:%llu fhandle=0x%08x "
1292 "offset=%lld count=%u res=%u pos=%llu", __entry
->error
,
1293 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1294 (unsigned long long)__entry
->fileid
, __entry
->fhandle
,
1295 (long long)__entry
->offset
, __entry
->arg_count
, __entry
->res_count
,
1300 TRACE_EVENT(nfs_initiate_write
,
1302 const struct nfs_pgio_header
*hdr
1309 __field(u32
, fhandle
)
1310 __field(u64
, fileid
)
1311 __field(loff_t
, offset
)
1313 __field(unsigned long, stable
)
1317 const struct inode
*inode
= hdr
->inode
;
1318 const struct nfs_inode
*nfsi
= NFS_I(inode
);
1319 const struct nfs_fh
*fh
= hdr
->args
.fh
?
1320 hdr
->args
.fh
: &nfsi
->fh
;
1322 __entry
->offset
= hdr
->args
.offset
;
1323 __entry
->count
= hdr
->args
.count
;
1324 __entry
->stable
= hdr
->args
.stable
;
1325 __entry
->dev
= inode
->i_sb
->s_dev
;
1326 __entry
->fileid
= nfsi
->fileid
;
1327 __entry
->fhandle
= nfs_fhandle_hash(fh
);
1331 "fileid=%02x:%02x:%llu fhandle=0x%08x "
1332 "offset=%lld count=%u stable=%s",
1333 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1334 (unsigned long long)__entry
->fileid
,
1336 (long long)__entry
->offset
, __entry
->count
,
1337 show_nfs_stable_how(__entry
->stable
)
1341 TRACE_EVENT(nfs_writeback_done
,
1343 const struct rpc_task
*task
,
1344 const struct nfs_pgio_header
*hdr
1351 __field(u32
, fhandle
)
1352 __field(u64
, fileid
)
1353 __field(loff_t
, offset
)
1354 __field(u32
, arg_count
)
1355 __field(u32
, res_count
)
1357 __field(unsigned long, stable
)
1358 __array(char, verifier
, NFS4_VERIFIER_SIZE
)
1362 const struct inode
*inode
= hdr
->inode
;
1363 const struct nfs_inode
*nfsi
= NFS_I(inode
);
1364 const struct nfs_fh
*fh
= hdr
->args
.fh
?
1365 hdr
->args
.fh
: &nfsi
->fh
;
1366 const struct nfs_writeverf
*verf
= hdr
->res
.verf
;
1368 __entry
->error
= task
->tk_status
;
1369 __entry
->offset
= hdr
->args
.offset
;
1370 __entry
->arg_count
= hdr
->args
.count
;
1371 __entry
->res_count
= hdr
->res
.count
;
1372 __entry
->stable
= verf
->committed
;
1373 memcpy(__entry
->verifier
,
1375 NFS4_VERIFIER_SIZE
);
1376 __entry
->dev
= inode
->i_sb
->s_dev
;
1377 __entry
->fileid
= nfsi
->fileid
;
1378 __entry
->fhandle
= nfs_fhandle_hash(fh
);
1382 "error=%d fileid=%02x:%02x:%llu fhandle=0x%08x "
1383 "offset=%lld count=%u res=%u stable=%s "
1384 "verifier=%s", __entry
->error
,
1385 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1386 (unsigned long long)__entry
->fileid
,
1388 (long long)__entry
->offset
, __entry
->arg_count
,
1390 show_nfs_stable_how(__entry
->stable
),
1391 show_nfs4_verifier(__entry
->verifier
)
1395 DECLARE_EVENT_CLASS(nfs_page_error_class
,
1397 const struct inode
*inode
,
1398 const struct nfs_page
*req
,
1402 TP_ARGS(inode
, req
, error
),
1406 __field(u32
, fhandle
)
1407 __field(u64
, fileid
)
1408 __field(loff_t
, offset
)
1409 __field(unsigned int, count
)
1414 const struct nfs_inode
*nfsi
= NFS_I(inode
);
1415 __entry
->dev
= inode
->i_sb
->s_dev
;
1416 __entry
->fileid
= nfsi
->fileid
;
1417 __entry
->fhandle
= nfs_fhandle_hash(&nfsi
->fh
);
1418 __entry
->offset
= req_offset(req
);
1419 __entry
->count
= req
->wb_bytes
;
1420 __entry
->error
= error
;
1424 "error=%d fileid=%02x:%02x:%llu fhandle=0x%08x "
1425 "offset=%lld count=%u", __entry
->error
,
1426 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1427 (unsigned long long)__entry
->fileid
,
1428 __entry
->fhandle
, __entry
->offset
,
1433 #define DEFINE_NFS_PAGEERR_EVENT(name) \
1434 DEFINE_EVENT(nfs_page_error_class, name, \
1436 const struct inode *inode, \
1437 const struct nfs_page *req, \
1440 TP_ARGS(inode, req, error))
1442 DEFINE_NFS_PAGEERR_EVENT(nfs_write_error
);
1443 DEFINE_NFS_PAGEERR_EVENT(nfs_comp_error
);
1444 DEFINE_NFS_PAGEERR_EVENT(nfs_commit_error
);
1446 TRACE_EVENT(nfs_initiate_commit
,
1448 const struct nfs_commit_data
*data
1455 __field(u32
, fhandle
)
1456 __field(u64
, fileid
)
1457 __field(loff_t
, offset
)
1462 const struct inode
*inode
= data
->inode
;
1463 const struct nfs_inode
*nfsi
= NFS_I(inode
);
1464 const struct nfs_fh
*fh
= data
->args
.fh
?
1465 data
->args
.fh
: &nfsi
->fh
;
1467 __entry
->offset
= data
->args
.offset
;
1468 __entry
->count
= data
->args
.count
;
1469 __entry
->dev
= inode
->i_sb
->s_dev
;
1470 __entry
->fileid
= nfsi
->fileid
;
1471 __entry
->fhandle
= nfs_fhandle_hash(fh
);
1475 "fileid=%02x:%02x:%llu fhandle=0x%08x "
1476 "offset=%lld count=%u",
1477 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1478 (unsigned long long)__entry
->fileid
,
1480 (long long)__entry
->offset
, __entry
->count
1484 TRACE_EVENT(nfs_commit_done
,
1486 const struct rpc_task
*task
,
1487 const struct nfs_commit_data
*data
1490 TP_ARGS(task
, data
),
1494 __field(u32
, fhandle
)
1495 __field(u64
, fileid
)
1496 __field(loff_t
, offset
)
1498 __field(unsigned long, stable
)
1499 __array(char, verifier
, NFS4_VERIFIER_SIZE
)
1503 const struct inode
*inode
= data
->inode
;
1504 const struct nfs_inode
*nfsi
= NFS_I(inode
);
1505 const struct nfs_fh
*fh
= data
->args
.fh
?
1506 data
->args
.fh
: &nfsi
->fh
;
1507 const struct nfs_writeverf
*verf
= data
->res
.verf
;
1509 __entry
->error
= task
->tk_status
;
1510 __entry
->offset
= data
->args
.offset
;
1511 __entry
->stable
= verf
->committed
;
1512 memcpy(__entry
->verifier
,
1514 NFS4_VERIFIER_SIZE
);
1515 __entry
->dev
= inode
->i_sb
->s_dev
;
1516 __entry
->fileid
= nfsi
->fileid
;
1517 __entry
->fhandle
= nfs_fhandle_hash(fh
);
1521 "error=%d fileid=%02x:%02x:%llu fhandle=0x%08x "
1522 "offset=%lld stable=%s verifier=%s", __entry
->error
,
1523 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1524 (unsigned long long)__entry
->fileid
,
1526 (long long)__entry
->offset
,
1527 show_nfs_stable_how(__entry
->stable
),
1528 show_nfs4_verifier(__entry
->verifier
)
1532 #define nfs_show_direct_req_flags(v) \
1533 __print_flags(v, "|", \
1534 { NFS_ODIRECT_DO_COMMIT, "DO_COMMIT" }, \
1535 { NFS_ODIRECT_RESCHED_WRITES, "RESCHED_WRITES" }, \
1536 { NFS_ODIRECT_SHOULD_DIRTY, "SHOULD DIRTY" }, \
1537 { NFS_ODIRECT_DONE, "DONE" } )
1539 DECLARE_EVENT_CLASS(nfs_direct_req_class
,
1541 const struct nfs_direct_req
*dreq
1548 __field(u64
, fileid
)
1549 __field(u32
, fhandle
)
1550 __field(loff_t
, offset
)
1551 __field(ssize_t
, count
)
1552 __field(ssize_t
, error
)
1557 const struct inode
*inode
= dreq
->inode
;
1558 const struct nfs_inode
*nfsi
= NFS_I(inode
);
1559 const struct nfs_fh
*fh
= &nfsi
->fh
;
1561 __entry
->dev
= inode
->i_sb
->s_dev
;
1562 __entry
->fileid
= nfsi
->fileid
;
1563 __entry
->fhandle
= nfs_fhandle_hash(fh
);
1564 __entry
->offset
= dreq
->io_start
;
1565 __entry
->count
= dreq
->count
;
1566 __entry
->error
= dreq
->error
;
1567 __entry
->flags
= dreq
->flags
;
1571 "error=%zd fileid=%02x:%02x:%llu fhandle=0x%08x "
1572 "offset=%lld count=%zd flags=%s",
1573 __entry
->error
, MAJOR(__entry
->dev
),
1574 MINOR(__entry
->dev
),
1575 (unsigned long long)__entry
->fileid
,
1576 __entry
->fhandle
, __entry
->offset
,
1578 nfs_show_direct_req_flags(__entry
->flags
)
1582 #define DEFINE_NFS_DIRECT_REQ_EVENT(name) \
1583 DEFINE_EVENT(nfs_direct_req_class, name, \
1585 const struct nfs_direct_req *dreq \
1589 DEFINE_NFS_DIRECT_REQ_EVENT(nfs_direct_commit_complete
);
1590 DEFINE_NFS_DIRECT_REQ_EVENT(nfs_direct_resched_write
);
1591 DEFINE_NFS_DIRECT_REQ_EVENT(nfs_direct_write_complete
);
1592 DEFINE_NFS_DIRECT_REQ_EVENT(nfs_direct_write_completion
);
1593 DEFINE_NFS_DIRECT_REQ_EVENT(nfs_direct_write_schedule_iovec
);
1594 DEFINE_NFS_DIRECT_REQ_EVENT(nfs_direct_write_reschedule_io
);
1596 TRACE_EVENT(nfs_fh_to_dentry
,
1598 const struct super_block
*sb
,
1599 const struct nfs_fh
*fh
,
1604 TP_ARGS(sb
, fh
, fileid
, error
),
1609 __field(u32
, fhandle
)
1610 __field(u64
, fileid
)
1614 __entry
->error
= error
;
1615 __entry
->dev
= sb
->s_dev
;
1616 __entry
->fileid
= fileid
;
1617 __entry
->fhandle
= nfs_fhandle_hash(fh
);
1621 "error=%d fileid=%02x:%02x:%llu fhandle=0x%08x ",
1623 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1624 (unsigned long long)__entry
->fileid
,
1629 TRACE_EVENT(nfs_mount_assign
,
1635 TP_ARGS(option
, value
),
1638 __string(option
, option
)
1639 __string(value
, value
)
1643 __assign_str(option
);
1644 __assign_str(value
);
1647 TP_printk("option %s=%s",
1648 __get_str(option
), __get_str(value
)
1652 TRACE_EVENT(nfs_mount_option
,
1654 const struct fs_parameter
*param
1660 __string(option
, param
->key
)
1664 __assign_str(option
);
1667 TP_printk("option %s", __get_str(option
))
1670 TRACE_EVENT(nfs_mount_path
,
1678 __string(path
, path
)
1685 TP_printk("path='%s'", __get_str(path
))
1688 TRACE_EVENT(nfs_local_open_fh
,
1690 const struct nfs_fh
*fh
,
1695 TP_ARGS(fh
, fmode
, error
),
1699 __field(u32
, fhandle
)
1700 __field(unsigned int, fmode
)
1704 __entry
->error
= error
;
1705 __entry
->fhandle
= nfs_fhandle_hash(fh
);
1706 __entry
->fmode
= (__force
unsigned int)fmode
;
1710 "error=%d fhandle=0x%08x mode=%s",
1713 show_fs_fmode_flags(__entry
->fmode
)
1717 DECLARE_EVENT_CLASS(nfs_local_client_event
,
1719 const struct nfs_client
*clp
1725 __field(unsigned int, protocol
)
1726 __string(server
, clp
->cl_hostname
)
1730 __entry
->protocol
= clp
->rpc_ops
->version
;
1731 __assign_str(server
);
1735 "server=%s NFSv%u", __get_str(server
), __entry
->protocol
1739 #define DEFINE_NFS_LOCAL_CLIENT_EVENT(name) \
1740 DEFINE_EVENT(nfs_local_client_event, name, \
1742 const struct nfs_client *clp \
1746 DEFINE_NFS_LOCAL_CLIENT_EVENT(nfs_local_enable
);
1747 DEFINE_NFS_LOCAL_CLIENT_EVENT(nfs_local_disable
);
1749 DECLARE_EVENT_CLASS(nfs_xdr_event
,
1751 const struct xdr_stream
*xdr
,
1755 TP_ARGS(xdr
, error
),
1758 __field(unsigned int, task_id
)
1759 __field(unsigned int, client_id
)
1761 __field(int, version
)
1762 __field(unsigned long, error
)
1764 xdr
->rqst
->rq_task
->tk_client
->cl_program
->name
)
1766 xdr
->rqst
->rq_task
->tk_msg
.rpc_proc
->p_name
)
1770 const struct rpc_rqst
*rqstp
= xdr
->rqst
;
1771 const struct rpc_task
*task
= rqstp
->rq_task
;
1773 __entry
->task_id
= task
->tk_pid
;
1774 __entry
->client_id
= task
->tk_client
->cl_clid
;
1775 __entry
->xid
= be32_to_cpu(rqstp
->rq_xid
);
1776 __entry
->version
= task
->tk_client
->cl_vers
;
1777 __entry
->error
= error
;
1778 __assign_str(program
);
1779 __assign_str(procedure
);
1782 TP_printk(SUNRPC_TRACE_TASK_SPECIFIER
1783 " xid=0x%08x %sv%d %s error=%ld (%s)",
1784 __entry
->task_id
, __entry
->client_id
, __entry
->xid
,
1785 __get_str(program
), __entry
->version
,
1786 __get_str(procedure
), -__entry
->error
,
1787 show_nfs_status(__entry
->error
)
1790 #define DEFINE_NFS_XDR_EVENT(name) \
1791 DEFINE_EVENT(nfs_xdr_event, name, \
1793 const struct xdr_stream *xdr, \
1796 TP_ARGS(xdr, error))
1797 DEFINE_NFS_XDR_EVENT(nfs_xdr_status
);
1798 DEFINE_NFS_XDR_EVENT(nfs_xdr_bad_filehandle
);
1800 #endif /* _TRACE_NFS_H */
1802 #undef TRACE_INCLUDE_PATH
1803 #define TRACE_INCLUDE_PATH .
1804 #define TRACE_INCLUDE_FILE nfstrace
1805 /* This part must be outside protection */
1806 #include <trace/define_trace.h>