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 TRACE_DEFINE_ENUM(EPERM
);
14 TRACE_DEFINE_ENUM(ENOENT
);
15 TRACE_DEFINE_ENUM(EIO
);
16 TRACE_DEFINE_ENUM(ENXIO
);
17 TRACE_DEFINE_ENUM(EACCES
);
18 TRACE_DEFINE_ENUM(EEXIST
);
19 TRACE_DEFINE_ENUM(EXDEV
);
20 TRACE_DEFINE_ENUM(ENOTDIR
);
21 TRACE_DEFINE_ENUM(EISDIR
);
22 TRACE_DEFINE_ENUM(EFBIG
);
23 TRACE_DEFINE_ENUM(ENOSPC
);
24 TRACE_DEFINE_ENUM(EROFS
);
25 TRACE_DEFINE_ENUM(EMLINK
);
26 TRACE_DEFINE_ENUM(ENAMETOOLONG
);
27 TRACE_DEFINE_ENUM(ENOTEMPTY
);
28 TRACE_DEFINE_ENUM(EDQUOT
);
29 TRACE_DEFINE_ENUM(ESTALE
);
30 TRACE_DEFINE_ENUM(EBADHANDLE
);
31 TRACE_DEFINE_ENUM(EBADCOOKIE
);
32 TRACE_DEFINE_ENUM(ENOTSUPP
);
33 TRACE_DEFINE_ENUM(ETOOSMALL
);
34 TRACE_DEFINE_ENUM(EREMOTEIO
);
35 TRACE_DEFINE_ENUM(EBADTYPE
);
36 TRACE_DEFINE_ENUM(EAGAIN
);
37 TRACE_DEFINE_ENUM(ELOOP
);
38 TRACE_DEFINE_ENUM(EOPNOTSUPP
);
39 TRACE_DEFINE_ENUM(EDEADLK
);
40 TRACE_DEFINE_ENUM(ENOMEM
);
41 TRACE_DEFINE_ENUM(EKEYEXPIRED
);
42 TRACE_DEFINE_ENUM(ETIMEDOUT
);
43 TRACE_DEFINE_ENUM(ERESTARTSYS
);
44 TRACE_DEFINE_ENUM(ECONNREFUSED
);
45 TRACE_DEFINE_ENUM(ECONNRESET
);
46 TRACE_DEFINE_ENUM(ENETUNREACH
);
47 TRACE_DEFINE_ENUM(EHOSTUNREACH
);
48 TRACE_DEFINE_ENUM(EHOSTDOWN
);
49 TRACE_DEFINE_ENUM(EPIPE
);
50 TRACE_DEFINE_ENUM(EPFNOSUPPORT
);
51 TRACE_DEFINE_ENUM(EPROTONOSUPPORT
);
53 TRACE_DEFINE_ENUM(NFS4_OK
);
54 TRACE_DEFINE_ENUM(NFS4ERR_ACCESS
);
55 TRACE_DEFINE_ENUM(NFS4ERR_ATTRNOTSUPP
);
56 TRACE_DEFINE_ENUM(NFS4ERR_ADMIN_REVOKED
);
57 TRACE_DEFINE_ENUM(NFS4ERR_BACK_CHAN_BUSY
);
58 TRACE_DEFINE_ENUM(NFS4ERR_BADCHAR
);
59 TRACE_DEFINE_ENUM(NFS4ERR_BADHANDLE
);
60 TRACE_DEFINE_ENUM(NFS4ERR_BADIOMODE
);
61 TRACE_DEFINE_ENUM(NFS4ERR_BADLAYOUT
);
62 TRACE_DEFINE_ENUM(NFS4ERR_BADLABEL
);
63 TRACE_DEFINE_ENUM(NFS4ERR_BADNAME
);
64 TRACE_DEFINE_ENUM(NFS4ERR_BADOWNER
);
65 TRACE_DEFINE_ENUM(NFS4ERR_BADSESSION
);
66 TRACE_DEFINE_ENUM(NFS4ERR_BADSLOT
);
67 TRACE_DEFINE_ENUM(NFS4ERR_BADTYPE
);
68 TRACE_DEFINE_ENUM(NFS4ERR_BADXDR
);
69 TRACE_DEFINE_ENUM(NFS4ERR_BAD_COOKIE
);
70 TRACE_DEFINE_ENUM(NFS4ERR_BAD_HIGH_SLOT
);
71 TRACE_DEFINE_ENUM(NFS4ERR_BAD_RANGE
);
72 TRACE_DEFINE_ENUM(NFS4ERR_BAD_SEQID
);
73 TRACE_DEFINE_ENUM(NFS4ERR_BAD_SESSION_DIGEST
);
74 TRACE_DEFINE_ENUM(NFS4ERR_BAD_STATEID
);
75 TRACE_DEFINE_ENUM(NFS4ERR_CB_PATH_DOWN
);
76 TRACE_DEFINE_ENUM(NFS4ERR_CLID_INUSE
);
77 TRACE_DEFINE_ENUM(NFS4ERR_CLIENTID_BUSY
);
78 TRACE_DEFINE_ENUM(NFS4ERR_COMPLETE_ALREADY
);
79 TRACE_DEFINE_ENUM(NFS4ERR_CONN_NOT_BOUND_TO_SESSION
);
80 TRACE_DEFINE_ENUM(NFS4ERR_DEADLOCK
);
81 TRACE_DEFINE_ENUM(NFS4ERR_DEADSESSION
);
82 TRACE_DEFINE_ENUM(NFS4ERR_DELAY
);
83 TRACE_DEFINE_ENUM(NFS4ERR_DELEG_ALREADY_WANTED
);
84 TRACE_DEFINE_ENUM(NFS4ERR_DELEG_REVOKED
);
85 TRACE_DEFINE_ENUM(NFS4ERR_DENIED
);
86 TRACE_DEFINE_ENUM(NFS4ERR_DIRDELEG_UNAVAIL
);
87 TRACE_DEFINE_ENUM(NFS4ERR_DQUOT
);
88 TRACE_DEFINE_ENUM(NFS4ERR_ENCR_ALG_UNSUPP
);
89 TRACE_DEFINE_ENUM(NFS4ERR_EXIST
);
90 TRACE_DEFINE_ENUM(NFS4ERR_EXPIRED
);
91 TRACE_DEFINE_ENUM(NFS4ERR_FBIG
);
92 TRACE_DEFINE_ENUM(NFS4ERR_FHEXPIRED
);
93 TRACE_DEFINE_ENUM(NFS4ERR_FILE_OPEN
);
94 TRACE_DEFINE_ENUM(NFS4ERR_GRACE
);
95 TRACE_DEFINE_ENUM(NFS4ERR_HASH_ALG_UNSUPP
);
96 TRACE_DEFINE_ENUM(NFS4ERR_INVAL
);
97 TRACE_DEFINE_ENUM(NFS4ERR_IO
);
98 TRACE_DEFINE_ENUM(NFS4ERR_ISDIR
);
99 TRACE_DEFINE_ENUM(NFS4ERR_LAYOUTTRYLATER
);
100 TRACE_DEFINE_ENUM(NFS4ERR_LAYOUTUNAVAILABLE
);
101 TRACE_DEFINE_ENUM(NFS4ERR_LEASE_MOVED
);
102 TRACE_DEFINE_ENUM(NFS4ERR_LOCKED
);
103 TRACE_DEFINE_ENUM(NFS4ERR_LOCKS_HELD
);
104 TRACE_DEFINE_ENUM(NFS4ERR_LOCK_RANGE
);
105 TRACE_DEFINE_ENUM(NFS4ERR_MINOR_VERS_MISMATCH
);
106 TRACE_DEFINE_ENUM(NFS4ERR_MLINK
);
107 TRACE_DEFINE_ENUM(NFS4ERR_MOVED
);
108 TRACE_DEFINE_ENUM(NFS4ERR_NAMETOOLONG
);
109 TRACE_DEFINE_ENUM(NFS4ERR_NOENT
);
110 TRACE_DEFINE_ENUM(NFS4ERR_NOFILEHANDLE
);
111 TRACE_DEFINE_ENUM(NFS4ERR_NOMATCHING_LAYOUT
);
112 TRACE_DEFINE_ENUM(NFS4ERR_NOSPC
);
113 TRACE_DEFINE_ENUM(NFS4ERR_NOTDIR
);
114 TRACE_DEFINE_ENUM(NFS4ERR_NOTEMPTY
);
115 TRACE_DEFINE_ENUM(NFS4ERR_NOTSUPP
);
116 TRACE_DEFINE_ENUM(NFS4ERR_NOT_ONLY_OP
);
117 TRACE_DEFINE_ENUM(NFS4ERR_NOT_SAME
);
118 TRACE_DEFINE_ENUM(NFS4ERR_NO_GRACE
);
119 TRACE_DEFINE_ENUM(NFS4ERR_NXIO
);
120 TRACE_DEFINE_ENUM(NFS4ERR_OLD_STATEID
);
121 TRACE_DEFINE_ENUM(NFS4ERR_OPENMODE
);
122 TRACE_DEFINE_ENUM(NFS4ERR_OP_ILLEGAL
);
123 TRACE_DEFINE_ENUM(NFS4ERR_OP_NOT_IN_SESSION
);
124 TRACE_DEFINE_ENUM(NFS4ERR_PERM
);
125 TRACE_DEFINE_ENUM(NFS4ERR_PNFS_IO_HOLE
);
126 TRACE_DEFINE_ENUM(NFS4ERR_PNFS_NO_LAYOUT
);
127 TRACE_DEFINE_ENUM(NFS4ERR_RECALLCONFLICT
);
128 TRACE_DEFINE_ENUM(NFS4ERR_RECLAIM_BAD
);
129 TRACE_DEFINE_ENUM(NFS4ERR_RECLAIM_CONFLICT
);
130 TRACE_DEFINE_ENUM(NFS4ERR_REJECT_DELEG
);
131 TRACE_DEFINE_ENUM(NFS4ERR_REP_TOO_BIG
);
132 TRACE_DEFINE_ENUM(NFS4ERR_REP_TOO_BIG_TO_CACHE
);
133 TRACE_DEFINE_ENUM(NFS4ERR_REQ_TOO_BIG
);
134 TRACE_DEFINE_ENUM(NFS4ERR_RESOURCE
);
135 TRACE_DEFINE_ENUM(NFS4ERR_RESTOREFH
);
136 TRACE_DEFINE_ENUM(NFS4ERR_RETRY_UNCACHED_REP
);
137 TRACE_DEFINE_ENUM(NFS4ERR_RETURNCONFLICT
);
138 TRACE_DEFINE_ENUM(NFS4ERR_ROFS
);
139 TRACE_DEFINE_ENUM(NFS4ERR_SAME
);
140 TRACE_DEFINE_ENUM(NFS4ERR_SHARE_DENIED
);
141 TRACE_DEFINE_ENUM(NFS4ERR_SEQUENCE_POS
);
142 TRACE_DEFINE_ENUM(NFS4ERR_SEQ_FALSE_RETRY
);
143 TRACE_DEFINE_ENUM(NFS4ERR_SEQ_MISORDERED
);
144 TRACE_DEFINE_ENUM(NFS4ERR_SERVERFAULT
);
145 TRACE_DEFINE_ENUM(NFS4ERR_STALE
);
146 TRACE_DEFINE_ENUM(NFS4ERR_STALE_CLIENTID
);
147 TRACE_DEFINE_ENUM(NFS4ERR_STALE_STATEID
);
148 TRACE_DEFINE_ENUM(NFS4ERR_SYMLINK
);
149 TRACE_DEFINE_ENUM(NFS4ERR_TOOSMALL
);
150 TRACE_DEFINE_ENUM(NFS4ERR_TOO_MANY_OPS
);
151 TRACE_DEFINE_ENUM(NFS4ERR_UNKNOWN_LAYOUTTYPE
);
152 TRACE_DEFINE_ENUM(NFS4ERR_UNSAFE_COMPOUND
);
153 TRACE_DEFINE_ENUM(NFS4ERR_WRONGSEC
);
154 TRACE_DEFINE_ENUM(NFS4ERR_WRONG_CRED
);
155 TRACE_DEFINE_ENUM(NFS4ERR_WRONG_TYPE
);
156 TRACE_DEFINE_ENUM(NFS4ERR_XDEV
);
158 TRACE_DEFINE_ENUM(NFS4ERR_RESET_TO_MDS
);
159 TRACE_DEFINE_ENUM(NFS4ERR_RESET_TO_PNFS
);
161 #define show_nfsv4_errors(error) \
162 __print_symbolic(error, \
164 /* Mapped by nfs4_stat_to_errno() */ \
165 { EPERM, "EPERM" }, \
166 { ENOENT, "ENOENT" }, \
168 { ENXIO, "ENXIO" }, \
169 { EACCES, "EACCES" }, \
170 { EEXIST, "EEXIST" }, \
171 { EXDEV, "EXDEV" }, \
172 { ENOTDIR, "ENOTDIR" }, \
173 { EISDIR, "EISDIR" }, \
174 { EFBIG, "EFBIG" }, \
175 { ENOSPC, "ENOSPC" }, \
176 { EROFS, "EROFS" }, \
177 { EMLINK, "EMLINK" }, \
178 { ENAMETOOLONG, "ENAMETOOLONG" }, \
179 { ENOTEMPTY, "ENOTEMPTY" }, \
180 { EDQUOT, "EDQUOT" }, \
181 { ESTALE, "ESTALE" }, \
182 { EBADHANDLE, "EBADHANDLE" }, \
183 { EBADCOOKIE, "EBADCOOKIE" }, \
184 { ENOTSUPP, "ENOTSUPP" }, \
185 { ETOOSMALL, "ETOOSMALL" }, \
186 { EREMOTEIO, "EREMOTEIO" }, \
187 { EBADTYPE, "EBADTYPE" }, \
188 { EAGAIN, "EAGAIN" }, \
189 { ELOOP, "ELOOP" }, \
190 { EOPNOTSUPP, "EOPNOTSUPP" }, \
191 { EDEADLK, "EDEADLK" }, \
193 { ENOMEM, "ENOMEM" }, \
194 { EKEYEXPIRED, "EKEYEXPIRED" }, \
195 { ETIMEDOUT, "ETIMEDOUT" }, \
196 { ERESTARTSYS, "ERESTARTSYS" }, \
197 { ECONNREFUSED, "ECONNREFUSED" }, \
198 { ECONNRESET, "ECONNRESET" }, \
199 { ENETUNREACH, "ENETUNREACH" }, \
200 { EHOSTUNREACH, "EHOSTUNREACH" }, \
201 { EHOSTDOWN, "EHOSTDOWN" }, \
202 { EPIPE, "EPIPE" }, \
203 { EPFNOSUPPORT, "EPFNOSUPPORT" }, \
204 { EPROTONOSUPPORT, "EPROTONOSUPPORT" }, \
205 /* NFSv4 native errors */ \
206 { NFS4ERR_ACCESS, "ACCESS" }, \
207 { NFS4ERR_ATTRNOTSUPP, "ATTRNOTSUPP" }, \
208 { NFS4ERR_ADMIN_REVOKED, "ADMIN_REVOKED" }, \
209 { NFS4ERR_BACK_CHAN_BUSY, "BACK_CHAN_BUSY" }, \
210 { NFS4ERR_BADCHAR, "BADCHAR" }, \
211 { NFS4ERR_BADHANDLE, "BADHANDLE" }, \
212 { NFS4ERR_BADIOMODE, "BADIOMODE" }, \
213 { NFS4ERR_BADLAYOUT, "BADLAYOUT" }, \
214 { NFS4ERR_BADLABEL, "BADLABEL" }, \
215 { NFS4ERR_BADNAME, "BADNAME" }, \
216 { NFS4ERR_BADOWNER, "BADOWNER" }, \
217 { NFS4ERR_BADSESSION, "BADSESSION" }, \
218 { NFS4ERR_BADSLOT, "BADSLOT" }, \
219 { NFS4ERR_BADTYPE, "BADTYPE" }, \
220 { NFS4ERR_BADXDR, "BADXDR" }, \
221 { NFS4ERR_BAD_COOKIE, "BAD_COOKIE" }, \
222 { NFS4ERR_BAD_HIGH_SLOT, "BAD_HIGH_SLOT" }, \
223 { NFS4ERR_BAD_RANGE, "BAD_RANGE" }, \
224 { NFS4ERR_BAD_SEQID, "BAD_SEQID" }, \
225 { NFS4ERR_BAD_SESSION_DIGEST, "BAD_SESSION_DIGEST" }, \
226 { NFS4ERR_BAD_STATEID, "BAD_STATEID" }, \
227 { NFS4ERR_CB_PATH_DOWN, "CB_PATH_DOWN" }, \
228 { NFS4ERR_CLID_INUSE, "CLID_INUSE" }, \
229 { NFS4ERR_CLIENTID_BUSY, "CLIENTID_BUSY" }, \
230 { NFS4ERR_COMPLETE_ALREADY, "COMPLETE_ALREADY" }, \
231 { NFS4ERR_CONN_NOT_BOUND_TO_SESSION, \
232 "CONN_NOT_BOUND_TO_SESSION" }, \
233 { NFS4ERR_DEADLOCK, "DEADLOCK" }, \
234 { NFS4ERR_DEADSESSION, "DEAD_SESSION" }, \
235 { NFS4ERR_DELAY, "DELAY" }, \
236 { NFS4ERR_DELEG_ALREADY_WANTED, \
237 "DELEG_ALREADY_WANTED" }, \
238 { NFS4ERR_DELEG_REVOKED, "DELEG_REVOKED" }, \
239 { NFS4ERR_DENIED, "DENIED" }, \
240 { NFS4ERR_DIRDELEG_UNAVAIL, "DIRDELEG_UNAVAIL" }, \
241 { NFS4ERR_DQUOT, "DQUOT" }, \
242 { NFS4ERR_ENCR_ALG_UNSUPP, "ENCR_ALG_UNSUPP" }, \
243 { NFS4ERR_EXIST, "EXIST" }, \
244 { NFS4ERR_EXPIRED, "EXPIRED" }, \
245 { NFS4ERR_FBIG, "FBIG" }, \
246 { NFS4ERR_FHEXPIRED, "FHEXPIRED" }, \
247 { NFS4ERR_FILE_OPEN, "FILE_OPEN" }, \
248 { NFS4ERR_GRACE, "GRACE" }, \
249 { NFS4ERR_HASH_ALG_UNSUPP, "HASH_ALG_UNSUPP" }, \
250 { NFS4ERR_INVAL, "INVAL" }, \
251 { NFS4ERR_IO, "IO" }, \
252 { NFS4ERR_ISDIR, "ISDIR" }, \
253 { NFS4ERR_LAYOUTTRYLATER, "LAYOUTTRYLATER" }, \
254 { NFS4ERR_LAYOUTUNAVAILABLE, "LAYOUTUNAVAILABLE" }, \
255 { NFS4ERR_LEASE_MOVED, "LEASE_MOVED" }, \
256 { NFS4ERR_LOCKED, "LOCKED" }, \
257 { NFS4ERR_LOCKS_HELD, "LOCKS_HELD" }, \
258 { NFS4ERR_LOCK_RANGE, "LOCK_RANGE" }, \
259 { NFS4ERR_MINOR_VERS_MISMATCH, "MINOR_VERS_MISMATCH" }, \
260 { NFS4ERR_MLINK, "MLINK" }, \
261 { NFS4ERR_MOVED, "MOVED" }, \
262 { NFS4ERR_NAMETOOLONG, "NAMETOOLONG" }, \
263 { NFS4ERR_NOENT, "NOENT" }, \
264 { NFS4ERR_NOFILEHANDLE, "NOFILEHANDLE" }, \
265 { NFS4ERR_NOMATCHING_LAYOUT, "NOMATCHING_LAYOUT" }, \
266 { NFS4ERR_NOSPC, "NOSPC" }, \
267 { NFS4ERR_NOTDIR, "NOTDIR" }, \
268 { NFS4ERR_NOTEMPTY, "NOTEMPTY" }, \
269 { NFS4ERR_NOTSUPP, "NOTSUPP" }, \
270 { NFS4ERR_NOT_ONLY_OP, "NOT_ONLY_OP" }, \
271 { NFS4ERR_NOT_SAME, "NOT_SAME" }, \
272 { NFS4ERR_NO_GRACE, "NO_GRACE" }, \
273 { NFS4ERR_NXIO, "NXIO" }, \
274 { NFS4ERR_OLD_STATEID, "OLD_STATEID" }, \
275 { NFS4ERR_OPENMODE, "OPENMODE" }, \
276 { NFS4ERR_OP_ILLEGAL, "OP_ILLEGAL" }, \
277 { NFS4ERR_OP_NOT_IN_SESSION, "OP_NOT_IN_SESSION" }, \
278 { NFS4ERR_PERM, "PERM" }, \
279 { NFS4ERR_PNFS_IO_HOLE, "PNFS_IO_HOLE" }, \
280 { NFS4ERR_PNFS_NO_LAYOUT, "PNFS_NO_LAYOUT" }, \
281 { NFS4ERR_RECALLCONFLICT, "RECALLCONFLICT" }, \
282 { NFS4ERR_RECLAIM_BAD, "RECLAIM_BAD" }, \
283 { NFS4ERR_RECLAIM_CONFLICT, "RECLAIM_CONFLICT" }, \
284 { NFS4ERR_REJECT_DELEG, "REJECT_DELEG" }, \
285 { NFS4ERR_REP_TOO_BIG, "REP_TOO_BIG" }, \
286 { NFS4ERR_REP_TOO_BIG_TO_CACHE, \
287 "REP_TOO_BIG_TO_CACHE" }, \
288 { NFS4ERR_REQ_TOO_BIG, "REQ_TOO_BIG" }, \
289 { NFS4ERR_RESOURCE, "RESOURCE" }, \
290 { NFS4ERR_RESTOREFH, "RESTOREFH" }, \
291 { NFS4ERR_RETRY_UNCACHED_REP, "RETRY_UNCACHED_REP" }, \
292 { NFS4ERR_RETURNCONFLICT, "RETURNCONFLICT" }, \
293 { NFS4ERR_ROFS, "ROFS" }, \
294 { NFS4ERR_SAME, "SAME" }, \
295 { NFS4ERR_SHARE_DENIED, "SHARE_DENIED" }, \
296 { NFS4ERR_SEQUENCE_POS, "SEQUENCE_POS" }, \
297 { NFS4ERR_SEQ_FALSE_RETRY, "SEQ_FALSE_RETRY" }, \
298 { NFS4ERR_SEQ_MISORDERED, "SEQ_MISORDERED" }, \
299 { NFS4ERR_SERVERFAULT, "SERVERFAULT" }, \
300 { NFS4ERR_STALE, "STALE" }, \
301 { NFS4ERR_STALE_CLIENTID, "STALE_CLIENTID" }, \
302 { NFS4ERR_STALE_STATEID, "STALE_STATEID" }, \
303 { NFS4ERR_SYMLINK, "SYMLINK" }, \
304 { NFS4ERR_TOOSMALL, "TOOSMALL" }, \
305 { NFS4ERR_TOO_MANY_OPS, "TOO_MANY_OPS" }, \
306 { NFS4ERR_UNKNOWN_LAYOUTTYPE, "UNKNOWN_LAYOUTTYPE" }, \
307 { NFS4ERR_UNSAFE_COMPOUND, "UNSAFE_COMPOUND" }, \
308 { NFS4ERR_WRONGSEC, "WRONGSEC" }, \
309 { NFS4ERR_WRONG_CRED, "WRONG_CRED" }, \
310 { NFS4ERR_WRONG_TYPE, "WRONG_TYPE" }, \
311 { NFS4ERR_XDEV, "XDEV" }, \
312 /* ***** Internal to Linux NFS client ***** */ \
313 { NFS4ERR_RESET_TO_MDS, "RESET_TO_MDS" }, \
314 { NFS4ERR_RESET_TO_PNFS, "RESET_TO_PNFS" })
316 #define show_open_flags(flags) \
317 __print_flags(flags, "|", \
318 { O_CREAT, "O_CREAT" }, \
319 { O_EXCL, "O_EXCL" }, \
320 { O_TRUNC, "O_TRUNC" }, \
321 { O_DIRECT, "O_DIRECT" })
323 #define show_fmode_flags(mode) \
324 __print_flags(mode, "|", \
325 { ((__force unsigned long)FMODE_READ), "READ" }, \
326 { ((__force unsigned long)FMODE_WRITE), "WRITE" }, \
327 { ((__force unsigned long)FMODE_EXEC), "EXEC" })
329 #define show_nfs_fattr_flags(valid) \
330 __print_flags((unsigned long)valid, "|", \
331 { NFS_ATTR_FATTR_TYPE, "TYPE" }, \
332 { NFS_ATTR_FATTR_MODE, "MODE" }, \
333 { NFS_ATTR_FATTR_NLINK, "NLINK" }, \
334 { NFS_ATTR_FATTR_OWNER, "OWNER" }, \
335 { NFS_ATTR_FATTR_GROUP, "GROUP" }, \
336 { NFS_ATTR_FATTR_RDEV, "RDEV" }, \
337 { NFS_ATTR_FATTR_SIZE, "SIZE" }, \
338 { NFS_ATTR_FATTR_FSID, "FSID" }, \
339 { NFS_ATTR_FATTR_FILEID, "FILEID" }, \
340 { NFS_ATTR_FATTR_ATIME, "ATIME" }, \
341 { NFS_ATTR_FATTR_MTIME, "MTIME" }, \
342 { NFS_ATTR_FATTR_CTIME, "CTIME" }, \
343 { NFS_ATTR_FATTR_CHANGE, "CHANGE" }, \
344 { NFS_ATTR_FATTR_OWNER_NAME, "OWNER_NAME" }, \
345 { NFS_ATTR_FATTR_GROUP_NAME, "GROUP_NAME" })
347 DECLARE_EVENT_CLASS(nfs4_clientid_event
,
349 const struct nfs_client
*clp
,
356 __string(dstaddr
, clp
->cl_hostname
)
357 __field(unsigned long, error
)
361 __entry
->error
= error
< 0 ? -error
: 0;
362 __assign_str(dstaddr
, clp
->cl_hostname
);
366 "error=%ld (%s) dstaddr=%s",
368 show_nfsv4_errors(__entry
->error
),
372 #define DEFINE_NFS4_CLIENTID_EVENT(name) \
373 DEFINE_EVENT(nfs4_clientid_event, name, \
375 const struct nfs_client *clp, \
379 DEFINE_NFS4_CLIENTID_EVENT(nfs4_setclientid
);
380 DEFINE_NFS4_CLIENTID_EVENT(nfs4_setclientid_confirm
);
381 DEFINE_NFS4_CLIENTID_EVENT(nfs4_renew
);
382 DEFINE_NFS4_CLIENTID_EVENT(nfs4_renew_async
);
383 #ifdef CONFIG_NFS_V4_1
384 DEFINE_NFS4_CLIENTID_EVENT(nfs4_exchange_id
);
385 DEFINE_NFS4_CLIENTID_EVENT(nfs4_create_session
);
386 DEFINE_NFS4_CLIENTID_EVENT(nfs4_destroy_session
);
387 DEFINE_NFS4_CLIENTID_EVENT(nfs4_destroy_clientid
);
388 DEFINE_NFS4_CLIENTID_EVENT(nfs4_bind_conn_to_session
);
389 DEFINE_NFS4_CLIENTID_EVENT(nfs4_sequence
);
390 DEFINE_NFS4_CLIENTID_EVENT(nfs4_reclaim_complete
);
392 #define show_nfs4_sequence_status_flags(status) \
393 __print_flags((unsigned long)status, "|", \
394 { SEQ4_STATUS_CB_PATH_DOWN, "CB_PATH_DOWN" }, \
395 { SEQ4_STATUS_CB_GSS_CONTEXTS_EXPIRING, \
396 "CB_GSS_CONTEXTS_EXPIRING" }, \
397 { SEQ4_STATUS_CB_GSS_CONTEXTS_EXPIRED, \
398 "CB_GSS_CONTEXTS_EXPIRED" }, \
399 { SEQ4_STATUS_EXPIRED_ALL_STATE_REVOKED, \
400 "EXPIRED_ALL_STATE_REVOKED" }, \
401 { SEQ4_STATUS_EXPIRED_SOME_STATE_REVOKED, \
402 "EXPIRED_SOME_STATE_REVOKED" }, \
403 { SEQ4_STATUS_ADMIN_STATE_REVOKED, \
404 "ADMIN_STATE_REVOKED" }, \
405 { SEQ4_STATUS_RECALLABLE_STATE_REVOKED, \
406 "RECALLABLE_STATE_REVOKED" }, \
407 { SEQ4_STATUS_LEASE_MOVED, "LEASE_MOVED" }, \
408 { SEQ4_STATUS_RESTART_RECLAIM_NEEDED, \
409 "RESTART_RECLAIM_NEEDED" }, \
410 { SEQ4_STATUS_CB_PATH_DOWN_SESSION, \
411 "CB_PATH_DOWN_SESSION" }, \
412 { SEQ4_STATUS_BACKCHANNEL_FAULT, \
413 "BACKCHANNEL_FAULT" })
415 TRACE_EVENT(nfs4_sequence_done
,
417 const struct nfs4_session
*session
,
418 const struct nfs4_sequence_res
*res
420 TP_ARGS(session
, res
),
423 __field(unsigned int, session
)
424 __field(unsigned int, slot_nr
)
425 __field(unsigned int, seq_nr
)
426 __field(unsigned int, highest_slotid
)
427 __field(unsigned int, target_highest_slotid
)
428 __field(unsigned int, status_flags
)
429 __field(unsigned long, error
)
433 const struct nfs4_slot
*sr_slot
= res
->sr_slot
;
434 __entry
->session
= nfs_session_id_hash(&session
->sess_id
);
435 __entry
->slot_nr
= sr_slot
->slot_nr
;
436 __entry
->seq_nr
= sr_slot
->seq_nr
;
437 __entry
->highest_slotid
= res
->sr_highest_slotid
;
438 __entry
->target_highest_slotid
=
439 res
->sr_target_highest_slotid
;
440 __entry
->status_flags
= res
->sr_status_flags
;
441 __entry
->error
= res
->sr_status
< 0 ?
445 "error=%ld (%s) session=0x%08x slot_nr=%u seq_nr=%u "
446 "highest_slotid=%u target_highest_slotid=%u "
447 "status_flags=%u (%s)",
449 show_nfsv4_errors(__entry
->error
),
453 __entry
->highest_slotid
,
454 __entry
->target_highest_slotid
,
455 __entry
->status_flags
,
456 show_nfs4_sequence_status_flags(__entry
->status_flags
)
460 struct cb_sequenceargs
;
461 struct cb_sequenceres
;
463 TRACE_EVENT(nfs4_cb_sequence
,
465 const struct cb_sequenceargs
*args
,
466 const struct cb_sequenceres
*res
,
469 TP_ARGS(args
, res
, status
),
472 __field(unsigned int, session
)
473 __field(unsigned int, slot_nr
)
474 __field(unsigned int, seq_nr
)
475 __field(unsigned int, highest_slotid
)
476 __field(unsigned int, cachethis
)
477 __field(unsigned long, error
)
481 __entry
->session
= nfs_session_id_hash(&args
->csa_sessionid
);
482 __entry
->slot_nr
= args
->csa_slotid
;
483 __entry
->seq_nr
= args
->csa_sequenceid
;
484 __entry
->highest_slotid
= args
->csa_highestslotid
;
485 __entry
->cachethis
= args
->csa_cachethis
;
486 __entry
->error
= be32_to_cpu(status
);
490 "error=%ld (%s) session=0x%08x slot_nr=%u seq_nr=%u "
493 show_nfsv4_errors(__entry
->error
),
497 __entry
->highest_slotid
501 TRACE_EVENT(nfs4_cb_seqid_err
,
503 const struct cb_sequenceargs
*args
,
506 TP_ARGS(args
, status
),
509 __field(unsigned int, session
)
510 __field(unsigned int, slot_nr
)
511 __field(unsigned int, seq_nr
)
512 __field(unsigned int, highest_slotid
)
513 __field(unsigned int, cachethis
)
514 __field(unsigned long, error
)
518 __entry
->session
= nfs_session_id_hash(&args
->csa_sessionid
);
519 __entry
->slot_nr
= args
->csa_slotid
;
520 __entry
->seq_nr
= args
->csa_sequenceid
;
521 __entry
->highest_slotid
= args
->csa_highestslotid
;
522 __entry
->cachethis
= args
->csa_cachethis
;
523 __entry
->error
= be32_to_cpu(status
);
527 "error=%ld (%s) session=0x%08x slot_nr=%u seq_nr=%u "
530 show_nfsv4_errors(__entry
->error
),
534 __entry
->highest_slotid
538 #endif /* CONFIG_NFS_V4_1 */
540 TRACE_EVENT(nfs4_setup_sequence
,
542 const struct nfs4_session
*session
,
543 const struct nfs4_sequence_args
*args
545 TP_ARGS(session
, args
),
548 __field(unsigned int, session
)
549 __field(unsigned int, slot_nr
)
550 __field(unsigned int, seq_nr
)
551 __field(unsigned int, highest_used_slotid
)
555 const struct nfs4_slot
*sa_slot
= args
->sa_slot
;
556 __entry
->session
= session
? nfs_session_id_hash(&session
->sess_id
) : 0;
557 __entry
->slot_nr
= sa_slot
->slot_nr
;
558 __entry
->seq_nr
= sa_slot
->seq_nr
;
559 __entry
->highest_used_slotid
=
560 sa_slot
->table
->highest_used_slotid
;
563 "session=0x%08x slot_nr=%u seq_nr=%u "
564 "highest_used_slotid=%u",
568 __entry
->highest_used_slotid
572 TRACE_DEFINE_ENUM(NFS4CLNT_MANAGER_RUNNING
);
573 TRACE_DEFINE_ENUM(NFS4CLNT_CHECK_LEASE
);
574 TRACE_DEFINE_ENUM(NFS4CLNT_LEASE_EXPIRED
);
575 TRACE_DEFINE_ENUM(NFS4CLNT_RECLAIM_REBOOT
);
576 TRACE_DEFINE_ENUM(NFS4CLNT_RECLAIM_NOGRACE
);
577 TRACE_DEFINE_ENUM(NFS4CLNT_DELEGRETURN
);
578 TRACE_DEFINE_ENUM(NFS4CLNT_SESSION_RESET
);
579 TRACE_DEFINE_ENUM(NFS4CLNT_LEASE_CONFIRM
);
580 TRACE_DEFINE_ENUM(NFS4CLNT_SERVER_SCOPE_MISMATCH
);
581 TRACE_DEFINE_ENUM(NFS4CLNT_PURGE_STATE
);
582 TRACE_DEFINE_ENUM(NFS4CLNT_BIND_CONN_TO_SESSION
);
583 TRACE_DEFINE_ENUM(NFS4CLNT_MOVED
);
584 TRACE_DEFINE_ENUM(NFS4CLNT_LEASE_MOVED
);
585 TRACE_DEFINE_ENUM(NFS4CLNT_DELEGATION_EXPIRED
);
586 TRACE_DEFINE_ENUM(NFS4CLNT_RUN_MANAGER
);
587 TRACE_DEFINE_ENUM(NFS4CLNT_DELEGRETURN_RUNNING
);
589 #define show_nfs4_clp_state(state) \
590 __print_flags(state, "|", \
591 { NFS4CLNT_MANAGER_RUNNING, "MANAGER_RUNNING" }, \
592 { NFS4CLNT_CHECK_LEASE, "CHECK_LEASE" }, \
593 { NFS4CLNT_LEASE_EXPIRED, "LEASE_EXPIRED" }, \
594 { NFS4CLNT_RECLAIM_REBOOT, "RECLAIM_REBOOT" }, \
595 { NFS4CLNT_RECLAIM_NOGRACE, "RECLAIM_NOGRACE" }, \
596 { NFS4CLNT_DELEGRETURN, "DELEGRETURN" }, \
597 { NFS4CLNT_SESSION_RESET, "SESSION_RESET" }, \
598 { NFS4CLNT_LEASE_CONFIRM, "LEASE_CONFIRM" }, \
599 { NFS4CLNT_SERVER_SCOPE_MISMATCH, \
600 "SERVER_SCOPE_MISMATCH" }, \
601 { NFS4CLNT_PURGE_STATE, "PURGE_STATE" }, \
602 { NFS4CLNT_BIND_CONN_TO_SESSION, \
603 "BIND_CONN_TO_SESSION" }, \
604 { NFS4CLNT_MOVED, "MOVED" }, \
605 { NFS4CLNT_LEASE_MOVED, "LEASE_MOVED" }, \
606 { NFS4CLNT_DELEGATION_EXPIRED, "DELEGATION_EXPIRED" }, \
607 { NFS4CLNT_RUN_MANAGER, "RUN_MANAGER" }, \
608 { NFS4CLNT_DELEGRETURN_RUNNING, "DELEGRETURN_RUNNING" })
610 TRACE_EVENT(nfs4_state_mgr
,
612 const struct nfs_client
*clp
618 __field(unsigned long, state
)
619 __string(hostname
, clp
->cl_hostname
)
623 __entry
->state
= clp
->cl_state
;
624 __assign_str(hostname
, clp
->cl_hostname
)
628 "hostname=%s clp state=%s", __get_str(hostname
),
629 show_nfs4_clp_state(__entry
->state
)
633 TRACE_EVENT(nfs4_state_mgr_failed
,
635 const struct nfs_client
*clp
,
640 TP_ARGS(clp
, section
, status
),
643 __field(unsigned long, error
)
644 __field(unsigned long, state
)
645 __string(hostname
, clp
->cl_hostname
)
646 __string(section
, section
)
650 __entry
->error
= status
< 0 ? -status
: 0;
651 __entry
->state
= clp
->cl_state
;
652 __assign_str(hostname
, clp
->cl_hostname
);
653 __assign_str(section
, section
);
657 "hostname=%s clp state=%s error=%ld (%s) section=%s",
659 show_nfs4_clp_state(__entry
->state
), -__entry
->error
,
660 show_nfsv4_errors(__entry
->error
), __get_str(section
)
665 TRACE_EVENT(nfs4_xdr_status
,
667 const struct xdr_stream
*xdr
,
672 TP_ARGS(xdr
, op
, error
),
675 __field(unsigned int, task_id
)
676 __field(unsigned int, client_id
)
679 __field(unsigned long, error
)
683 const struct rpc_rqst
*rqstp
= xdr
->rqst
;
684 const struct rpc_task
*task
= rqstp
->rq_task
;
686 __entry
->task_id
= task
->tk_pid
;
687 __entry
->client_id
= task
->tk_client
->cl_clid
;
688 __entry
->xid
= be32_to_cpu(rqstp
->rq_xid
);
690 __entry
->error
= error
;
694 "task:%u@%d xid=0x%08x error=%ld (%s) operation=%u",
695 __entry
->task_id
, __entry
->client_id
, __entry
->xid
,
696 -__entry
->error
, show_nfsv4_errors(__entry
->error
),
701 DECLARE_EVENT_CLASS(nfs4_cb_error_class
,
707 TP_ARGS(xid
, cb_ident
),
711 __field(u32
, cbident
)
715 __entry
->xid
= be32_to_cpu(xid
);
716 __entry
->cbident
= cb_ident
;
720 "xid=0x%08x cb_ident=0x%08x",
721 __entry
->xid
, __entry
->cbident
725 #define DEFINE_CB_ERROR_EVENT(name) \
726 DEFINE_EVENT(nfs4_cb_error_class, nfs_cb_##name, \
731 TP_ARGS(xid, cb_ident))
733 DEFINE_CB_ERROR_EVENT(no_clp
);
734 DEFINE_CB_ERROR_EVENT(badprinc
);
736 DECLARE_EVENT_CLASS(nfs4_open_event
,
738 const struct nfs_open_context
*ctx
,
743 TP_ARGS(ctx
, flags
, error
),
746 __field(unsigned long, error
)
747 __field(unsigned int, flags
)
748 __field(unsigned int, fmode
)
750 __field(u32
, fhandle
)
753 __string(name
, ctx
->dentry
->d_name
.name
)
754 __field(int, stateid_seq
)
755 __field(u32
, stateid_hash
)
756 __field(int, openstateid_seq
)
757 __field(u32
, openstateid_hash
)
761 const struct nfs4_state
*state
= ctx
->state
;
762 const struct inode
*inode
= NULL
;
764 __entry
->error
= -error
;
765 __entry
->flags
= flags
;
766 __entry
->fmode
= (__force
unsigned int)ctx
->mode
;
767 __entry
->dev
= ctx
->dentry
->d_sb
->s_dev
;
768 if (!IS_ERR_OR_NULL(state
)) {
769 inode
= state
->inode
;
770 __entry
->stateid_seq
=
771 be32_to_cpu(state
->stateid
.seqid
);
772 __entry
->stateid_hash
=
773 nfs_stateid_hash(&state
->stateid
);
774 __entry
->openstateid_seq
=
775 be32_to_cpu(state
->open_stateid
.seqid
);
776 __entry
->openstateid_hash
=
777 nfs_stateid_hash(&state
->open_stateid
);
779 __entry
->stateid_seq
= 0;
780 __entry
->stateid_hash
= 0;
781 __entry
->openstateid_seq
= 0;
782 __entry
->openstateid_hash
= 0;
785 __entry
->fileid
= NFS_FILEID(inode
);
786 __entry
->fhandle
= nfs_fhandle_hash(NFS_FH(inode
));
789 __entry
->fhandle
= 0;
791 __entry
->dir
= NFS_FILEID(d_inode(ctx
->dentry
->d_parent
));
792 __assign_str(name
, ctx
->dentry
->d_name
.name
);
796 "error=%ld (%s) flags=%d (%s) fmode=%s "
797 "fileid=%02x:%02x:%llu fhandle=0x%08x "
798 "name=%02x:%02x:%llu/%s stateid=%d:0x%08x "
799 "openstateid=%d:0x%08x",
801 show_nfsv4_errors(__entry
->error
),
803 show_open_flags(__entry
->flags
),
804 show_fmode_flags(__entry
->fmode
),
805 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
806 (unsigned long long)__entry
->fileid
,
808 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
809 (unsigned long long)__entry
->dir
,
811 __entry
->stateid_seq
, __entry
->stateid_hash
,
812 __entry
->openstateid_seq
, __entry
->openstateid_hash
816 #define DEFINE_NFS4_OPEN_EVENT(name) \
817 DEFINE_EVENT(nfs4_open_event, name, \
819 const struct nfs_open_context *ctx, \
823 TP_ARGS(ctx, flags, error))
824 DEFINE_NFS4_OPEN_EVENT(nfs4_open_reclaim
);
825 DEFINE_NFS4_OPEN_EVENT(nfs4_open_expired
);
826 DEFINE_NFS4_OPEN_EVENT(nfs4_open_file
);
828 TRACE_EVENT(nfs4_cached_open
,
830 const struct nfs4_state
*state
835 __field(u32
, fhandle
)
837 __field(unsigned int, fmode
)
838 __field(int, stateid_seq
)
839 __field(u32
, stateid_hash
)
843 const struct inode
*inode
= state
->inode
;
845 __entry
->dev
= inode
->i_sb
->s_dev
;
846 __entry
->fileid
= NFS_FILEID(inode
);
847 __entry
->fhandle
= nfs_fhandle_hash(NFS_FH(inode
));
848 __entry
->fmode
= (__force
unsigned int)state
->state
;
849 __entry
->stateid_seq
=
850 be32_to_cpu(state
->stateid
.seqid
);
851 __entry
->stateid_hash
=
852 nfs_stateid_hash(&state
->stateid
);
856 "fmode=%s fileid=%02x:%02x:%llu "
857 "fhandle=0x%08x stateid=%d:0x%08x",
858 __entry
->fmode
? show_fmode_flags(__entry
->fmode
) :
860 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
861 (unsigned long long)__entry
->fileid
,
863 __entry
->stateid_seq
, __entry
->stateid_hash
867 TRACE_EVENT(nfs4_close
,
869 const struct nfs4_state
*state
,
870 const struct nfs_closeargs
*args
,
871 const struct nfs_closeres
*res
,
875 TP_ARGS(state
, args
, res
, error
),
879 __field(u32
, fhandle
)
881 __field(unsigned int, fmode
)
882 __field(unsigned long, error
)
883 __field(int, stateid_seq
)
884 __field(u32
, stateid_hash
)
888 const struct inode
*inode
= state
->inode
;
890 __entry
->dev
= inode
->i_sb
->s_dev
;
891 __entry
->fileid
= NFS_FILEID(inode
);
892 __entry
->fhandle
= nfs_fhandle_hash(NFS_FH(inode
));
893 __entry
->fmode
= (__force
unsigned int)state
->state
;
894 __entry
->error
= error
< 0 ? -error
: 0;
895 __entry
->stateid_seq
=
896 be32_to_cpu(args
->stateid
.seqid
);
897 __entry
->stateid_hash
=
898 nfs_stateid_hash(&args
->stateid
);
902 "error=%ld (%s) fmode=%s fileid=%02x:%02x:%llu "
903 "fhandle=0x%08x openstateid=%d:0x%08x",
905 show_nfsv4_errors(__entry
->error
),
906 __entry
->fmode
? show_fmode_flags(__entry
->fmode
) :
908 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
909 (unsigned long long)__entry
->fileid
,
911 __entry
->stateid_seq
, __entry
->stateid_hash
915 TRACE_DEFINE_ENUM(F_GETLK
);
916 TRACE_DEFINE_ENUM(F_SETLK
);
917 TRACE_DEFINE_ENUM(F_SETLKW
);
918 TRACE_DEFINE_ENUM(F_RDLCK
);
919 TRACE_DEFINE_ENUM(F_WRLCK
);
920 TRACE_DEFINE_ENUM(F_UNLCK
);
922 #define show_lock_cmd(type) \
923 __print_symbolic((int)type, \
924 { F_GETLK, "GETLK" }, \
925 { F_SETLK, "SETLK" }, \
926 { F_SETLKW, "SETLKW" })
927 #define show_lock_type(type) \
928 __print_symbolic((int)type, \
929 { F_RDLCK, "RDLCK" }, \
930 { F_WRLCK, "WRLCK" }, \
931 { F_UNLCK, "UNLCK" })
933 DECLARE_EVENT_CLASS(nfs4_lock_event
,
935 const struct file_lock
*request
,
936 const struct nfs4_state
*state
,
941 TP_ARGS(request
, state
, cmd
, error
),
944 __field(unsigned long, error
)
947 __field(loff_t
, start
)
950 __field(u32
, fhandle
)
952 __field(int, stateid_seq
)
953 __field(u32
, stateid_hash
)
957 const struct inode
*inode
= state
->inode
;
959 __entry
->error
= error
< 0 ? -error
: 0;
961 __entry
->type
= request
->fl_type
;
962 __entry
->start
= request
->fl_start
;
963 __entry
->end
= request
->fl_end
;
964 __entry
->dev
= inode
->i_sb
->s_dev
;
965 __entry
->fileid
= NFS_FILEID(inode
);
966 __entry
->fhandle
= nfs_fhandle_hash(NFS_FH(inode
));
967 __entry
->stateid_seq
=
968 be32_to_cpu(state
->stateid
.seqid
);
969 __entry
->stateid_hash
=
970 nfs_stateid_hash(&state
->stateid
);
974 "error=%ld (%s) cmd=%s:%s range=%lld:%lld "
975 "fileid=%02x:%02x:%llu fhandle=0x%08x "
978 show_nfsv4_errors(__entry
->error
),
979 show_lock_cmd(__entry
->cmd
),
980 show_lock_type(__entry
->type
),
981 (long long)__entry
->start
,
982 (long long)__entry
->end
,
983 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
984 (unsigned long long)__entry
->fileid
,
986 __entry
->stateid_seq
, __entry
->stateid_hash
990 #define DEFINE_NFS4_LOCK_EVENT(name) \
991 DEFINE_EVENT(nfs4_lock_event, name, \
993 const struct file_lock *request, \
994 const struct nfs4_state *state, \
998 TP_ARGS(request, state, cmd, error))
999 DEFINE_NFS4_LOCK_EVENT(nfs4_get_lock
);
1000 DEFINE_NFS4_LOCK_EVENT(nfs4_unlock
);
1002 TRACE_EVENT(nfs4_set_lock
,
1004 const struct file_lock
*request
,
1005 const struct nfs4_state
*state
,
1006 const nfs4_stateid
*lockstateid
,
1011 TP_ARGS(request
, state
, lockstateid
, cmd
, error
),
1014 __field(unsigned long, error
)
1017 __field(loff_t
, start
)
1018 __field(loff_t
, end
)
1020 __field(u32
, fhandle
)
1021 __field(u64
, fileid
)
1022 __field(int, stateid_seq
)
1023 __field(u32
, stateid_hash
)
1024 __field(int, lockstateid_seq
)
1025 __field(u32
, lockstateid_hash
)
1029 const struct inode
*inode
= state
->inode
;
1031 __entry
->error
= error
< 0 ? -error
: 0;
1033 __entry
->type
= request
->fl_type
;
1034 __entry
->start
= request
->fl_start
;
1035 __entry
->end
= request
->fl_end
;
1036 __entry
->dev
= inode
->i_sb
->s_dev
;
1037 __entry
->fileid
= NFS_FILEID(inode
);
1038 __entry
->fhandle
= nfs_fhandle_hash(NFS_FH(inode
));
1039 __entry
->stateid_seq
=
1040 be32_to_cpu(state
->stateid
.seqid
);
1041 __entry
->stateid_hash
=
1042 nfs_stateid_hash(&state
->stateid
);
1043 __entry
->lockstateid_seq
=
1044 be32_to_cpu(lockstateid
->seqid
);
1045 __entry
->lockstateid_hash
=
1046 nfs_stateid_hash(lockstateid
);
1050 "error=%ld (%s) cmd=%s:%s range=%lld:%lld "
1051 "fileid=%02x:%02x:%llu fhandle=0x%08x "
1052 "stateid=%d:0x%08x lockstateid=%d:0x%08x",
1054 show_nfsv4_errors(__entry
->error
),
1055 show_lock_cmd(__entry
->cmd
),
1056 show_lock_type(__entry
->type
),
1057 (long long)__entry
->start
,
1058 (long long)__entry
->end
,
1059 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1060 (unsigned long long)__entry
->fileid
,
1062 __entry
->stateid_seq
, __entry
->stateid_hash
,
1063 __entry
->lockstateid_seq
, __entry
->lockstateid_hash
1067 TRACE_DEFINE_ENUM(LK_STATE_IN_USE
);
1068 TRACE_DEFINE_ENUM(NFS_DELEGATED_STATE
);
1069 TRACE_DEFINE_ENUM(NFS_OPEN_STATE
);
1070 TRACE_DEFINE_ENUM(NFS_O_RDONLY_STATE
);
1071 TRACE_DEFINE_ENUM(NFS_O_WRONLY_STATE
);
1072 TRACE_DEFINE_ENUM(NFS_O_RDWR_STATE
);
1073 TRACE_DEFINE_ENUM(NFS_STATE_RECLAIM_REBOOT
);
1074 TRACE_DEFINE_ENUM(NFS_STATE_RECLAIM_NOGRACE
);
1075 TRACE_DEFINE_ENUM(NFS_STATE_POSIX_LOCKS
);
1076 TRACE_DEFINE_ENUM(NFS_STATE_RECOVERY_FAILED
);
1077 TRACE_DEFINE_ENUM(NFS_STATE_MAY_NOTIFY_LOCK
);
1078 TRACE_DEFINE_ENUM(NFS_STATE_CHANGE_WAIT
);
1079 TRACE_DEFINE_ENUM(NFS_CLNT_DST_SSC_COPY_STATE
);
1080 TRACE_DEFINE_ENUM(NFS_CLNT_SRC_SSC_COPY_STATE
);
1081 TRACE_DEFINE_ENUM(NFS_SRV_SSC_COPY_STATE
);
1083 #define show_nfs4_state_flags(flags) \
1084 __print_flags(flags, "|", \
1085 { LK_STATE_IN_USE, "IN_USE" }, \
1086 { NFS_DELEGATED_STATE, "DELEGATED" }, \
1087 { NFS_OPEN_STATE, "OPEN" }, \
1088 { NFS_O_RDONLY_STATE, "O_RDONLY" }, \
1089 { NFS_O_WRONLY_STATE, "O_WRONLY" }, \
1090 { NFS_O_RDWR_STATE, "O_RDWR" }, \
1091 { NFS_STATE_RECLAIM_REBOOT, "RECLAIM_REBOOT" }, \
1092 { NFS_STATE_RECLAIM_NOGRACE, "RECLAIM_NOGRACE" }, \
1093 { NFS_STATE_POSIX_LOCKS, "POSIX_LOCKS" }, \
1094 { NFS_STATE_RECOVERY_FAILED, "RECOVERY_FAILED" }, \
1095 { NFS_STATE_MAY_NOTIFY_LOCK, "MAY_NOTIFY_LOCK" }, \
1096 { NFS_STATE_CHANGE_WAIT, "CHANGE_WAIT" }, \
1097 { NFS_CLNT_DST_SSC_COPY_STATE, "CLNT_DST_SSC_COPY" }, \
1098 { NFS_CLNT_SRC_SSC_COPY_STATE, "CLNT_SRC_SSC_COPY" }, \
1099 { NFS_SRV_SSC_COPY_STATE, "SRV_SSC_COPY" })
1101 #define show_nfs4_lock_flags(flags) \
1102 __print_flags(flags, "|", \
1103 { BIT(NFS_LOCK_INITIALIZED), "INITIALIZED" }, \
1104 { BIT(NFS_LOCK_LOST), "LOST" })
1106 TRACE_EVENT(nfs4_state_lock_reclaim
,
1108 const struct nfs4_state
*state
,
1109 const struct nfs4_lock_state
*lock
1112 TP_ARGS(state
, lock
),
1116 __field(u32
, fhandle
)
1117 __field(u64
, fileid
)
1118 __field(unsigned long, state_flags
)
1119 __field(unsigned long, lock_flags
)
1120 __field(int, stateid_seq
)
1121 __field(u32
, stateid_hash
)
1125 const struct inode
*inode
= state
->inode
;
1127 __entry
->dev
= inode
->i_sb
->s_dev
;
1128 __entry
->fileid
= NFS_FILEID(inode
);
1129 __entry
->fhandle
= nfs_fhandle_hash(NFS_FH(inode
));
1130 __entry
->state_flags
= state
->flags
;
1131 __entry
->lock_flags
= lock
->ls_flags
;
1132 __entry
->stateid_seq
=
1133 be32_to_cpu(state
->stateid
.seqid
);
1134 __entry
->stateid_hash
=
1135 nfs_stateid_hash(&state
->stateid
);
1139 "fileid=%02x:%02x:%llu fhandle=0x%08x "
1140 "stateid=%d:0x%08x state_flags=%s lock_flags=%s",
1141 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1142 (unsigned long long)__entry
->fileid
, __entry
->fhandle
,
1143 __entry
->stateid_seq
, __entry
->stateid_hash
,
1144 show_nfs4_state_flags(__entry
->state_flags
),
1145 show_nfs4_lock_flags(__entry
->lock_flags
)
1149 DECLARE_EVENT_CLASS(nfs4_set_delegation_event
,
1151 const struct inode
*inode
,
1155 TP_ARGS(inode
, fmode
),
1159 __field(u32
, fhandle
)
1160 __field(u64
, fileid
)
1161 __field(unsigned int, fmode
)
1165 __entry
->dev
= inode
->i_sb
->s_dev
;
1166 __entry
->fileid
= NFS_FILEID(inode
);
1167 __entry
->fhandle
= nfs_fhandle_hash(NFS_FH(inode
));
1168 __entry
->fmode
= (__force
unsigned int)fmode
;
1172 "fmode=%s fileid=%02x:%02x:%llu fhandle=0x%08x",
1173 show_fmode_flags(__entry
->fmode
),
1174 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1175 (unsigned long long)__entry
->fileid
,
1179 #define DEFINE_NFS4_SET_DELEGATION_EVENT(name) \
1180 DEFINE_EVENT(nfs4_set_delegation_event, name, \
1182 const struct inode *inode, \
1185 TP_ARGS(inode, fmode))
1186 DEFINE_NFS4_SET_DELEGATION_EVENT(nfs4_set_delegation
);
1187 DEFINE_NFS4_SET_DELEGATION_EVENT(nfs4_reclaim_delegation
);
1189 TRACE_EVENT(nfs4_delegreturn_exit
,
1191 const struct nfs4_delegreturnargs
*args
,
1192 const struct nfs4_delegreturnres
*res
,
1196 TP_ARGS(args
, res
, error
),
1200 __field(u32
, fhandle
)
1201 __field(unsigned long, error
)
1202 __field(int, stateid_seq
)
1203 __field(u32
, stateid_hash
)
1207 __entry
->dev
= res
->server
->s_dev
;
1208 __entry
->fhandle
= nfs_fhandle_hash(args
->fhandle
);
1209 __entry
->error
= error
< 0 ? -error
: 0;
1210 __entry
->stateid_seq
=
1211 be32_to_cpu(args
->stateid
->seqid
);
1212 __entry
->stateid_hash
=
1213 nfs_stateid_hash(args
->stateid
);
1217 "error=%ld (%s) dev=%02x:%02x fhandle=0x%08x "
1218 "stateid=%d:0x%08x",
1220 show_nfsv4_errors(__entry
->error
),
1221 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1223 __entry
->stateid_seq
, __entry
->stateid_hash
1227 #ifdef CONFIG_NFS_V4_1
1228 DECLARE_EVENT_CLASS(nfs4_test_stateid_event
,
1230 const struct nfs4_state
*state
,
1231 const struct nfs4_lock_state
*lsp
,
1235 TP_ARGS(state
, lsp
, error
),
1238 __field(unsigned long, error
)
1240 __field(u32
, fhandle
)
1241 __field(u64
, fileid
)
1242 __field(int, stateid_seq
)
1243 __field(u32
, stateid_hash
)
1247 const struct inode
*inode
= state
->inode
;
1249 __entry
->error
= error
< 0 ? -error
: 0;
1250 __entry
->dev
= inode
->i_sb
->s_dev
;
1251 __entry
->fileid
= NFS_FILEID(inode
);
1252 __entry
->fhandle
= nfs_fhandle_hash(NFS_FH(inode
));
1253 __entry
->stateid_seq
=
1254 be32_to_cpu(state
->stateid
.seqid
);
1255 __entry
->stateid_hash
=
1256 nfs_stateid_hash(&state
->stateid
);
1260 "error=%ld (%s) fileid=%02x:%02x:%llu fhandle=0x%08x "
1261 "stateid=%d:0x%08x",
1263 show_nfsv4_errors(__entry
->error
),
1264 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1265 (unsigned long long)__entry
->fileid
,
1267 __entry
->stateid_seq
, __entry
->stateid_hash
1271 #define DEFINE_NFS4_TEST_STATEID_EVENT(name) \
1272 DEFINE_EVENT(nfs4_test_stateid_event, name, \
1274 const struct nfs4_state *state, \
1275 const struct nfs4_lock_state *lsp, \
1278 TP_ARGS(state, lsp, error))
1279 DEFINE_NFS4_TEST_STATEID_EVENT(nfs4_test_delegation_stateid
);
1280 DEFINE_NFS4_TEST_STATEID_EVENT(nfs4_test_open_stateid
);
1281 DEFINE_NFS4_TEST_STATEID_EVENT(nfs4_test_lock_stateid
);
1282 #endif /* CONFIG_NFS_V4_1 */
1284 DECLARE_EVENT_CLASS(nfs4_lookup_event
,
1286 const struct inode
*dir
,
1287 const struct qstr
*name
,
1291 TP_ARGS(dir
, name
, error
),
1295 __field(unsigned long, error
)
1297 __string(name
, name
->name
)
1301 __entry
->dev
= dir
->i_sb
->s_dev
;
1302 __entry
->dir
= NFS_FILEID(dir
);
1303 __entry
->error
= -error
;
1304 __assign_str(name
, name
->name
);
1308 "error=%ld (%s) name=%02x:%02x:%llu/%s",
1310 show_nfsv4_errors(__entry
->error
),
1311 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1312 (unsigned long long)__entry
->dir
,
1317 #define DEFINE_NFS4_LOOKUP_EVENT(name) \
1318 DEFINE_EVENT(nfs4_lookup_event, name, \
1320 const struct inode *dir, \
1321 const struct qstr *name, \
1324 TP_ARGS(dir, name, error))
1326 DEFINE_NFS4_LOOKUP_EVENT(nfs4_lookup
);
1327 DEFINE_NFS4_LOOKUP_EVENT(nfs4_symlink
);
1328 DEFINE_NFS4_LOOKUP_EVENT(nfs4_mkdir
);
1329 DEFINE_NFS4_LOOKUP_EVENT(nfs4_mknod
);
1330 DEFINE_NFS4_LOOKUP_EVENT(nfs4_remove
);
1331 DEFINE_NFS4_LOOKUP_EVENT(nfs4_get_fs_locations
);
1332 DEFINE_NFS4_LOOKUP_EVENT(nfs4_secinfo
);
1334 TRACE_EVENT(nfs4_lookupp
,
1336 const struct inode
*inode
,
1340 TP_ARGS(inode
, error
),
1345 __field(unsigned long, error
)
1349 __entry
->dev
= inode
->i_sb
->s_dev
;
1350 __entry
->ino
= NFS_FILEID(inode
);
1351 __entry
->error
= error
< 0 ? -error
: 0;
1355 "error=%ld (%s) inode=%02x:%02x:%llu",
1357 show_nfsv4_errors(__entry
->error
),
1358 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1359 (unsigned long long)__entry
->ino
1363 TRACE_EVENT(nfs4_rename
,
1365 const struct inode
*olddir
,
1366 const struct qstr
*oldname
,
1367 const struct inode
*newdir
,
1368 const struct qstr
*newname
,
1372 TP_ARGS(olddir
, oldname
, newdir
, newname
, error
),
1376 __field(unsigned long, error
)
1377 __field(u64
, olddir
)
1378 __string(oldname
, oldname
->name
)
1379 __field(u64
, newdir
)
1380 __string(newname
, newname
->name
)
1384 __entry
->dev
= olddir
->i_sb
->s_dev
;
1385 __entry
->olddir
= NFS_FILEID(olddir
);
1386 __entry
->newdir
= NFS_FILEID(newdir
);
1387 __entry
->error
= error
< 0 ? -error
: 0;
1388 __assign_str(oldname
, oldname
->name
);
1389 __assign_str(newname
, newname
->name
);
1393 "error=%ld (%s) oldname=%02x:%02x:%llu/%s "
1394 "newname=%02x:%02x:%llu/%s",
1396 show_nfsv4_errors(__entry
->error
),
1397 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1398 (unsigned long long)__entry
->olddir
,
1400 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1401 (unsigned long long)__entry
->newdir
,
1406 DECLARE_EVENT_CLASS(nfs4_inode_event
,
1408 const struct inode
*inode
,
1412 TP_ARGS(inode
, error
),
1416 __field(u32
, fhandle
)
1417 __field(u64
, fileid
)
1418 __field(unsigned long, error
)
1422 __entry
->dev
= inode
->i_sb
->s_dev
;
1423 __entry
->fileid
= NFS_FILEID(inode
);
1424 __entry
->fhandle
= nfs_fhandle_hash(NFS_FH(inode
));
1425 __entry
->error
= error
< 0 ? -error
: 0;
1429 "error=%ld (%s) fileid=%02x:%02x:%llu fhandle=0x%08x",
1431 show_nfsv4_errors(__entry
->error
),
1432 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1433 (unsigned long long)__entry
->fileid
,
1438 #define DEFINE_NFS4_INODE_EVENT(name) \
1439 DEFINE_EVENT(nfs4_inode_event, name, \
1441 const struct inode *inode, \
1444 TP_ARGS(inode, error))
1446 DEFINE_NFS4_INODE_EVENT(nfs4_access
);
1447 DEFINE_NFS4_INODE_EVENT(nfs4_readlink
);
1448 DEFINE_NFS4_INODE_EVENT(nfs4_readdir
);
1449 DEFINE_NFS4_INODE_EVENT(nfs4_get_acl
);
1450 DEFINE_NFS4_INODE_EVENT(nfs4_set_acl
);
1451 #ifdef CONFIG_NFS_V4_SECURITY_LABEL
1452 DEFINE_NFS4_INODE_EVENT(nfs4_get_security_label
);
1453 DEFINE_NFS4_INODE_EVENT(nfs4_set_security_label
);
1454 #endif /* CONFIG_NFS_V4_SECURITY_LABEL */
1456 DECLARE_EVENT_CLASS(nfs4_inode_stateid_event
,
1458 const struct inode
*inode
,
1459 const nfs4_stateid
*stateid
,
1463 TP_ARGS(inode
, stateid
, error
),
1467 __field(u32
, fhandle
)
1468 __field(u64
, fileid
)
1469 __field(unsigned long, error
)
1470 __field(int, stateid_seq
)
1471 __field(u32
, stateid_hash
)
1475 __entry
->dev
= inode
->i_sb
->s_dev
;
1476 __entry
->fileid
= NFS_FILEID(inode
);
1477 __entry
->fhandle
= nfs_fhandle_hash(NFS_FH(inode
));
1478 __entry
->error
= error
< 0 ? -error
: 0;
1479 __entry
->stateid_seq
=
1480 be32_to_cpu(stateid
->seqid
);
1481 __entry
->stateid_hash
=
1482 nfs_stateid_hash(stateid
);
1486 "error=%ld (%s) fileid=%02x:%02x:%llu fhandle=0x%08x "
1487 "stateid=%d:0x%08x",
1489 show_nfsv4_errors(__entry
->error
),
1490 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1491 (unsigned long long)__entry
->fileid
,
1493 __entry
->stateid_seq
, __entry
->stateid_hash
1497 #define DEFINE_NFS4_INODE_STATEID_EVENT(name) \
1498 DEFINE_EVENT(nfs4_inode_stateid_event, name, \
1500 const struct inode *inode, \
1501 const nfs4_stateid *stateid, \
1504 TP_ARGS(inode, stateid, error))
1506 DEFINE_NFS4_INODE_STATEID_EVENT(nfs4_setattr
);
1507 DEFINE_NFS4_INODE_STATEID_EVENT(nfs4_delegreturn
);
1508 DEFINE_NFS4_INODE_STATEID_EVENT(nfs4_open_stateid_update
);
1509 DEFINE_NFS4_INODE_STATEID_EVENT(nfs4_open_stateid_update_wait
);
1511 DECLARE_EVENT_CLASS(nfs4_getattr_event
,
1513 const struct nfs_server
*server
,
1514 const struct nfs_fh
*fhandle
,
1515 const struct nfs_fattr
*fattr
,
1519 TP_ARGS(server
, fhandle
, fattr
, error
),
1523 __field(u32
, fhandle
)
1524 __field(u64
, fileid
)
1525 __field(unsigned int, valid
)
1526 __field(unsigned long, error
)
1530 __entry
->dev
= server
->s_dev
;
1531 __entry
->valid
= fattr
->valid
;
1532 __entry
->fhandle
= nfs_fhandle_hash(fhandle
);
1533 __entry
->fileid
= (fattr
->valid
& NFS_ATTR_FATTR_FILEID
) ? fattr
->fileid
: 0;
1534 __entry
->error
= error
< 0 ? -error
: 0;
1538 "error=%ld (%s) fileid=%02x:%02x:%llu fhandle=0x%08x "
1541 show_nfsv4_errors(__entry
->error
),
1542 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1543 (unsigned long long)__entry
->fileid
,
1545 show_nfs_fattr_flags(__entry
->valid
)
1549 #define DEFINE_NFS4_GETATTR_EVENT(name) \
1550 DEFINE_EVENT(nfs4_getattr_event, name, \
1552 const struct nfs_server *server, \
1553 const struct nfs_fh *fhandle, \
1554 const struct nfs_fattr *fattr, \
1557 TP_ARGS(server, fhandle, fattr, error))
1558 DEFINE_NFS4_GETATTR_EVENT(nfs4_getattr
);
1559 DEFINE_NFS4_GETATTR_EVENT(nfs4_lookup_root
);
1560 DEFINE_NFS4_GETATTR_EVENT(nfs4_fsinfo
);
1562 DECLARE_EVENT_CLASS(nfs4_inode_callback_event
,
1564 const struct nfs_client
*clp
,
1565 const struct nfs_fh
*fhandle
,
1566 const struct inode
*inode
,
1570 TP_ARGS(clp
, fhandle
, inode
, error
),
1573 __field(unsigned long, error
)
1575 __field(u32
, fhandle
)
1576 __field(u64
, fileid
)
1577 __string(dstaddr
, clp
? clp
->cl_hostname
: "unknown")
1581 __entry
->error
= error
< 0 ? -error
: 0;
1582 __entry
->fhandle
= nfs_fhandle_hash(fhandle
);
1583 if (!IS_ERR_OR_NULL(inode
)) {
1584 __entry
->fileid
= NFS_FILEID(inode
);
1585 __entry
->dev
= inode
->i_sb
->s_dev
;
1587 __entry
->fileid
= 0;
1590 __assign_str(dstaddr
, clp
? clp
->cl_hostname
: "unknown")
1594 "error=%ld (%s) fileid=%02x:%02x:%llu fhandle=0x%08x "
1597 show_nfsv4_errors(__entry
->error
),
1598 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1599 (unsigned long long)__entry
->fileid
,
1605 #define DEFINE_NFS4_INODE_CALLBACK_EVENT(name) \
1606 DEFINE_EVENT(nfs4_inode_callback_event, name, \
1608 const struct nfs_client *clp, \
1609 const struct nfs_fh *fhandle, \
1610 const struct inode *inode, \
1613 TP_ARGS(clp, fhandle, inode, error))
1614 DEFINE_NFS4_INODE_CALLBACK_EVENT(nfs4_cb_getattr
);
1616 DECLARE_EVENT_CLASS(nfs4_inode_stateid_callback_event
,
1618 const struct nfs_client
*clp
,
1619 const struct nfs_fh
*fhandle
,
1620 const struct inode
*inode
,
1621 const nfs4_stateid
*stateid
,
1625 TP_ARGS(clp
, fhandle
, inode
, stateid
, error
),
1628 __field(unsigned long, error
)
1630 __field(u32
, fhandle
)
1631 __field(u64
, fileid
)
1632 __string(dstaddr
, clp
? clp
->cl_hostname
: "unknown")
1633 __field(int, stateid_seq
)
1634 __field(u32
, stateid_hash
)
1638 __entry
->error
= error
< 0 ? -error
: 0;
1639 __entry
->fhandle
= nfs_fhandle_hash(fhandle
);
1640 if (!IS_ERR_OR_NULL(inode
)) {
1641 __entry
->fileid
= NFS_FILEID(inode
);
1642 __entry
->dev
= inode
->i_sb
->s_dev
;
1644 __entry
->fileid
= 0;
1647 __assign_str(dstaddr
, clp
? clp
->cl_hostname
: "unknown")
1648 __entry
->stateid_seq
=
1649 be32_to_cpu(stateid
->seqid
);
1650 __entry
->stateid_hash
=
1651 nfs_stateid_hash(stateid
);
1655 "error=%ld (%s) fileid=%02x:%02x:%llu fhandle=0x%08x "
1656 "stateid=%d:0x%08x dstaddr=%s",
1658 show_nfsv4_errors(__entry
->error
),
1659 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1660 (unsigned long long)__entry
->fileid
,
1662 __entry
->stateid_seq
, __entry
->stateid_hash
,
1667 #define DEFINE_NFS4_INODE_STATEID_CALLBACK_EVENT(name) \
1668 DEFINE_EVENT(nfs4_inode_stateid_callback_event, name, \
1670 const struct nfs_client *clp, \
1671 const struct nfs_fh *fhandle, \
1672 const struct inode *inode, \
1673 const nfs4_stateid *stateid, \
1676 TP_ARGS(clp, fhandle, inode, stateid, error))
1677 DEFINE_NFS4_INODE_STATEID_CALLBACK_EVENT(nfs4_cb_recall
);
1678 DEFINE_NFS4_INODE_STATEID_CALLBACK_EVENT(nfs4_cb_layoutrecall_file
);
1680 DECLARE_EVENT_CLASS(nfs4_idmap_event
,
1688 TP_ARGS(name
, len
, id
, error
),
1691 __field(unsigned long, error
)
1693 __dynamic_array(char, name
, len
> 0 ? len
+ 1 : 1)
1699 __entry
->error
= error
< 0 ? error
: 0;
1701 memcpy(__get_str(name
), name
, len
);
1702 __get_str(name
)[len
] = 0;
1706 "error=%ld (%s) id=%u name=%s",
1707 -__entry
->error
, show_nfsv4_errors(__entry
->error
),
1712 #define DEFINE_NFS4_IDMAP_EVENT(name) \
1713 DEFINE_EVENT(nfs4_idmap_event, name, \
1720 TP_ARGS(name, len, id, error))
1721 DEFINE_NFS4_IDMAP_EVENT(nfs4_map_name_to_uid
);
1722 DEFINE_NFS4_IDMAP_EVENT(nfs4_map_group_to_gid
);
1723 DEFINE_NFS4_IDMAP_EVENT(nfs4_map_uid_to_name
);
1724 DEFINE_NFS4_IDMAP_EVENT(nfs4_map_gid_to_group
);
1726 DECLARE_EVENT_CLASS(nfs4_read_event
,
1728 const struct nfs_pgio_header
*hdr
,
1732 TP_ARGS(hdr
, error
),
1736 __field(u32
, fhandle
)
1737 __field(u64
, fileid
)
1738 __field(loff_t
, offset
)
1739 __field(u32
, arg_count
)
1740 __field(u32
, res_count
)
1741 __field(unsigned long, error
)
1742 __field(int, stateid_seq
)
1743 __field(u32
, stateid_hash
)
1747 const struct inode
*inode
= hdr
->inode
;
1748 const struct nfs_inode
*nfsi
= NFS_I(inode
);
1749 const struct nfs_fh
*fh
= hdr
->args
.fh
?
1750 hdr
->args
.fh
: &nfsi
->fh
;
1751 const struct nfs4_state
*state
=
1752 hdr
->args
.context
->state
;
1754 __entry
->dev
= inode
->i_sb
->s_dev
;
1755 __entry
->fileid
= nfsi
->fileid
;
1756 __entry
->fhandle
= nfs_fhandle_hash(fh
);
1757 __entry
->offset
= hdr
->args
.offset
;
1758 __entry
->arg_count
= hdr
->args
.count
;
1759 __entry
->res_count
= hdr
->res
.count
;
1760 __entry
->error
= error
< 0 ? -error
: 0;
1761 __entry
->stateid_seq
=
1762 be32_to_cpu(state
->stateid
.seqid
);
1763 __entry
->stateid_hash
=
1764 nfs_stateid_hash(&state
->stateid
);
1768 "error=%ld (%s) fileid=%02x:%02x:%llu fhandle=0x%08x "
1769 "offset=%lld count=%u res=%u stateid=%d:0x%08x",
1771 show_nfsv4_errors(__entry
->error
),
1772 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1773 (unsigned long long)__entry
->fileid
,
1775 (long long)__entry
->offset
,
1776 __entry
->arg_count
, __entry
->res_count
,
1777 __entry
->stateid_seq
, __entry
->stateid_hash
1780 #define DEFINE_NFS4_READ_EVENT(name) \
1781 DEFINE_EVENT(nfs4_read_event, name, \
1783 const struct nfs_pgio_header *hdr, \
1786 TP_ARGS(hdr, error))
1787 DEFINE_NFS4_READ_EVENT(nfs4_read
);
1788 #ifdef CONFIG_NFS_V4_1
1789 DEFINE_NFS4_READ_EVENT(nfs4_pnfs_read
);
1790 #endif /* CONFIG_NFS_V4_1 */
1792 DECLARE_EVENT_CLASS(nfs4_write_event
,
1794 const struct nfs_pgio_header
*hdr
,
1798 TP_ARGS(hdr
, error
),
1802 __field(u32
, fhandle
)
1803 __field(u64
, fileid
)
1804 __field(loff_t
, offset
)
1805 __field(u32
, arg_count
)
1806 __field(u32
, res_count
)
1807 __field(unsigned long, error
)
1808 __field(int, stateid_seq
)
1809 __field(u32
, stateid_hash
)
1813 const struct inode
*inode
= hdr
->inode
;
1814 const struct nfs_inode
*nfsi
= NFS_I(inode
);
1815 const struct nfs_fh
*fh
= hdr
->args
.fh
?
1816 hdr
->args
.fh
: &nfsi
->fh
;
1817 const struct nfs4_state
*state
=
1818 hdr
->args
.context
->state
;
1820 __entry
->dev
= inode
->i_sb
->s_dev
;
1821 __entry
->fileid
= nfsi
->fileid
;
1822 __entry
->fhandle
= nfs_fhandle_hash(fh
);
1823 __entry
->offset
= hdr
->args
.offset
;
1824 __entry
->arg_count
= hdr
->args
.count
;
1825 __entry
->res_count
= hdr
->res
.count
;
1826 __entry
->error
= error
< 0 ? -error
: 0;
1827 __entry
->stateid_seq
=
1828 be32_to_cpu(state
->stateid
.seqid
);
1829 __entry
->stateid_hash
=
1830 nfs_stateid_hash(&state
->stateid
);
1834 "error=%ld (%s) fileid=%02x:%02x:%llu fhandle=0x%08x "
1835 "offset=%lld count=%u res=%u stateid=%d:0x%08x",
1837 show_nfsv4_errors(__entry
->error
),
1838 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1839 (unsigned long long)__entry
->fileid
,
1841 (long long)__entry
->offset
,
1842 __entry
->arg_count
, __entry
->res_count
,
1843 __entry
->stateid_seq
, __entry
->stateid_hash
1847 #define DEFINE_NFS4_WRITE_EVENT(name) \
1848 DEFINE_EVENT(nfs4_write_event, name, \
1850 const struct nfs_pgio_header *hdr, \
1853 TP_ARGS(hdr, error))
1854 DEFINE_NFS4_WRITE_EVENT(nfs4_write
);
1855 #ifdef CONFIG_NFS_V4_1
1856 DEFINE_NFS4_WRITE_EVENT(nfs4_pnfs_write
);
1857 #endif /* CONFIG_NFS_V4_1 */
1859 DECLARE_EVENT_CLASS(nfs4_commit_event
,
1861 const struct nfs_commit_data
*data
,
1865 TP_ARGS(data
, error
),
1869 __field(u32
, fhandle
)
1870 __field(u64
, fileid
)
1871 __field(unsigned long, error
)
1872 __field(loff_t
, offset
)
1877 const struct inode
*inode
= data
->inode
;
1878 const struct nfs_inode
*nfsi
= NFS_I(inode
);
1879 const struct nfs_fh
*fh
= data
->args
.fh
?
1880 data
->args
.fh
: &nfsi
->fh
;
1882 __entry
->dev
= inode
->i_sb
->s_dev
;
1883 __entry
->fileid
= nfsi
->fileid
;
1884 __entry
->fhandle
= nfs_fhandle_hash(fh
);
1885 __entry
->offset
= data
->args
.offset
;
1886 __entry
->count
= data
->args
.count
;
1887 __entry
->error
= error
< 0 ? -error
: 0;
1891 "error=%ld (%s) fileid=%02x:%02x:%llu fhandle=0x%08x "
1892 "offset=%lld count=%u",
1894 show_nfsv4_errors(__entry
->error
),
1895 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1896 (unsigned long long)__entry
->fileid
,
1898 (long long)__entry
->offset
,
1902 #define DEFINE_NFS4_COMMIT_EVENT(name) \
1903 DEFINE_EVENT(nfs4_commit_event, name, \
1905 const struct nfs_commit_data *data, \
1908 TP_ARGS(data, error))
1909 DEFINE_NFS4_COMMIT_EVENT(nfs4_commit
);
1910 #ifdef CONFIG_NFS_V4_1
1911 DEFINE_NFS4_COMMIT_EVENT(nfs4_pnfs_commit_ds
);
1913 TRACE_DEFINE_ENUM(IOMODE_READ
);
1914 TRACE_DEFINE_ENUM(IOMODE_RW
);
1915 TRACE_DEFINE_ENUM(IOMODE_ANY
);
1917 #define show_pnfs_iomode(iomode) \
1918 __print_symbolic(iomode, \
1919 { IOMODE_READ, "READ" }, \
1920 { IOMODE_RW, "RW" }, \
1921 { IOMODE_ANY, "ANY" })
1923 TRACE_EVENT(nfs4_layoutget
,
1925 const struct nfs_open_context
*ctx
,
1926 const struct pnfs_layout_range
*args
,
1927 const struct pnfs_layout_range
*res
,
1928 const nfs4_stateid
*layout_stateid
,
1932 TP_ARGS(ctx
, args
, res
, layout_stateid
, error
),
1936 __field(u32
, fhandle
)
1937 __field(u64
, fileid
)
1938 __field(u32
, iomode
)
1939 __field(u64
, offset
)
1941 __field(unsigned long, error
)
1942 __field(int, stateid_seq
)
1943 __field(u32
, stateid_hash
)
1944 __field(int, layoutstateid_seq
)
1945 __field(u32
, layoutstateid_hash
)
1949 const struct inode
*inode
= d_inode(ctx
->dentry
);
1950 const struct nfs4_state
*state
= ctx
->state
;
1951 __entry
->dev
= inode
->i_sb
->s_dev
;
1952 __entry
->fileid
= NFS_FILEID(inode
);
1953 __entry
->fhandle
= nfs_fhandle_hash(NFS_FH(inode
));
1954 __entry
->iomode
= args
->iomode
;
1955 __entry
->offset
= args
->offset
;
1956 __entry
->count
= args
->length
;
1957 __entry
->error
= error
< 0 ? -error
: 0;
1958 __entry
->stateid_seq
=
1959 be32_to_cpu(state
->stateid
.seqid
);
1960 __entry
->stateid_hash
=
1961 nfs_stateid_hash(&state
->stateid
);
1963 __entry
->layoutstateid_seq
=
1964 be32_to_cpu(layout_stateid
->seqid
);
1965 __entry
->layoutstateid_hash
=
1966 nfs_stateid_hash(layout_stateid
);
1968 __entry
->layoutstateid_seq
= 0;
1969 __entry
->layoutstateid_hash
= 0;
1974 "error=%ld (%s) fileid=%02x:%02x:%llu fhandle=0x%08x "
1975 "iomode=%s offset=%llu count=%llu stateid=%d:0x%08x "
1976 "layoutstateid=%d:0x%08x",
1978 show_nfsv4_errors(__entry
->error
),
1979 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1980 (unsigned long long)__entry
->fileid
,
1982 show_pnfs_iomode(__entry
->iomode
),
1983 (unsigned long long)__entry
->offset
,
1984 (unsigned long long)__entry
->count
,
1985 __entry
->stateid_seq
, __entry
->stateid_hash
,
1986 __entry
->layoutstateid_seq
, __entry
->layoutstateid_hash
1990 DEFINE_NFS4_INODE_STATEID_EVENT(nfs4_layoutcommit
);
1991 DEFINE_NFS4_INODE_STATEID_EVENT(nfs4_layoutreturn
);
1992 DEFINE_NFS4_INODE_EVENT(nfs4_layoutreturn_on_close
);
1994 TRACE_DEFINE_ENUM(PNFS_UPDATE_LAYOUT_UNKNOWN
);
1995 TRACE_DEFINE_ENUM(PNFS_UPDATE_LAYOUT_NO_PNFS
);
1996 TRACE_DEFINE_ENUM(PNFS_UPDATE_LAYOUT_RD_ZEROLEN
);
1997 TRACE_DEFINE_ENUM(PNFS_UPDATE_LAYOUT_MDSTHRESH
);
1998 TRACE_DEFINE_ENUM(PNFS_UPDATE_LAYOUT_NOMEM
);
1999 TRACE_DEFINE_ENUM(PNFS_UPDATE_LAYOUT_BULK_RECALL
);
2000 TRACE_DEFINE_ENUM(PNFS_UPDATE_LAYOUT_IO_TEST_FAIL
);
2001 TRACE_DEFINE_ENUM(PNFS_UPDATE_LAYOUT_FOUND_CACHED
);
2002 TRACE_DEFINE_ENUM(PNFS_UPDATE_LAYOUT_RETURN
);
2003 TRACE_DEFINE_ENUM(PNFS_UPDATE_LAYOUT_BLOCKED
);
2004 TRACE_DEFINE_ENUM(PNFS_UPDATE_LAYOUT_INVALID_OPEN
);
2005 TRACE_DEFINE_ENUM(PNFS_UPDATE_LAYOUT_RETRY
);
2006 TRACE_DEFINE_ENUM(PNFS_UPDATE_LAYOUT_SEND_LAYOUTGET
);
2007 TRACE_DEFINE_ENUM(PNFS_UPDATE_LAYOUT_EXIT
);
2009 #define show_pnfs_update_layout_reason(reason) \
2010 __print_symbolic(reason, \
2011 { PNFS_UPDATE_LAYOUT_UNKNOWN, "unknown" }, \
2012 { PNFS_UPDATE_LAYOUT_NO_PNFS, "no pnfs" }, \
2013 { PNFS_UPDATE_LAYOUT_RD_ZEROLEN, "read+zerolen" }, \
2014 { PNFS_UPDATE_LAYOUT_MDSTHRESH, "mdsthresh" }, \
2015 { PNFS_UPDATE_LAYOUT_NOMEM, "nomem" }, \
2016 { PNFS_UPDATE_LAYOUT_BULK_RECALL, "bulk recall" }, \
2017 { PNFS_UPDATE_LAYOUT_IO_TEST_FAIL, "io test fail" }, \
2018 { PNFS_UPDATE_LAYOUT_FOUND_CACHED, "found cached" }, \
2019 { PNFS_UPDATE_LAYOUT_RETURN, "layoutreturn" }, \
2020 { PNFS_UPDATE_LAYOUT_BLOCKED, "layouts blocked" }, \
2021 { PNFS_UPDATE_LAYOUT_INVALID_OPEN, "invalid open" }, \
2022 { PNFS_UPDATE_LAYOUT_RETRY, "retrying" }, \
2023 { PNFS_UPDATE_LAYOUT_SEND_LAYOUTGET, "sent layoutget" }, \
2024 { PNFS_UPDATE_LAYOUT_EXIT, "exit" })
2026 TRACE_EVENT(pnfs_update_layout
,
2027 TP_PROTO(struct inode
*inode
,
2030 enum pnfs_iomode iomode
,
2031 struct pnfs_layout_hdr
*lo
,
2032 struct pnfs_layout_segment
*lseg
,
2033 enum pnfs_update_layout_reason reason
2035 TP_ARGS(inode
, pos
, count
, iomode
, lo
, lseg
, reason
),
2038 __field(u64
, fileid
)
2039 __field(u32
, fhandle
)
2040 __field(loff_t
, pos
)
2042 __field(enum pnfs_iomode
, iomode
)
2043 __field(int, layoutstateid_seq
)
2044 __field(u32
, layoutstateid_hash
)
2046 __field(enum pnfs_update_layout_reason
, reason
)
2049 __entry
->dev
= inode
->i_sb
->s_dev
;
2050 __entry
->fileid
= NFS_FILEID(inode
);
2051 __entry
->fhandle
= nfs_fhandle_hash(NFS_FH(inode
));
2053 __entry
->count
= count
;
2054 __entry
->iomode
= iomode
;
2055 __entry
->reason
= reason
;
2057 __entry
->layoutstateid_seq
=
2058 be32_to_cpu(lo
->plh_stateid
.seqid
);
2059 __entry
->layoutstateid_hash
=
2060 nfs_stateid_hash(&lo
->plh_stateid
);
2062 __entry
->layoutstateid_seq
= 0;
2063 __entry
->layoutstateid_hash
= 0;
2065 __entry
->lseg
= (long)lseg
;
2068 "fileid=%02x:%02x:%llu fhandle=0x%08x "
2069 "iomode=%s pos=%llu count=%llu "
2070 "layoutstateid=%d:0x%08x lseg=0x%lx (%s)",
2071 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
2072 (unsigned long long)__entry
->fileid
,
2074 show_pnfs_iomode(__entry
->iomode
),
2075 (unsigned long long)__entry
->pos
,
2076 (unsigned long long)__entry
->count
,
2077 __entry
->layoutstateid_seq
, __entry
->layoutstateid_hash
,
2079 show_pnfs_update_layout_reason(__entry
->reason
)
2083 DECLARE_EVENT_CLASS(pnfs_layout_event
,
2084 TP_PROTO(struct inode
*inode
,
2087 enum pnfs_iomode iomode
,
2088 struct pnfs_layout_hdr
*lo
,
2089 struct pnfs_layout_segment
*lseg
2091 TP_ARGS(inode
, pos
, count
, iomode
, lo
, lseg
),
2094 __field(u64
, fileid
)
2095 __field(u32
, fhandle
)
2096 __field(loff_t
, pos
)
2098 __field(enum pnfs_iomode
, iomode
)
2099 __field(int, layoutstateid_seq
)
2100 __field(u32
, layoutstateid_hash
)
2104 __entry
->dev
= inode
->i_sb
->s_dev
;
2105 __entry
->fileid
= NFS_FILEID(inode
);
2106 __entry
->fhandle
= nfs_fhandle_hash(NFS_FH(inode
));
2108 __entry
->count
= count
;
2109 __entry
->iomode
= iomode
;
2111 __entry
->layoutstateid_seq
=
2112 be32_to_cpu(lo
->plh_stateid
.seqid
);
2113 __entry
->layoutstateid_hash
=
2114 nfs_stateid_hash(&lo
->plh_stateid
);
2116 __entry
->layoutstateid_seq
= 0;
2117 __entry
->layoutstateid_hash
= 0;
2119 __entry
->lseg
= (long)lseg
;
2122 "fileid=%02x:%02x:%llu fhandle=0x%08x "
2123 "iomode=%s pos=%llu count=%llu "
2124 "layoutstateid=%d:0x%08x lseg=0x%lx",
2125 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
2126 (unsigned long long)__entry
->fileid
,
2128 show_pnfs_iomode(__entry
->iomode
),
2129 (unsigned long long)__entry
->pos
,
2130 (unsigned long long)__entry
->count
,
2131 __entry
->layoutstateid_seq
, __entry
->layoutstateid_hash
,
2136 #define DEFINE_PNFS_LAYOUT_EVENT(name) \
2137 DEFINE_EVENT(pnfs_layout_event, name, \
2138 TP_PROTO(struct inode *inode, \
2141 enum pnfs_iomode iomode, \
2142 struct pnfs_layout_hdr *lo, \
2143 struct pnfs_layout_segment *lseg \
2145 TP_ARGS(inode, pos, count, iomode, lo, lseg))
2147 DEFINE_PNFS_LAYOUT_EVENT(pnfs_mds_fallback_pg_init_read
);
2148 DEFINE_PNFS_LAYOUT_EVENT(pnfs_mds_fallback_pg_init_write
);
2149 DEFINE_PNFS_LAYOUT_EVENT(pnfs_mds_fallback_pg_get_mirror_count
);
2150 DEFINE_PNFS_LAYOUT_EVENT(pnfs_mds_fallback_read_done
);
2151 DEFINE_PNFS_LAYOUT_EVENT(pnfs_mds_fallback_write_done
);
2152 DEFINE_PNFS_LAYOUT_EVENT(pnfs_mds_fallback_read_pagelist
);
2153 DEFINE_PNFS_LAYOUT_EVENT(pnfs_mds_fallback_write_pagelist
);
2155 DECLARE_EVENT_CLASS(nfs4_flexfiles_io_event
,
2157 const struct nfs_pgio_header
*hdr
2163 __field(unsigned long, error
)
2165 __field(u32
, fhandle
)
2166 __field(u64
, fileid
)
2167 __field(loff_t
, offset
)
2169 __field(int, stateid_seq
)
2170 __field(u32
, stateid_hash
)
2171 __string(dstaddr
, hdr
->ds_clp
?
2172 rpc_peeraddr2str(hdr
->ds_clp
->cl_rpcclient
,
2173 RPC_DISPLAY_ADDR
) : "unknown")
2177 const struct inode
*inode
= hdr
->inode
;
2179 __entry
->error
= hdr
->res
.op_status
;
2180 __entry
->fhandle
= nfs_fhandle_hash(hdr
->args
.fh
);
2181 __entry
->fileid
= NFS_FILEID(inode
);
2182 __entry
->dev
= inode
->i_sb
->s_dev
;
2183 __entry
->offset
= hdr
->args
.offset
;
2184 __entry
->count
= hdr
->args
.count
;
2185 __entry
->stateid_seq
=
2186 be32_to_cpu(hdr
->args
.stateid
.seqid
);
2187 __entry
->stateid_hash
=
2188 nfs_stateid_hash(&hdr
->args
.stateid
);
2189 __assign_str(dstaddr
, hdr
->ds_clp
?
2190 rpc_peeraddr2str(hdr
->ds_clp
->cl_rpcclient
,
2191 RPC_DISPLAY_ADDR
) : "unknown");
2195 "error=%ld (%s) fileid=%02x:%02x:%llu fhandle=0x%08x "
2196 "offset=%llu count=%u stateid=%d:0x%08x dstaddr=%s",
2198 show_nfsv4_errors(__entry
->error
),
2199 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
2200 (unsigned long long)__entry
->fileid
,
2202 __entry
->offset
, __entry
->count
,
2203 __entry
->stateid_seq
, __entry
->stateid_hash
,
2208 #define DEFINE_NFS4_FLEXFILES_IO_EVENT(name) \
2209 DEFINE_EVENT(nfs4_flexfiles_io_event, name, \
2211 const struct nfs_pgio_header *hdr \
2214 DEFINE_NFS4_FLEXFILES_IO_EVENT(ff_layout_read_error
);
2215 DEFINE_NFS4_FLEXFILES_IO_EVENT(ff_layout_write_error
);
2217 TRACE_EVENT(ff_layout_commit_error
,
2219 const struct nfs_commit_data
*data
2225 __field(unsigned long, error
)
2227 __field(u32
, fhandle
)
2228 __field(u64
, fileid
)
2229 __field(loff_t
, offset
)
2231 __string(dstaddr
, data
->ds_clp
?
2232 rpc_peeraddr2str(data
->ds_clp
->cl_rpcclient
,
2233 RPC_DISPLAY_ADDR
) : "unknown")
2237 const struct inode
*inode
= data
->inode
;
2239 __entry
->error
= data
->res
.op_status
;
2240 __entry
->fhandle
= nfs_fhandle_hash(data
->args
.fh
);
2241 __entry
->fileid
= NFS_FILEID(inode
);
2242 __entry
->dev
= inode
->i_sb
->s_dev
;
2243 __entry
->offset
= data
->args
.offset
;
2244 __entry
->count
= data
->args
.count
;
2245 __assign_str(dstaddr
, data
->ds_clp
?
2246 rpc_peeraddr2str(data
->ds_clp
->cl_rpcclient
,
2247 RPC_DISPLAY_ADDR
) : "unknown");
2251 "error=%ld (%s) fileid=%02x:%02x:%llu fhandle=0x%08x "
2252 "offset=%llu count=%u dstaddr=%s",
2254 show_nfsv4_errors(__entry
->error
),
2255 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
2256 (unsigned long long)__entry
->fileid
,
2258 __entry
->offset
, __entry
->count
,
2264 #endif /* CONFIG_NFS_V4_1 */
2266 #endif /* _TRACE_NFS4_H */
2268 #undef TRACE_INCLUDE_PATH
2269 #define TRACE_INCLUDE_PATH .
2270 #define TRACE_INCLUDE_FILE nfs4trace
2271 /* This part must be outside protection */
2272 #include <trace/define_trace.h>