Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

NFS: Add a tracepoint in nfs_set_pgio_error()

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>

authored by

Chuck Lever and committed by
Anna Schumaker
cd2ed9bd fd2b6121

+46
+44
fs/nfs/nfstrace.h
··· 1008 1008 ) 1009 1009 ); 1010 1010 1011 + TRACE_EVENT(nfs_pgio_error, 1012 + TP_PROTO( 1013 + const struct nfs_pgio_header *hdr, 1014 + int error, 1015 + loff_t pos 1016 + ), 1017 + 1018 + TP_ARGS(hdr, error, pos), 1019 + 1020 + TP_STRUCT__entry( 1021 + __field(dev_t, dev) 1022 + __field(u32, fhandle) 1023 + __field(u64, fileid) 1024 + __field(loff_t, offset) 1025 + __field(u32, arg_count) 1026 + __field(u32, res_count) 1027 + __field(loff_t, pos) 1028 + __field(int, status) 1029 + ), 1030 + 1031 + TP_fast_assign( 1032 + const struct inode *inode = hdr->inode; 1033 + const struct nfs_inode *nfsi = NFS_I(inode); 1034 + const struct nfs_fh *fh = hdr->args.fh ? 1035 + hdr->args.fh : &nfsi->fh; 1036 + 1037 + __entry->status = error; 1038 + __entry->offset = hdr->args.offset; 1039 + __entry->arg_count = hdr->args.count; 1040 + __entry->res_count = hdr->res.count; 1041 + __entry->dev = inode->i_sb->s_dev; 1042 + __entry->fileid = nfsi->fileid; 1043 + __entry->fhandle = nfs_fhandle_hash(fh); 1044 + ), 1045 + 1046 + TP_printk("fileid=%02x:%02x:%llu fhandle=0x%08x " 1047 + "offset=%lld count=%u res=%u pos=%llu status=%d", 1048 + MAJOR(__entry->dev), MINOR(__entry->dev), 1049 + (unsigned long long)__entry->fileid, __entry->fhandle, 1050 + (long long)__entry->offset, __entry->arg_count, __entry->res_count, 1051 + __entry->pos, __entry->status 1052 + ) 1053 + ); 1054 + 1011 1055 TRACE_DEFINE_ENUM(NFS_UNSTABLE); 1012 1056 TRACE_DEFINE_ENUM(NFS_DATA_SYNC); 1013 1057 TRACE_DEFINE_ENUM(NFS_FILE_SYNC);
+2
fs/nfs/pagelist.c
··· 24 24 25 25 #include "internal.h" 26 26 #include "pnfs.h" 27 + #include "nfstrace.h" 27 28 28 29 #define NFSDBG_FACILITY NFSDBG_PAGECACHE 29 30 ··· 65 64 { 66 65 unsigned int new = pos - hdr->io_start; 67 66 67 + trace_nfs_pgio_error(hdr, error, pos); 68 68 if (hdr->good_bytes > new) { 69 69 hdr->good_bytes = new; 70 70 clear_bit(NFS_IOHDR_EOF, &hdr->flags);