2 * Copyright (c) 2013 Trond Myklebust <Trond.Myklebust@netapp.com>
5 #define TRACE_SYSTEM nfs4
7 #if !defined(_TRACE_NFS4_H) || defined(TRACE_HEADER_MULTI_READ)
10 #include <linux/tracepoint.h>
12 #define show_nfsv4_errors(error) \
13 __print_symbolic(error, \
15 /* Mapped by nfs4_stat_to_errno() */ \
16 { -EPERM, "EPERM" }, \
17 { -ENOENT, "ENOENT" }, \
19 { -ENXIO, "ENXIO" }, \
20 { -EACCES, "EACCES" }, \
21 { -EEXIST, "EEXIST" }, \
22 { -EXDEV, "EXDEV" }, \
23 { -ENOTDIR, "ENOTDIR" }, \
24 { -EISDIR, "EISDIR" }, \
25 { -EFBIG, "EFBIG" }, \
26 { -ENOSPC, "ENOSPC" }, \
27 { -EROFS, "EROFS" }, \
28 { -EMLINK, "EMLINK" }, \
29 { -ENAMETOOLONG, "ENAMETOOLONG" }, \
30 { -ENOTEMPTY, "ENOTEMPTY" }, \
31 { -EDQUOT, "EDQUOT" }, \
32 { -ESTALE, "ESTALE" }, \
33 { -EBADHANDLE, "EBADHANDLE" }, \
34 { -EBADCOOKIE, "EBADCOOKIE" }, \
35 { -ENOTSUPP, "ENOTSUPP" }, \
36 { -ETOOSMALL, "ETOOSMALL" }, \
37 { -EREMOTEIO, "EREMOTEIO" }, \
38 { -EBADTYPE, "EBADTYPE" }, \
39 { -EAGAIN, "EAGAIN" }, \
40 { -ELOOP, "ELOOP" }, \
41 { -EOPNOTSUPP, "EOPNOTSUPP" }, \
42 { -EDEADLK, "EDEADLK" }, \
44 { -ENOMEM, "ENOMEM" }, \
45 { -EKEYEXPIRED, "EKEYEXPIRED" }, \
46 { -ETIMEDOUT, "ETIMEDOUT" }, \
47 { -ERESTARTSYS, "ERESTARTSYS" }, \
48 { -ECONNREFUSED, "ECONNREFUSED" }, \
49 { -ECONNRESET, "ECONNRESET" }, \
50 { -ENETUNREACH, "ENETUNREACH" }, \
51 { -EHOSTUNREACH, "EHOSTUNREACH" }, \
52 { -EHOSTDOWN, "EHOSTDOWN" }, \
53 { -EPIPE, "EPIPE" }, \
54 { -EPFNOSUPPORT, "EPFNOSUPPORT" }, \
55 { -EPROTONOSUPPORT, "EPROTONOSUPPORT" }, \
56 /* NFSv4 native errors */ \
57 { -NFS4ERR_ACCESS, "ACCESS" }, \
58 { -NFS4ERR_ATTRNOTSUPP, "ATTRNOTSUPP" }, \
59 { -NFS4ERR_ADMIN_REVOKED, "ADMIN_REVOKED" }, \
60 { -NFS4ERR_BACK_CHAN_BUSY, "BACK_CHAN_BUSY" }, \
61 { -NFS4ERR_BADCHAR, "BADCHAR" }, \
62 { -NFS4ERR_BADHANDLE, "BADHANDLE" }, \
63 { -NFS4ERR_BADIOMODE, "BADIOMODE" }, \
64 { -NFS4ERR_BADLAYOUT, "BADLAYOUT" }, \
65 { -NFS4ERR_BADLABEL, "BADLABEL" }, \
66 { -NFS4ERR_BADNAME, "BADNAME" }, \
67 { -NFS4ERR_BADOWNER, "BADOWNER" }, \
68 { -NFS4ERR_BADSESSION, "BADSESSION" }, \
69 { -NFS4ERR_BADSLOT, "BADSLOT" }, \
70 { -NFS4ERR_BADTYPE, "BADTYPE" }, \
71 { -NFS4ERR_BADXDR, "BADXDR" }, \
72 { -NFS4ERR_BAD_COOKIE, "BAD_COOKIE" }, \
73 { -NFS4ERR_BAD_HIGH_SLOT, "BAD_HIGH_SLOT" }, \
74 { -NFS4ERR_BAD_RANGE, "BAD_RANGE" }, \
75 { -NFS4ERR_BAD_SEQID, "BAD_SEQID" }, \
76 { -NFS4ERR_BAD_SESSION_DIGEST, "BAD_SESSION_DIGEST" }, \
77 { -NFS4ERR_BAD_STATEID, "BAD_STATEID" }, \
78 { -NFS4ERR_CB_PATH_DOWN, "CB_PATH_DOWN" }, \
79 { -NFS4ERR_CLID_INUSE, "CLID_INUSE" }, \
80 { -NFS4ERR_CLIENTID_BUSY, "CLIENTID_BUSY" }, \
81 { -NFS4ERR_COMPLETE_ALREADY, "COMPLETE_ALREADY" }, \
82 { -NFS4ERR_CONN_NOT_BOUND_TO_SESSION, \
83 "CONN_NOT_BOUND_TO_SESSION" }, \
84 { -NFS4ERR_DEADLOCK, "DEADLOCK" }, \
85 { -NFS4ERR_DEADSESSION, "DEAD_SESSION" }, \
86 { -NFS4ERR_DELAY, "DELAY" }, \
87 { -NFS4ERR_DELEG_ALREADY_WANTED, \
88 "DELEG_ALREADY_WANTED" }, \
89 { -NFS4ERR_DELEG_REVOKED, "DELEG_REVOKED" }, \
90 { -NFS4ERR_DENIED, "DENIED" }, \
91 { -NFS4ERR_DIRDELEG_UNAVAIL, "DIRDELEG_UNAVAIL" }, \
92 { -NFS4ERR_DQUOT, "DQUOT" }, \
93 { -NFS4ERR_ENCR_ALG_UNSUPP, "ENCR_ALG_UNSUPP" }, \
94 { -NFS4ERR_EXIST, "EXIST" }, \
95 { -NFS4ERR_EXPIRED, "EXPIRED" }, \
96 { -NFS4ERR_FBIG, "FBIG" }, \
97 { -NFS4ERR_FHEXPIRED, "FHEXPIRED" }, \
98 { -NFS4ERR_FILE_OPEN, "FILE_OPEN" }, \
99 { -NFS4ERR_GRACE, "GRACE" }, \
100 { -NFS4ERR_HASH_ALG_UNSUPP, "HASH_ALG_UNSUPP" }, \
101 { -NFS4ERR_INVAL, "INVAL" }, \
102 { -NFS4ERR_IO, "IO" }, \
103 { -NFS4ERR_ISDIR, "ISDIR" }, \
104 { -NFS4ERR_LAYOUTTRYLATER, "LAYOUTTRYLATER" }, \
105 { -NFS4ERR_LAYOUTUNAVAILABLE, "LAYOUTUNAVAILABLE" }, \
106 { -NFS4ERR_LEASE_MOVED, "LEASE_MOVED" }, \
107 { -NFS4ERR_LOCKED, "LOCKED" }, \
108 { -NFS4ERR_LOCKS_HELD, "LOCKS_HELD" }, \
109 { -NFS4ERR_LOCK_RANGE, "LOCK_RANGE" }, \
110 { -NFS4ERR_MINOR_VERS_MISMATCH, "MINOR_VERS_MISMATCH" }, \
111 { -NFS4ERR_MLINK, "MLINK" }, \
112 { -NFS4ERR_MOVED, "MOVED" }, \
113 { -NFS4ERR_NAMETOOLONG, "NAMETOOLONG" }, \
114 { -NFS4ERR_NOENT, "NOENT" }, \
115 { -NFS4ERR_NOFILEHANDLE, "NOFILEHANDLE" }, \
116 { -NFS4ERR_NOMATCHING_LAYOUT, "NOMATCHING_LAYOUT" }, \
117 { -NFS4ERR_NOSPC, "NOSPC" }, \
118 { -NFS4ERR_NOTDIR, "NOTDIR" }, \
119 { -NFS4ERR_NOTEMPTY, "NOTEMPTY" }, \
120 { -NFS4ERR_NOTSUPP, "NOTSUPP" }, \
121 { -NFS4ERR_NOT_ONLY_OP, "NOT_ONLY_OP" }, \
122 { -NFS4ERR_NOT_SAME, "NOT_SAME" }, \
123 { -NFS4ERR_NO_GRACE, "NO_GRACE" }, \
124 { -NFS4ERR_NXIO, "NXIO" }, \
125 { -NFS4ERR_OLD_STATEID, "OLD_STATEID" }, \
126 { -NFS4ERR_OPENMODE, "OPENMODE" }, \
127 { -NFS4ERR_OP_ILLEGAL, "OP_ILLEGAL" }, \
128 { -NFS4ERR_OP_NOT_IN_SESSION, "OP_NOT_IN_SESSION" }, \
129 { -NFS4ERR_PERM, "PERM" }, \
130 { -NFS4ERR_PNFS_IO_HOLE, "PNFS_IO_HOLE" }, \
131 { -NFS4ERR_PNFS_NO_LAYOUT, "PNFS_NO_LAYOUT" }, \
132 { -NFS4ERR_RECALLCONFLICT, "RECALLCONFLICT" }, \
133 { -NFS4ERR_RECLAIM_BAD, "RECLAIM_BAD" }, \
134 { -NFS4ERR_RECLAIM_CONFLICT, "RECLAIM_CONFLICT" }, \
135 { -NFS4ERR_REJECT_DELEG, "REJECT_DELEG" }, \
136 { -NFS4ERR_REP_TOO_BIG, "REP_TOO_BIG" }, \
137 { -NFS4ERR_REP_TOO_BIG_TO_CACHE, \
138 "REP_TOO_BIG_TO_CACHE" }, \
139 { -NFS4ERR_REQ_TOO_BIG, "REQ_TOO_BIG" }, \
140 { -NFS4ERR_RESOURCE, "RESOURCE" }, \
141 { -NFS4ERR_RESTOREFH, "RESTOREFH" }, \
142 { -NFS4ERR_RETRY_UNCACHED_REP, "RETRY_UNCACHED_REP" }, \
143 { -NFS4ERR_RETURNCONFLICT, "RETURNCONFLICT" }, \
144 { -NFS4ERR_ROFS, "ROFS" }, \
145 { -NFS4ERR_SAME, "SAME" }, \
146 { -NFS4ERR_SHARE_DENIED, "SHARE_DENIED" }, \
147 { -NFS4ERR_SEQUENCE_POS, "SEQUENCE_POS" }, \
148 { -NFS4ERR_SEQ_FALSE_RETRY, "SEQ_FALSE_RETRY" }, \
149 { -NFS4ERR_SEQ_MISORDERED, "SEQ_MISORDERED" }, \
150 { -NFS4ERR_SERVERFAULT, "SERVERFAULT" }, \
151 { -NFS4ERR_STALE, "STALE" }, \
152 { -NFS4ERR_STALE_CLIENTID, "STALE_CLIENTID" }, \
153 { -NFS4ERR_STALE_STATEID, "STALE_STATEID" }, \
154 { -NFS4ERR_SYMLINK, "SYMLINK" }, \
155 { -NFS4ERR_TOOSMALL, "TOOSMALL" }, \
156 { -NFS4ERR_TOO_MANY_OPS, "TOO_MANY_OPS" }, \
157 { -NFS4ERR_UNKNOWN_LAYOUTTYPE, "UNKNOWN_LAYOUTTYPE" }, \
158 { -NFS4ERR_UNSAFE_COMPOUND, "UNSAFE_COMPOUND" }, \
159 { -NFS4ERR_WRONGSEC, "WRONGSEC" }, \
160 { -NFS4ERR_WRONG_CRED, "WRONG_CRED" }, \
161 { -NFS4ERR_WRONG_TYPE, "WRONG_TYPE" }, \
162 { -NFS4ERR_XDEV, "XDEV" })
164 #define show_open_flags(flags) \
165 __print_flags(flags, "|", \
166 { O_CREAT, "O_CREAT" }, \
167 { O_EXCL, "O_EXCL" }, \
168 { O_TRUNC, "O_TRUNC" }, \
169 { O_DIRECT, "O_DIRECT" })
171 #define show_fmode_flags(mode) \
172 __print_flags(mode, "|", \
173 { ((__force unsigned long)FMODE_READ), "READ" }, \
174 { ((__force unsigned long)FMODE_WRITE), "WRITE" }, \
175 { ((__force unsigned long)FMODE_EXEC), "EXEC" })
177 #define show_nfs_fattr_flags(valid) \
178 __print_flags((unsigned long)valid, "|", \
179 { NFS_ATTR_FATTR_TYPE, "TYPE" }, \
180 { NFS_ATTR_FATTR_MODE, "MODE" }, \
181 { NFS_ATTR_FATTR_NLINK, "NLINK" }, \
182 { NFS_ATTR_FATTR_OWNER, "OWNER" }, \
183 { NFS_ATTR_FATTR_GROUP, "GROUP" }, \
184 { NFS_ATTR_FATTR_RDEV, "RDEV" }, \
185 { NFS_ATTR_FATTR_SIZE, "SIZE" }, \
186 { NFS_ATTR_FATTR_FSID, "FSID" }, \
187 { NFS_ATTR_FATTR_FILEID, "FILEID" }, \
188 { NFS_ATTR_FATTR_ATIME, "ATIME" }, \
189 { NFS_ATTR_FATTR_MTIME, "MTIME" }, \
190 { NFS_ATTR_FATTR_CTIME, "CTIME" }, \
191 { NFS_ATTR_FATTR_CHANGE, "CHANGE" }, \
192 { NFS_ATTR_FATTR_OWNER_NAME, "OWNER_NAME" }, \
193 { NFS_ATTR_FATTR_GROUP_NAME, "GROUP_NAME" })
195 DECLARE_EVENT_CLASS(nfs4_clientid_event
,
197 const struct nfs_client
*clp
,
205 rpc_peeraddr2str(clp
->cl_rpcclient
,
211 __entry
->error
= error
;
212 __assign_str(dstaddr
,
213 rpc_peeraddr2str(clp
->cl_rpcclient
,
218 "error=%d (%s) dstaddr=%s",
220 show_nfsv4_errors(__entry
->error
),
224 #define DEFINE_NFS4_CLIENTID_EVENT(name) \
225 DEFINE_EVENT(nfs4_clientid_event, name, \
227 const struct nfs_client *clp, \
231 DEFINE_NFS4_CLIENTID_EVENT(nfs4_setclientid
);
232 DEFINE_NFS4_CLIENTID_EVENT(nfs4_setclientid_confirm
);
233 DEFINE_NFS4_CLIENTID_EVENT(nfs4_renew
);
234 DEFINE_NFS4_CLIENTID_EVENT(nfs4_renew_async
);
235 #ifdef CONFIG_NFS_V4_1
236 DEFINE_NFS4_CLIENTID_EVENT(nfs4_exchange_id
);
237 DEFINE_NFS4_CLIENTID_EVENT(nfs4_create_session
);
238 DEFINE_NFS4_CLIENTID_EVENT(nfs4_destroy_session
);
239 DEFINE_NFS4_CLIENTID_EVENT(nfs4_destroy_clientid
);
240 DEFINE_NFS4_CLIENTID_EVENT(nfs4_bind_conn_to_session
);
241 DEFINE_NFS4_CLIENTID_EVENT(nfs4_sequence
);
242 DEFINE_NFS4_CLIENTID_EVENT(nfs4_reclaim_complete
);
244 #define show_nfs4_sequence_status_flags(status) \
245 __print_flags((unsigned long)status, "|", \
246 { SEQ4_STATUS_CB_PATH_DOWN, "CB_PATH_DOWN" }, \
247 { SEQ4_STATUS_CB_GSS_CONTEXTS_EXPIRING, \
248 "CB_GSS_CONTEXTS_EXPIRING" }, \
249 { SEQ4_STATUS_CB_GSS_CONTEXTS_EXPIRED, \
250 "CB_GSS_CONTEXTS_EXPIRED" }, \
251 { SEQ4_STATUS_EXPIRED_ALL_STATE_REVOKED, \
252 "EXPIRED_ALL_STATE_REVOKED" }, \
253 { SEQ4_STATUS_EXPIRED_SOME_STATE_REVOKED, \
254 "EXPIRED_SOME_STATE_REVOKED" }, \
255 { SEQ4_STATUS_ADMIN_STATE_REVOKED, \
256 "ADMIN_STATE_REVOKED" }, \
257 { SEQ4_STATUS_RECALLABLE_STATE_REVOKED, \
258 "RECALLABLE_STATE_REVOKED" }, \
259 { SEQ4_STATUS_LEASE_MOVED, "LEASE_MOVED" }, \
260 { SEQ4_STATUS_RESTART_RECLAIM_NEEDED, \
261 "RESTART_RECLAIM_NEEDED" }, \
262 { SEQ4_STATUS_CB_PATH_DOWN_SESSION, \
263 "CB_PATH_DOWN_SESSION" }, \
264 { SEQ4_STATUS_BACKCHANNEL_FAULT, \
265 "BACKCHANNEL_FAULT" })
267 TRACE_EVENT(nfs4_sequence_done
,
269 const struct nfs4_session
*session
,
270 const struct nfs4_sequence_res
*res
272 TP_ARGS(session
, res
),
275 __field(unsigned int, session
)
276 __field(unsigned int, slot_nr
)
277 __field(unsigned int, seq_nr
)
278 __field(unsigned int, highest_slotid
)
279 __field(unsigned int, target_highest_slotid
)
280 __field(unsigned int, status_flags
)
285 const struct nfs4_slot
*sr_slot
= res
->sr_slot
;
286 __entry
->session
= nfs_session_id_hash(&session
->sess_id
);
287 __entry
->slot_nr
= sr_slot
->slot_nr
;
288 __entry
->seq_nr
= sr_slot
->seq_nr
;
289 __entry
->highest_slotid
= res
->sr_highest_slotid
;
290 __entry
->target_highest_slotid
=
291 res
->sr_target_highest_slotid
;
292 __entry
->status_flags
= res
->sr_status_flags
;
293 __entry
->error
= res
->sr_status
;
296 "error=%d (%s) session=0x%08x slot_nr=%u seq_nr=%u "
297 "highest_slotid=%u target_highest_slotid=%u "
298 "status_flags=%u (%s)",
300 show_nfsv4_errors(__entry
->error
),
304 __entry
->highest_slotid
,
305 __entry
->target_highest_slotid
,
306 __entry
->status_flags
,
307 show_nfs4_sequence_status_flags(__entry
->status_flags
)
311 struct cb_sequenceargs
;
312 struct cb_sequenceres
;
314 TRACE_EVENT(nfs4_cb_sequence
,
316 const struct cb_sequenceargs
*args
,
317 const struct cb_sequenceres
*res
,
320 TP_ARGS(args
, res
, status
),
323 __field(unsigned int, session
)
324 __field(unsigned int, slot_nr
)
325 __field(unsigned int, seq_nr
)
326 __field(unsigned int, highest_slotid
)
327 __field(unsigned int, cachethis
)
332 __entry
->session
= nfs_session_id_hash(&args
->csa_sessionid
);
333 __entry
->slot_nr
= args
->csa_slotid
;
334 __entry
->seq_nr
= args
->csa_sequenceid
;
335 __entry
->highest_slotid
= args
->csa_highestslotid
;
336 __entry
->cachethis
= args
->csa_cachethis
;
337 __entry
->error
= -be32_to_cpu(status
);
341 "error=%d (%s) session=0x%08x slot_nr=%u seq_nr=%u "
344 show_nfsv4_errors(__entry
->error
),
348 __entry
->highest_slotid
351 #endif /* CONFIG_NFS_V4_1 */
353 TRACE_EVENT(nfs4_setup_sequence
,
355 const struct nfs4_session
*session
,
356 const struct nfs4_sequence_args
*args
358 TP_ARGS(session
, args
),
361 __field(unsigned int, session
)
362 __field(unsigned int, slot_nr
)
363 __field(unsigned int, seq_nr
)
364 __field(unsigned int, highest_used_slotid
)
368 const struct nfs4_slot
*sa_slot
= args
->sa_slot
;
369 __entry
->session
= session
? nfs_session_id_hash(&session
->sess_id
) : 0;
370 __entry
->slot_nr
= sa_slot
->slot_nr
;
371 __entry
->seq_nr
= sa_slot
->seq_nr
;
372 __entry
->highest_used_slotid
=
373 sa_slot
->table
->highest_used_slotid
;
376 "session=0x%08x slot_nr=%u seq_nr=%u "
377 "highest_used_slotid=%u",
381 __entry
->highest_used_slotid
385 DECLARE_EVENT_CLASS(nfs4_open_event
,
387 const struct nfs_open_context
*ctx
,
392 TP_ARGS(ctx
, flags
, error
),
396 __field(unsigned int, flags
)
397 __field(unsigned int, fmode
)
399 __field(u32
, fhandle
)
402 __string(name
, ctx
->dentry
->d_name
.name
)
403 __field(int, stateid_seq
)
404 __field(u32
, stateid_hash
)
405 __field(int, openstateid_seq
)
406 __field(u32
, openstateid_hash
)
410 const struct nfs4_state
*state
= ctx
->state
;
411 const struct inode
*inode
= NULL
;
413 __entry
->error
= error
;
414 __entry
->flags
= flags
;
415 __entry
->fmode
= (__force
unsigned int)ctx
->mode
;
416 __entry
->dev
= ctx
->dentry
->d_sb
->s_dev
;
417 if (!IS_ERR_OR_NULL(state
)) {
418 inode
= state
->inode
;
419 __entry
->stateid_seq
=
420 be32_to_cpu(state
->stateid
.seqid
);
421 __entry
->stateid_hash
=
422 nfs_stateid_hash(&state
->stateid
);
423 __entry
->openstateid_seq
=
424 be32_to_cpu(state
->open_stateid
.seqid
);
425 __entry
->openstateid_hash
=
426 nfs_stateid_hash(&state
->open_stateid
);
428 __entry
->stateid_seq
= 0;
429 __entry
->stateid_hash
= 0;
430 __entry
->openstateid_seq
= 0;
431 __entry
->openstateid_hash
= 0;
434 __entry
->fileid
= NFS_FILEID(inode
);
435 __entry
->fhandle
= nfs_fhandle_hash(NFS_FH(inode
));
438 __entry
->fhandle
= 0;
440 __entry
->dir
= NFS_FILEID(d_inode(ctx
->dentry
->d_parent
));
441 __assign_str(name
, ctx
->dentry
->d_name
.name
);
445 "error=%d (%s) flags=%d (%s) fmode=%s "
446 "fileid=%02x:%02x:%llu fhandle=0x%08x "
447 "name=%02x:%02x:%llu/%s stateid=%d:0x%08x "
448 "openstateid=%d:0x%08x",
450 show_nfsv4_errors(__entry
->error
),
452 show_open_flags(__entry
->flags
),
453 show_fmode_flags(__entry
->fmode
),
454 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
455 (unsigned long long)__entry
->fileid
,
457 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
458 (unsigned long long)__entry
->dir
,
460 __entry
->stateid_seq
, __entry
->stateid_hash
,
461 __entry
->openstateid_seq
, __entry
->openstateid_hash
465 #define DEFINE_NFS4_OPEN_EVENT(name) \
466 DEFINE_EVENT(nfs4_open_event, name, \
468 const struct nfs_open_context *ctx, \
472 TP_ARGS(ctx, flags, error))
473 DEFINE_NFS4_OPEN_EVENT(nfs4_open_reclaim
);
474 DEFINE_NFS4_OPEN_EVENT(nfs4_open_expired
);
475 DEFINE_NFS4_OPEN_EVENT(nfs4_open_file
);
477 TRACE_EVENT(nfs4_cached_open
,
479 const struct nfs4_state
*state
484 __field(u32
, fhandle
)
486 __field(unsigned int, fmode
)
487 __field(int, stateid_seq
)
488 __field(u32
, stateid_hash
)
492 const struct inode
*inode
= state
->inode
;
494 __entry
->dev
= inode
->i_sb
->s_dev
;
495 __entry
->fileid
= NFS_FILEID(inode
);
496 __entry
->fhandle
= nfs_fhandle_hash(NFS_FH(inode
));
497 __entry
->fmode
= (__force
unsigned int)state
->state
;
498 __entry
->stateid_seq
=
499 be32_to_cpu(state
->stateid
.seqid
);
500 __entry
->stateid_hash
=
501 nfs_stateid_hash(&state
->stateid
);
505 "fmode=%s fileid=%02x:%02x:%llu "
506 "fhandle=0x%08x stateid=%d:0x%08x",
507 __entry
->fmode
? show_fmode_flags(__entry
->fmode
) :
509 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
510 (unsigned long long)__entry
->fileid
,
512 __entry
->stateid_seq
, __entry
->stateid_hash
516 TRACE_EVENT(nfs4_close
,
518 const struct nfs4_state
*state
,
519 const struct nfs_closeargs
*args
,
520 const struct nfs_closeres
*res
,
524 TP_ARGS(state
, args
, res
, error
),
528 __field(u32
, fhandle
)
530 __field(unsigned int, fmode
)
532 __field(int, stateid_seq
)
533 __field(u32
, stateid_hash
)
537 const struct inode
*inode
= state
->inode
;
539 __entry
->dev
= inode
->i_sb
->s_dev
;
540 __entry
->fileid
= NFS_FILEID(inode
);
541 __entry
->fhandle
= nfs_fhandle_hash(NFS_FH(inode
));
542 __entry
->fmode
= (__force
unsigned int)state
->state
;
543 __entry
->error
= error
;
544 __entry
->stateid_seq
=
545 be32_to_cpu(args
->stateid
.seqid
);
546 __entry
->stateid_hash
=
547 nfs_stateid_hash(&args
->stateid
);
551 "error=%d (%s) fmode=%s fileid=%02x:%02x:%llu "
552 "fhandle=0x%08x openstateid=%d:0x%08x",
554 show_nfsv4_errors(__entry
->error
),
555 __entry
->fmode
? show_fmode_flags(__entry
->fmode
) :
557 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
558 (unsigned long long)__entry
->fileid
,
560 __entry
->stateid_seq
, __entry
->stateid_hash
564 #define show_lock_cmd(type) \
565 __print_symbolic((int)type, \
566 { F_GETLK, "GETLK" }, \
567 { F_SETLK, "SETLK" }, \
568 { F_SETLKW, "SETLKW" })
569 #define show_lock_type(type) \
570 __print_symbolic((int)type, \
571 { F_RDLCK, "RDLCK" }, \
572 { F_WRLCK, "WRLCK" }, \
573 { F_UNLCK, "UNLCK" })
575 DECLARE_EVENT_CLASS(nfs4_lock_event
,
577 const struct file_lock
*request
,
578 const struct nfs4_state
*state
,
583 TP_ARGS(request
, state
, cmd
, error
),
589 __field(loff_t
, start
)
592 __field(u32
, fhandle
)
594 __field(int, stateid_seq
)
595 __field(u32
, stateid_hash
)
599 const struct inode
*inode
= state
->inode
;
601 __entry
->error
= error
;
603 __entry
->type
= request
->fl_type
;
604 __entry
->start
= request
->fl_start
;
605 __entry
->end
= request
->fl_end
;
606 __entry
->dev
= inode
->i_sb
->s_dev
;
607 __entry
->fileid
= NFS_FILEID(inode
);
608 __entry
->fhandle
= nfs_fhandle_hash(NFS_FH(inode
));
609 __entry
->stateid_seq
=
610 be32_to_cpu(state
->stateid
.seqid
);
611 __entry
->stateid_hash
=
612 nfs_stateid_hash(&state
->stateid
);
616 "error=%d (%s) cmd=%s:%s range=%lld:%lld "
617 "fileid=%02x:%02x:%llu fhandle=0x%08x "
620 show_nfsv4_errors(__entry
->error
),
621 show_lock_cmd(__entry
->cmd
),
622 show_lock_type(__entry
->type
),
623 (long long)__entry
->start
,
624 (long long)__entry
->end
,
625 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
626 (unsigned long long)__entry
->fileid
,
628 __entry
->stateid_seq
, __entry
->stateid_hash
632 #define DEFINE_NFS4_LOCK_EVENT(name) \
633 DEFINE_EVENT(nfs4_lock_event, name, \
635 const struct file_lock *request, \
636 const struct nfs4_state *state, \
640 TP_ARGS(request, state, cmd, error))
641 DEFINE_NFS4_LOCK_EVENT(nfs4_get_lock
);
642 DEFINE_NFS4_LOCK_EVENT(nfs4_unlock
);
644 TRACE_EVENT(nfs4_set_lock
,
646 const struct file_lock
*request
,
647 const struct nfs4_state
*state
,
648 const nfs4_stateid
*lockstateid
,
653 TP_ARGS(request
, state
, lockstateid
, cmd
, error
),
659 __field(loff_t
, start
)
662 __field(u32
, fhandle
)
664 __field(int, stateid_seq
)
665 __field(u32
, stateid_hash
)
666 __field(int, lockstateid_seq
)
667 __field(u32
, lockstateid_hash
)
671 const struct inode
*inode
= state
->inode
;
673 __entry
->error
= error
;
675 __entry
->type
= request
->fl_type
;
676 __entry
->start
= request
->fl_start
;
677 __entry
->end
= request
->fl_end
;
678 __entry
->dev
= inode
->i_sb
->s_dev
;
679 __entry
->fileid
= NFS_FILEID(inode
);
680 __entry
->fhandle
= nfs_fhandle_hash(NFS_FH(inode
));
681 __entry
->stateid_seq
=
682 be32_to_cpu(state
->stateid
.seqid
);
683 __entry
->stateid_hash
=
684 nfs_stateid_hash(&state
->stateid
);
685 __entry
->lockstateid_seq
=
686 be32_to_cpu(lockstateid
->seqid
);
687 __entry
->lockstateid_hash
=
688 nfs_stateid_hash(lockstateid
);
692 "error=%d (%s) cmd=%s:%s range=%lld:%lld "
693 "fileid=%02x:%02x:%llu fhandle=0x%08x "
694 "stateid=%d:0x%08x lockstateid=%d:0x%08x",
696 show_nfsv4_errors(__entry
->error
),
697 show_lock_cmd(__entry
->cmd
),
698 show_lock_type(__entry
->type
),
699 (long long)__entry
->start
,
700 (long long)__entry
->end
,
701 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
702 (unsigned long long)__entry
->fileid
,
704 __entry
->stateid_seq
, __entry
->stateid_hash
,
705 __entry
->lockstateid_seq
, __entry
->lockstateid_hash
709 DECLARE_EVENT_CLASS(nfs4_set_delegation_event
,
711 const struct inode
*inode
,
715 TP_ARGS(inode
, fmode
),
719 __field(u32
, fhandle
)
721 __field(unsigned int, fmode
)
725 __entry
->dev
= inode
->i_sb
->s_dev
;
726 __entry
->fileid
= NFS_FILEID(inode
);
727 __entry
->fhandle
= nfs_fhandle_hash(NFS_FH(inode
));
728 __entry
->fmode
= (__force
unsigned int)fmode
;
732 "fmode=%s fileid=%02x:%02x:%llu fhandle=0x%08x",
733 show_fmode_flags(__entry
->fmode
),
734 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
735 (unsigned long long)__entry
->fileid
,
739 #define DEFINE_NFS4_SET_DELEGATION_EVENT(name) \
740 DEFINE_EVENT(nfs4_set_delegation_event, name, \
742 const struct inode *inode, \
745 TP_ARGS(inode, fmode))
746 DEFINE_NFS4_SET_DELEGATION_EVENT(nfs4_set_delegation
);
747 DEFINE_NFS4_SET_DELEGATION_EVENT(nfs4_reclaim_delegation
);
749 TRACE_EVENT(nfs4_delegreturn_exit
,
751 const struct nfs4_delegreturnargs
*args
,
752 const struct nfs4_delegreturnres
*res
,
756 TP_ARGS(args
, res
, error
),
760 __field(u32
, fhandle
)
762 __field(int, stateid_seq
)
763 __field(u32
, stateid_hash
)
767 __entry
->dev
= res
->server
->s_dev
;
768 __entry
->fhandle
= nfs_fhandle_hash(args
->fhandle
);
769 __entry
->error
= error
;
770 __entry
->stateid_seq
=
771 be32_to_cpu(args
->stateid
->seqid
);
772 __entry
->stateid_hash
=
773 nfs_stateid_hash(args
->stateid
);
777 "error=%d (%s) dev=%02x:%02x fhandle=0x%08x "
780 show_nfsv4_errors(__entry
->error
),
781 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
783 __entry
->stateid_seq
, __entry
->stateid_hash
787 #ifdef CONFIG_NFS_V4_1
788 DECLARE_EVENT_CLASS(nfs4_test_stateid_event
,
790 const struct nfs4_state
*state
,
791 const struct nfs4_lock_state
*lsp
,
795 TP_ARGS(state
, lsp
, error
),
800 __field(u32
, fhandle
)
802 __field(int, stateid_seq
)
803 __field(u32
, stateid_hash
)
807 const struct inode
*inode
= state
->inode
;
809 __entry
->error
= error
;
810 __entry
->dev
= inode
->i_sb
->s_dev
;
811 __entry
->fileid
= NFS_FILEID(inode
);
812 __entry
->fhandle
= nfs_fhandle_hash(NFS_FH(inode
));
813 __entry
->stateid_seq
=
814 be32_to_cpu(state
->stateid
.seqid
);
815 __entry
->stateid_hash
=
816 nfs_stateid_hash(&state
->stateid
);
820 "error=%d (%s) fileid=%02x:%02x:%llu fhandle=0x%08x "
823 show_nfsv4_errors(__entry
->error
),
824 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
825 (unsigned long long)__entry
->fileid
,
827 __entry
->stateid_seq
, __entry
->stateid_hash
831 #define DEFINE_NFS4_TEST_STATEID_EVENT(name) \
832 DEFINE_EVENT(nfs4_test_stateid_event, name, \
834 const struct nfs4_state *state, \
835 const struct nfs4_lock_state *lsp, \
838 TP_ARGS(state, lsp, error))
839 DEFINE_NFS4_TEST_STATEID_EVENT(nfs4_test_delegation_stateid
);
840 DEFINE_NFS4_TEST_STATEID_EVENT(nfs4_test_open_stateid
);
841 DEFINE_NFS4_TEST_STATEID_EVENT(nfs4_test_lock_stateid
);
842 #endif /* CONFIG_NFS_V4_1 */
844 DECLARE_EVENT_CLASS(nfs4_lookup_event
,
846 const struct inode
*dir
,
847 const struct qstr
*name
,
851 TP_ARGS(dir
, name
, error
),
857 __string(name
, name
->name
)
861 __entry
->dev
= dir
->i_sb
->s_dev
;
862 __entry
->dir
= NFS_FILEID(dir
);
863 __entry
->error
= error
;
864 __assign_str(name
, name
->name
);
868 "error=%d (%s) name=%02x:%02x:%llu/%s",
870 show_nfsv4_errors(__entry
->error
),
871 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
872 (unsigned long long)__entry
->dir
,
877 #define DEFINE_NFS4_LOOKUP_EVENT(name) \
878 DEFINE_EVENT(nfs4_lookup_event, name, \
880 const struct inode *dir, \
881 const struct qstr *name, \
884 TP_ARGS(dir, name, error))
886 DEFINE_NFS4_LOOKUP_EVENT(nfs4_lookup
);
887 DEFINE_NFS4_LOOKUP_EVENT(nfs4_symlink
);
888 DEFINE_NFS4_LOOKUP_EVENT(nfs4_mkdir
);
889 DEFINE_NFS4_LOOKUP_EVENT(nfs4_mknod
);
890 DEFINE_NFS4_LOOKUP_EVENT(nfs4_remove
);
891 DEFINE_NFS4_LOOKUP_EVENT(nfs4_get_fs_locations
);
892 DEFINE_NFS4_LOOKUP_EVENT(nfs4_secinfo
);
894 TRACE_EVENT(nfs4_lookupp
,
896 const struct inode
*inode
,
900 TP_ARGS(inode
, error
),
909 __entry
->dev
= inode
->i_sb
->s_dev
;
910 __entry
->ino
= NFS_FILEID(inode
);
911 __entry
->error
= error
;
915 "error=%d (%s) inode=%02x:%02x:%llu",
917 show_nfsv4_errors(__entry
->error
),
918 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
919 (unsigned long long)__entry
->ino
923 TRACE_EVENT(nfs4_rename
,
925 const struct inode
*olddir
,
926 const struct qstr
*oldname
,
927 const struct inode
*newdir
,
928 const struct qstr
*newname
,
932 TP_ARGS(olddir
, oldname
, newdir
, newname
, error
),
938 __string(oldname
, oldname
->name
)
940 __string(newname
, newname
->name
)
944 __entry
->dev
= olddir
->i_sb
->s_dev
;
945 __entry
->olddir
= NFS_FILEID(olddir
);
946 __entry
->newdir
= NFS_FILEID(newdir
);
947 __entry
->error
= error
;
948 __assign_str(oldname
, oldname
->name
);
949 __assign_str(newname
, newname
->name
);
953 "error=%d (%s) oldname=%02x:%02x:%llu/%s "
954 "newname=%02x:%02x:%llu/%s",
956 show_nfsv4_errors(__entry
->error
),
957 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
958 (unsigned long long)__entry
->olddir
,
960 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
961 (unsigned long long)__entry
->newdir
,
966 DECLARE_EVENT_CLASS(nfs4_inode_event
,
968 const struct inode
*inode
,
972 TP_ARGS(inode
, error
),
976 __field(u32
, fhandle
)
982 __entry
->dev
= inode
->i_sb
->s_dev
;
983 __entry
->fileid
= NFS_FILEID(inode
);
984 __entry
->fhandle
= nfs_fhandle_hash(NFS_FH(inode
));
985 __entry
->error
= error
;
989 "error=%d (%s) fileid=%02x:%02x:%llu fhandle=0x%08x",
991 show_nfsv4_errors(__entry
->error
),
992 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
993 (unsigned long long)__entry
->fileid
,
998 #define DEFINE_NFS4_INODE_EVENT(name) \
999 DEFINE_EVENT(nfs4_inode_event, name, \
1001 const struct inode *inode, \
1004 TP_ARGS(inode, error))
1006 DEFINE_NFS4_INODE_EVENT(nfs4_access
);
1007 DEFINE_NFS4_INODE_EVENT(nfs4_readlink
);
1008 DEFINE_NFS4_INODE_EVENT(nfs4_readdir
);
1009 DEFINE_NFS4_INODE_EVENT(nfs4_get_acl
);
1010 DEFINE_NFS4_INODE_EVENT(nfs4_set_acl
);
1011 #ifdef CONFIG_NFS_V4_SECURITY_LABEL
1012 DEFINE_NFS4_INODE_EVENT(nfs4_get_security_label
);
1013 DEFINE_NFS4_INODE_EVENT(nfs4_set_security_label
);
1014 #endif /* CONFIG_NFS_V4_SECURITY_LABEL */
1016 DECLARE_EVENT_CLASS(nfs4_inode_stateid_event
,
1018 const struct inode
*inode
,
1019 const nfs4_stateid
*stateid
,
1023 TP_ARGS(inode
, stateid
, error
),
1027 __field(u32
, fhandle
)
1028 __field(u64
, fileid
)
1030 __field(int, stateid_seq
)
1031 __field(u32
, stateid_hash
)
1035 __entry
->dev
= inode
->i_sb
->s_dev
;
1036 __entry
->fileid
= NFS_FILEID(inode
);
1037 __entry
->fhandle
= nfs_fhandle_hash(NFS_FH(inode
));
1038 __entry
->error
= error
;
1039 __entry
->stateid_seq
=
1040 be32_to_cpu(stateid
->seqid
);
1041 __entry
->stateid_hash
=
1042 nfs_stateid_hash(stateid
);
1046 "error=%d (%s) fileid=%02x:%02x:%llu fhandle=0x%08x "
1047 "stateid=%d:0x%08x",
1049 show_nfsv4_errors(__entry
->error
),
1050 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1051 (unsigned long long)__entry
->fileid
,
1053 __entry
->stateid_seq
, __entry
->stateid_hash
1057 #define DEFINE_NFS4_INODE_STATEID_EVENT(name) \
1058 DEFINE_EVENT(nfs4_inode_stateid_event, name, \
1060 const struct inode *inode, \
1061 const nfs4_stateid *stateid, \
1064 TP_ARGS(inode, stateid, error))
1066 DEFINE_NFS4_INODE_STATEID_EVENT(nfs4_setattr
);
1067 DEFINE_NFS4_INODE_STATEID_EVENT(nfs4_delegreturn
);
1069 DECLARE_EVENT_CLASS(nfs4_getattr_event
,
1071 const struct nfs_server
*server
,
1072 const struct nfs_fh
*fhandle
,
1073 const struct nfs_fattr
*fattr
,
1077 TP_ARGS(server
, fhandle
, fattr
, error
),
1081 __field(u32
, fhandle
)
1082 __field(u64
, fileid
)
1083 __field(unsigned int, valid
)
1088 __entry
->dev
= server
->s_dev
;
1089 __entry
->valid
= fattr
->valid
;
1090 __entry
->fhandle
= nfs_fhandle_hash(fhandle
);
1091 __entry
->fileid
= (fattr
->valid
& NFS_ATTR_FATTR_FILEID
) ? fattr
->fileid
: 0;
1092 __entry
->error
= error
;
1096 "error=%d (%s) fileid=%02x:%02x:%llu fhandle=0x%08x "
1099 show_nfsv4_errors(__entry
->error
),
1100 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1101 (unsigned long long)__entry
->fileid
,
1103 show_nfs_fattr_flags(__entry
->valid
)
1107 #define DEFINE_NFS4_GETATTR_EVENT(name) \
1108 DEFINE_EVENT(nfs4_getattr_event, name, \
1110 const struct nfs_server *server, \
1111 const struct nfs_fh *fhandle, \
1112 const struct nfs_fattr *fattr, \
1115 TP_ARGS(server, fhandle, fattr, error))
1116 DEFINE_NFS4_GETATTR_EVENT(nfs4_getattr
);
1117 DEFINE_NFS4_GETATTR_EVENT(nfs4_lookup_root
);
1118 DEFINE_NFS4_GETATTR_EVENT(nfs4_fsinfo
);
1120 DECLARE_EVENT_CLASS(nfs4_inode_callback_event
,
1122 const struct nfs_client
*clp
,
1123 const struct nfs_fh
*fhandle
,
1124 const struct inode
*inode
,
1128 TP_ARGS(clp
, fhandle
, inode
, error
),
1133 __field(u32
, fhandle
)
1134 __field(u64
, fileid
)
1135 __string(dstaddr
, clp
?
1136 rpc_peeraddr2str(clp
->cl_rpcclient
,
1137 RPC_DISPLAY_ADDR
) : "unknown")
1141 __entry
->error
= error
;
1142 __entry
->fhandle
= nfs_fhandle_hash(fhandle
);
1143 if (inode
!= NULL
) {
1144 __entry
->fileid
= NFS_FILEID(inode
);
1145 __entry
->dev
= inode
->i_sb
->s_dev
;
1147 __entry
->fileid
= 0;
1150 __assign_str(dstaddr
, clp
?
1151 rpc_peeraddr2str(clp
->cl_rpcclient
,
1152 RPC_DISPLAY_ADDR
) : "unknown")
1156 "error=%d (%s) fileid=%02x:%02x:%llu fhandle=0x%08x "
1159 show_nfsv4_errors(__entry
->error
),
1160 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1161 (unsigned long long)__entry
->fileid
,
1167 #define DEFINE_NFS4_INODE_CALLBACK_EVENT(name) \
1168 DEFINE_EVENT(nfs4_inode_callback_event, name, \
1170 const struct nfs_client *clp, \
1171 const struct nfs_fh *fhandle, \
1172 const struct inode *inode, \
1175 TP_ARGS(clp, fhandle, inode, error))
1176 DEFINE_NFS4_INODE_CALLBACK_EVENT(nfs4_cb_getattr
);
1178 DECLARE_EVENT_CLASS(nfs4_inode_stateid_callback_event
,
1180 const struct nfs_client
*clp
,
1181 const struct nfs_fh
*fhandle
,
1182 const struct inode
*inode
,
1183 const nfs4_stateid
*stateid
,
1187 TP_ARGS(clp
, fhandle
, inode
, stateid
, error
),
1192 __field(u32
, fhandle
)
1193 __field(u64
, fileid
)
1194 __string(dstaddr
, clp
?
1195 rpc_peeraddr2str(clp
->cl_rpcclient
,
1196 RPC_DISPLAY_ADDR
) : "unknown")
1197 __field(int, stateid_seq
)
1198 __field(u32
, stateid_hash
)
1202 __entry
->error
= error
;
1203 __entry
->fhandle
= nfs_fhandle_hash(fhandle
);
1204 if (inode
!= NULL
) {
1205 __entry
->fileid
= NFS_FILEID(inode
);
1206 __entry
->dev
= inode
->i_sb
->s_dev
;
1208 __entry
->fileid
= 0;
1211 __assign_str(dstaddr
, clp
?
1212 rpc_peeraddr2str(clp
->cl_rpcclient
,
1213 RPC_DISPLAY_ADDR
) : "unknown")
1214 __entry
->stateid_seq
=
1215 be32_to_cpu(stateid
->seqid
);
1216 __entry
->stateid_hash
=
1217 nfs_stateid_hash(stateid
);
1221 "error=%d (%s) fileid=%02x:%02x:%llu fhandle=0x%08x "
1222 "stateid=%d:0x%08x dstaddr=%s",
1224 show_nfsv4_errors(__entry
->error
),
1225 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1226 (unsigned long long)__entry
->fileid
,
1228 __entry
->stateid_seq
, __entry
->stateid_hash
,
1233 #define DEFINE_NFS4_INODE_STATEID_CALLBACK_EVENT(name) \
1234 DEFINE_EVENT(nfs4_inode_stateid_callback_event, name, \
1236 const struct nfs_client *clp, \
1237 const struct nfs_fh *fhandle, \
1238 const struct inode *inode, \
1239 const nfs4_stateid *stateid, \
1242 TP_ARGS(clp, fhandle, inode, stateid, error))
1243 DEFINE_NFS4_INODE_STATEID_CALLBACK_EVENT(nfs4_cb_recall
);
1244 DEFINE_NFS4_INODE_STATEID_CALLBACK_EVENT(nfs4_cb_layoutrecall_file
);
1246 DECLARE_EVENT_CLASS(nfs4_idmap_event
,
1254 TP_ARGS(name
, len
, id
, error
),
1259 __dynamic_array(char, name
, len
> 0 ? len
+ 1 : 1)
1265 __entry
->error
= error
< 0 ? error
: 0;
1267 memcpy(__get_str(name
), name
, len
);
1268 __get_str(name
)[len
] = 0;
1272 "error=%d id=%u name=%s",
1278 #define DEFINE_NFS4_IDMAP_EVENT(name) \
1279 DEFINE_EVENT(nfs4_idmap_event, name, \
1286 TP_ARGS(name, len, id, error))
1287 DEFINE_NFS4_IDMAP_EVENT(nfs4_map_name_to_uid
);
1288 DEFINE_NFS4_IDMAP_EVENT(nfs4_map_group_to_gid
);
1289 DEFINE_NFS4_IDMAP_EVENT(nfs4_map_uid_to_name
);
1290 DEFINE_NFS4_IDMAP_EVENT(nfs4_map_gid_to_group
);
1292 DECLARE_EVENT_CLASS(nfs4_read_event
,
1294 const struct nfs_pgio_header
*hdr
,
1298 TP_ARGS(hdr
, error
),
1302 __field(u32
, fhandle
)
1303 __field(u64
, fileid
)
1304 __field(loff_t
, offset
)
1305 __field(size_t, count
)
1307 __field(int, stateid_seq
)
1308 __field(u32
, stateid_hash
)
1312 const struct inode
*inode
= hdr
->inode
;
1313 const struct nfs4_state
*state
=
1314 hdr
->args
.context
->state
;
1315 __entry
->dev
= inode
->i_sb
->s_dev
;
1316 __entry
->fileid
= NFS_FILEID(inode
);
1317 __entry
->fhandle
= nfs_fhandle_hash(NFS_FH(inode
));
1318 __entry
->offset
= hdr
->args
.offset
;
1319 __entry
->count
= hdr
->args
.count
;
1320 __entry
->error
= error
;
1321 __entry
->stateid_seq
=
1322 be32_to_cpu(state
->stateid
.seqid
);
1323 __entry
->stateid_hash
=
1324 nfs_stateid_hash(&state
->stateid
);
1328 "error=%d (%s) fileid=%02x:%02x:%llu fhandle=0x%08x "
1329 "offset=%lld count=%zu stateid=%d:0x%08x",
1331 show_nfsv4_errors(__entry
->error
),
1332 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1333 (unsigned long long)__entry
->fileid
,
1335 (long long)__entry
->offset
,
1337 __entry
->stateid_seq
, __entry
->stateid_hash
1340 #define DEFINE_NFS4_READ_EVENT(name) \
1341 DEFINE_EVENT(nfs4_read_event, name, \
1343 const struct nfs_pgio_header *hdr, \
1346 TP_ARGS(hdr, error))
1347 DEFINE_NFS4_READ_EVENT(nfs4_read
);
1348 #ifdef CONFIG_NFS_V4_1
1349 DEFINE_NFS4_READ_EVENT(nfs4_pnfs_read
);
1350 #endif /* CONFIG_NFS_V4_1 */
1352 DECLARE_EVENT_CLASS(nfs4_write_event
,
1354 const struct nfs_pgio_header
*hdr
,
1358 TP_ARGS(hdr
, error
),
1362 __field(u32
, fhandle
)
1363 __field(u64
, fileid
)
1364 __field(loff_t
, offset
)
1365 __field(size_t, count
)
1367 __field(int, stateid_seq
)
1368 __field(u32
, stateid_hash
)
1372 const struct inode
*inode
= hdr
->inode
;
1373 const struct nfs4_state
*state
=
1374 hdr
->args
.context
->state
;
1375 __entry
->dev
= inode
->i_sb
->s_dev
;
1376 __entry
->fileid
= NFS_FILEID(inode
);
1377 __entry
->fhandle
= nfs_fhandle_hash(NFS_FH(inode
));
1378 __entry
->offset
= hdr
->args
.offset
;
1379 __entry
->count
= hdr
->args
.count
;
1380 __entry
->error
= error
;
1381 __entry
->stateid_seq
=
1382 be32_to_cpu(state
->stateid
.seqid
);
1383 __entry
->stateid_hash
=
1384 nfs_stateid_hash(&state
->stateid
);
1388 "error=%d (%s) fileid=%02x:%02x:%llu fhandle=0x%08x "
1389 "offset=%lld count=%zu stateid=%d:0x%08x",
1391 show_nfsv4_errors(__entry
->error
),
1392 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1393 (unsigned long long)__entry
->fileid
,
1395 (long long)__entry
->offset
,
1397 __entry
->stateid_seq
, __entry
->stateid_hash
1401 #define DEFINE_NFS4_WRITE_EVENT(name) \
1402 DEFINE_EVENT(nfs4_write_event, name, \
1404 const struct nfs_pgio_header *hdr, \
1407 TP_ARGS(hdr, error))
1408 DEFINE_NFS4_WRITE_EVENT(nfs4_write
);
1409 #ifdef CONFIG_NFS_V4_1
1410 DEFINE_NFS4_WRITE_EVENT(nfs4_pnfs_write
);
1411 #endif /* CONFIG_NFS_V4_1 */
1413 DECLARE_EVENT_CLASS(nfs4_commit_event
,
1415 const struct nfs_commit_data
*data
,
1419 TP_ARGS(data
, error
),
1423 __field(u32
, fhandle
)
1424 __field(u64
, fileid
)
1425 __field(loff_t
, offset
)
1426 __field(size_t, count
)
1431 const struct inode
*inode
= data
->inode
;
1432 __entry
->dev
= inode
->i_sb
->s_dev
;
1433 __entry
->fileid
= NFS_FILEID(inode
);
1434 __entry
->fhandle
= nfs_fhandle_hash(NFS_FH(inode
));
1435 __entry
->offset
= data
->args
.offset
;
1436 __entry
->count
= data
->args
.count
;
1437 __entry
->error
= error
;
1441 "error=%d (%s) fileid=%02x:%02x:%llu fhandle=0x%08x "
1442 "offset=%lld count=%zu",
1444 show_nfsv4_errors(__entry
->error
),
1445 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1446 (unsigned long long)__entry
->fileid
,
1448 (long long)__entry
->offset
,
1452 #define DEFINE_NFS4_COMMIT_EVENT(name) \
1453 DEFINE_EVENT(nfs4_commit_event, name, \
1455 const struct nfs_commit_data *data, \
1458 TP_ARGS(data, error))
1459 DEFINE_NFS4_COMMIT_EVENT(nfs4_commit
);
1460 #ifdef CONFIG_NFS_V4_1
1461 DEFINE_NFS4_COMMIT_EVENT(nfs4_pnfs_commit_ds
);
1463 #define show_pnfs_iomode(iomode) \
1464 __print_symbolic(iomode, \
1465 { IOMODE_READ, "READ" }, \
1466 { IOMODE_RW, "RW" }, \
1467 { IOMODE_ANY, "ANY" })
1469 TRACE_EVENT(nfs4_layoutget
,
1471 const struct nfs_open_context
*ctx
,
1472 const struct pnfs_layout_range
*args
,
1473 const struct pnfs_layout_range
*res
,
1474 const nfs4_stateid
*layout_stateid
,
1478 TP_ARGS(ctx
, args
, res
, layout_stateid
, error
),
1482 __field(u32
, fhandle
)
1483 __field(u64
, fileid
)
1484 __field(u32
, iomode
)
1485 __field(u64
, offset
)
1488 __field(int, stateid_seq
)
1489 __field(u32
, stateid_hash
)
1490 __field(int, layoutstateid_seq
)
1491 __field(u32
, layoutstateid_hash
)
1495 const struct inode
*inode
= d_inode(ctx
->dentry
);
1496 const struct nfs4_state
*state
= ctx
->state
;
1497 __entry
->dev
= inode
->i_sb
->s_dev
;
1498 __entry
->fileid
= NFS_FILEID(inode
);
1499 __entry
->fhandle
= nfs_fhandle_hash(NFS_FH(inode
));
1500 __entry
->iomode
= args
->iomode
;
1501 __entry
->offset
= args
->offset
;
1502 __entry
->count
= args
->length
;
1503 __entry
->error
= error
;
1504 __entry
->stateid_seq
=
1505 be32_to_cpu(state
->stateid
.seqid
);
1506 __entry
->stateid_hash
=
1507 nfs_stateid_hash(&state
->stateid
);
1509 __entry
->layoutstateid_seq
=
1510 be32_to_cpu(layout_stateid
->seqid
);
1511 __entry
->layoutstateid_hash
=
1512 nfs_stateid_hash(layout_stateid
);
1514 __entry
->layoutstateid_seq
= 0;
1515 __entry
->layoutstateid_hash
= 0;
1520 "error=%d (%s) fileid=%02x:%02x:%llu fhandle=0x%08x "
1521 "iomode=%s offset=%llu count=%llu stateid=%d:0x%08x "
1522 "layoutstateid=%d:0x%08x",
1524 show_nfsv4_errors(__entry
->error
),
1525 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1526 (unsigned long long)__entry
->fileid
,
1528 show_pnfs_iomode(__entry
->iomode
),
1529 (unsigned long long)__entry
->offset
,
1530 (unsigned long long)__entry
->count
,
1531 __entry
->stateid_seq
, __entry
->stateid_hash
,
1532 __entry
->layoutstateid_seq
, __entry
->layoutstateid_hash
1536 DEFINE_NFS4_INODE_STATEID_EVENT(nfs4_layoutcommit
);
1537 DEFINE_NFS4_INODE_STATEID_EVENT(nfs4_layoutreturn
);
1538 DEFINE_NFS4_INODE_EVENT(nfs4_layoutreturn_on_close
);
1540 #define show_pnfs_update_layout_reason(reason) \
1541 __print_symbolic(reason, \
1542 { PNFS_UPDATE_LAYOUT_UNKNOWN, "unknown" }, \
1543 { PNFS_UPDATE_LAYOUT_NO_PNFS, "no pnfs" }, \
1544 { PNFS_UPDATE_LAYOUT_RD_ZEROLEN, "read+zerolen" }, \
1545 { PNFS_UPDATE_LAYOUT_MDSTHRESH, "mdsthresh" }, \
1546 { PNFS_UPDATE_LAYOUT_NOMEM, "nomem" }, \
1547 { PNFS_UPDATE_LAYOUT_BULK_RECALL, "bulk recall" }, \
1548 { PNFS_UPDATE_LAYOUT_IO_TEST_FAIL, "io test fail" }, \
1549 { PNFS_UPDATE_LAYOUT_FOUND_CACHED, "found cached" }, \
1550 { PNFS_UPDATE_LAYOUT_RETURN, "layoutreturn" }, \
1551 { PNFS_UPDATE_LAYOUT_BLOCKED, "layouts blocked" }, \
1552 { PNFS_UPDATE_LAYOUT_INVALID_OPEN, "invalid open" }, \
1553 { PNFS_UPDATE_LAYOUT_RETRY, "retrying" }, \
1554 { PNFS_UPDATE_LAYOUT_SEND_LAYOUTGET, "sent layoutget" })
1556 TRACE_EVENT(pnfs_update_layout
,
1557 TP_PROTO(struct inode
*inode
,
1560 enum pnfs_iomode iomode
,
1561 struct pnfs_layout_hdr
*lo
,
1562 struct pnfs_layout_segment
*lseg
,
1563 enum pnfs_update_layout_reason reason
1565 TP_ARGS(inode
, pos
, count
, iomode
, lo
, lseg
, reason
),
1568 __field(u64
, fileid
)
1569 __field(u32
, fhandle
)
1570 __field(loff_t
, pos
)
1572 __field(enum pnfs_iomode
, iomode
)
1573 __field(int, layoutstateid_seq
)
1574 __field(u32
, layoutstateid_hash
)
1576 __field(enum pnfs_update_layout_reason
, reason
)
1579 __entry
->dev
= inode
->i_sb
->s_dev
;
1580 __entry
->fileid
= NFS_FILEID(inode
);
1581 __entry
->fhandle
= nfs_fhandle_hash(NFS_FH(inode
));
1583 __entry
->count
= count
;
1584 __entry
->iomode
= iomode
;
1585 __entry
->reason
= reason
;
1587 __entry
->layoutstateid_seq
=
1588 be32_to_cpu(lo
->plh_stateid
.seqid
);
1589 __entry
->layoutstateid_hash
=
1590 nfs_stateid_hash(&lo
->plh_stateid
);
1592 __entry
->layoutstateid_seq
= 0;
1593 __entry
->layoutstateid_hash
= 0;
1595 __entry
->lseg
= (long)lseg
;
1598 "fileid=%02x:%02x:%llu fhandle=0x%08x "
1599 "iomode=%s pos=%llu count=%llu "
1600 "layoutstateid=%d:0x%08x lseg=0x%lx (%s)",
1601 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1602 (unsigned long long)__entry
->fileid
,
1604 show_pnfs_iomode(__entry
->iomode
),
1605 (unsigned long long)__entry
->pos
,
1606 (unsigned long long)__entry
->count
,
1607 __entry
->layoutstateid_seq
, __entry
->layoutstateid_hash
,
1609 show_pnfs_update_layout_reason(__entry
->reason
)
1613 #endif /* CONFIG_NFS_V4_1 */
1615 #endif /* _TRACE_NFS4_H */
1617 #undef TRACE_INCLUDE_PATH
1618 #define TRACE_INCLUDE_PATH .
1619 #define TRACE_INCLUDE_FILE nfs4trace
1620 /* This part must be outside protection */
1621 #include <trace/define_trace.h>