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)
403 __string(name, dentry->d_name.name)
407 __entry->dev = dir->i_sb->s_dev;
408 __entry->dir = NFS_FILEID(dir);
409 __entry->flags = flags;
410 __assign_str(name, dentry->d_name.name);
414 "flags=0x%lx (%s) name=%02x:%02x:%llu/%s",
416 show_fs_lookup_flags(__entry->flags),
417 MAJOR(__entry->dev), MINOR(__entry->dev),
418 (unsigned long long)__entry->dir,
423 #define DEFINE_NFS_LOOKUP_EVENT(name) \
424 DEFINE_EVENT(nfs_lookup_event, name, \
426 const struct inode *dir, \
427 const struct dentry *dentry, \
430 TP_ARGS(dir, dentry, flags))
432 DECLARE_EVENT_CLASS(nfs_lookup_event_done,
434 const struct inode *dir,
435 const struct dentry *dentry,
440 TP_ARGS(dir, dentry, flags, error),
443 __field(unsigned long, error)
444 __field(unsigned long, flags)
447 __string(name, dentry->d_name.name)
451 __entry->dev = dir->i_sb->s_dev;
452 __entry->dir = NFS_FILEID(dir);
453 __entry->error = error < 0 ? -error : 0;
454 __entry->flags = flags;
455 __assign_str(name, dentry->d_name.name);
459 "error=%ld (%s) flags=0x%lx (%s) name=%02x:%02x:%llu/%s",
460 -__entry->error, show_nfs_status(__entry->error),
462 show_fs_lookup_flags(__entry->flags),
463 MAJOR(__entry->dev), MINOR(__entry->dev),
464 (unsigned long long)__entry->dir,
469 #define DEFINE_NFS_LOOKUP_EVENT_DONE(name) \
470 DEFINE_EVENT(nfs_lookup_event_done, name, \
472 const struct inode *dir, \
473 const struct dentry *dentry, \
474 unsigned int flags, \
477 TP_ARGS(dir, dentry, flags, error))
479 DEFINE_NFS_LOOKUP_EVENT(nfs_lookup_enter);
480 DEFINE_NFS_LOOKUP_EVENT_DONE(nfs_lookup_exit);
481 DEFINE_NFS_LOOKUP_EVENT(nfs_lookup_revalidate_enter);
482 DEFINE_NFS_LOOKUP_EVENT_DONE(nfs_lookup_revalidate_exit);
483 DEFINE_NFS_LOOKUP_EVENT(nfs_readdir_lookup);
484 DEFINE_NFS_LOOKUP_EVENT(nfs_readdir_lookup_revalidate_failed);
485 DEFINE_NFS_LOOKUP_EVENT_DONE(nfs_readdir_lookup_revalidate);
487 TRACE_EVENT(nfs_atomic_open_enter,
489 const struct inode *dir,
490 const struct nfs_open_context *ctx,
494 TP_ARGS(dir, ctx, flags),
497 __field(unsigned long, flags)
498 __field(unsigned long, fmode)
501 __string(name, ctx->dentry->d_name.name)
505 __entry->dev = dir->i_sb->s_dev;
506 __entry->dir = NFS_FILEID(dir);
507 __entry->flags = flags;
508 __entry->fmode = (__force unsigned long)ctx->mode;
509 __assign_str(name, ctx->dentry->d_name.name);
513 "flags=0x%lx (%s) fmode=%s name=%02x:%02x:%llu/%s",
515 show_fs_fcntl_open_flags(__entry->flags),
516 show_fs_fmode_flags(__entry->fmode),
517 MAJOR(__entry->dev), MINOR(__entry->dev),
518 (unsigned long long)__entry->dir,
523 TRACE_EVENT(nfs_atomic_open_exit,
525 const struct inode *dir,
526 const struct nfs_open_context *ctx,
531 TP_ARGS(dir, ctx, flags, error),
534 __field(unsigned long, error)
535 __field(unsigned long, flags)
536 __field(unsigned long, fmode)
539 __string(name, ctx->dentry->d_name.name)
543 __entry->error = -error;
544 __entry->dev = dir->i_sb->s_dev;
545 __entry->dir = NFS_FILEID(dir);
546 __entry->flags = flags;
547 __entry->fmode = (__force unsigned long)ctx->mode;
548 __assign_str(name, ctx->dentry->d_name.name);
552 "error=%ld (%s) flags=0x%lx (%s) fmode=%s "
553 "name=%02x:%02x:%llu/%s",
554 -__entry->error, show_nfs_status(__entry->error),
556 show_fs_fcntl_open_flags(__entry->flags),
557 show_fs_fmode_flags(__entry->fmode),
558 MAJOR(__entry->dev), MINOR(__entry->dev),
559 (unsigned long long)__entry->dir,
564 TRACE_EVENT(nfs_create_enter,
566 const struct inode *dir,
567 const struct dentry *dentry,
571 TP_ARGS(dir, dentry, flags),
574 __field(unsigned long, flags)
577 __string(name, dentry->d_name.name)
581 __entry->dev = dir->i_sb->s_dev;
582 __entry->dir = NFS_FILEID(dir);
583 __entry->flags = flags;
584 __assign_str(name, dentry->d_name.name);
588 "flags=0x%lx (%s) name=%02x:%02x:%llu/%s",
590 show_fs_fcntl_open_flags(__entry->flags),
591 MAJOR(__entry->dev), MINOR(__entry->dev),
592 (unsigned long long)__entry->dir,
597 TRACE_EVENT(nfs_create_exit,
599 const struct inode *dir,
600 const struct dentry *dentry,
605 TP_ARGS(dir, dentry, flags, error),
608 __field(unsigned long, error)
609 __field(unsigned long, flags)
612 __string(name, dentry->d_name.name)
616 __entry->error = -error;
617 __entry->dev = dir->i_sb->s_dev;
618 __entry->dir = NFS_FILEID(dir);
619 __entry->flags = flags;
620 __assign_str(name, dentry->d_name.name);
624 "error=%ld (%s) flags=0x%lx (%s) name=%02x:%02x:%llu/%s",
625 -__entry->error, show_nfs_status(__entry->error),
627 show_fs_fcntl_open_flags(__entry->flags),
628 MAJOR(__entry->dev), MINOR(__entry->dev),
629 (unsigned long long)__entry->dir,
634 DECLARE_EVENT_CLASS(nfs_directory_event,
636 const struct inode *dir,
637 const struct dentry *dentry
640 TP_ARGS(dir, dentry),
645 __string(name, dentry->d_name.name)
649 __entry->dev = dir->i_sb->s_dev;
650 __entry->dir = NFS_FILEID(dir);
651 __assign_str(name, dentry->d_name.name);
655 "name=%02x:%02x:%llu/%s",
656 MAJOR(__entry->dev), MINOR(__entry->dev),
657 (unsigned long long)__entry->dir,
662 #define DEFINE_NFS_DIRECTORY_EVENT(name) \
663 DEFINE_EVENT(nfs_directory_event, name, \
665 const struct inode *dir, \
666 const struct dentry *dentry \
668 TP_ARGS(dir, dentry))
670 DECLARE_EVENT_CLASS(nfs_directory_event_done,
672 const struct inode *dir,
673 const struct dentry *dentry,
677 TP_ARGS(dir, dentry, error),
680 __field(unsigned long, error)
683 __string(name, dentry->d_name.name)
687 __entry->dev = dir->i_sb->s_dev;
688 __entry->dir = NFS_FILEID(dir);
689 __entry->error = error < 0 ? -error : 0;
690 __assign_str(name, dentry->d_name.name);
694 "error=%ld (%s) name=%02x:%02x:%llu/%s",
695 -__entry->error, show_nfs_status(__entry->error),
696 MAJOR(__entry->dev), MINOR(__entry->dev),
697 (unsigned long long)__entry->dir,
702 #define DEFINE_NFS_DIRECTORY_EVENT_DONE(name) \
703 DEFINE_EVENT(nfs_directory_event_done, name, \
705 const struct inode *dir, \
706 const struct dentry *dentry, \
709 TP_ARGS(dir, dentry, error))
711 DEFINE_NFS_DIRECTORY_EVENT(nfs_mknod_enter);
712 DEFINE_NFS_DIRECTORY_EVENT_DONE(nfs_mknod_exit);
713 DEFINE_NFS_DIRECTORY_EVENT(nfs_mkdir_enter);
714 DEFINE_NFS_DIRECTORY_EVENT_DONE(nfs_mkdir_exit);
715 DEFINE_NFS_DIRECTORY_EVENT(nfs_rmdir_enter);
716 DEFINE_NFS_DIRECTORY_EVENT_DONE(nfs_rmdir_exit);
717 DEFINE_NFS_DIRECTORY_EVENT(nfs_remove_enter);
718 DEFINE_NFS_DIRECTORY_EVENT_DONE(nfs_remove_exit);
719 DEFINE_NFS_DIRECTORY_EVENT(nfs_unlink_enter);
720 DEFINE_NFS_DIRECTORY_EVENT_DONE(nfs_unlink_exit);
721 DEFINE_NFS_DIRECTORY_EVENT(nfs_symlink_enter);
722 DEFINE_NFS_DIRECTORY_EVENT_DONE(nfs_symlink_exit);
724 TRACE_EVENT(nfs_link_enter,
726 const struct inode *inode,
727 const struct inode *dir,
728 const struct dentry *dentry
731 TP_ARGS(inode, dir, dentry),
737 __string(name, dentry->d_name.name)
741 __entry->dev = inode->i_sb->s_dev;
742 __entry->fileid = NFS_FILEID(inode);
743 __entry->dir = NFS_FILEID(dir);
744 __assign_str(name, dentry->d_name.name);
748 "fileid=%02x:%02x:%llu name=%02x:%02x:%llu/%s",
749 MAJOR(__entry->dev), MINOR(__entry->dev),
751 MAJOR(__entry->dev), MINOR(__entry->dev),
752 (unsigned long long)__entry->dir,
757 TRACE_EVENT(nfs_link_exit,
759 const struct inode *inode,
760 const struct inode *dir,
761 const struct dentry *dentry,
765 TP_ARGS(inode, dir, dentry, error),
768 __field(unsigned long, error)
772 __string(name, dentry->d_name.name)
776 __entry->dev = inode->i_sb->s_dev;
777 __entry->fileid = NFS_FILEID(inode);
778 __entry->dir = NFS_FILEID(dir);
779 __entry->error = error < 0 ? -error : 0;
780 __assign_str(name, dentry->d_name.name);
784 "error=%ld (%s) fileid=%02x:%02x:%llu name=%02x:%02x:%llu/%s",
785 -__entry->error, show_nfs_status(__entry->error),
786 MAJOR(__entry->dev), MINOR(__entry->dev),
788 MAJOR(__entry->dev), MINOR(__entry->dev),
789 (unsigned long long)__entry->dir,
794 DECLARE_EVENT_CLASS(nfs_rename_event,
796 const struct inode *old_dir,
797 const struct dentry *old_dentry,
798 const struct inode *new_dir,
799 const struct dentry *new_dentry
802 TP_ARGS(old_dir, old_dentry, new_dir, new_dentry),
806 __field(u64, old_dir)
807 __field(u64, new_dir)
808 __string(old_name, old_dentry->d_name.name)
809 __string(new_name, new_dentry->d_name.name)
813 __entry->dev = old_dir->i_sb->s_dev;
814 __entry->old_dir = NFS_FILEID(old_dir);
815 __entry->new_dir = NFS_FILEID(new_dir);
816 __assign_str(old_name, old_dentry->d_name.name);
817 __assign_str(new_name, new_dentry->d_name.name);
821 "old_name=%02x:%02x:%llu/%s new_name=%02x:%02x:%llu/%s",
822 MAJOR(__entry->dev), MINOR(__entry->dev),
823 (unsigned long long)__entry->old_dir,
825 MAJOR(__entry->dev), MINOR(__entry->dev),
826 (unsigned long long)__entry->new_dir,
830 #define DEFINE_NFS_RENAME_EVENT(name) \
831 DEFINE_EVENT(nfs_rename_event, name, \
833 const struct inode *old_dir, \
834 const struct dentry *old_dentry, \
835 const struct inode *new_dir, \
836 const struct dentry *new_dentry \
838 TP_ARGS(old_dir, old_dentry, new_dir, new_dentry))
840 DECLARE_EVENT_CLASS(nfs_rename_event_done,
842 const struct inode *old_dir,
843 const struct dentry *old_dentry,
844 const struct inode *new_dir,
845 const struct dentry *new_dentry,
849 TP_ARGS(old_dir, old_dentry, new_dir, new_dentry, error),
853 __field(unsigned long, error)
854 __field(u64, old_dir)
855 __string(old_name, old_dentry->d_name.name)
856 __field(u64, new_dir)
857 __string(new_name, new_dentry->d_name.name)
861 __entry->dev = old_dir->i_sb->s_dev;
862 __entry->error = -error;
863 __entry->old_dir = NFS_FILEID(old_dir);
864 __entry->new_dir = NFS_FILEID(new_dir);
865 __assign_str(old_name, old_dentry->d_name.name);
866 __assign_str(new_name, new_dentry->d_name.name);
870 "error=%ld (%s) old_name=%02x:%02x:%llu/%s "
871 "new_name=%02x:%02x:%llu/%s",
872 -__entry->error, show_nfs_status(__entry->error),
873 MAJOR(__entry->dev), MINOR(__entry->dev),
874 (unsigned long long)__entry->old_dir,
876 MAJOR(__entry->dev), MINOR(__entry->dev),
877 (unsigned long long)__entry->new_dir,
881 #define DEFINE_NFS_RENAME_EVENT_DONE(name) \
882 DEFINE_EVENT(nfs_rename_event_done, name, \
884 const struct inode *old_dir, \
885 const struct dentry *old_dentry, \
886 const struct inode *new_dir, \
887 const struct dentry *new_dentry, \
890 TP_ARGS(old_dir, old_dentry, new_dir, \
893 DEFINE_NFS_RENAME_EVENT(nfs_rename_enter);
894 DEFINE_NFS_RENAME_EVENT_DONE(nfs_rename_exit);
896 DEFINE_NFS_RENAME_EVENT_DONE(nfs_sillyrename_rename);
898 TRACE_EVENT(nfs_sillyrename_unlink,
900 const struct nfs_unlinkdata *data,
904 TP_ARGS(data, error),
908 __field(unsigned long, error)
910 __dynamic_array(char, name, data->args.name.len + 1)
914 struct inode *dir = d_inode(data->dentry->d_parent);
915 size_t len = data->args.name.len;
916 __entry->dev = dir->i_sb->s_dev;
917 __entry->dir = NFS_FILEID(dir);
918 __entry->error = -error;
919 memcpy(__get_str(name),
920 data->args.name.name, len);
921 __get_str(name)[len] = 0;
925 "error=%ld (%s) name=%02x:%02x:%llu/%s",
926 -__entry->error, show_nfs_status(__entry->error),
927 MAJOR(__entry->dev), MINOR(__entry->dev),
928 (unsigned long long)__entry->dir,
933 DECLARE_EVENT_CLASS(nfs_folio_event,
935 const struct inode *inode,
939 TP_ARGS(inode, folio),
943 __field(u32, fhandle)
945 __field(u64, version)
946 __field(loff_t, offset)
951 const struct nfs_inode *nfsi = NFS_I(inode);
953 __entry->dev = inode->i_sb->s_dev;
954 __entry->fileid = nfsi->fileid;
955 __entry->fhandle = nfs_fhandle_hash(&nfsi->fh);
956 __entry->version = inode_peek_iversion_raw(inode);
957 __entry->offset = folio_file_pos(folio);
958 __entry->count = nfs_folio_length(folio);
962 "fileid=%02x:%02x:%llu fhandle=0x%08x version=%llu "
963 "offset=%lld count=%u",
964 MAJOR(__entry->dev), MINOR(__entry->dev),
965 (unsigned long long)__entry->fileid,
966 __entry->fhandle, __entry->version,
967 __entry->offset, __entry->count
971 #define DEFINE_NFS_FOLIO_EVENT(name) \
972 DEFINE_EVENT(nfs_folio_event, name, \
974 const struct inode *inode, \
975 struct folio *folio \
977 TP_ARGS(inode, folio))
979 DECLARE_EVENT_CLASS(nfs_folio_event_done,
981 const struct inode *inode,
986 TP_ARGS(inode, folio, ret),
990 __field(u32, fhandle)
993 __field(u64, version)
994 __field(loff_t, offset)
999 const struct nfs_inode *nfsi = NFS_I(inode);
1001 __entry->dev = inode->i_sb->s_dev;
1002 __entry->fileid = nfsi->fileid;
1003 __entry->fhandle = nfs_fhandle_hash(&nfsi->fh);
1004 __entry->version = inode_peek_iversion_raw(inode);
1005 __entry->offset = folio_file_pos(folio);
1006 __entry->count = nfs_folio_length(folio);
1011 "fileid=%02x:%02x:%llu fhandle=0x%08x version=%llu "
1012 "offset=%lld count=%u ret=%d",
1013 MAJOR(__entry->dev), MINOR(__entry->dev),
1014 (unsigned long long)__entry->fileid,
1015 __entry->fhandle, __entry->version,
1016 __entry->offset, __entry->count, __entry->ret
1020 #define DEFINE_NFS_FOLIO_EVENT_DONE(name) \
1021 DEFINE_EVENT(nfs_folio_event_done, name, \
1023 const struct inode *inode, \
1024 struct folio *folio, \
1027 TP_ARGS(inode, folio, ret))
1029 DEFINE_NFS_FOLIO_EVENT(nfs_aop_readpage);
1030 DEFINE_NFS_FOLIO_EVENT_DONE(nfs_aop_readpage_done);
1032 DEFINE_NFS_FOLIO_EVENT(nfs_writeback_folio);
1033 DEFINE_NFS_FOLIO_EVENT_DONE(nfs_writeback_folio_done);
1035 DEFINE_NFS_FOLIO_EVENT(nfs_invalidate_folio);
1036 DEFINE_NFS_FOLIO_EVENT_DONE(nfs_launder_folio_done);
1038 TRACE_EVENT(nfs_aop_readahead,
1040 const struct inode *inode,
1042 unsigned int nr_pages
1045 TP_ARGS(inode, pos, nr_pages),
1049 __field(u32, fhandle)
1050 __field(u64, fileid)
1051 __field(u64, version)
1052 __field(loff_t, offset)
1053 __field(unsigned int, nr_pages)
1057 const struct nfs_inode *nfsi = NFS_I(inode);
1059 __entry->dev = inode->i_sb->s_dev;
1060 __entry->fileid = nfsi->fileid;
1061 __entry->fhandle = nfs_fhandle_hash(&nfsi->fh);
1062 __entry->version = inode_peek_iversion_raw(inode);
1063 __entry->offset = pos;
1064 __entry->nr_pages = nr_pages;
1068 "fileid=%02x:%02x:%llu fhandle=0x%08x version=%llu offset=%lld nr_pages=%u",
1069 MAJOR(__entry->dev), MINOR(__entry->dev),
1070 (unsigned long long)__entry->fileid,
1071 __entry->fhandle, __entry->version,
1072 __entry->offset, __entry->nr_pages
1076 TRACE_EVENT(nfs_aop_readahead_done,
1078 const struct inode *inode,
1079 unsigned int nr_pages,
1083 TP_ARGS(inode, nr_pages, ret),
1087 __field(u32, fhandle)
1089 __field(u64, fileid)
1090 __field(u64, version)
1091 __field(loff_t, offset)
1092 __field(unsigned int, nr_pages)
1096 const struct nfs_inode *nfsi = NFS_I(inode);
1098 __entry->dev = inode->i_sb->s_dev;
1099 __entry->fileid = nfsi->fileid;
1100 __entry->fhandle = nfs_fhandle_hash(&nfsi->fh);
1101 __entry->version = inode_peek_iversion_raw(inode);
1102 __entry->nr_pages = nr_pages;
1107 "fileid=%02x:%02x:%llu fhandle=0x%08x version=%llu nr_pages=%u ret=%d",
1108 MAJOR(__entry->dev), MINOR(__entry->dev),
1109 (unsigned long long)__entry->fileid,
1110 __entry->fhandle, __entry->version,
1111 __entry->nr_pages, __entry->ret
1115 TRACE_EVENT(nfs_initiate_read,
1117 const struct nfs_pgio_header *hdr
1124 __field(u32, fhandle)
1125 __field(u64, fileid)
1126 __field(loff_t, offset)
1131 const struct inode *inode = hdr->inode;
1132 const struct nfs_inode *nfsi = NFS_I(inode);
1133 const struct nfs_fh *fh = hdr->args.fh ?
1134 hdr->args.fh : &nfsi->fh;
1136 __entry->offset = hdr->args.offset;
1137 __entry->count = hdr->args.count;
1138 __entry->dev = inode->i_sb->s_dev;
1139 __entry->fileid = nfsi->fileid;
1140 __entry->fhandle = nfs_fhandle_hash(fh);
1144 "fileid=%02x:%02x:%llu fhandle=0x%08x "
1145 "offset=%lld count=%u",
1146 MAJOR(__entry->dev), MINOR(__entry->dev),
1147 (unsigned long long)__entry->fileid,
1149 (long long)__entry->offset, __entry->count
1153 TRACE_EVENT(nfs_readpage_done,
1155 const struct rpc_task *task,
1156 const struct nfs_pgio_header *hdr
1163 __field(u32, fhandle)
1164 __field(u64, fileid)
1165 __field(loff_t, offset)
1166 __field(u32, arg_count)
1167 __field(u32, res_count)
1173 const struct inode *inode = hdr->inode;
1174 const struct nfs_inode *nfsi = NFS_I(inode);
1175 const struct nfs_fh *fh = hdr->args.fh ?
1176 hdr->args.fh : &nfsi->fh;
1178 __entry->error = task->tk_status;
1179 __entry->offset = hdr->args.offset;
1180 __entry->arg_count = hdr->args.count;
1181 __entry->res_count = hdr->res.count;
1182 __entry->eof = hdr->res.eof;
1183 __entry->dev = inode->i_sb->s_dev;
1184 __entry->fileid = nfsi->fileid;
1185 __entry->fhandle = nfs_fhandle_hash(fh);
1189 "error=%d fileid=%02x:%02x:%llu fhandle=0x%08x "
1190 "offset=%lld count=%u res=%u%s", __entry->error,
1191 MAJOR(__entry->dev), MINOR(__entry->dev),
1192 (unsigned long long)__entry->fileid,
1194 (long long)__entry->offset, __entry->arg_count,
1195 __entry->res_count, __entry->eof ? " eof" : ""
1199 TRACE_EVENT(nfs_readpage_short,
1201 const struct rpc_task *task,
1202 const struct nfs_pgio_header *hdr
1209 __field(u32, fhandle)
1210 __field(u64, fileid)
1211 __field(loff_t, offset)
1212 __field(u32, arg_count)
1213 __field(u32, res_count)
1219 const struct inode *inode = hdr->inode;
1220 const struct nfs_inode *nfsi = NFS_I(inode);
1221 const struct nfs_fh *fh = hdr->args.fh ?
1222 hdr->args.fh : &nfsi->fh;
1224 __entry->error = task->tk_status;
1225 __entry->offset = hdr->args.offset;
1226 __entry->arg_count = hdr->args.count;
1227 __entry->res_count = hdr->res.count;
1228 __entry->eof = hdr->res.eof;
1229 __entry->dev = inode->i_sb->s_dev;
1230 __entry->fileid = nfsi->fileid;
1231 __entry->fhandle = nfs_fhandle_hash(fh);
1235 "error=%d fileid=%02x:%02x:%llu fhandle=0x%08x "
1236 "offset=%lld count=%u res=%u%s", __entry->error,
1237 MAJOR(__entry->dev), MINOR(__entry->dev),
1238 (unsigned long long)__entry->fileid,
1240 (long long)__entry->offset, __entry->arg_count,
1241 __entry->res_count, __entry->eof ? " eof" : ""
1246 TRACE_EVENT(nfs_pgio_error,
1248 const struct nfs_pgio_header *hdr,
1253 TP_ARGS(hdr, error, pos),
1257 __field(u32, fhandle)
1258 __field(u64, fileid)
1259 __field(loff_t, offset)
1260 __field(u32, arg_count)
1261 __field(u32, res_count)
1262 __field(loff_t, pos)
1267 const struct inode *inode = hdr->inode;
1268 const struct nfs_inode *nfsi = NFS_I(inode);
1269 const struct nfs_fh *fh = hdr->args.fh ?
1270 hdr->args.fh : &nfsi->fh;
1272 __entry->error = error;
1273 __entry->offset = hdr->args.offset;
1274 __entry->arg_count = hdr->args.count;
1275 __entry->res_count = hdr->res.count;
1276 __entry->dev = inode->i_sb->s_dev;
1277 __entry->fileid = nfsi->fileid;
1278 __entry->fhandle = nfs_fhandle_hash(fh);
1281 TP_printk("error=%d fileid=%02x:%02x:%llu fhandle=0x%08x "
1282 "offset=%lld count=%u res=%u pos=%llu", __entry->error,
1283 MAJOR(__entry->dev), MINOR(__entry->dev),
1284 (unsigned long long)__entry->fileid, __entry->fhandle,
1285 (long long)__entry->offset, __entry->arg_count, __entry->res_count,
1290 TRACE_EVENT(nfs_initiate_write,
1292 const struct nfs_pgio_header *hdr
1299 __field(u32, fhandle)
1300 __field(u64, fileid)
1301 __field(loff_t, offset)
1303 __field(unsigned long, stable)
1307 const struct inode *inode = hdr->inode;
1308 const struct nfs_inode *nfsi = NFS_I(inode);
1309 const struct nfs_fh *fh = hdr->args.fh ?
1310 hdr->args.fh : &nfsi->fh;
1312 __entry->offset = hdr->args.offset;
1313 __entry->count = hdr->args.count;
1314 __entry->stable = hdr->args.stable;
1315 __entry->dev = inode->i_sb->s_dev;
1316 __entry->fileid = nfsi->fileid;
1317 __entry->fhandle = nfs_fhandle_hash(fh);
1321 "fileid=%02x:%02x:%llu fhandle=0x%08x "
1322 "offset=%lld count=%u stable=%s",
1323 MAJOR(__entry->dev), MINOR(__entry->dev),
1324 (unsigned long long)__entry->fileid,
1326 (long long)__entry->offset, __entry->count,
1327 show_nfs_stable_how(__entry->stable)
1331 TRACE_EVENT(nfs_writeback_done,
1333 const struct rpc_task *task,
1334 const struct nfs_pgio_header *hdr
1341 __field(u32, fhandle)
1342 __field(u64, fileid)
1343 __field(loff_t, offset)
1344 __field(u32, arg_count)
1345 __field(u32, res_count)
1347 __field(unsigned long, stable)
1348 __array(char, verifier, NFS4_VERIFIER_SIZE)
1352 const struct inode *inode = hdr->inode;
1353 const struct nfs_inode *nfsi = NFS_I(inode);
1354 const struct nfs_fh *fh = hdr->args.fh ?
1355 hdr->args.fh : &nfsi->fh;
1356 const struct nfs_writeverf *verf = hdr->res.verf;
1358 __entry->error = task->tk_status;
1359 __entry->offset = hdr->args.offset;
1360 __entry->arg_count = hdr->args.count;
1361 __entry->res_count = hdr->res.count;
1362 __entry->stable = verf->committed;
1363 memcpy(__entry->verifier,
1365 NFS4_VERIFIER_SIZE);
1366 __entry->dev = inode->i_sb->s_dev;
1367 __entry->fileid = nfsi->fileid;
1368 __entry->fhandle = nfs_fhandle_hash(fh);
1372 "error=%d fileid=%02x:%02x:%llu fhandle=0x%08x "
1373 "offset=%lld count=%u res=%u stable=%s "
1374 "verifier=%s", __entry->error,
1375 MAJOR(__entry->dev), MINOR(__entry->dev),
1376 (unsigned long long)__entry->fileid,
1378 (long long)__entry->offset, __entry->arg_count,
1380 show_nfs_stable_how(__entry->stable),
1381 show_nfs4_verifier(__entry->verifier)
1385 DECLARE_EVENT_CLASS(nfs_page_error_class,
1387 const struct inode *inode,
1388 const struct nfs_page *req,
1392 TP_ARGS(inode, req, error),
1396 __field(u32, fhandle)
1397 __field(u64, fileid)
1398 __field(loff_t, offset)
1399 __field(unsigned int, count)
1404 const struct nfs_inode *nfsi = NFS_I(inode);
1405 __entry->dev = inode->i_sb->s_dev;
1406 __entry->fileid = nfsi->fileid;
1407 __entry->fhandle = nfs_fhandle_hash(&nfsi->fh);
1408 __entry->offset = req_offset(req);
1409 __entry->count = req->wb_bytes;
1410 __entry->error = error;
1414 "error=%d fileid=%02x:%02x:%llu fhandle=0x%08x "
1415 "offset=%lld count=%u", __entry->error,
1416 MAJOR(__entry->dev), MINOR(__entry->dev),
1417 (unsigned long long)__entry->fileid,
1418 __entry->fhandle, __entry->offset,
1423 #define DEFINE_NFS_PAGEERR_EVENT(name) \
1424 DEFINE_EVENT(nfs_page_error_class, name, \
1426 const struct inode *inode, \
1427 const struct nfs_page *req, \
1430 TP_ARGS(inode, req, error))
1432 DEFINE_NFS_PAGEERR_EVENT(nfs_write_error);
1433 DEFINE_NFS_PAGEERR_EVENT(nfs_comp_error);
1434 DEFINE_NFS_PAGEERR_EVENT(nfs_commit_error);
1436 TRACE_EVENT(nfs_initiate_commit,
1438 const struct nfs_commit_data *data
1445 __field(u32, fhandle)
1446 __field(u64, fileid)
1447 __field(loff_t, offset)
1452 const struct inode *inode = data->inode;
1453 const struct nfs_inode *nfsi = NFS_I(inode);
1454 const struct nfs_fh *fh = data->args.fh ?
1455 data->args.fh : &nfsi->fh;
1457 __entry->offset = data->args.offset;
1458 __entry->count = data->args.count;
1459 __entry->dev = inode->i_sb->s_dev;
1460 __entry->fileid = nfsi->fileid;
1461 __entry->fhandle = nfs_fhandle_hash(fh);
1465 "fileid=%02x:%02x:%llu fhandle=0x%08x "
1466 "offset=%lld count=%u",
1467 MAJOR(__entry->dev), MINOR(__entry->dev),
1468 (unsigned long long)__entry->fileid,
1470 (long long)__entry->offset, __entry->count
1474 TRACE_EVENT(nfs_commit_done,
1476 const struct rpc_task *task,
1477 const struct nfs_commit_data *data
1480 TP_ARGS(task, data),
1484 __field(u32, fhandle)
1485 __field(u64, fileid)
1486 __field(loff_t, offset)
1488 __field(unsigned long, stable)
1489 __array(char, verifier, NFS4_VERIFIER_SIZE)
1493 const struct inode *inode = data->inode;
1494 const struct nfs_inode *nfsi = NFS_I(inode);
1495 const struct nfs_fh *fh = data->args.fh ?
1496 data->args.fh : &nfsi->fh;
1497 const struct nfs_writeverf *verf = data->res.verf;
1499 __entry->error = task->tk_status;
1500 __entry->offset = data->args.offset;
1501 __entry->stable = verf->committed;
1502 memcpy(__entry->verifier,
1504 NFS4_VERIFIER_SIZE);
1505 __entry->dev = inode->i_sb->s_dev;
1506 __entry->fileid = nfsi->fileid;
1507 __entry->fhandle = nfs_fhandle_hash(fh);
1511 "error=%d fileid=%02x:%02x:%llu fhandle=0x%08x "
1512 "offset=%lld stable=%s verifier=%s", __entry->error,
1513 MAJOR(__entry->dev), MINOR(__entry->dev),
1514 (unsigned long long)__entry->fileid,
1516 (long long)__entry->offset,
1517 show_nfs_stable_how(__entry->stable),
1518 show_nfs4_verifier(__entry->verifier)
1522 #define nfs_show_direct_req_flags(v) \
1523 __print_flags(v, "|", \
1524 { NFS_ODIRECT_DO_COMMIT, "DO_COMMIT" }, \
1525 { NFS_ODIRECT_RESCHED_WRITES, "RESCHED_WRITES" }, \
1526 { NFS_ODIRECT_SHOULD_DIRTY, "SHOULD DIRTY" }, \
1527 { NFS_ODIRECT_DONE, "DONE" } )
1529 DECLARE_EVENT_CLASS(nfs_direct_req_class,
1531 const struct nfs_direct_req *dreq
1538 __field(u64, fileid)
1539 __field(u32, fhandle)
1540 __field(loff_t, offset)
1541 __field(ssize_t, count)
1542 __field(ssize_t, bytes_left)
1543 __field(ssize_t, error)
1548 const struct inode *inode = dreq->inode;
1549 const struct nfs_inode *nfsi = NFS_I(inode);
1550 const struct nfs_fh *fh = &nfsi->fh;
1552 __entry->dev = inode->i_sb->s_dev;
1553 __entry->fileid = nfsi->fileid;
1554 __entry->fhandle = nfs_fhandle_hash(fh);
1555 __entry->offset = dreq->io_start;
1556 __entry->count = dreq->count;
1557 __entry->bytes_left = dreq->bytes_left;
1558 __entry->error = dreq->error;
1559 __entry->flags = dreq->flags;
1563 "error=%zd fileid=%02x:%02x:%llu fhandle=0x%08x "
1564 "offset=%lld count=%zd bytes_left=%zd flags=%s",
1565 __entry->error, MAJOR(__entry->dev),
1566 MINOR(__entry->dev),
1567 (unsigned long long)__entry->fileid,
1568 __entry->fhandle, __entry->offset,
1569 __entry->count, __entry->bytes_left,
1570 nfs_show_direct_req_flags(__entry->flags)
1574 #define DEFINE_NFS_DIRECT_REQ_EVENT(name) \
1575 DEFINE_EVENT(nfs_direct_req_class, name, \
1577 const struct nfs_direct_req *dreq \
1581 DEFINE_NFS_DIRECT_REQ_EVENT(nfs_direct_commit_complete);
1582 DEFINE_NFS_DIRECT_REQ_EVENT(nfs_direct_resched_write);
1583 DEFINE_NFS_DIRECT_REQ_EVENT(nfs_direct_write_complete);
1584 DEFINE_NFS_DIRECT_REQ_EVENT(nfs_direct_write_completion);
1585 DEFINE_NFS_DIRECT_REQ_EVENT(nfs_direct_write_schedule_iovec);
1586 DEFINE_NFS_DIRECT_REQ_EVENT(nfs_direct_write_reschedule_io);
1588 TRACE_EVENT(nfs_fh_to_dentry,
1590 const struct super_block *sb,
1591 const struct nfs_fh *fh,
1596 TP_ARGS(sb, fh, fileid, error),
1601 __field(u32, fhandle)
1602 __field(u64, fileid)
1606 __entry->error = error;
1607 __entry->dev = sb->s_dev;
1608 __entry->fileid = fileid;
1609 __entry->fhandle = nfs_fhandle_hash(fh);
1613 "error=%d fileid=%02x:%02x:%llu fhandle=0x%08x ",
1615 MAJOR(__entry->dev), MINOR(__entry->dev),
1616 (unsigned long long)__entry->fileid,
1621 TRACE_EVENT(nfs_mount_assign,
1627 TP_ARGS(option, value),
1630 __string(option, option)
1631 __string(value, value)
1635 __assign_str(option, option);
1636 __assign_str(value, value);
1639 TP_printk("option %s=%s",
1640 __get_str(option), __get_str(value)
1644 TRACE_EVENT(nfs_mount_option,
1646 const struct fs_parameter *param
1652 __string(option, param->key)
1656 __assign_str(option, param->key);
1659 TP_printk("option %s", __get_str(option))
1662 TRACE_EVENT(nfs_mount_path,
1670 __string(path, path)
1674 __assign_str(path, path);
1677 TP_printk("path='%s'", __get_str(path))
1680 DECLARE_EVENT_CLASS(nfs_xdr_event,
1682 const struct xdr_stream *xdr,
1686 TP_ARGS(xdr, error),
1689 __field(unsigned int, task_id)
1690 __field(unsigned int, client_id)
1692 __field(int, version)
1693 __field(unsigned long, error)
1695 xdr->rqst->rq_task->tk_client->cl_program->name)
1697 xdr->rqst->rq_task->tk_msg.rpc_proc->p_name)
1701 const struct rpc_rqst *rqstp = xdr->rqst;
1702 const struct rpc_task *task = rqstp->rq_task;
1704 __entry->task_id = task->tk_pid;
1705 __entry->client_id = task->tk_client->cl_clid;
1706 __entry->xid = be32_to_cpu(rqstp->rq_xid);
1707 __entry->version = task->tk_client->cl_vers;
1708 __entry->error = error;
1709 __assign_str(program,
1710 task->tk_client->cl_program->name);
1711 __assign_str(procedure, task->tk_msg.rpc_proc->p_name);
1714 TP_printk(SUNRPC_TRACE_TASK_SPECIFIER
1715 " xid=0x%08x %sv%d %s error=%ld (%s)",
1716 __entry->task_id, __entry->client_id, __entry->xid,
1717 __get_str(program), __entry->version,
1718 __get_str(procedure), -__entry->error,
1719 show_nfs_status(__entry->error)
1722 #define DEFINE_NFS_XDR_EVENT(name) \
1723 DEFINE_EVENT(nfs_xdr_event, name, \
1725 const struct xdr_stream *xdr, \
1728 TP_ARGS(xdr, error))
1729 DEFINE_NFS_XDR_EVENT(nfs_xdr_status);
1730 DEFINE_NFS_XDR_EVENT(nfs_xdr_bad_filehandle);
1732 #endif /* _TRACE_NFS_H */
1734 #undef TRACE_INCLUDE_PATH
1735 #define TRACE_INCLUDE_PATH .
1736 #define TRACE_INCLUDE_FILE nfstrace
1737 /* This part must be outside protection */
1738 #include <trace/define_trace.h>