1 /* SPDX-License-Identifier: GPL-2.0 */
3 * Copyright (c) 2013 Trond Myklebust <Trond.Myklebust@netapp.com>
6 #define TRACE_SYSTEM nfs4
8 #if !defined(_TRACE_NFS4_H) || defined(TRACE_HEADER_MULTI_READ)
11 #include <linux/tracepoint.h>
13 #define show_nfsv4_errors(error) \
14 __print_symbolic(error, \
16 /* Mapped by nfs4_stat_to_errno() */ \
17 { -EPERM, "EPERM" }, \
18 { -ENOENT, "ENOENT" }, \
20 { -ENXIO, "ENXIO" }, \
21 { -EACCES, "EACCES" }, \
22 { -EEXIST, "EEXIST" }, \
23 { -EXDEV, "EXDEV" }, \
24 { -ENOTDIR, "ENOTDIR" }, \
25 { -EISDIR, "EISDIR" }, \
26 { -EFBIG, "EFBIG" }, \
27 { -ENOSPC, "ENOSPC" }, \
28 { -EROFS, "EROFS" }, \
29 { -EMLINK, "EMLINK" }, \
30 { -ENAMETOOLONG, "ENAMETOOLONG" }, \
31 { -ENOTEMPTY, "ENOTEMPTY" }, \
32 { -EDQUOT, "EDQUOT" }, \
33 { -ESTALE, "ESTALE" }, \
34 { -EBADHANDLE, "EBADHANDLE" }, \
35 { -EBADCOOKIE, "EBADCOOKIE" }, \
36 { -ENOTSUPP, "ENOTSUPP" }, \
37 { -ETOOSMALL, "ETOOSMALL" }, \
38 { -EREMOTEIO, "EREMOTEIO" }, \
39 { -EBADTYPE, "EBADTYPE" }, \
40 { -EAGAIN, "EAGAIN" }, \
41 { -ELOOP, "ELOOP" }, \
42 { -EOPNOTSUPP, "EOPNOTSUPP" }, \
43 { -EDEADLK, "EDEADLK" }, \
45 { -ENOMEM, "ENOMEM" }, \
46 { -EKEYEXPIRED, "EKEYEXPIRED" }, \
47 { -ETIMEDOUT, "ETIMEDOUT" }, \
48 { -ERESTARTSYS, "ERESTARTSYS" }, \
49 { -ECONNREFUSED, "ECONNREFUSED" }, \
50 { -ECONNRESET, "ECONNRESET" }, \
51 { -ENETUNREACH, "ENETUNREACH" }, \
52 { -EHOSTUNREACH, "EHOSTUNREACH" }, \
53 { -EHOSTDOWN, "EHOSTDOWN" }, \
54 { -EPIPE, "EPIPE" }, \
55 { -EPFNOSUPPORT, "EPFNOSUPPORT" }, \
56 { -EPROTONOSUPPORT, "EPROTONOSUPPORT" }, \
57 /* NFSv4 native errors */ \
58 { -NFS4ERR_ACCESS, "ACCESS" }, \
59 { -NFS4ERR_ATTRNOTSUPP, "ATTRNOTSUPP" }, \
60 { -NFS4ERR_ADMIN_REVOKED, "ADMIN_REVOKED" }, \
61 { -NFS4ERR_BACK_CHAN_BUSY, "BACK_CHAN_BUSY" }, \
62 { -NFS4ERR_BADCHAR, "BADCHAR" }, \
63 { -NFS4ERR_BADHANDLE, "BADHANDLE" }, \
64 { -NFS4ERR_BADIOMODE, "BADIOMODE" }, \
65 { -NFS4ERR_BADLAYOUT, "BADLAYOUT" }, \
66 { -NFS4ERR_BADLABEL, "BADLABEL" }, \
67 { -NFS4ERR_BADNAME, "BADNAME" }, \
68 { -NFS4ERR_BADOWNER, "BADOWNER" }, \
69 { -NFS4ERR_BADSESSION, "BADSESSION" }, \
70 { -NFS4ERR_BADSLOT, "BADSLOT" }, \
71 { -NFS4ERR_BADTYPE, "BADTYPE" }, \
72 { -NFS4ERR_BADXDR, "BADXDR" }, \
73 { -NFS4ERR_BAD_COOKIE, "BAD_COOKIE" }, \
74 { -NFS4ERR_BAD_HIGH_SLOT, "BAD_HIGH_SLOT" }, \
75 { -NFS4ERR_BAD_RANGE, "BAD_RANGE" }, \
76 { -NFS4ERR_BAD_SEQID, "BAD_SEQID" }, \
77 { -NFS4ERR_BAD_SESSION_DIGEST, "BAD_SESSION_DIGEST" }, \
78 { -NFS4ERR_BAD_STATEID, "BAD_STATEID" }, \
79 { -NFS4ERR_CB_PATH_DOWN, "CB_PATH_DOWN" }, \
80 { -NFS4ERR_CLID_INUSE, "CLID_INUSE" }, \
81 { -NFS4ERR_CLIENTID_BUSY, "CLIENTID_BUSY" }, \
82 { -NFS4ERR_COMPLETE_ALREADY, "COMPLETE_ALREADY" }, \
83 { -NFS4ERR_CONN_NOT_BOUND_TO_SESSION, \
84 "CONN_NOT_BOUND_TO_SESSION" }, \
85 { -NFS4ERR_DEADLOCK, "DEADLOCK" }, \
86 { -NFS4ERR_DEADSESSION, "DEAD_SESSION" }, \
87 { -NFS4ERR_DELAY, "DELAY" }, \
88 { -NFS4ERR_DELEG_ALREADY_WANTED, \
89 "DELEG_ALREADY_WANTED" }, \
90 { -NFS4ERR_DELEG_REVOKED, "DELEG_REVOKED" }, \
91 { -NFS4ERR_DENIED, "DENIED" }, \
92 { -NFS4ERR_DIRDELEG_UNAVAIL, "DIRDELEG_UNAVAIL" }, \
93 { -NFS4ERR_DQUOT, "DQUOT" }, \
94 { -NFS4ERR_ENCR_ALG_UNSUPP, "ENCR_ALG_UNSUPP" }, \
95 { -NFS4ERR_EXIST, "EXIST" }, \
96 { -NFS4ERR_EXPIRED, "EXPIRED" }, \
97 { -NFS4ERR_FBIG, "FBIG" }, \
98 { -NFS4ERR_FHEXPIRED, "FHEXPIRED" }, \
99 { -NFS4ERR_FILE_OPEN, "FILE_OPEN" }, \
100 { -NFS4ERR_GRACE, "GRACE" }, \
101 { -NFS4ERR_HASH_ALG_UNSUPP, "HASH_ALG_UNSUPP" }, \
102 { -NFS4ERR_INVAL, "INVAL" }, \
103 { -NFS4ERR_IO, "IO" }, \
104 { -NFS4ERR_ISDIR, "ISDIR" }, \
105 { -NFS4ERR_LAYOUTTRYLATER, "LAYOUTTRYLATER" }, \
106 { -NFS4ERR_LAYOUTUNAVAILABLE, "LAYOUTUNAVAILABLE" }, \
107 { -NFS4ERR_LEASE_MOVED, "LEASE_MOVED" }, \
108 { -NFS4ERR_LOCKED, "LOCKED" }, \
109 { -NFS4ERR_LOCKS_HELD, "LOCKS_HELD" }, \
110 { -NFS4ERR_LOCK_RANGE, "LOCK_RANGE" }, \
111 { -NFS4ERR_MINOR_VERS_MISMATCH, "MINOR_VERS_MISMATCH" }, \
112 { -NFS4ERR_MLINK, "MLINK" }, \
113 { -NFS4ERR_MOVED, "MOVED" }, \
114 { -NFS4ERR_NAMETOOLONG, "NAMETOOLONG" }, \
115 { -NFS4ERR_NOENT, "NOENT" }, \
116 { -NFS4ERR_NOFILEHANDLE, "NOFILEHANDLE" }, \
117 { -NFS4ERR_NOMATCHING_LAYOUT, "NOMATCHING_LAYOUT" }, \
118 { -NFS4ERR_NOSPC, "NOSPC" }, \
119 { -NFS4ERR_NOTDIR, "NOTDIR" }, \
120 { -NFS4ERR_NOTEMPTY, "NOTEMPTY" }, \
121 { -NFS4ERR_NOTSUPP, "NOTSUPP" }, \
122 { -NFS4ERR_NOT_ONLY_OP, "NOT_ONLY_OP" }, \
123 { -NFS4ERR_NOT_SAME, "NOT_SAME" }, \
124 { -NFS4ERR_NO_GRACE, "NO_GRACE" }, \
125 { -NFS4ERR_NXIO, "NXIO" }, \
126 { -NFS4ERR_OLD_STATEID, "OLD_STATEID" }, \
127 { -NFS4ERR_OPENMODE, "OPENMODE" }, \
128 { -NFS4ERR_OP_ILLEGAL, "OP_ILLEGAL" }, \
129 { -NFS4ERR_OP_NOT_IN_SESSION, "OP_NOT_IN_SESSION" }, \
130 { -NFS4ERR_PERM, "PERM" }, \
131 { -NFS4ERR_PNFS_IO_HOLE, "PNFS_IO_HOLE" }, \
132 { -NFS4ERR_PNFS_NO_LAYOUT, "PNFS_NO_LAYOUT" }, \
133 { -NFS4ERR_RECALLCONFLICT, "RECALLCONFLICT" }, \
134 { -NFS4ERR_RECLAIM_BAD, "RECLAIM_BAD" }, \
135 { -NFS4ERR_RECLAIM_CONFLICT, "RECLAIM_CONFLICT" }, \
136 { -NFS4ERR_REJECT_DELEG, "REJECT_DELEG" }, \
137 { -NFS4ERR_REP_TOO_BIG, "REP_TOO_BIG" }, \
138 { -NFS4ERR_REP_TOO_BIG_TO_CACHE, \
139 "REP_TOO_BIG_TO_CACHE" }, \
140 { -NFS4ERR_REQ_TOO_BIG, "REQ_TOO_BIG" }, \
141 { -NFS4ERR_RESOURCE, "RESOURCE" }, \
142 { -NFS4ERR_RESTOREFH, "RESTOREFH" }, \
143 { -NFS4ERR_RETRY_UNCACHED_REP, "RETRY_UNCACHED_REP" }, \
144 { -NFS4ERR_RETURNCONFLICT, "RETURNCONFLICT" }, \
145 { -NFS4ERR_ROFS, "ROFS" }, \
146 { -NFS4ERR_SAME, "SAME" }, \
147 { -NFS4ERR_SHARE_DENIED, "SHARE_DENIED" }, \
148 { -NFS4ERR_SEQUENCE_POS, "SEQUENCE_POS" }, \
149 { -NFS4ERR_SEQ_FALSE_RETRY, "SEQ_FALSE_RETRY" }, \
150 { -NFS4ERR_SEQ_MISORDERED, "SEQ_MISORDERED" }, \
151 { -NFS4ERR_SERVERFAULT, "SERVERFAULT" }, \
152 { -NFS4ERR_STALE, "STALE" }, \
153 { -NFS4ERR_STALE_CLIENTID, "STALE_CLIENTID" }, \
154 { -NFS4ERR_STALE_STATEID, "STALE_STATEID" }, \
155 { -NFS4ERR_SYMLINK, "SYMLINK" }, \
156 { -NFS4ERR_TOOSMALL, "TOOSMALL" }, \
157 { -NFS4ERR_TOO_MANY_OPS, "TOO_MANY_OPS" }, \
158 { -NFS4ERR_UNKNOWN_LAYOUTTYPE, "UNKNOWN_LAYOUTTYPE" }, \
159 { -NFS4ERR_UNSAFE_COMPOUND, "UNSAFE_COMPOUND" }, \
160 { -NFS4ERR_WRONGSEC, "WRONGSEC" }, \
161 { -NFS4ERR_WRONG_CRED, "WRONG_CRED" }, \
162 { -NFS4ERR_WRONG_TYPE, "WRONG_TYPE" }, \
163 { -NFS4ERR_XDEV, "XDEV" })
165 #define show_open_flags(flags) \
166 __print_flags(flags, "|", \
167 { O_CREAT, "O_CREAT" }, \
168 { O_EXCL, "O_EXCL" }, \
169 { O_TRUNC, "O_TRUNC" }, \
170 { O_DIRECT, "O_DIRECT" })
172 #define show_fmode_flags(mode) \
173 __print_flags(mode, "|", \
174 { ((__force unsigned long)FMODE_READ), "READ" }, \
175 { ((__force unsigned long)FMODE_WRITE), "WRITE" }, \
176 { ((__force unsigned long)FMODE_EXEC), "EXEC" })
178 #define show_nfs_fattr_flags(valid) \
179 __print_flags((unsigned long)valid, "|", \
180 { NFS_ATTR_FATTR_TYPE, "TYPE" }, \
181 { NFS_ATTR_FATTR_MODE, "MODE" }, \
182 { NFS_ATTR_FATTR_NLINK, "NLINK" }, \
183 { NFS_ATTR_FATTR_OWNER, "OWNER" }, \
184 { NFS_ATTR_FATTR_GROUP, "GROUP" }, \
185 { NFS_ATTR_FATTR_RDEV, "RDEV" }, \
186 { NFS_ATTR_FATTR_SIZE, "SIZE" }, \
187 { NFS_ATTR_FATTR_FSID, "FSID" }, \
188 { NFS_ATTR_FATTR_FILEID, "FILEID" }, \
189 { NFS_ATTR_FATTR_ATIME, "ATIME" }, \
190 { NFS_ATTR_FATTR_MTIME, "MTIME" }, \
191 { NFS_ATTR_FATTR_CTIME, "CTIME" }, \
192 { NFS_ATTR_FATTR_CHANGE, "CHANGE" }, \
193 { NFS_ATTR_FATTR_OWNER_NAME, "OWNER_NAME" }, \
194 { NFS_ATTR_FATTR_GROUP_NAME, "GROUP_NAME" })
196 DECLARE_EVENT_CLASS(nfs4_clientid_event
,
198 const struct nfs_client
*clp
,
205 __string(dstaddr
, clp
->cl_hostname
)
210 __entry
->error
= error
;
211 __assign_str(dstaddr
, clp
->cl_hostname
);
215 "error=%d (%s) dstaddr=%s",
217 show_nfsv4_errors(__entry
->error
),
221 #define DEFINE_NFS4_CLIENTID_EVENT(name) \
222 DEFINE_EVENT(nfs4_clientid_event, name, \
224 const struct nfs_client *clp, \
228 DEFINE_NFS4_CLIENTID_EVENT(nfs4_setclientid
);
229 DEFINE_NFS4_CLIENTID_EVENT(nfs4_setclientid_confirm
);
230 DEFINE_NFS4_CLIENTID_EVENT(nfs4_renew
);
231 DEFINE_NFS4_CLIENTID_EVENT(nfs4_renew_async
);
232 #ifdef CONFIG_NFS_V4_1
233 DEFINE_NFS4_CLIENTID_EVENT(nfs4_exchange_id
);
234 DEFINE_NFS4_CLIENTID_EVENT(nfs4_create_session
);
235 DEFINE_NFS4_CLIENTID_EVENT(nfs4_destroy_session
);
236 DEFINE_NFS4_CLIENTID_EVENT(nfs4_destroy_clientid
);
237 DEFINE_NFS4_CLIENTID_EVENT(nfs4_bind_conn_to_session
);
238 DEFINE_NFS4_CLIENTID_EVENT(nfs4_sequence
);
239 DEFINE_NFS4_CLIENTID_EVENT(nfs4_reclaim_complete
);
241 #define show_nfs4_sequence_status_flags(status) \
242 __print_flags((unsigned long)status, "|", \
243 { SEQ4_STATUS_CB_PATH_DOWN, "CB_PATH_DOWN" }, \
244 { SEQ4_STATUS_CB_GSS_CONTEXTS_EXPIRING, \
245 "CB_GSS_CONTEXTS_EXPIRING" }, \
246 { SEQ4_STATUS_CB_GSS_CONTEXTS_EXPIRED, \
247 "CB_GSS_CONTEXTS_EXPIRED" }, \
248 { SEQ4_STATUS_EXPIRED_ALL_STATE_REVOKED, \
249 "EXPIRED_ALL_STATE_REVOKED" }, \
250 { SEQ4_STATUS_EXPIRED_SOME_STATE_REVOKED, \
251 "EXPIRED_SOME_STATE_REVOKED" }, \
252 { SEQ4_STATUS_ADMIN_STATE_REVOKED, \
253 "ADMIN_STATE_REVOKED" }, \
254 { SEQ4_STATUS_RECALLABLE_STATE_REVOKED, \
255 "RECALLABLE_STATE_REVOKED" }, \
256 { SEQ4_STATUS_LEASE_MOVED, "LEASE_MOVED" }, \
257 { SEQ4_STATUS_RESTART_RECLAIM_NEEDED, \
258 "RESTART_RECLAIM_NEEDED" }, \
259 { SEQ4_STATUS_CB_PATH_DOWN_SESSION, \
260 "CB_PATH_DOWN_SESSION" }, \
261 { SEQ4_STATUS_BACKCHANNEL_FAULT, \
262 "BACKCHANNEL_FAULT" })
264 TRACE_EVENT(nfs4_sequence_done
,
266 const struct nfs4_session
*session
,
267 const struct nfs4_sequence_res
*res
269 TP_ARGS(session
, res
),
272 __field(unsigned int, session
)
273 __field(unsigned int, slot_nr
)
274 __field(unsigned int, seq_nr
)
275 __field(unsigned int, highest_slotid
)
276 __field(unsigned int, target_highest_slotid
)
277 __field(unsigned int, status_flags
)
282 const struct nfs4_slot
*sr_slot
= res
->sr_slot
;
283 __entry
->session
= nfs_session_id_hash(&session
->sess_id
);
284 __entry
->slot_nr
= sr_slot
->slot_nr
;
285 __entry
->seq_nr
= sr_slot
->seq_nr
;
286 __entry
->highest_slotid
= res
->sr_highest_slotid
;
287 __entry
->target_highest_slotid
=
288 res
->sr_target_highest_slotid
;
289 __entry
->status_flags
= res
->sr_status_flags
;
290 __entry
->error
= res
->sr_status
;
293 "error=%d (%s) session=0x%08x slot_nr=%u seq_nr=%u "
294 "highest_slotid=%u target_highest_slotid=%u "
295 "status_flags=%u (%s)",
297 show_nfsv4_errors(__entry
->error
),
301 __entry
->highest_slotid
,
302 __entry
->target_highest_slotid
,
303 __entry
->status_flags
,
304 show_nfs4_sequence_status_flags(__entry
->status_flags
)
308 struct cb_sequenceargs
;
309 struct cb_sequenceres
;
311 TRACE_EVENT(nfs4_cb_sequence
,
313 const struct cb_sequenceargs
*args
,
314 const struct cb_sequenceres
*res
,
317 TP_ARGS(args
, res
, status
),
320 __field(unsigned int, session
)
321 __field(unsigned int, slot_nr
)
322 __field(unsigned int, seq_nr
)
323 __field(unsigned int, highest_slotid
)
324 __field(unsigned int, cachethis
)
329 __entry
->session
= nfs_session_id_hash(&args
->csa_sessionid
);
330 __entry
->slot_nr
= args
->csa_slotid
;
331 __entry
->seq_nr
= args
->csa_sequenceid
;
332 __entry
->highest_slotid
= args
->csa_highestslotid
;
333 __entry
->cachethis
= args
->csa_cachethis
;
334 __entry
->error
= -be32_to_cpu(status
);
338 "error=%d (%s) session=0x%08x slot_nr=%u seq_nr=%u "
341 show_nfsv4_errors(__entry
->error
),
345 __entry
->highest_slotid
348 #endif /* CONFIG_NFS_V4_1 */
350 TRACE_EVENT(nfs4_setup_sequence
,
352 const struct nfs4_session
*session
,
353 const struct nfs4_sequence_args
*args
355 TP_ARGS(session
, args
),
358 __field(unsigned int, session
)
359 __field(unsigned int, slot_nr
)
360 __field(unsigned int, seq_nr
)
361 __field(unsigned int, highest_used_slotid
)
365 const struct nfs4_slot
*sa_slot
= args
->sa_slot
;
366 __entry
->session
= session
? nfs_session_id_hash(&session
->sess_id
) : 0;
367 __entry
->slot_nr
= sa_slot
->slot_nr
;
368 __entry
->seq_nr
= sa_slot
->seq_nr
;
369 __entry
->highest_used_slotid
=
370 sa_slot
->table
->highest_used_slotid
;
373 "session=0x%08x slot_nr=%u seq_nr=%u "
374 "highest_used_slotid=%u",
378 __entry
->highest_used_slotid
382 DECLARE_EVENT_CLASS(nfs4_open_event
,
384 const struct nfs_open_context
*ctx
,
389 TP_ARGS(ctx
, flags
, error
),
393 __field(unsigned int, flags
)
394 __field(unsigned int, fmode
)
396 __field(u32
, fhandle
)
399 __string(name
, ctx
->dentry
->d_name
.name
)
400 __field(int, stateid_seq
)
401 __field(u32
, stateid_hash
)
402 __field(int, openstateid_seq
)
403 __field(u32
, openstateid_hash
)
407 const struct nfs4_state
*state
= ctx
->state
;
408 const struct inode
*inode
= NULL
;
410 __entry
->error
= error
;
411 __entry
->flags
= flags
;
412 __entry
->fmode
= (__force
unsigned int)ctx
->mode
;
413 __entry
->dev
= ctx
->dentry
->d_sb
->s_dev
;
414 if (!IS_ERR_OR_NULL(state
)) {
415 inode
= state
->inode
;
416 __entry
->stateid_seq
=
417 be32_to_cpu(state
->stateid
.seqid
);
418 __entry
->stateid_hash
=
419 nfs_stateid_hash(&state
->stateid
);
420 __entry
->openstateid_seq
=
421 be32_to_cpu(state
->open_stateid
.seqid
);
422 __entry
->openstateid_hash
=
423 nfs_stateid_hash(&state
->open_stateid
);
425 __entry
->stateid_seq
= 0;
426 __entry
->stateid_hash
= 0;
427 __entry
->openstateid_seq
= 0;
428 __entry
->openstateid_hash
= 0;
431 __entry
->fileid
= NFS_FILEID(inode
);
432 __entry
->fhandle
= nfs_fhandle_hash(NFS_FH(inode
));
435 __entry
->fhandle
= 0;
437 __entry
->dir
= NFS_FILEID(d_inode(ctx
->dentry
->d_parent
));
438 __assign_str(name
, ctx
->dentry
->d_name
.name
);
442 "error=%d (%s) flags=%d (%s) fmode=%s "
443 "fileid=%02x:%02x:%llu fhandle=0x%08x "
444 "name=%02x:%02x:%llu/%s stateid=%d:0x%08x "
445 "openstateid=%d:0x%08x",
447 show_nfsv4_errors(__entry
->error
),
449 show_open_flags(__entry
->flags
),
450 show_fmode_flags(__entry
->fmode
),
451 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
452 (unsigned long long)__entry
->fileid
,
454 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
455 (unsigned long long)__entry
->dir
,
457 __entry
->stateid_seq
, __entry
->stateid_hash
,
458 __entry
->openstateid_seq
, __entry
->openstateid_hash
462 #define DEFINE_NFS4_OPEN_EVENT(name) \
463 DEFINE_EVENT(nfs4_open_event, name, \
465 const struct nfs_open_context *ctx, \
469 TP_ARGS(ctx, flags, error))
470 DEFINE_NFS4_OPEN_EVENT(nfs4_open_reclaim
);
471 DEFINE_NFS4_OPEN_EVENT(nfs4_open_expired
);
472 DEFINE_NFS4_OPEN_EVENT(nfs4_open_file
);
474 TRACE_EVENT(nfs4_cached_open
,
476 const struct nfs4_state
*state
481 __field(u32
, fhandle
)
483 __field(unsigned int, fmode
)
484 __field(int, stateid_seq
)
485 __field(u32
, stateid_hash
)
489 const struct inode
*inode
= state
->inode
;
491 __entry
->dev
= inode
->i_sb
->s_dev
;
492 __entry
->fileid
= NFS_FILEID(inode
);
493 __entry
->fhandle
= nfs_fhandle_hash(NFS_FH(inode
));
494 __entry
->fmode
= (__force
unsigned int)state
->state
;
495 __entry
->stateid_seq
=
496 be32_to_cpu(state
->stateid
.seqid
);
497 __entry
->stateid_hash
=
498 nfs_stateid_hash(&state
->stateid
);
502 "fmode=%s fileid=%02x:%02x:%llu "
503 "fhandle=0x%08x stateid=%d:0x%08x",
504 __entry
->fmode
? show_fmode_flags(__entry
->fmode
) :
506 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
507 (unsigned long long)__entry
->fileid
,
509 __entry
->stateid_seq
, __entry
->stateid_hash
513 TRACE_EVENT(nfs4_close
,
515 const struct nfs4_state
*state
,
516 const struct nfs_closeargs
*args
,
517 const struct nfs_closeres
*res
,
521 TP_ARGS(state
, args
, res
, error
),
525 __field(u32
, fhandle
)
527 __field(unsigned int, fmode
)
529 __field(int, stateid_seq
)
530 __field(u32
, stateid_hash
)
534 const struct inode
*inode
= state
->inode
;
536 __entry
->dev
= inode
->i_sb
->s_dev
;
537 __entry
->fileid
= NFS_FILEID(inode
);
538 __entry
->fhandle
= nfs_fhandle_hash(NFS_FH(inode
));
539 __entry
->fmode
= (__force
unsigned int)state
->state
;
540 __entry
->error
= error
;
541 __entry
->stateid_seq
=
542 be32_to_cpu(args
->stateid
.seqid
);
543 __entry
->stateid_hash
=
544 nfs_stateid_hash(&args
->stateid
);
548 "error=%d (%s) fmode=%s fileid=%02x:%02x:%llu "
549 "fhandle=0x%08x openstateid=%d:0x%08x",
551 show_nfsv4_errors(__entry
->error
),
552 __entry
->fmode
? show_fmode_flags(__entry
->fmode
) :
554 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
555 (unsigned long long)__entry
->fileid
,
557 __entry
->stateid_seq
, __entry
->stateid_hash
561 #define show_lock_cmd(type) \
562 __print_symbolic((int)type, \
563 { F_GETLK, "GETLK" }, \
564 { F_SETLK, "SETLK" }, \
565 { F_SETLKW, "SETLKW" })
566 #define show_lock_type(type) \
567 __print_symbolic((int)type, \
568 { F_RDLCK, "RDLCK" }, \
569 { F_WRLCK, "WRLCK" }, \
570 { F_UNLCK, "UNLCK" })
572 DECLARE_EVENT_CLASS(nfs4_lock_event
,
574 const struct file_lock
*request
,
575 const struct nfs4_state
*state
,
580 TP_ARGS(request
, state
, cmd
, error
),
586 __field(loff_t
, start
)
589 __field(u32
, fhandle
)
591 __field(int, stateid_seq
)
592 __field(u32
, stateid_hash
)
596 const struct inode
*inode
= state
->inode
;
598 __entry
->error
= error
;
600 __entry
->type
= request
->fl_type
;
601 __entry
->start
= request
->fl_start
;
602 __entry
->end
= request
->fl_end
;
603 __entry
->dev
= inode
->i_sb
->s_dev
;
604 __entry
->fileid
= NFS_FILEID(inode
);
605 __entry
->fhandle
= nfs_fhandle_hash(NFS_FH(inode
));
606 __entry
->stateid_seq
=
607 be32_to_cpu(state
->stateid
.seqid
);
608 __entry
->stateid_hash
=
609 nfs_stateid_hash(&state
->stateid
);
613 "error=%d (%s) cmd=%s:%s range=%lld:%lld "
614 "fileid=%02x:%02x:%llu fhandle=0x%08x "
617 show_nfsv4_errors(__entry
->error
),
618 show_lock_cmd(__entry
->cmd
),
619 show_lock_type(__entry
->type
),
620 (long long)__entry
->start
,
621 (long long)__entry
->end
,
622 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
623 (unsigned long long)__entry
->fileid
,
625 __entry
->stateid_seq
, __entry
->stateid_hash
629 #define DEFINE_NFS4_LOCK_EVENT(name) \
630 DEFINE_EVENT(nfs4_lock_event, name, \
632 const struct file_lock *request, \
633 const struct nfs4_state *state, \
637 TP_ARGS(request, state, cmd, error))
638 DEFINE_NFS4_LOCK_EVENT(nfs4_get_lock
);
639 DEFINE_NFS4_LOCK_EVENT(nfs4_unlock
);
641 TRACE_EVENT(nfs4_set_lock
,
643 const struct file_lock
*request
,
644 const struct nfs4_state
*state
,
645 const nfs4_stateid
*lockstateid
,
650 TP_ARGS(request
, state
, lockstateid
, cmd
, error
),
656 __field(loff_t
, start
)
659 __field(u32
, fhandle
)
661 __field(int, stateid_seq
)
662 __field(u32
, stateid_hash
)
663 __field(int, lockstateid_seq
)
664 __field(u32
, lockstateid_hash
)
668 const struct inode
*inode
= state
->inode
;
670 __entry
->error
= error
;
672 __entry
->type
= request
->fl_type
;
673 __entry
->start
= request
->fl_start
;
674 __entry
->end
= request
->fl_end
;
675 __entry
->dev
= inode
->i_sb
->s_dev
;
676 __entry
->fileid
= NFS_FILEID(inode
);
677 __entry
->fhandle
= nfs_fhandle_hash(NFS_FH(inode
));
678 __entry
->stateid_seq
=
679 be32_to_cpu(state
->stateid
.seqid
);
680 __entry
->stateid_hash
=
681 nfs_stateid_hash(&state
->stateid
);
682 __entry
->lockstateid_seq
=
683 be32_to_cpu(lockstateid
->seqid
);
684 __entry
->lockstateid_hash
=
685 nfs_stateid_hash(lockstateid
);
689 "error=%d (%s) cmd=%s:%s range=%lld:%lld "
690 "fileid=%02x:%02x:%llu fhandle=0x%08x "
691 "stateid=%d:0x%08x lockstateid=%d:0x%08x",
693 show_nfsv4_errors(__entry
->error
),
694 show_lock_cmd(__entry
->cmd
),
695 show_lock_type(__entry
->type
),
696 (long long)__entry
->start
,
697 (long long)__entry
->end
,
698 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
699 (unsigned long long)__entry
->fileid
,
701 __entry
->stateid_seq
, __entry
->stateid_hash
,
702 __entry
->lockstateid_seq
, __entry
->lockstateid_hash
706 DECLARE_EVENT_CLASS(nfs4_set_delegation_event
,
708 const struct inode
*inode
,
712 TP_ARGS(inode
, fmode
),
716 __field(u32
, fhandle
)
718 __field(unsigned int, fmode
)
722 __entry
->dev
= inode
->i_sb
->s_dev
;
723 __entry
->fileid
= NFS_FILEID(inode
);
724 __entry
->fhandle
= nfs_fhandle_hash(NFS_FH(inode
));
725 __entry
->fmode
= (__force
unsigned int)fmode
;
729 "fmode=%s fileid=%02x:%02x:%llu fhandle=0x%08x",
730 show_fmode_flags(__entry
->fmode
),
731 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
732 (unsigned long long)__entry
->fileid
,
736 #define DEFINE_NFS4_SET_DELEGATION_EVENT(name) \
737 DEFINE_EVENT(nfs4_set_delegation_event, name, \
739 const struct inode *inode, \
742 TP_ARGS(inode, fmode))
743 DEFINE_NFS4_SET_DELEGATION_EVENT(nfs4_set_delegation
);
744 DEFINE_NFS4_SET_DELEGATION_EVENT(nfs4_reclaim_delegation
);
746 TRACE_EVENT(nfs4_delegreturn_exit
,
748 const struct nfs4_delegreturnargs
*args
,
749 const struct nfs4_delegreturnres
*res
,
753 TP_ARGS(args
, res
, error
),
757 __field(u32
, fhandle
)
759 __field(int, stateid_seq
)
760 __field(u32
, stateid_hash
)
764 __entry
->dev
= res
->server
->s_dev
;
765 __entry
->fhandle
= nfs_fhandle_hash(args
->fhandle
);
766 __entry
->error
= error
;
767 __entry
->stateid_seq
=
768 be32_to_cpu(args
->stateid
->seqid
);
769 __entry
->stateid_hash
=
770 nfs_stateid_hash(args
->stateid
);
774 "error=%d (%s) dev=%02x:%02x fhandle=0x%08x "
777 show_nfsv4_errors(__entry
->error
),
778 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
780 __entry
->stateid_seq
, __entry
->stateid_hash
784 #ifdef CONFIG_NFS_V4_1
785 DECLARE_EVENT_CLASS(nfs4_test_stateid_event
,
787 const struct nfs4_state
*state
,
788 const struct nfs4_lock_state
*lsp
,
792 TP_ARGS(state
, lsp
, error
),
797 __field(u32
, fhandle
)
799 __field(int, stateid_seq
)
800 __field(u32
, stateid_hash
)
804 const struct inode
*inode
= state
->inode
;
806 __entry
->error
= error
;
807 __entry
->dev
= inode
->i_sb
->s_dev
;
808 __entry
->fileid
= NFS_FILEID(inode
);
809 __entry
->fhandle
= nfs_fhandle_hash(NFS_FH(inode
));
810 __entry
->stateid_seq
=
811 be32_to_cpu(state
->stateid
.seqid
);
812 __entry
->stateid_hash
=
813 nfs_stateid_hash(&state
->stateid
);
817 "error=%d (%s) fileid=%02x:%02x:%llu fhandle=0x%08x "
820 show_nfsv4_errors(__entry
->error
),
821 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
822 (unsigned long long)__entry
->fileid
,
824 __entry
->stateid_seq
, __entry
->stateid_hash
828 #define DEFINE_NFS4_TEST_STATEID_EVENT(name) \
829 DEFINE_EVENT(nfs4_test_stateid_event, name, \
831 const struct nfs4_state *state, \
832 const struct nfs4_lock_state *lsp, \
835 TP_ARGS(state, lsp, error))
836 DEFINE_NFS4_TEST_STATEID_EVENT(nfs4_test_delegation_stateid
);
837 DEFINE_NFS4_TEST_STATEID_EVENT(nfs4_test_open_stateid
);
838 DEFINE_NFS4_TEST_STATEID_EVENT(nfs4_test_lock_stateid
);
839 #endif /* CONFIG_NFS_V4_1 */
841 DECLARE_EVENT_CLASS(nfs4_lookup_event
,
843 const struct inode
*dir
,
844 const struct qstr
*name
,
848 TP_ARGS(dir
, name
, error
),
854 __string(name
, name
->name
)
858 __entry
->dev
= dir
->i_sb
->s_dev
;
859 __entry
->dir
= NFS_FILEID(dir
);
860 __entry
->error
= error
;
861 __assign_str(name
, name
->name
);
865 "error=%d (%s) name=%02x:%02x:%llu/%s",
867 show_nfsv4_errors(__entry
->error
),
868 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
869 (unsigned long long)__entry
->dir
,
874 #define DEFINE_NFS4_LOOKUP_EVENT(name) \
875 DEFINE_EVENT(nfs4_lookup_event, name, \
877 const struct inode *dir, \
878 const struct qstr *name, \
881 TP_ARGS(dir, name, error))
883 DEFINE_NFS4_LOOKUP_EVENT(nfs4_lookup
);
884 DEFINE_NFS4_LOOKUP_EVENT(nfs4_symlink
);
885 DEFINE_NFS4_LOOKUP_EVENT(nfs4_mkdir
);
886 DEFINE_NFS4_LOOKUP_EVENT(nfs4_mknod
);
887 DEFINE_NFS4_LOOKUP_EVENT(nfs4_remove
);
888 DEFINE_NFS4_LOOKUP_EVENT(nfs4_get_fs_locations
);
889 DEFINE_NFS4_LOOKUP_EVENT(nfs4_secinfo
);
891 TRACE_EVENT(nfs4_lookupp
,
893 const struct inode
*inode
,
897 TP_ARGS(inode
, error
),
906 __entry
->dev
= inode
->i_sb
->s_dev
;
907 __entry
->ino
= NFS_FILEID(inode
);
908 __entry
->error
= error
;
912 "error=%d (%s) inode=%02x:%02x:%llu",
914 show_nfsv4_errors(__entry
->error
),
915 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
916 (unsigned long long)__entry
->ino
920 TRACE_EVENT(nfs4_rename
,
922 const struct inode
*olddir
,
923 const struct qstr
*oldname
,
924 const struct inode
*newdir
,
925 const struct qstr
*newname
,
929 TP_ARGS(olddir
, oldname
, newdir
, newname
, error
),
935 __string(oldname
, oldname
->name
)
937 __string(newname
, newname
->name
)
941 __entry
->dev
= olddir
->i_sb
->s_dev
;
942 __entry
->olddir
= NFS_FILEID(olddir
);
943 __entry
->newdir
= NFS_FILEID(newdir
);
944 __entry
->error
= error
;
945 __assign_str(oldname
, oldname
->name
);
946 __assign_str(newname
, newname
->name
);
950 "error=%d (%s) oldname=%02x:%02x:%llu/%s "
951 "newname=%02x:%02x:%llu/%s",
953 show_nfsv4_errors(__entry
->error
),
954 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
955 (unsigned long long)__entry
->olddir
,
957 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
958 (unsigned long long)__entry
->newdir
,
963 DECLARE_EVENT_CLASS(nfs4_inode_event
,
965 const struct inode
*inode
,
969 TP_ARGS(inode
, error
),
973 __field(u32
, fhandle
)
979 __entry
->dev
= inode
->i_sb
->s_dev
;
980 __entry
->fileid
= NFS_FILEID(inode
);
981 __entry
->fhandle
= nfs_fhandle_hash(NFS_FH(inode
));
982 __entry
->error
= error
;
986 "error=%d (%s) fileid=%02x:%02x:%llu fhandle=0x%08x",
988 show_nfsv4_errors(__entry
->error
),
989 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
990 (unsigned long long)__entry
->fileid
,
995 #define DEFINE_NFS4_INODE_EVENT(name) \
996 DEFINE_EVENT(nfs4_inode_event, name, \
998 const struct inode *inode, \
1001 TP_ARGS(inode, error))
1003 DEFINE_NFS4_INODE_EVENT(nfs4_access
);
1004 DEFINE_NFS4_INODE_EVENT(nfs4_readlink
);
1005 DEFINE_NFS4_INODE_EVENT(nfs4_readdir
);
1006 DEFINE_NFS4_INODE_EVENT(nfs4_get_acl
);
1007 DEFINE_NFS4_INODE_EVENT(nfs4_set_acl
);
1008 #ifdef CONFIG_NFS_V4_SECURITY_LABEL
1009 DEFINE_NFS4_INODE_EVENT(nfs4_get_security_label
);
1010 DEFINE_NFS4_INODE_EVENT(nfs4_set_security_label
);
1011 #endif /* CONFIG_NFS_V4_SECURITY_LABEL */
1013 DECLARE_EVENT_CLASS(nfs4_inode_stateid_event
,
1015 const struct inode
*inode
,
1016 const nfs4_stateid
*stateid
,
1020 TP_ARGS(inode
, stateid
, error
),
1024 __field(u32
, fhandle
)
1025 __field(u64
, fileid
)
1027 __field(int, stateid_seq
)
1028 __field(u32
, stateid_hash
)
1032 __entry
->dev
= inode
->i_sb
->s_dev
;
1033 __entry
->fileid
= NFS_FILEID(inode
);
1034 __entry
->fhandle
= nfs_fhandle_hash(NFS_FH(inode
));
1035 __entry
->error
= error
;
1036 __entry
->stateid_seq
=
1037 be32_to_cpu(stateid
->seqid
);
1038 __entry
->stateid_hash
=
1039 nfs_stateid_hash(stateid
);
1043 "error=%d (%s) fileid=%02x:%02x:%llu fhandle=0x%08x "
1044 "stateid=%d:0x%08x",
1046 show_nfsv4_errors(__entry
->error
),
1047 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1048 (unsigned long long)__entry
->fileid
,
1050 __entry
->stateid_seq
, __entry
->stateid_hash
1054 #define DEFINE_NFS4_INODE_STATEID_EVENT(name) \
1055 DEFINE_EVENT(nfs4_inode_stateid_event, name, \
1057 const struct inode *inode, \
1058 const nfs4_stateid *stateid, \
1061 TP_ARGS(inode, stateid, error))
1063 DEFINE_NFS4_INODE_STATEID_EVENT(nfs4_setattr
);
1064 DEFINE_NFS4_INODE_STATEID_EVENT(nfs4_delegreturn
);
1065 DEFINE_NFS4_INODE_STATEID_EVENT(nfs4_open_stateid_update
);
1066 DEFINE_NFS4_INODE_STATEID_EVENT(nfs4_open_stateid_update_wait
);
1068 DECLARE_EVENT_CLASS(nfs4_getattr_event
,
1070 const struct nfs_server
*server
,
1071 const struct nfs_fh
*fhandle
,
1072 const struct nfs_fattr
*fattr
,
1076 TP_ARGS(server
, fhandle
, fattr
, error
),
1080 __field(u32
, fhandle
)
1081 __field(u64
, fileid
)
1082 __field(unsigned int, valid
)
1087 __entry
->dev
= server
->s_dev
;
1088 __entry
->valid
= fattr
->valid
;
1089 __entry
->fhandle
= nfs_fhandle_hash(fhandle
);
1090 __entry
->fileid
= (fattr
->valid
& NFS_ATTR_FATTR_FILEID
) ? fattr
->fileid
: 0;
1091 __entry
->error
= error
;
1095 "error=%d (%s) fileid=%02x:%02x:%llu fhandle=0x%08x "
1098 show_nfsv4_errors(__entry
->error
),
1099 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1100 (unsigned long long)__entry
->fileid
,
1102 show_nfs_fattr_flags(__entry
->valid
)
1106 #define DEFINE_NFS4_GETATTR_EVENT(name) \
1107 DEFINE_EVENT(nfs4_getattr_event, name, \
1109 const struct nfs_server *server, \
1110 const struct nfs_fh *fhandle, \
1111 const struct nfs_fattr *fattr, \
1114 TP_ARGS(server, fhandle, fattr, error))
1115 DEFINE_NFS4_GETATTR_EVENT(nfs4_getattr
);
1116 DEFINE_NFS4_GETATTR_EVENT(nfs4_lookup_root
);
1117 DEFINE_NFS4_GETATTR_EVENT(nfs4_fsinfo
);
1119 DECLARE_EVENT_CLASS(nfs4_inode_callback_event
,
1121 const struct nfs_client
*clp
,
1122 const struct nfs_fh
*fhandle
,
1123 const struct inode
*inode
,
1127 TP_ARGS(clp
, fhandle
, inode
, error
),
1132 __field(u32
, fhandle
)
1133 __field(u64
, fileid
)
1134 __string(dstaddr
, clp
? clp
->cl_hostname
: "unknown")
1138 __entry
->error
= error
;
1139 __entry
->fhandle
= nfs_fhandle_hash(fhandle
);
1140 if (!IS_ERR_OR_NULL(inode
)) {
1141 __entry
->fileid
= NFS_FILEID(inode
);
1142 __entry
->dev
= inode
->i_sb
->s_dev
;
1144 __entry
->fileid
= 0;
1147 __assign_str(dstaddr
, clp
? clp
->cl_hostname
: "unknown")
1151 "error=%d (%s) fileid=%02x:%02x:%llu fhandle=0x%08x "
1154 show_nfsv4_errors(__entry
->error
),
1155 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1156 (unsigned long long)__entry
->fileid
,
1162 #define DEFINE_NFS4_INODE_CALLBACK_EVENT(name) \
1163 DEFINE_EVENT(nfs4_inode_callback_event, name, \
1165 const struct nfs_client *clp, \
1166 const struct nfs_fh *fhandle, \
1167 const struct inode *inode, \
1170 TP_ARGS(clp, fhandle, inode, error))
1171 DEFINE_NFS4_INODE_CALLBACK_EVENT(nfs4_cb_getattr
);
1173 DECLARE_EVENT_CLASS(nfs4_inode_stateid_callback_event
,
1175 const struct nfs_client
*clp
,
1176 const struct nfs_fh
*fhandle
,
1177 const struct inode
*inode
,
1178 const nfs4_stateid
*stateid
,
1182 TP_ARGS(clp
, fhandle
, inode
, stateid
, error
),
1187 __field(u32
, fhandle
)
1188 __field(u64
, fileid
)
1189 __string(dstaddr
, clp
? clp
->cl_hostname
: "unknown")
1190 __field(int, stateid_seq
)
1191 __field(u32
, stateid_hash
)
1195 __entry
->error
= error
;
1196 __entry
->fhandle
= nfs_fhandle_hash(fhandle
);
1197 if (!IS_ERR_OR_NULL(inode
)) {
1198 __entry
->fileid
= NFS_FILEID(inode
);
1199 __entry
->dev
= inode
->i_sb
->s_dev
;
1201 __entry
->fileid
= 0;
1204 __assign_str(dstaddr
, clp
? clp
->cl_hostname
: "unknown")
1205 __entry
->stateid_seq
=
1206 be32_to_cpu(stateid
->seqid
);
1207 __entry
->stateid_hash
=
1208 nfs_stateid_hash(stateid
);
1212 "error=%d (%s) fileid=%02x:%02x:%llu fhandle=0x%08x "
1213 "stateid=%d:0x%08x dstaddr=%s",
1215 show_nfsv4_errors(__entry
->error
),
1216 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1217 (unsigned long long)__entry
->fileid
,
1219 __entry
->stateid_seq
, __entry
->stateid_hash
,
1224 #define DEFINE_NFS4_INODE_STATEID_CALLBACK_EVENT(name) \
1225 DEFINE_EVENT(nfs4_inode_stateid_callback_event, name, \
1227 const struct nfs_client *clp, \
1228 const struct nfs_fh *fhandle, \
1229 const struct inode *inode, \
1230 const nfs4_stateid *stateid, \
1233 TP_ARGS(clp, fhandle, inode, stateid, error))
1234 DEFINE_NFS4_INODE_STATEID_CALLBACK_EVENT(nfs4_cb_recall
);
1235 DEFINE_NFS4_INODE_STATEID_CALLBACK_EVENT(nfs4_cb_layoutrecall_file
);
1237 DECLARE_EVENT_CLASS(nfs4_idmap_event
,
1245 TP_ARGS(name
, len
, id
, error
),
1250 __dynamic_array(char, name
, len
> 0 ? len
+ 1 : 1)
1256 __entry
->error
= error
< 0 ? error
: 0;
1258 memcpy(__get_str(name
), name
, len
);
1259 __get_str(name
)[len
] = 0;
1263 "error=%d id=%u name=%s",
1269 #define DEFINE_NFS4_IDMAP_EVENT(name) \
1270 DEFINE_EVENT(nfs4_idmap_event, name, \
1277 TP_ARGS(name, len, id, error))
1278 DEFINE_NFS4_IDMAP_EVENT(nfs4_map_name_to_uid
);
1279 DEFINE_NFS4_IDMAP_EVENT(nfs4_map_group_to_gid
);
1280 DEFINE_NFS4_IDMAP_EVENT(nfs4_map_uid_to_name
);
1281 DEFINE_NFS4_IDMAP_EVENT(nfs4_map_gid_to_group
);
1283 DECLARE_EVENT_CLASS(nfs4_read_event
,
1285 const struct nfs_pgio_header
*hdr
,
1289 TP_ARGS(hdr
, error
),
1293 __field(u32
, fhandle
)
1294 __field(u64
, fileid
)
1295 __field(loff_t
, offset
)
1296 __field(size_t, count
)
1298 __field(int, stateid_seq
)
1299 __field(u32
, stateid_hash
)
1303 const struct inode
*inode
= hdr
->inode
;
1304 const struct nfs4_state
*state
=
1305 hdr
->args
.context
->state
;
1306 __entry
->dev
= inode
->i_sb
->s_dev
;
1307 __entry
->fileid
= NFS_FILEID(inode
);
1308 __entry
->fhandle
= nfs_fhandle_hash(NFS_FH(inode
));
1309 __entry
->offset
= hdr
->args
.offset
;
1310 __entry
->count
= hdr
->args
.count
;
1311 __entry
->error
= error
;
1312 __entry
->stateid_seq
=
1313 be32_to_cpu(state
->stateid
.seqid
);
1314 __entry
->stateid_hash
=
1315 nfs_stateid_hash(&state
->stateid
);
1319 "error=%d (%s) fileid=%02x:%02x:%llu fhandle=0x%08x "
1320 "offset=%lld count=%zu stateid=%d:0x%08x",
1322 show_nfsv4_errors(__entry
->error
),
1323 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1324 (unsigned long long)__entry
->fileid
,
1326 (long long)__entry
->offset
,
1328 __entry
->stateid_seq
, __entry
->stateid_hash
1331 #define DEFINE_NFS4_READ_EVENT(name) \
1332 DEFINE_EVENT(nfs4_read_event, name, \
1334 const struct nfs_pgio_header *hdr, \
1337 TP_ARGS(hdr, error))
1338 DEFINE_NFS4_READ_EVENT(nfs4_read
);
1339 #ifdef CONFIG_NFS_V4_1
1340 DEFINE_NFS4_READ_EVENT(nfs4_pnfs_read
);
1341 #endif /* CONFIG_NFS_V4_1 */
1343 DECLARE_EVENT_CLASS(nfs4_write_event
,
1345 const struct nfs_pgio_header
*hdr
,
1349 TP_ARGS(hdr
, error
),
1353 __field(u32
, fhandle
)
1354 __field(u64
, fileid
)
1355 __field(loff_t
, offset
)
1356 __field(size_t, count
)
1358 __field(int, stateid_seq
)
1359 __field(u32
, stateid_hash
)
1363 const struct inode
*inode
= hdr
->inode
;
1364 const struct nfs4_state
*state
=
1365 hdr
->args
.context
->state
;
1366 __entry
->dev
= inode
->i_sb
->s_dev
;
1367 __entry
->fileid
= NFS_FILEID(inode
);
1368 __entry
->fhandle
= nfs_fhandle_hash(NFS_FH(inode
));
1369 __entry
->offset
= hdr
->args
.offset
;
1370 __entry
->count
= hdr
->args
.count
;
1371 __entry
->error
= error
;
1372 __entry
->stateid_seq
=
1373 be32_to_cpu(state
->stateid
.seqid
);
1374 __entry
->stateid_hash
=
1375 nfs_stateid_hash(&state
->stateid
);
1379 "error=%d (%s) fileid=%02x:%02x:%llu fhandle=0x%08x "
1380 "offset=%lld count=%zu stateid=%d:0x%08x",
1382 show_nfsv4_errors(__entry
->error
),
1383 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1384 (unsigned long long)__entry
->fileid
,
1386 (long long)__entry
->offset
,
1388 __entry
->stateid_seq
, __entry
->stateid_hash
1392 #define DEFINE_NFS4_WRITE_EVENT(name) \
1393 DEFINE_EVENT(nfs4_write_event, name, \
1395 const struct nfs_pgio_header *hdr, \
1398 TP_ARGS(hdr, error))
1399 DEFINE_NFS4_WRITE_EVENT(nfs4_write
);
1400 #ifdef CONFIG_NFS_V4_1
1401 DEFINE_NFS4_WRITE_EVENT(nfs4_pnfs_write
);
1402 #endif /* CONFIG_NFS_V4_1 */
1404 DECLARE_EVENT_CLASS(nfs4_commit_event
,
1406 const struct nfs_commit_data
*data
,
1410 TP_ARGS(data
, error
),
1414 __field(u32
, fhandle
)
1415 __field(u64
, fileid
)
1416 __field(loff_t
, offset
)
1417 __field(size_t, count
)
1422 const struct inode
*inode
= data
->inode
;
1423 __entry
->dev
= inode
->i_sb
->s_dev
;
1424 __entry
->fileid
= NFS_FILEID(inode
);
1425 __entry
->fhandle
= nfs_fhandle_hash(NFS_FH(inode
));
1426 __entry
->offset
= data
->args
.offset
;
1427 __entry
->count
= data
->args
.count
;
1428 __entry
->error
= error
;
1432 "error=%d (%s) fileid=%02x:%02x:%llu fhandle=0x%08x "
1433 "offset=%lld count=%zu",
1435 show_nfsv4_errors(__entry
->error
),
1436 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1437 (unsigned long long)__entry
->fileid
,
1439 (long long)__entry
->offset
,
1443 #define DEFINE_NFS4_COMMIT_EVENT(name) \
1444 DEFINE_EVENT(nfs4_commit_event, name, \
1446 const struct nfs_commit_data *data, \
1449 TP_ARGS(data, error))
1450 DEFINE_NFS4_COMMIT_EVENT(nfs4_commit
);
1451 #ifdef CONFIG_NFS_V4_1
1452 DEFINE_NFS4_COMMIT_EVENT(nfs4_pnfs_commit_ds
);
1454 #define show_pnfs_iomode(iomode) \
1455 __print_symbolic(iomode, \
1456 { IOMODE_READ, "READ" }, \
1457 { IOMODE_RW, "RW" }, \
1458 { IOMODE_ANY, "ANY" })
1460 TRACE_EVENT(nfs4_layoutget
,
1462 const struct nfs_open_context
*ctx
,
1463 const struct pnfs_layout_range
*args
,
1464 const struct pnfs_layout_range
*res
,
1465 const nfs4_stateid
*layout_stateid
,
1469 TP_ARGS(ctx
, args
, res
, layout_stateid
, error
),
1473 __field(u32
, fhandle
)
1474 __field(u64
, fileid
)
1475 __field(u32
, iomode
)
1476 __field(u64
, offset
)
1479 __field(int, stateid_seq
)
1480 __field(u32
, stateid_hash
)
1481 __field(int, layoutstateid_seq
)
1482 __field(u32
, layoutstateid_hash
)
1486 const struct inode
*inode
= d_inode(ctx
->dentry
);
1487 const struct nfs4_state
*state
= ctx
->state
;
1488 __entry
->dev
= inode
->i_sb
->s_dev
;
1489 __entry
->fileid
= NFS_FILEID(inode
);
1490 __entry
->fhandle
= nfs_fhandle_hash(NFS_FH(inode
));
1491 __entry
->iomode
= args
->iomode
;
1492 __entry
->offset
= args
->offset
;
1493 __entry
->count
= args
->length
;
1494 __entry
->error
= error
;
1495 __entry
->stateid_seq
=
1496 be32_to_cpu(state
->stateid
.seqid
);
1497 __entry
->stateid_hash
=
1498 nfs_stateid_hash(&state
->stateid
);
1500 __entry
->layoutstateid_seq
=
1501 be32_to_cpu(layout_stateid
->seqid
);
1502 __entry
->layoutstateid_hash
=
1503 nfs_stateid_hash(layout_stateid
);
1505 __entry
->layoutstateid_seq
= 0;
1506 __entry
->layoutstateid_hash
= 0;
1511 "error=%d (%s) fileid=%02x:%02x:%llu fhandle=0x%08x "
1512 "iomode=%s offset=%llu count=%llu stateid=%d:0x%08x "
1513 "layoutstateid=%d:0x%08x",
1515 show_nfsv4_errors(__entry
->error
),
1516 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1517 (unsigned long long)__entry
->fileid
,
1519 show_pnfs_iomode(__entry
->iomode
),
1520 (unsigned long long)__entry
->offset
,
1521 (unsigned long long)__entry
->count
,
1522 __entry
->stateid_seq
, __entry
->stateid_hash
,
1523 __entry
->layoutstateid_seq
, __entry
->layoutstateid_hash
1527 DEFINE_NFS4_INODE_STATEID_EVENT(nfs4_layoutcommit
);
1528 DEFINE_NFS4_INODE_STATEID_EVENT(nfs4_layoutreturn
);
1529 DEFINE_NFS4_INODE_EVENT(nfs4_layoutreturn_on_close
);
1531 #define show_pnfs_update_layout_reason(reason) \
1532 __print_symbolic(reason, \
1533 { PNFS_UPDATE_LAYOUT_UNKNOWN, "unknown" }, \
1534 { PNFS_UPDATE_LAYOUT_NO_PNFS, "no pnfs" }, \
1535 { PNFS_UPDATE_LAYOUT_RD_ZEROLEN, "read+zerolen" }, \
1536 { PNFS_UPDATE_LAYOUT_MDSTHRESH, "mdsthresh" }, \
1537 { PNFS_UPDATE_LAYOUT_NOMEM, "nomem" }, \
1538 { PNFS_UPDATE_LAYOUT_BULK_RECALL, "bulk recall" }, \
1539 { PNFS_UPDATE_LAYOUT_IO_TEST_FAIL, "io test fail" }, \
1540 { PNFS_UPDATE_LAYOUT_FOUND_CACHED, "found cached" }, \
1541 { PNFS_UPDATE_LAYOUT_RETURN, "layoutreturn" }, \
1542 { PNFS_UPDATE_LAYOUT_BLOCKED, "layouts blocked" }, \
1543 { PNFS_UPDATE_LAYOUT_INVALID_OPEN, "invalid open" }, \
1544 { PNFS_UPDATE_LAYOUT_RETRY, "retrying" }, \
1545 { PNFS_UPDATE_LAYOUT_SEND_LAYOUTGET, "sent layoutget" })
1547 TRACE_EVENT(pnfs_update_layout
,
1548 TP_PROTO(struct inode
*inode
,
1551 enum pnfs_iomode iomode
,
1552 struct pnfs_layout_hdr
*lo
,
1553 struct pnfs_layout_segment
*lseg
,
1554 enum pnfs_update_layout_reason reason
1556 TP_ARGS(inode
, pos
, count
, iomode
, lo
, lseg
, reason
),
1559 __field(u64
, fileid
)
1560 __field(u32
, fhandle
)
1561 __field(loff_t
, pos
)
1563 __field(enum pnfs_iomode
, iomode
)
1564 __field(int, layoutstateid_seq
)
1565 __field(u32
, layoutstateid_hash
)
1567 __field(enum pnfs_update_layout_reason
, reason
)
1570 __entry
->dev
= inode
->i_sb
->s_dev
;
1571 __entry
->fileid
= NFS_FILEID(inode
);
1572 __entry
->fhandle
= nfs_fhandle_hash(NFS_FH(inode
));
1574 __entry
->count
= count
;
1575 __entry
->iomode
= iomode
;
1576 __entry
->reason
= reason
;
1578 __entry
->layoutstateid_seq
=
1579 be32_to_cpu(lo
->plh_stateid
.seqid
);
1580 __entry
->layoutstateid_hash
=
1581 nfs_stateid_hash(&lo
->plh_stateid
);
1583 __entry
->layoutstateid_seq
= 0;
1584 __entry
->layoutstateid_hash
= 0;
1586 __entry
->lseg
= (long)lseg
;
1589 "fileid=%02x:%02x:%llu fhandle=0x%08x "
1590 "iomode=%s pos=%llu count=%llu "
1591 "layoutstateid=%d:0x%08x lseg=0x%lx (%s)",
1592 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1593 (unsigned long long)__entry
->fileid
,
1595 show_pnfs_iomode(__entry
->iomode
),
1596 (unsigned long long)__entry
->pos
,
1597 (unsigned long long)__entry
->count
,
1598 __entry
->layoutstateid_seq
, __entry
->layoutstateid_hash
,
1600 show_pnfs_update_layout_reason(__entry
->reason
)
1604 #endif /* CONFIG_NFS_V4_1 */
1606 #endif /* _TRACE_NFS4_H */
1608 #undef TRACE_INCLUDE_PATH
1609 #define TRACE_INCLUDE_PATH .
1610 #define TRACE_INCLUDE_FILE nfs4trace
1611 /* This part must be outside protection */
1612 #include <trace/define_trace.h>