@@ -2127,6 +2127,62 @@ TRACE_EVENT(nfs4_llseek,
2127
2127
)
2128
2128
);
2129
2129
2130
+ DECLARE_EVENT_CLASS (nfs4_sparse_event ,
2131
+ TP_PROTO (
2132
+ const struct inode * inode ,
2133
+ const struct nfs42_falloc_args * args ,
2134
+ int error
2135
+ ),
2136
+
2137
+ TP_ARGS (inode , args , error ),
2138
+
2139
+ TP_STRUCT__entry (
2140
+ __field (unsigned long , error )
2141
+ __field (loff_t , offset )
2142
+ __field (loff_t , len )
2143
+ __field (dev_t , dev )
2144
+ __field (u32 , fhandle )
2145
+ __field (u64 , fileid )
2146
+ __field (int , stateid_seq )
2147
+ __field (u32 , stateid_hash )
2148
+ ),
2149
+
2150
+ TP_fast_assign (
2151
+ __entry -> error = error < 0 ? - error : 0 ;
2152
+ __entry -> offset = args -> falloc_offset ;
2153
+ __entry -> len = args -> falloc_length ;
2154
+ __entry -> dev = inode -> i_sb -> s_dev ;
2155
+ __entry -> fileid = NFS_FILEID (inode );
2156
+ __entry -> fhandle = nfs_fhandle_hash (NFS_FH (inode ));
2157
+ __entry -> stateid_seq =
2158
+ be32_to_cpu (args -> falloc_stateid .seqid );
2159
+ __entry -> stateid_hash =
2160
+ nfs_stateid_hash (& args -> falloc_stateid );
2161
+ ),
2162
+
2163
+ TP_printk (
2164
+ "error=%ld (%s) fileid=%02x:%02x:%llu fhandle=0x%08x "
2165
+ "stateid=%d:0x%08x offset=%llu len=%llu" ,
2166
+ - __entry -> error ,
2167
+ show_nfs4_status (__entry -> error ),
2168
+ MAJOR (__entry -> dev ), MINOR (__entry -> dev ),
2169
+ (unsigned long long )__entry -> fileid ,
2170
+ __entry -> fhandle ,
2171
+ __entry -> stateid_seq , __entry -> stateid_hash ,
2172
+ (long long )__entry -> offset ,
2173
+ (long long )__entry -> len
2174
+ )
2175
+ );
2176
+ #define DEFINE_NFS4_SPARSE_EVENT (name ) \
2177
+ DEFINE_EVENT(nfs4_sparse_event, name, \
2178
+ TP_PROTO( \
2179
+ const struct inode *inode, \
2180
+ const struct nfs42_falloc_args *args, \
2181
+ int error \
2182
+ ), \
2183
+ TP_ARGS(inode, args, error))
2184
+ DEFINE_NFS4_SPARSE_EVENT (nfs4_fallocate );
2185
+ DEFINE_NFS4_SPARSE_EVENT (nfs4_deallocate );
2130
2186
#endif /* CONFIG_NFS_V4_2 */
2131
2187
2132
2188
#endif /* CONFIG_NFS_V4_1 */
0 commit comments