@@ -2183,6 +2183,113 @@ DECLARE_EVENT_CLASS(nfs4_sparse_event,
2183
2183
TP_ARGS(inode, args, error))
2184
2184
DEFINE_NFS4_SPARSE_EVENT (nfs4_fallocate );
2185
2185
DEFINE_NFS4_SPARSE_EVENT (nfs4_deallocate );
2186
+
2187
+ TRACE_EVENT (nfs4_copy ,
2188
+ TP_PROTO (
2189
+ const struct inode * src_inode ,
2190
+ const struct inode * dst_inode ,
2191
+ const struct nfs42_copy_args * args ,
2192
+ const struct nfs42_copy_res * res ,
2193
+ const struct nl4_server * nss ,
2194
+ int error
2195
+ ),
2196
+
2197
+ TP_ARGS (src_inode , dst_inode , args , res , nss , error ),
2198
+
2199
+ TP_STRUCT__entry (
2200
+ __field (unsigned long , error )
2201
+ __field (u32 , src_fhandle )
2202
+ __field (u32 , src_fileid )
2203
+ __field (u32 , dst_fhandle )
2204
+ __field (u32 , dst_fileid )
2205
+ __field (dev_t , src_dev )
2206
+ __field (dev_t , dst_dev )
2207
+ __field (int , src_stateid_seq )
2208
+ __field (u32 , src_stateid_hash )
2209
+ __field (int , dst_stateid_seq )
2210
+ __field (u32 , dst_stateid_hash )
2211
+ __field (loff_t , src_offset )
2212
+ __field (loff_t , dst_offset )
2213
+ __field (bool , sync )
2214
+ __field (loff_t , len )
2215
+ __field (int , res_stateid_seq )
2216
+ __field (u32 , res_stateid_hash )
2217
+ __field (loff_t , res_count )
2218
+ __field (bool , res_sync )
2219
+ __field (bool , res_cons )
2220
+ __field (bool , intra )
2221
+ ),
2222
+
2223
+ TP_fast_assign (
2224
+ const struct nfs_inode * src_nfsi = NFS_I (src_inode );
2225
+ const struct nfs_inode * dst_nfsi = NFS_I (dst_inode );
2226
+
2227
+ __entry -> src_fileid = src_nfsi -> fileid ;
2228
+ __entry -> src_dev = src_inode -> i_sb -> s_dev ;
2229
+ __entry -> src_fhandle = nfs_fhandle_hash (args -> src_fh );
2230
+ __entry -> src_offset = args -> src_pos ;
2231
+ __entry -> dst_fileid = dst_nfsi -> fileid ;
2232
+ __entry -> dst_dev = dst_inode -> i_sb -> s_dev ;
2233
+ __entry -> dst_fhandle = nfs_fhandle_hash (args -> dst_fh );
2234
+ __entry -> dst_offset = args -> dst_pos ;
2235
+ __entry -> len = args -> count ;
2236
+ __entry -> sync = args -> sync ;
2237
+ __entry -> src_stateid_seq =
2238
+ be32_to_cpu (args -> src_stateid .seqid );
2239
+ __entry -> src_stateid_hash =
2240
+ nfs_stateid_hash (& args -> src_stateid );
2241
+ __entry -> dst_stateid_seq =
2242
+ be32_to_cpu (args -> dst_stateid .seqid );
2243
+ __entry -> dst_stateid_hash =
2244
+ nfs_stateid_hash (& args -> dst_stateid );
2245
+ __entry -> intra = nss ? 0 : 1 ;
2246
+ if (error ) {
2247
+ __entry -> error = - error ;
2248
+ __entry -> res_stateid_seq = 0 ;
2249
+ __entry -> res_stateid_hash = 0 ;
2250
+ __entry -> res_count = 0 ;
2251
+ __entry -> res_sync = 0 ;
2252
+ __entry -> res_cons = 0 ;
2253
+ } else {
2254
+ __entry -> error = 0 ;
2255
+ __entry -> res_stateid_seq =
2256
+ be32_to_cpu (res -> write_res .stateid .seqid );
2257
+ __entry -> res_stateid_hash =
2258
+ nfs_stateid_hash (& res -> write_res .stateid );
2259
+ __entry -> res_count = res -> write_res .count ;
2260
+ __entry -> res_sync = res -> synchronous ;
2261
+ __entry -> res_cons = res -> consecutive ;
2262
+ }
2263
+ ),
2264
+
2265
+ TP_printk (
2266
+ "error=%ld (%s) intra=%d src_fileid=%02x:%02x:%llu "
2267
+ "src_fhandle=0x%08x dst_fileid=%02x:%02x:%llu "
2268
+ "dst_fhandle=0x%08x src_stateid=%d:0x%08x "
2269
+ "dst_stateid=%d:0x%08x src_offset=%llu dst_offset=%llu "
2270
+ "len=%llu sync=%d cb_stateid=%d:0x%08x res_sync=%d "
2271
+ "res_cons=%d res_count=%llu" ,
2272
+ - __entry -> error ,
2273
+ show_nfs4_status (__entry -> error ),
2274
+ __entry -> intra ,
2275
+ MAJOR (__entry -> src_dev ), MINOR (__entry -> src_dev ),
2276
+ (unsigned long long )__entry -> src_fileid ,
2277
+ __entry -> src_fhandle ,
2278
+ MAJOR (__entry -> dst_dev ), MINOR (__entry -> dst_dev ),
2279
+ (unsigned long long )__entry -> dst_fileid ,
2280
+ __entry -> dst_fhandle ,
2281
+ __entry -> src_stateid_seq , __entry -> src_stateid_hash ,
2282
+ __entry -> dst_stateid_seq , __entry -> dst_stateid_hash ,
2283
+ __entry -> src_offset ,
2284
+ __entry -> dst_offset ,
2285
+ __entry -> len ,
2286
+ __entry -> sync ,
2287
+ __entry -> res_stateid_seq , __entry -> res_stateid_hash ,
2288
+ __entry -> res_sync ,
2289
+ __entry -> res_cons ,
2290
+ __entry -> res_count
2291
+ )
2292
+ );
2186
2293
#endif /* CONFIG_NFS_V4_2 */
2187
2294
2188
2295
#endif /* CONFIG_NFS_V4_1 */
0 commit comments