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_RECALL_RUNNING
);
588 TRACE_DEFINE_ENUM(NFS4CLNT_RECALL_ANY_LAYOUT_READ
);
589 TRACE_DEFINE_ENUM(NFS4CLNT_RECALL_ANY_LAYOUT_RW
);
591 #define show_nfs4_clp_state(state) \
592 __print_flags(state, "|", \
593 { NFS4CLNT_MANAGER_RUNNING, "MANAGER_RUNNING" }, \
594 { NFS4CLNT_CHECK_LEASE, "CHECK_LEASE" }, \
595 { NFS4CLNT_LEASE_EXPIRED, "LEASE_EXPIRED" }, \
596 { NFS4CLNT_RECLAIM_REBOOT, "RECLAIM_REBOOT" }, \
597 { NFS4CLNT_RECLAIM_NOGRACE, "RECLAIM_NOGRACE" }, \
598 { NFS4CLNT_DELEGRETURN, "DELEGRETURN" }, \
599 { NFS4CLNT_SESSION_RESET, "SESSION_RESET" }, \
600 { NFS4CLNT_LEASE_CONFIRM, "LEASE_CONFIRM" }, \
601 { NFS4CLNT_SERVER_SCOPE_MISMATCH, \
602 "SERVER_SCOPE_MISMATCH" }, \
603 { NFS4CLNT_PURGE_STATE, "PURGE_STATE" }, \
604 { NFS4CLNT_BIND_CONN_TO_SESSION, \
605 "BIND_CONN_TO_SESSION" }, \
606 { NFS4CLNT_MOVED, "MOVED" }, \
607 { NFS4CLNT_LEASE_MOVED, "LEASE_MOVED" }, \
608 { NFS4CLNT_DELEGATION_EXPIRED, "DELEGATION_EXPIRED" }, \
609 { NFS4CLNT_RUN_MANAGER, "RUN_MANAGER" }, \
610 { NFS4CLNT_RECALL_RUNNING, "RECALL_RUNNING" }, \
611 { NFS4CLNT_RECALL_ANY_LAYOUT_READ, "RECALL_ANY_LAYOUT_READ" }, \
612 { NFS4CLNT_RECALL_ANY_LAYOUT_RW, "RECALL_ANY_LAYOUT_RW" })
614 TRACE_EVENT(nfs4_state_mgr
,
616 const struct nfs_client
*clp
622 __field(unsigned long, state
)
623 __string(hostname
, clp
->cl_hostname
)
627 __entry
->state
= clp
->cl_state
;
628 __assign_str(hostname
, clp
->cl_hostname
)
632 "hostname=%s clp state=%s", __get_str(hostname
),
633 show_nfs4_clp_state(__entry
->state
)
637 TRACE_EVENT(nfs4_state_mgr_failed
,
639 const struct nfs_client
*clp
,
644 TP_ARGS(clp
, section
, status
),
647 __field(unsigned long, error
)
648 __field(unsigned long, state
)
649 __string(hostname
, clp
->cl_hostname
)
650 __string(section
, section
)
654 __entry
->error
= status
< 0 ? -status
: 0;
655 __entry
->state
= clp
->cl_state
;
656 __assign_str(hostname
, clp
->cl_hostname
);
657 __assign_str(section
, section
);
661 "hostname=%s clp state=%s error=%ld (%s) section=%s",
663 show_nfs4_clp_state(__entry
->state
), -__entry
->error
,
664 show_nfsv4_errors(__entry
->error
), __get_str(section
)
669 TRACE_EVENT(nfs4_xdr_status
,
671 const struct xdr_stream
*xdr
,
676 TP_ARGS(xdr
, op
, error
),
679 __field(unsigned int, task_id
)
680 __field(unsigned int, client_id
)
683 __field(unsigned long, error
)
687 const struct rpc_rqst
*rqstp
= xdr
->rqst
;
688 const struct rpc_task
*task
= rqstp
->rq_task
;
690 __entry
->task_id
= task
->tk_pid
;
691 __entry
->client_id
= task
->tk_client
->cl_clid
;
692 __entry
->xid
= be32_to_cpu(rqstp
->rq_xid
);
694 __entry
->error
= error
;
698 "task:%u@%d xid=0x%08x error=%ld (%s) operation=%u",
699 __entry
->task_id
, __entry
->client_id
, __entry
->xid
,
700 -__entry
->error
, show_nfsv4_errors(__entry
->error
),
705 DECLARE_EVENT_CLASS(nfs4_cb_error_class
,
711 TP_ARGS(xid
, cb_ident
),
715 __field(u32
, cbident
)
719 __entry
->xid
= be32_to_cpu(xid
);
720 __entry
->cbident
= cb_ident
;
724 "xid=0x%08x cb_ident=0x%08x",
725 __entry
->xid
, __entry
->cbident
729 #define DEFINE_CB_ERROR_EVENT(name) \
730 DEFINE_EVENT(nfs4_cb_error_class, nfs_cb_##name, \
735 TP_ARGS(xid, cb_ident))
737 DEFINE_CB_ERROR_EVENT(no_clp
);
738 DEFINE_CB_ERROR_EVENT(badprinc
);
740 DECLARE_EVENT_CLASS(nfs4_open_event
,
742 const struct nfs_open_context
*ctx
,
747 TP_ARGS(ctx
, flags
, error
),
750 __field(unsigned long, error
)
751 __field(unsigned int, flags
)
752 __field(unsigned int, fmode
)
754 __field(u32
, fhandle
)
757 __string(name
, ctx
->dentry
->d_name
.name
)
758 __field(int, stateid_seq
)
759 __field(u32
, stateid_hash
)
760 __field(int, openstateid_seq
)
761 __field(u32
, openstateid_hash
)
765 const struct nfs4_state
*state
= ctx
->state
;
766 const struct inode
*inode
= NULL
;
768 __entry
->error
= -error
;
769 __entry
->flags
= flags
;
770 __entry
->fmode
= (__force
unsigned int)ctx
->mode
;
771 __entry
->dev
= ctx
->dentry
->d_sb
->s_dev
;
772 if (!IS_ERR_OR_NULL(state
)) {
773 inode
= state
->inode
;
774 __entry
->stateid_seq
=
775 be32_to_cpu(state
->stateid
.seqid
);
776 __entry
->stateid_hash
=
777 nfs_stateid_hash(&state
->stateid
);
778 __entry
->openstateid_seq
=
779 be32_to_cpu(state
->open_stateid
.seqid
);
780 __entry
->openstateid_hash
=
781 nfs_stateid_hash(&state
->open_stateid
);
783 __entry
->stateid_seq
= 0;
784 __entry
->stateid_hash
= 0;
785 __entry
->openstateid_seq
= 0;
786 __entry
->openstateid_hash
= 0;
789 __entry
->fileid
= NFS_FILEID(inode
);
790 __entry
->fhandle
= nfs_fhandle_hash(NFS_FH(inode
));
793 __entry
->fhandle
= 0;
795 __entry
->dir
= NFS_FILEID(d_inode(ctx
->dentry
->d_parent
));
796 __assign_str(name
, ctx
->dentry
->d_name
.name
);
800 "error=%ld (%s) flags=%d (%s) fmode=%s "
801 "fileid=%02x:%02x:%llu fhandle=0x%08x "
802 "name=%02x:%02x:%llu/%s stateid=%d:0x%08x "
803 "openstateid=%d:0x%08x",
805 show_nfsv4_errors(__entry
->error
),
807 show_open_flags(__entry
->flags
),
808 show_fmode_flags(__entry
->fmode
),
809 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
810 (unsigned long long)__entry
->fileid
,
812 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
813 (unsigned long long)__entry
->dir
,
815 __entry
->stateid_seq
, __entry
->stateid_hash
,
816 __entry
->openstateid_seq
, __entry
->openstateid_hash
820 #define DEFINE_NFS4_OPEN_EVENT(name) \
821 DEFINE_EVENT(nfs4_open_event, name, \
823 const struct nfs_open_context *ctx, \
827 TP_ARGS(ctx, flags, error))
828 DEFINE_NFS4_OPEN_EVENT(nfs4_open_reclaim
);
829 DEFINE_NFS4_OPEN_EVENT(nfs4_open_expired
);
830 DEFINE_NFS4_OPEN_EVENT(nfs4_open_file
);
832 TRACE_EVENT(nfs4_cached_open
,
834 const struct nfs4_state
*state
839 __field(u32
, fhandle
)
841 __field(unsigned int, fmode
)
842 __field(int, stateid_seq
)
843 __field(u32
, stateid_hash
)
847 const struct inode
*inode
= state
->inode
;
849 __entry
->dev
= inode
->i_sb
->s_dev
;
850 __entry
->fileid
= NFS_FILEID(inode
);
851 __entry
->fhandle
= nfs_fhandle_hash(NFS_FH(inode
));
852 __entry
->fmode
= (__force
unsigned int)state
->state
;
853 __entry
->stateid_seq
=
854 be32_to_cpu(state
->stateid
.seqid
);
855 __entry
->stateid_hash
=
856 nfs_stateid_hash(&state
->stateid
);
860 "fmode=%s fileid=%02x:%02x:%llu "
861 "fhandle=0x%08x stateid=%d:0x%08x",
862 __entry
->fmode
? show_fmode_flags(__entry
->fmode
) :
864 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
865 (unsigned long long)__entry
->fileid
,
867 __entry
->stateid_seq
, __entry
->stateid_hash
871 TRACE_EVENT(nfs4_close
,
873 const struct nfs4_state
*state
,
874 const struct nfs_closeargs
*args
,
875 const struct nfs_closeres
*res
,
879 TP_ARGS(state
, args
, res
, error
),
883 __field(u32
, fhandle
)
885 __field(unsigned int, fmode
)
886 __field(unsigned long, error
)
887 __field(int, stateid_seq
)
888 __field(u32
, stateid_hash
)
892 const struct inode
*inode
= state
->inode
;
894 __entry
->dev
= inode
->i_sb
->s_dev
;
895 __entry
->fileid
= NFS_FILEID(inode
);
896 __entry
->fhandle
= nfs_fhandle_hash(NFS_FH(inode
));
897 __entry
->fmode
= (__force
unsigned int)state
->state
;
898 __entry
->error
= error
< 0 ? -error
: 0;
899 __entry
->stateid_seq
=
900 be32_to_cpu(args
->stateid
.seqid
);
901 __entry
->stateid_hash
=
902 nfs_stateid_hash(&args
->stateid
);
906 "error=%ld (%s) fmode=%s fileid=%02x:%02x:%llu "
907 "fhandle=0x%08x openstateid=%d:0x%08x",
909 show_nfsv4_errors(__entry
->error
),
910 __entry
->fmode
? show_fmode_flags(__entry
->fmode
) :
912 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
913 (unsigned long long)__entry
->fileid
,
915 __entry
->stateid_seq
, __entry
->stateid_hash
919 TRACE_DEFINE_ENUM(F_GETLK
);
920 TRACE_DEFINE_ENUM(F_SETLK
);
921 TRACE_DEFINE_ENUM(F_SETLKW
);
922 TRACE_DEFINE_ENUM(F_RDLCK
);
923 TRACE_DEFINE_ENUM(F_WRLCK
);
924 TRACE_DEFINE_ENUM(F_UNLCK
);
926 #define show_lock_cmd(type) \
927 __print_symbolic((int)type, \
928 { F_GETLK, "GETLK" }, \
929 { F_SETLK, "SETLK" }, \
930 { F_SETLKW, "SETLKW" })
931 #define show_lock_type(type) \
932 __print_symbolic((int)type, \
933 { F_RDLCK, "RDLCK" }, \
934 { F_WRLCK, "WRLCK" }, \
935 { F_UNLCK, "UNLCK" })
937 DECLARE_EVENT_CLASS(nfs4_lock_event
,
939 const struct file_lock
*request
,
940 const struct nfs4_state
*state
,
945 TP_ARGS(request
, state
, cmd
, error
),
948 __field(unsigned long, error
)
951 __field(loff_t
, start
)
954 __field(u32
, fhandle
)
956 __field(int, stateid_seq
)
957 __field(u32
, stateid_hash
)
961 const struct inode
*inode
= state
->inode
;
963 __entry
->error
= error
< 0 ? -error
: 0;
965 __entry
->type
= request
->fl_type
;
966 __entry
->start
= request
->fl_start
;
967 __entry
->end
= request
->fl_end
;
968 __entry
->dev
= inode
->i_sb
->s_dev
;
969 __entry
->fileid
= NFS_FILEID(inode
);
970 __entry
->fhandle
= nfs_fhandle_hash(NFS_FH(inode
));
971 __entry
->stateid_seq
=
972 be32_to_cpu(state
->stateid
.seqid
);
973 __entry
->stateid_hash
=
974 nfs_stateid_hash(&state
->stateid
);
978 "error=%ld (%s) cmd=%s:%s range=%lld:%lld "
979 "fileid=%02x:%02x:%llu fhandle=0x%08x "
982 show_nfsv4_errors(__entry
->error
),
983 show_lock_cmd(__entry
->cmd
),
984 show_lock_type(__entry
->type
),
985 (long long)__entry
->start
,
986 (long long)__entry
->end
,
987 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
988 (unsigned long long)__entry
->fileid
,
990 __entry
->stateid_seq
, __entry
->stateid_hash
994 #define DEFINE_NFS4_LOCK_EVENT(name) \
995 DEFINE_EVENT(nfs4_lock_event, name, \
997 const struct file_lock *request, \
998 const struct nfs4_state *state, \
1002 TP_ARGS(request, state, cmd, error))
1003 DEFINE_NFS4_LOCK_EVENT(nfs4_get_lock
);
1004 DEFINE_NFS4_LOCK_EVENT(nfs4_unlock
);
1006 TRACE_EVENT(nfs4_set_lock
,
1008 const struct file_lock
*request
,
1009 const struct nfs4_state
*state
,
1010 const nfs4_stateid
*lockstateid
,
1015 TP_ARGS(request
, state
, lockstateid
, cmd
, error
),
1018 __field(unsigned long, error
)
1021 __field(loff_t
, start
)
1022 __field(loff_t
, end
)
1024 __field(u32
, fhandle
)
1025 __field(u64
, fileid
)
1026 __field(int, stateid_seq
)
1027 __field(u32
, stateid_hash
)
1028 __field(int, lockstateid_seq
)
1029 __field(u32
, lockstateid_hash
)
1033 const struct inode
*inode
= state
->inode
;
1035 __entry
->error
= error
< 0 ? -error
: 0;
1037 __entry
->type
= request
->fl_type
;
1038 __entry
->start
= request
->fl_start
;
1039 __entry
->end
= request
->fl_end
;
1040 __entry
->dev
= inode
->i_sb
->s_dev
;
1041 __entry
->fileid
= NFS_FILEID(inode
);
1042 __entry
->fhandle
= nfs_fhandle_hash(NFS_FH(inode
));
1043 __entry
->stateid_seq
=
1044 be32_to_cpu(state
->stateid
.seqid
);
1045 __entry
->stateid_hash
=
1046 nfs_stateid_hash(&state
->stateid
);
1047 __entry
->lockstateid_seq
=
1048 be32_to_cpu(lockstateid
->seqid
);
1049 __entry
->lockstateid_hash
=
1050 nfs_stateid_hash(lockstateid
);
1054 "error=%ld (%s) cmd=%s:%s range=%lld:%lld "
1055 "fileid=%02x:%02x:%llu fhandle=0x%08x "
1056 "stateid=%d:0x%08x lockstateid=%d:0x%08x",
1058 show_nfsv4_errors(__entry
->error
),
1059 show_lock_cmd(__entry
->cmd
),
1060 show_lock_type(__entry
->type
),
1061 (long long)__entry
->start
,
1062 (long long)__entry
->end
,
1063 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1064 (unsigned long long)__entry
->fileid
,
1066 __entry
->stateid_seq
, __entry
->stateid_hash
,
1067 __entry
->lockstateid_seq
, __entry
->lockstateid_hash
1071 TRACE_DEFINE_ENUM(LK_STATE_IN_USE
);
1072 TRACE_DEFINE_ENUM(NFS_DELEGATED_STATE
);
1073 TRACE_DEFINE_ENUM(NFS_OPEN_STATE
);
1074 TRACE_DEFINE_ENUM(NFS_O_RDONLY_STATE
);
1075 TRACE_DEFINE_ENUM(NFS_O_WRONLY_STATE
);
1076 TRACE_DEFINE_ENUM(NFS_O_RDWR_STATE
);
1077 TRACE_DEFINE_ENUM(NFS_STATE_RECLAIM_REBOOT
);
1078 TRACE_DEFINE_ENUM(NFS_STATE_RECLAIM_NOGRACE
);
1079 TRACE_DEFINE_ENUM(NFS_STATE_POSIX_LOCKS
);
1080 TRACE_DEFINE_ENUM(NFS_STATE_RECOVERY_FAILED
);
1081 TRACE_DEFINE_ENUM(NFS_STATE_MAY_NOTIFY_LOCK
);
1082 TRACE_DEFINE_ENUM(NFS_STATE_CHANGE_WAIT
);
1083 TRACE_DEFINE_ENUM(NFS_CLNT_DST_SSC_COPY_STATE
);
1084 TRACE_DEFINE_ENUM(NFS_CLNT_SRC_SSC_COPY_STATE
);
1085 TRACE_DEFINE_ENUM(NFS_SRV_SSC_COPY_STATE
);
1087 #define show_nfs4_state_flags(flags) \
1088 __print_flags(flags, "|", \
1089 { LK_STATE_IN_USE, "IN_USE" }, \
1090 { NFS_DELEGATED_STATE, "DELEGATED" }, \
1091 { NFS_OPEN_STATE, "OPEN" }, \
1092 { NFS_O_RDONLY_STATE, "O_RDONLY" }, \
1093 { NFS_O_WRONLY_STATE, "O_WRONLY" }, \
1094 { NFS_O_RDWR_STATE, "O_RDWR" }, \
1095 { NFS_STATE_RECLAIM_REBOOT, "RECLAIM_REBOOT" }, \
1096 { NFS_STATE_RECLAIM_NOGRACE, "RECLAIM_NOGRACE" }, \
1097 { NFS_STATE_POSIX_LOCKS, "POSIX_LOCKS" }, \
1098 { NFS_STATE_RECOVERY_FAILED, "RECOVERY_FAILED" }, \
1099 { NFS_STATE_MAY_NOTIFY_LOCK, "MAY_NOTIFY_LOCK" }, \
1100 { NFS_STATE_CHANGE_WAIT, "CHANGE_WAIT" }, \
1101 { NFS_CLNT_DST_SSC_COPY_STATE, "CLNT_DST_SSC_COPY" }, \
1102 { NFS_CLNT_SRC_SSC_COPY_STATE, "CLNT_SRC_SSC_COPY" }, \
1103 { NFS_SRV_SSC_COPY_STATE, "SRV_SSC_COPY" })
1105 #define show_nfs4_lock_flags(flags) \
1106 __print_flags(flags, "|", \
1107 { BIT(NFS_LOCK_INITIALIZED), "INITIALIZED" }, \
1108 { BIT(NFS_LOCK_LOST), "LOST" })
1110 TRACE_EVENT(nfs4_state_lock_reclaim
,
1112 const struct nfs4_state
*state
,
1113 const struct nfs4_lock_state
*lock
1116 TP_ARGS(state
, lock
),
1120 __field(u32
, fhandle
)
1121 __field(u64
, fileid
)
1122 __field(unsigned long, state_flags
)
1123 __field(unsigned long, lock_flags
)
1124 __field(int, stateid_seq
)
1125 __field(u32
, stateid_hash
)
1129 const struct inode
*inode
= state
->inode
;
1131 __entry
->dev
= inode
->i_sb
->s_dev
;
1132 __entry
->fileid
= NFS_FILEID(inode
);
1133 __entry
->fhandle
= nfs_fhandle_hash(NFS_FH(inode
));
1134 __entry
->state_flags
= state
->flags
;
1135 __entry
->lock_flags
= lock
->ls_flags
;
1136 __entry
->stateid_seq
=
1137 be32_to_cpu(state
->stateid
.seqid
);
1138 __entry
->stateid_hash
=
1139 nfs_stateid_hash(&state
->stateid
);
1143 "fileid=%02x:%02x:%llu fhandle=0x%08x "
1144 "stateid=%d:0x%08x state_flags=%s lock_flags=%s",
1145 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1146 (unsigned long long)__entry
->fileid
, __entry
->fhandle
,
1147 __entry
->stateid_seq
, __entry
->stateid_hash
,
1148 show_nfs4_state_flags(__entry
->state_flags
),
1149 show_nfs4_lock_flags(__entry
->lock_flags
)
1153 DECLARE_EVENT_CLASS(nfs4_set_delegation_event
,
1155 const struct inode
*inode
,
1159 TP_ARGS(inode
, fmode
),
1163 __field(u32
, fhandle
)
1164 __field(u64
, fileid
)
1165 __field(unsigned int, fmode
)
1169 __entry
->dev
= inode
->i_sb
->s_dev
;
1170 __entry
->fileid
= NFS_FILEID(inode
);
1171 __entry
->fhandle
= nfs_fhandle_hash(NFS_FH(inode
));
1172 __entry
->fmode
= (__force
unsigned int)fmode
;
1176 "fmode=%s fileid=%02x:%02x:%llu fhandle=0x%08x",
1177 show_fmode_flags(__entry
->fmode
),
1178 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1179 (unsigned long long)__entry
->fileid
,
1183 #define DEFINE_NFS4_SET_DELEGATION_EVENT(name) \
1184 DEFINE_EVENT(nfs4_set_delegation_event, name, \
1186 const struct inode *inode, \
1189 TP_ARGS(inode, fmode))
1190 DEFINE_NFS4_SET_DELEGATION_EVENT(nfs4_set_delegation
);
1191 DEFINE_NFS4_SET_DELEGATION_EVENT(nfs4_reclaim_delegation
);
1193 TRACE_EVENT(nfs4_delegreturn_exit
,
1195 const struct nfs4_delegreturnargs
*args
,
1196 const struct nfs4_delegreturnres
*res
,
1200 TP_ARGS(args
, res
, error
),
1204 __field(u32
, fhandle
)
1205 __field(unsigned long, error
)
1206 __field(int, stateid_seq
)
1207 __field(u32
, stateid_hash
)
1211 __entry
->dev
= res
->server
->s_dev
;
1212 __entry
->fhandle
= nfs_fhandle_hash(args
->fhandle
);
1213 __entry
->error
= error
< 0 ? -error
: 0;
1214 __entry
->stateid_seq
=
1215 be32_to_cpu(args
->stateid
->seqid
);
1216 __entry
->stateid_hash
=
1217 nfs_stateid_hash(args
->stateid
);
1221 "error=%ld (%s) dev=%02x:%02x fhandle=0x%08x "
1222 "stateid=%d:0x%08x",
1224 show_nfsv4_errors(__entry
->error
),
1225 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1227 __entry
->stateid_seq
, __entry
->stateid_hash
1231 #ifdef CONFIG_NFS_V4_1
1232 DECLARE_EVENT_CLASS(nfs4_test_stateid_event
,
1234 const struct nfs4_state
*state
,
1235 const struct nfs4_lock_state
*lsp
,
1239 TP_ARGS(state
, lsp
, error
),
1242 __field(unsigned long, error
)
1244 __field(u32
, fhandle
)
1245 __field(u64
, fileid
)
1246 __field(int, stateid_seq
)
1247 __field(u32
, stateid_hash
)
1251 const struct inode
*inode
= state
->inode
;
1253 __entry
->error
= error
< 0 ? -error
: 0;
1254 __entry
->dev
= inode
->i_sb
->s_dev
;
1255 __entry
->fileid
= NFS_FILEID(inode
);
1256 __entry
->fhandle
= nfs_fhandle_hash(NFS_FH(inode
));
1257 __entry
->stateid_seq
=
1258 be32_to_cpu(state
->stateid
.seqid
);
1259 __entry
->stateid_hash
=
1260 nfs_stateid_hash(&state
->stateid
);
1264 "error=%ld (%s) fileid=%02x:%02x:%llu fhandle=0x%08x "
1265 "stateid=%d:0x%08x",
1267 show_nfsv4_errors(__entry
->error
),
1268 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1269 (unsigned long long)__entry
->fileid
,
1271 __entry
->stateid_seq
, __entry
->stateid_hash
1275 #define DEFINE_NFS4_TEST_STATEID_EVENT(name) \
1276 DEFINE_EVENT(nfs4_test_stateid_event, name, \
1278 const struct nfs4_state *state, \
1279 const struct nfs4_lock_state *lsp, \
1282 TP_ARGS(state, lsp, error))
1283 DEFINE_NFS4_TEST_STATEID_EVENT(nfs4_test_delegation_stateid
);
1284 DEFINE_NFS4_TEST_STATEID_EVENT(nfs4_test_open_stateid
);
1285 DEFINE_NFS4_TEST_STATEID_EVENT(nfs4_test_lock_stateid
);
1286 #endif /* CONFIG_NFS_V4_1 */
1288 DECLARE_EVENT_CLASS(nfs4_lookup_event
,
1290 const struct inode
*dir
,
1291 const struct qstr
*name
,
1295 TP_ARGS(dir
, name
, error
),
1299 __field(unsigned long, error
)
1301 __string(name
, name
->name
)
1305 __entry
->dev
= dir
->i_sb
->s_dev
;
1306 __entry
->dir
= NFS_FILEID(dir
);
1307 __entry
->error
= -error
;
1308 __assign_str(name
, name
->name
);
1312 "error=%ld (%s) name=%02x:%02x:%llu/%s",
1314 show_nfsv4_errors(__entry
->error
),
1315 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1316 (unsigned long long)__entry
->dir
,
1321 #define DEFINE_NFS4_LOOKUP_EVENT(name) \
1322 DEFINE_EVENT(nfs4_lookup_event, name, \
1324 const struct inode *dir, \
1325 const struct qstr *name, \
1328 TP_ARGS(dir, name, error))
1330 DEFINE_NFS4_LOOKUP_EVENT(nfs4_lookup
);
1331 DEFINE_NFS4_LOOKUP_EVENT(nfs4_symlink
);
1332 DEFINE_NFS4_LOOKUP_EVENT(nfs4_mkdir
);
1333 DEFINE_NFS4_LOOKUP_EVENT(nfs4_mknod
);
1334 DEFINE_NFS4_LOOKUP_EVENT(nfs4_remove
);
1335 DEFINE_NFS4_LOOKUP_EVENT(nfs4_get_fs_locations
);
1336 DEFINE_NFS4_LOOKUP_EVENT(nfs4_secinfo
);
1338 TRACE_EVENT(nfs4_lookupp
,
1340 const struct inode
*inode
,
1344 TP_ARGS(inode
, error
),
1349 __field(unsigned long, error
)
1353 __entry
->dev
= inode
->i_sb
->s_dev
;
1354 __entry
->ino
= NFS_FILEID(inode
);
1355 __entry
->error
= error
< 0 ? -error
: 0;
1359 "error=%ld (%s) inode=%02x:%02x:%llu",
1361 show_nfsv4_errors(__entry
->error
),
1362 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1363 (unsigned long long)__entry
->ino
1367 TRACE_EVENT(nfs4_rename
,
1369 const struct inode
*olddir
,
1370 const struct qstr
*oldname
,
1371 const struct inode
*newdir
,
1372 const struct qstr
*newname
,
1376 TP_ARGS(olddir
, oldname
, newdir
, newname
, error
),
1380 __field(unsigned long, error
)
1381 __field(u64
, olddir
)
1382 __string(oldname
, oldname
->name
)
1383 __field(u64
, newdir
)
1384 __string(newname
, newname
->name
)
1388 __entry
->dev
= olddir
->i_sb
->s_dev
;
1389 __entry
->olddir
= NFS_FILEID(olddir
);
1390 __entry
->newdir
= NFS_FILEID(newdir
);
1391 __entry
->error
= error
< 0 ? -error
: 0;
1392 __assign_str(oldname
, oldname
->name
);
1393 __assign_str(newname
, newname
->name
);
1397 "error=%ld (%s) oldname=%02x:%02x:%llu/%s "
1398 "newname=%02x:%02x:%llu/%s",
1400 show_nfsv4_errors(__entry
->error
),
1401 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1402 (unsigned long long)__entry
->olddir
,
1404 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1405 (unsigned long long)__entry
->newdir
,
1410 DECLARE_EVENT_CLASS(nfs4_inode_event
,
1412 const struct inode
*inode
,
1416 TP_ARGS(inode
, error
),
1420 __field(u32
, fhandle
)
1421 __field(u64
, fileid
)
1422 __field(unsigned long, error
)
1426 __entry
->dev
= inode
->i_sb
->s_dev
;
1427 __entry
->fileid
= NFS_FILEID(inode
);
1428 __entry
->fhandle
= nfs_fhandle_hash(NFS_FH(inode
));
1429 __entry
->error
= error
< 0 ? -error
: 0;
1433 "error=%ld (%s) fileid=%02x:%02x:%llu fhandle=0x%08x",
1435 show_nfsv4_errors(__entry
->error
),
1436 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1437 (unsigned long long)__entry
->fileid
,
1442 #define DEFINE_NFS4_INODE_EVENT(name) \
1443 DEFINE_EVENT(nfs4_inode_event, name, \
1445 const struct inode *inode, \
1448 TP_ARGS(inode, error))
1450 DEFINE_NFS4_INODE_EVENT(nfs4_access
);
1451 DEFINE_NFS4_INODE_EVENT(nfs4_readlink
);
1452 DEFINE_NFS4_INODE_EVENT(nfs4_readdir
);
1453 DEFINE_NFS4_INODE_EVENT(nfs4_get_acl
);
1454 DEFINE_NFS4_INODE_EVENT(nfs4_set_acl
);
1455 #ifdef CONFIG_NFS_V4_SECURITY_LABEL
1456 DEFINE_NFS4_INODE_EVENT(nfs4_get_security_label
);
1457 DEFINE_NFS4_INODE_EVENT(nfs4_set_security_label
);
1458 #endif /* CONFIG_NFS_V4_SECURITY_LABEL */
1460 DECLARE_EVENT_CLASS(nfs4_inode_stateid_event
,
1462 const struct inode
*inode
,
1463 const nfs4_stateid
*stateid
,
1467 TP_ARGS(inode
, stateid
, error
),
1471 __field(u32
, fhandle
)
1472 __field(u64
, fileid
)
1473 __field(unsigned long, error
)
1474 __field(int, stateid_seq
)
1475 __field(u32
, stateid_hash
)
1479 __entry
->dev
= inode
->i_sb
->s_dev
;
1480 __entry
->fileid
= NFS_FILEID(inode
);
1481 __entry
->fhandle
= nfs_fhandle_hash(NFS_FH(inode
));
1482 __entry
->error
= error
< 0 ? -error
: 0;
1483 __entry
->stateid_seq
=
1484 be32_to_cpu(stateid
->seqid
);
1485 __entry
->stateid_hash
=
1486 nfs_stateid_hash(stateid
);
1490 "error=%ld (%s) fileid=%02x:%02x:%llu fhandle=0x%08x "
1491 "stateid=%d:0x%08x",
1493 show_nfsv4_errors(__entry
->error
),
1494 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1495 (unsigned long long)__entry
->fileid
,
1497 __entry
->stateid_seq
, __entry
->stateid_hash
1501 #define DEFINE_NFS4_INODE_STATEID_EVENT(name) \
1502 DEFINE_EVENT(nfs4_inode_stateid_event, name, \
1504 const struct inode *inode, \
1505 const nfs4_stateid *stateid, \
1508 TP_ARGS(inode, stateid, error))
1510 DEFINE_NFS4_INODE_STATEID_EVENT(nfs4_setattr
);
1511 DEFINE_NFS4_INODE_STATEID_EVENT(nfs4_delegreturn
);
1512 DEFINE_NFS4_INODE_STATEID_EVENT(nfs4_open_stateid_update
);
1513 DEFINE_NFS4_INODE_STATEID_EVENT(nfs4_open_stateid_update_wait
);
1514 DEFINE_NFS4_INODE_STATEID_EVENT(nfs4_close_stateid_update_wait
);
1516 DECLARE_EVENT_CLASS(nfs4_getattr_event
,
1518 const struct nfs_server
*server
,
1519 const struct nfs_fh
*fhandle
,
1520 const struct nfs_fattr
*fattr
,
1524 TP_ARGS(server
, fhandle
, fattr
, error
),
1528 __field(u32
, fhandle
)
1529 __field(u64
, fileid
)
1530 __field(unsigned int, valid
)
1531 __field(unsigned long, error
)
1535 __entry
->dev
= server
->s_dev
;
1536 __entry
->valid
= fattr
->valid
;
1537 __entry
->fhandle
= nfs_fhandle_hash(fhandle
);
1538 __entry
->fileid
= (fattr
->valid
& NFS_ATTR_FATTR_FILEID
) ? fattr
->fileid
: 0;
1539 __entry
->error
= error
< 0 ? -error
: 0;
1543 "error=%ld (%s) fileid=%02x:%02x:%llu fhandle=0x%08x "
1546 show_nfsv4_errors(__entry
->error
),
1547 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1548 (unsigned long long)__entry
->fileid
,
1550 show_nfs_fattr_flags(__entry
->valid
)
1554 #define DEFINE_NFS4_GETATTR_EVENT(name) \
1555 DEFINE_EVENT(nfs4_getattr_event, name, \
1557 const struct nfs_server *server, \
1558 const struct nfs_fh *fhandle, \
1559 const struct nfs_fattr *fattr, \
1562 TP_ARGS(server, fhandle, fattr, error))
1563 DEFINE_NFS4_GETATTR_EVENT(nfs4_getattr
);
1564 DEFINE_NFS4_GETATTR_EVENT(nfs4_lookup_root
);
1565 DEFINE_NFS4_GETATTR_EVENT(nfs4_fsinfo
);
1567 DECLARE_EVENT_CLASS(nfs4_inode_callback_event
,
1569 const struct nfs_client
*clp
,
1570 const struct nfs_fh
*fhandle
,
1571 const struct inode
*inode
,
1575 TP_ARGS(clp
, fhandle
, inode
, error
),
1578 __field(unsigned long, error
)
1580 __field(u32
, fhandle
)
1581 __field(u64
, fileid
)
1582 __string(dstaddr
, clp
? clp
->cl_hostname
: "unknown")
1586 __entry
->error
= error
< 0 ? -error
: 0;
1587 __entry
->fhandle
= nfs_fhandle_hash(fhandle
);
1588 if (!IS_ERR_OR_NULL(inode
)) {
1589 __entry
->fileid
= NFS_FILEID(inode
);
1590 __entry
->dev
= inode
->i_sb
->s_dev
;
1592 __entry
->fileid
= 0;
1595 __assign_str(dstaddr
, clp
? clp
->cl_hostname
: "unknown")
1599 "error=%ld (%s) fileid=%02x:%02x:%llu fhandle=0x%08x "
1602 show_nfsv4_errors(__entry
->error
),
1603 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1604 (unsigned long long)__entry
->fileid
,
1610 #define DEFINE_NFS4_INODE_CALLBACK_EVENT(name) \
1611 DEFINE_EVENT(nfs4_inode_callback_event, name, \
1613 const struct nfs_client *clp, \
1614 const struct nfs_fh *fhandle, \
1615 const struct inode *inode, \
1618 TP_ARGS(clp, fhandle, inode, error))
1619 DEFINE_NFS4_INODE_CALLBACK_EVENT(nfs4_cb_getattr
);
1621 DECLARE_EVENT_CLASS(nfs4_inode_stateid_callback_event
,
1623 const struct nfs_client
*clp
,
1624 const struct nfs_fh
*fhandle
,
1625 const struct inode
*inode
,
1626 const nfs4_stateid
*stateid
,
1630 TP_ARGS(clp
, fhandle
, inode
, stateid
, error
),
1633 __field(unsigned long, error
)
1635 __field(u32
, fhandle
)
1636 __field(u64
, fileid
)
1637 __string(dstaddr
, clp
? clp
->cl_hostname
: "unknown")
1638 __field(int, stateid_seq
)
1639 __field(u32
, stateid_hash
)
1643 __entry
->error
= error
< 0 ? -error
: 0;
1644 __entry
->fhandle
= nfs_fhandle_hash(fhandle
);
1645 if (!IS_ERR_OR_NULL(inode
)) {
1646 __entry
->fileid
= NFS_FILEID(inode
);
1647 __entry
->dev
= inode
->i_sb
->s_dev
;
1649 __entry
->fileid
= 0;
1652 __assign_str(dstaddr
, clp
? clp
->cl_hostname
: "unknown")
1653 __entry
->stateid_seq
=
1654 be32_to_cpu(stateid
->seqid
);
1655 __entry
->stateid_hash
=
1656 nfs_stateid_hash(stateid
);
1660 "error=%ld (%s) fileid=%02x:%02x:%llu fhandle=0x%08x "
1661 "stateid=%d:0x%08x dstaddr=%s",
1663 show_nfsv4_errors(__entry
->error
),
1664 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1665 (unsigned long long)__entry
->fileid
,
1667 __entry
->stateid_seq
, __entry
->stateid_hash
,
1672 #define DEFINE_NFS4_INODE_STATEID_CALLBACK_EVENT(name) \
1673 DEFINE_EVENT(nfs4_inode_stateid_callback_event, name, \
1675 const struct nfs_client *clp, \
1676 const struct nfs_fh *fhandle, \
1677 const struct inode *inode, \
1678 const nfs4_stateid *stateid, \
1681 TP_ARGS(clp, fhandle, inode, stateid, error))
1682 DEFINE_NFS4_INODE_STATEID_CALLBACK_EVENT(nfs4_cb_recall
);
1683 DEFINE_NFS4_INODE_STATEID_CALLBACK_EVENT(nfs4_cb_layoutrecall_file
);
1685 DECLARE_EVENT_CLASS(nfs4_idmap_event
,
1693 TP_ARGS(name
, len
, id
, error
),
1696 __field(unsigned long, error
)
1698 __dynamic_array(char, name
, len
> 0 ? len
+ 1 : 1)
1704 __entry
->error
= error
< 0 ? error
: 0;
1706 memcpy(__get_str(name
), name
, len
);
1707 __get_str(name
)[len
] = 0;
1711 "error=%ld (%s) id=%u name=%s",
1712 -__entry
->error
, show_nfsv4_errors(__entry
->error
),
1717 #define DEFINE_NFS4_IDMAP_EVENT(name) \
1718 DEFINE_EVENT(nfs4_idmap_event, name, \
1725 TP_ARGS(name, len, id, error))
1726 DEFINE_NFS4_IDMAP_EVENT(nfs4_map_name_to_uid
);
1727 DEFINE_NFS4_IDMAP_EVENT(nfs4_map_group_to_gid
);
1728 DEFINE_NFS4_IDMAP_EVENT(nfs4_map_uid_to_name
);
1729 DEFINE_NFS4_IDMAP_EVENT(nfs4_map_gid_to_group
);
1731 #ifdef CONFIG_NFS_V4_1
1732 #define NFS4_LSEG_LAYOUT_STATEID_HASH(lseg) \
1733 (lseg ? nfs_stateid_hash(&lseg->pls_layout->plh_stateid) : 0)
1735 #define NFS4_LSEG_LAYOUT_STATEID_HASH(lseg) (0)
1738 DECLARE_EVENT_CLASS(nfs4_read_event
,
1740 const struct nfs_pgio_header
*hdr
,
1744 TP_ARGS(hdr
, error
),
1748 __field(u32
, fhandle
)
1749 __field(u64
, fileid
)
1750 __field(loff_t
, offset
)
1751 __field(u32
, arg_count
)
1752 __field(u32
, res_count
)
1753 __field(unsigned long, error
)
1754 __field(int, stateid_seq
)
1755 __field(u32
, stateid_hash
)
1756 __field(int, layoutstateid_seq
)
1757 __field(u32
, layoutstateid_hash
)
1761 const struct inode
*inode
= hdr
->inode
;
1762 const struct nfs_inode
*nfsi
= NFS_I(inode
);
1763 const struct nfs_fh
*fh
= hdr
->args
.fh
?
1764 hdr
->args
.fh
: &nfsi
->fh
;
1765 const struct nfs4_state
*state
=
1766 hdr
->args
.context
->state
;
1767 const struct pnfs_layout_segment
*lseg
= hdr
->lseg
;
1769 __entry
->dev
= inode
->i_sb
->s_dev
;
1770 __entry
->fileid
= nfsi
->fileid
;
1771 __entry
->fhandle
= nfs_fhandle_hash(fh
);
1772 __entry
->offset
= hdr
->args
.offset
;
1773 __entry
->arg_count
= hdr
->args
.count
;
1774 __entry
->res_count
= hdr
->res
.count
;
1775 __entry
->error
= error
< 0 ? -error
: 0;
1776 __entry
->stateid_seq
=
1777 be32_to_cpu(state
->stateid
.seqid
);
1778 __entry
->stateid_hash
=
1779 nfs_stateid_hash(&state
->stateid
);
1780 __entry
->layoutstateid_seq
= lseg
? lseg
->pls_seq
: 0;
1781 __entry
->layoutstateid_hash
=
1782 NFS4_LSEG_LAYOUT_STATEID_HASH(lseg
);
1786 "error=%ld (%s) fileid=%02x:%02x:%llu fhandle=0x%08x "
1787 "offset=%lld count=%u res=%u stateid=%d:0x%08x "
1788 "layoutstateid=%d:0x%08x",
1790 show_nfsv4_errors(__entry
->error
),
1791 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1792 (unsigned long long)__entry
->fileid
,
1794 (long long)__entry
->offset
,
1795 __entry
->arg_count
, __entry
->res_count
,
1796 __entry
->stateid_seq
, __entry
->stateid_hash
,
1797 __entry
->layoutstateid_seq
, __entry
->layoutstateid_hash
1800 #define DEFINE_NFS4_READ_EVENT(name) \
1801 DEFINE_EVENT(nfs4_read_event, name, \
1803 const struct nfs_pgio_header *hdr, \
1806 TP_ARGS(hdr, error))
1807 DEFINE_NFS4_READ_EVENT(nfs4_read
);
1808 #ifdef CONFIG_NFS_V4_1
1809 DEFINE_NFS4_READ_EVENT(nfs4_pnfs_read
);
1810 #endif /* CONFIG_NFS_V4_1 */
1812 DECLARE_EVENT_CLASS(nfs4_write_event
,
1814 const struct nfs_pgio_header
*hdr
,
1818 TP_ARGS(hdr
, error
),
1822 __field(u32
, fhandle
)
1823 __field(u64
, fileid
)
1824 __field(loff_t
, offset
)
1825 __field(u32
, arg_count
)
1826 __field(u32
, res_count
)
1827 __field(unsigned long, error
)
1828 __field(int, stateid_seq
)
1829 __field(u32
, stateid_hash
)
1830 __field(int, layoutstateid_seq
)
1831 __field(u32
, layoutstateid_hash
)
1835 const struct inode
*inode
= hdr
->inode
;
1836 const struct nfs_inode
*nfsi
= NFS_I(inode
);
1837 const struct nfs_fh
*fh
= hdr
->args
.fh
?
1838 hdr
->args
.fh
: &nfsi
->fh
;
1839 const struct nfs4_state
*state
=
1840 hdr
->args
.context
->state
;
1841 const struct pnfs_layout_segment
*lseg
= hdr
->lseg
;
1843 __entry
->dev
= inode
->i_sb
->s_dev
;
1844 __entry
->fileid
= nfsi
->fileid
;
1845 __entry
->fhandle
= nfs_fhandle_hash(fh
);
1846 __entry
->offset
= hdr
->args
.offset
;
1847 __entry
->arg_count
= hdr
->args
.count
;
1848 __entry
->res_count
= hdr
->res
.count
;
1849 __entry
->error
= error
< 0 ? -error
: 0;
1850 __entry
->stateid_seq
=
1851 be32_to_cpu(state
->stateid
.seqid
);
1852 __entry
->stateid_hash
=
1853 nfs_stateid_hash(&state
->stateid
);
1854 __entry
->layoutstateid_seq
= lseg
? lseg
->pls_seq
: 0;
1855 __entry
->layoutstateid_hash
=
1856 NFS4_LSEG_LAYOUT_STATEID_HASH(lseg
);
1860 "error=%ld (%s) fileid=%02x:%02x:%llu fhandle=0x%08x "
1861 "offset=%lld count=%u res=%u stateid=%d:0x%08x "
1862 "layoutstateid=%d:0x%08x",
1864 show_nfsv4_errors(__entry
->error
),
1865 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1866 (unsigned long long)__entry
->fileid
,
1868 (long long)__entry
->offset
,
1869 __entry
->arg_count
, __entry
->res_count
,
1870 __entry
->stateid_seq
, __entry
->stateid_hash
,
1871 __entry
->layoutstateid_seq
, __entry
->layoutstateid_hash
1875 #define DEFINE_NFS4_WRITE_EVENT(name) \
1876 DEFINE_EVENT(nfs4_write_event, name, \
1878 const struct nfs_pgio_header *hdr, \
1881 TP_ARGS(hdr, error))
1882 DEFINE_NFS4_WRITE_EVENT(nfs4_write
);
1883 #ifdef CONFIG_NFS_V4_1
1884 DEFINE_NFS4_WRITE_EVENT(nfs4_pnfs_write
);
1885 #endif /* CONFIG_NFS_V4_1 */
1887 DECLARE_EVENT_CLASS(nfs4_commit_event
,
1889 const struct nfs_commit_data
*data
,
1893 TP_ARGS(data
, error
),
1897 __field(u32
, fhandle
)
1898 __field(u64
, fileid
)
1899 __field(unsigned long, error
)
1900 __field(loff_t
, offset
)
1902 __field(int, layoutstateid_seq
)
1903 __field(u32
, layoutstateid_hash
)
1907 const struct inode
*inode
= data
->inode
;
1908 const struct nfs_inode
*nfsi
= NFS_I(inode
);
1909 const struct nfs_fh
*fh
= data
->args
.fh
?
1910 data
->args
.fh
: &nfsi
->fh
;
1911 const struct pnfs_layout_segment
*lseg
= data
->lseg
;
1913 __entry
->dev
= inode
->i_sb
->s_dev
;
1914 __entry
->fileid
= nfsi
->fileid
;
1915 __entry
->fhandle
= nfs_fhandle_hash(fh
);
1916 __entry
->offset
= data
->args
.offset
;
1917 __entry
->count
= data
->args
.count
;
1918 __entry
->error
= error
< 0 ? -error
: 0;
1919 __entry
->layoutstateid_seq
= lseg
? lseg
->pls_seq
: 0;
1920 __entry
->layoutstateid_hash
=
1921 NFS4_LSEG_LAYOUT_STATEID_HASH(lseg
);
1925 "error=%ld (%s) fileid=%02x:%02x:%llu fhandle=0x%08x "
1926 "offset=%lld count=%u layoutstateid=%d:0x%08x",
1928 show_nfsv4_errors(__entry
->error
),
1929 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1930 (unsigned long long)__entry
->fileid
,
1932 (long long)__entry
->offset
,
1934 __entry
->layoutstateid_seq
, __entry
->layoutstateid_hash
1937 #define DEFINE_NFS4_COMMIT_EVENT(name) \
1938 DEFINE_EVENT(nfs4_commit_event, name, \
1940 const struct nfs_commit_data *data, \
1943 TP_ARGS(data, error))
1944 DEFINE_NFS4_COMMIT_EVENT(nfs4_commit
);
1945 #ifdef CONFIG_NFS_V4_1
1946 DEFINE_NFS4_COMMIT_EVENT(nfs4_pnfs_commit_ds
);
1948 TRACE_DEFINE_ENUM(IOMODE_READ
);
1949 TRACE_DEFINE_ENUM(IOMODE_RW
);
1950 TRACE_DEFINE_ENUM(IOMODE_ANY
);
1952 #define show_pnfs_iomode(iomode) \
1953 __print_symbolic(iomode, \
1954 { IOMODE_READ, "READ" }, \
1955 { IOMODE_RW, "RW" }, \
1956 { IOMODE_ANY, "ANY" })
1958 TRACE_EVENT(nfs4_layoutget
,
1960 const struct nfs_open_context
*ctx
,
1961 const struct pnfs_layout_range
*args
,
1962 const struct pnfs_layout_range
*res
,
1963 const nfs4_stateid
*layout_stateid
,
1967 TP_ARGS(ctx
, args
, res
, layout_stateid
, error
),
1971 __field(u32
, fhandle
)
1972 __field(u64
, fileid
)
1973 __field(u32
, iomode
)
1974 __field(u64
, offset
)
1976 __field(unsigned long, error
)
1977 __field(int, stateid_seq
)
1978 __field(u32
, stateid_hash
)
1979 __field(int, layoutstateid_seq
)
1980 __field(u32
, layoutstateid_hash
)
1984 const struct inode
*inode
= d_inode(ctx
->dentry
);
1985 const struct nfs4_state
*state
= ctx
->state
;
1986 __entry
->dev
= inode
->i_sb
->s_dev
;
1987 __entry
->fileid
= NFS_FILEID(inode
);
1988 __entry
->fhandle
= nfs_fhandle_hash(NFS_FH(inode
));
1989 __entry
->iomode
= args
->iomode
;
1990 __entry
->offset
= args
->offset
;
1991 __entry
->count
= args
->length
;
1992 __entry
->error
= error
< 0 ? -error
: 0;
1993 __entry
->stateid_seq
=
1994 be32_to_cpu(state
->stateid
.seqid
);
1995 __entry
->stateid_hash
=
1996 nfs_stateid_hash(&state
->stateid
);
1998 __entry
->layoutstateid_seq
=
1999 be32_to_cpu(layout_stateid
->seqid
);
2000 __entry
->layoutstateid_hash
=
2001 nfs_stateid_hash(layout_stateid
);
2003 __entry
->layoutstateid_seq
= 0;
2004 __entry
->layoutstateid_hash
= 0;
2009 "error=%ld (%s) fileid=%02x:%02x:%llu fhandle=0x%08x "
2010 "iomode=%s offset=%llu count=%llu stateid=%d:0x%08x "
2011 "layoutstateid=%d:0x%08x",
2013 show_nfsv4_errors(__entry
->error
),
2014 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
2015 (unsigned long long)__entry
->fileid
,
2017 show_pnfs_iomode(__entry
->iomode
),
2018 (unsigned long long)__entry
->offset
,
2019 (unsigned long long)__entry
->count
,
2020 __entry
->stateid_seq
, __entry
->stateid_hash
,
2021 __entry
->layoutstateid_seq
, __entry
->layoutstateid_hash
2025 DEFINE_NFS4_INODE_STATEID_EVENT(nfs4_layoutcommit
);
2026 DEFINE_NFS4_INODE_STATEID_EVENT(nfs4_layoutreturn
);
2027 DEFINE_NFS4_INODE_STATEID_EVENT(nfs4_layoutreturn_on_close
);
2028 DEFINE_NFS4_INODE_STATEID_EVENT(nfs4_layouterror
);
2029 DEFINE_NFS4_INODE_STATEID_EVENT(nfs4_layoutstats
);
2031 TRACE_DEFINE_ENUM(PNFS_UPDATE_LAYOUT_UNKNOWN
);
2032 TRACE_DEFINE_ENUM(PNFS_UPDATE_LAYOUT_NO_PNFS
);
2033 TRACE_DEFINE_ENUM(PNFS_UPDATE_LAYOUT_RD_ZEROLEN
);
2034 TRACE_DEFINE_ENUM(PNFS_UPDATE_LAYOUT_MDSTHRESH
);
2035 TRACE_DEFINE_ENUM(PNFS_UPDATE_LAYOUT_NOMEM
);
2036 TRACE_DEFINE_ENUM(PNFS_UPDATE_LAYOUT_BULK_RECALL
);
2037 TRACE_DEFINE_ENUM(PNFS_UPDATE_LAYOUT_IO_TEST_FAIL
);
2038 TRACE_DEFINE_ENUM(PNFS_UPDATE_LAYOUT_FOUND_CACHED
);
2039 TRACE_DEFINE_ENUM(PNFS_UPDATE_LAYOUT_RETURN
);
2040 TRACE_DEFINE_ENUM(PNFS_UPDATE_LAYOUT_BLOCKED
);
2041 TRACE_DEFINE_ENUM(PNFS_UPDATE_LAYOUT_INVALID_OPEN
);
2042 TRACE_DEFINE_ENUM(PNFS_UPDATE_LAYOUT_RETRY
);
2043 TRACE_DEFINE_ENUM(PNFS_UPDATE_LAYOUT_SEND_LAYOUTGET
);
2044 TRACE_DEFINE_ENUM(PNFS_UPDATE_LAYOUT_EXIT
);
2046 #define show_pnfs_update_layout_reason(reason) \
2047 __print_symbolic(reason, \
2048 { PNFS_UPDATE_LAYOUT_UNKNOWN, "unknown" }, \
2049 { PNFS_UPDATE_LAYOUT_NO_PNFS, "no pnfs" }, \
2050 { PNFS_UPDATE_LAYOUT_RD_ZEROLEN, "read+zerolen" }, \
2051 { PNFS_UPDATE_LAYOUT_MDSTHRESH, "mdsthresh" }, \
2052 { PNFS_UPDATE_LAYOUT_NOMEM, "nomem" }, \
2053 { PNFS_UPDATE_LAYOUT_BULK_RECALL, "bulk recall" }, \
2054 { PNFS_UPDATE_LAYOUT_IO_TEST_FAIL, "io test fail" }, \
2055 { PNFS_UPDATE_LAYOUT_FOUND_CACHED, "found cached" }, \
2056 { PNFS_UPDATE_LAYOUT_RETURN, "layoutreturn" }, \
2057 { PNFS_UPDATE_LAYOUT_BLOCKED, "layouts blocked" }, \
2058 { PNFS_UPDATE_LAYOUT_INVALID_OPEN, "invalid open" }, \
2059 { PNFS_UPDATE_LAYOUT_RETRY, "retrying" }, \
2060 { PNFS_UPDATE_LAYOUT_SEND_LAYOUTGET, "sent layoutget" }, \
2061 { PNFS_UPDATE_LAYOUT_EXIT, "exit" })
2063 TRACE_EVENT(pnfs_update_layout
,
2064 TP_PROTO(struct inode
*inode
,
2067 enum pnfs_iomode iomode
,
2068 struct pnfs_layout_hdr
*lo
,
2069 struct pnfs_layout_segment
*lseg
,
2070 enum pnfs_update_layout_reason reason
2072 TP_ARGS(inode
, pos
, count
, iomode
, lo
, lseg
, reason
),
2075 __field(u64
, fileid
)
2076 __field(u32
, fhandle
)
2077 __field(loff_t
, pos
)
2079 __field(enum pnfs_iomode
, iomode
)
2080 __field(int, layoutstateid_seq
)
2081 __field(u32
, layoutstateid_hash
)
2083 __field(enum pnfs_update_layout_reason
, reason
)
2086 __entry
->dev
= inode
->i_sb
->s_dev
;
2087 __entry
->fileid
= NFS_FILEID(inode
);
2088 __entry
->fhandle
= nfs_fhandle_hash(NFS_FH(inode
));
2090 __entry
->count
= count
;
2091 __entry
->iomode
= iomode
;
2092 __entry
->reason
= reason
;
2094 __entry
->layoutstateid_seq
=
2095 be32_to_cpu(lo
->plh_stateid
.seqid
);
2096 __entry
->layoutstateid_hash
=
2097 nfs_stateid_hash(&lo
->plh_stateid
);
2099 __entry
->layoutstateid_seq
= 0;
2100 __entry
->layoutstateid_hash
= 0;
2102 __entry
->lseg
= (long)lseg
;
2105 "fileid=%02x:%02x:%llu fhandle=0x%08x "
2106 "iomode=%s pos=%llu count=%llu "
2107 "layoutstateid=%d:0x%08x lseg=0x%lx (%s)",
2108 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
2109 (unsigned long long)__entry
->fileid
,
2111 show_pnfs_iomode(__entry
->iomode
),
2112 (unsigned long long)__entry
->pos
,
2113 (unsigned long long)__entry
->count
,
2114 __entry
->layoutstateid_seq
, __entry
->layoutstateid_hash
,
2116 show_pnfs_update_layout_reason(__entry
->reason
)
2120 DECLARE_EVENT_CLASS(pnfs_layout_event
,
2121 TP_PROTO(struct inode
*inode
,
2124 enum pnfs_iomode iomode
,
2125 struct pnfs_layout_hdr
*lo
,
2126 struct pnfs_layout_segment
*lseg
2128 TP_ARGS(inode
, pos
, count
, iomode
, lo
, lseg
),
2131 __field(u64
, fileid
)
2132 __field(u32
, fhandle
)
2133 __field(loff_t
, pos
)
2135 __field(enum pnfs_iomode
, iomode
)
2136 __field(int, layoutstateid_seq
)
2137 __field(u32
, layoutstateid_hash
)
2141 __entry
->dev
= inode
->i_sb
->s_dev
;
2142 __entry
->fileid
= NFS_FILEID(inode
);
2143 __entry
->fhandle
= nfs_fhandle_hash(NFS_FH(inode
));
2145 __entry
->count
= count
;
2146 __entry
->iomode
= iomode
;
2148 __entry
->layoutstateid_seq
=
2149 be32_to_cpu(lo
->plh_stateid
.seqid
);
2150 __entry
->layoutstateid_hash
=
2151 nfs_stateid_hash(&lo
->plh_stateid
);
2153 __entry
->layoutstateid_seq
= 0;
2154 __entry
->layoutstateid_hash
= 0;
2156 __entry
->lseg
= (long)lseg
;
2159 "fileid=%02x:%02x:%llu fhandle=0x%08x "
2160 "iomode=%s pos=%llu count=%llu "
2161 "layoutstateid=%d:0x%08x lseg=0x%lx",
2162 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
2163 (unsigned long long)__entry
->fileid
,
2165 show_pnfs_iomode(__entry
->iomode
),
2166 (unsigned long long)__entry
->pos
,
2167 (unsigned long long)__entry
->count
,
2168 __entry
->layoutstateid_seq
, __entry
->layoutstateid_hash
,
2173 #define DEFINE_PNFS_LAYOUT_EVENT(name) \
2174 DEFINE_EVENT(pnfs_layout_event, name, \
2175 TP_PROTO(struct inode *inode, \
2178 enum pnfs_iomode iomode, \
2179 struct pnfs_layout_hdr *lo, \
2180 struct pnfs_layout_segment *lseg \
2182 TP_ARGS(inode, pos, count, iomode, lo, lseg))
2184 DEFINE_PNFS_LAYOUT_EVENT(pnfs_mds_fallback_pg_init_read
);
2185 DEFINE_PNFS_LAYOUT_EVENT(pnfs_mds_fallback_pg_init_write
);
2186 DEFINE_PNFS_LAYOUT_EVENT(pnfs_mds_fallback_pg_get_mirror_count
);
2187 DEFINE_PNFS_LAYOUT_EVENT(pnfs_mds_fallback_read_done
);
2188 DEFINE_PNFS_LAYOUT_EVENT(pnfs_mds_fallback_write_done
);
2189 DEFINE_PNFS_LAYOUT_EVENT(pnfs_mds_fallback_read_pagelist
);
2190 DEFINE_PNFS_LAYOUT_EVENT(pnfs_mds_fallback_write_pagelist
);
2192 DECLARE_EVENT_CLASS(nfs4_deviceid_event
,
2194 const struct nfs_client
*clp
,
2195 const struct nfs4_deviceid
*deviceid
2198 TP_ARGS(clp
, deviceid
),
2201 __string(dstaddr
, clp
->cl_hostname
)
2202 __array(unsigned char, deviceid
, NFS4_DEVICEID4_SIZE
)
2206 __assign_str(dstaddr
, clp
->cl_hostname
);
2207 memcpy(__entry
->deviceid
, deviceid
->data
,
2208 NFS4_DEVICEID4_SIZE
);
2212 "deviceid=%s, dstaddr=%s",
2213 __print_hex(__entry
->deviceid
, NFS4_DEVICEID4_SIZE
),
2217 #define DEFINE_PNFS_DEVICEID_EVENT(name) \
2218 DEFINE_EVENT(nfs4_deviceid_event, name, \
2219 TP_PROTO(const struct nfs_client *clp, \
2220 const struct nfs4_deviceid *deviceid \
2222 TP_ARGS(clp, deviceid))
2223 DEFINE_PNFS_DEVICEID_EVENT(nfs4_deviceid_free
);
2225 DECLARE_EVENT_CLASS(nfs4_deviceid_status
,
2227 const struct nfs_server
*server
,
2228 const struct nfs4_deviceid
*deviceid
,
2232 TP_ARGS(server
, deviceid
, status
),
2236 __field(int, status
)
2237 __string(dstaddr
, server
->nfs_client
->cl_hostname
)
2238 __array(unsigned char, deviceid
, NFS4_DEVICEID4_SIZE
)
2242 __entry
->dev
= server
->s_dev
;
2243 __entry
->status
= status
;
2244 __assign_str(dstaddr
, server
->nfs_client
->cl_hostname
);
2245 memcpy(__entry
->deviceid
, deviceid
->data
,
2246 NFS4_DEVICEID4_SIZE
);
2250 "dev=%02x:%02x: deviceid=%s, dstaddr=%s, status=%d",
2251 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
2252 __print_hex(__entry
->deviceid
, NFS4_DEVICEID4_SIZE
),
2257 #define DEFINE_PNFS_DEVICEID_STATUS(name) \
2258 DEFINE_EVENT(nfs4_deviceid_status, name, \
2259 TP_PROTO(const struct nfs_server *server, \
2260 const struct nfs4_deviceid *deviceid, \
2263 TP_ARGS(server, deviceid, status))
2264 DEFINE_PNFS_DEVICEID_STATUS(nfs4_getdeviceinfo
);
2265 DEFINE_PNFS_DEVICEID_STATUS(nfs4_find_deviceid
);
2267 DECLARE_EVENT_CLASS(nfs4_flexfiles_io_event
,
2269 const struct nfs_pgio_header
*hdr
2275 __field(unsigned long, error
)
2277 __field(u32
, fhandle
)
2278 __field(u64
, fileid
)
2279 __field(loff_t
, offset
)
2281 __field(int, stateid_seq
)
2282 __field(u32
, stateid_hash
)
2283 __string(dstaddr
, hdr
->ds_clp
?
2284 rpc_peeraddr2str(hdr
->ds_clp
->cl_rpcclient
,
2285 RPC_DISPLAY_ADDR
) : "unknown")
2289 const struct inode
*inode
= hdr
->inode
;
2291 __entry
->error
= hdr
->res
.op_status
;
2292 __entry
->fhandle
= nfs_fhandle_hash(hdr
->args
.fh
);
2293 __entry
->fileid
= NFS_FILEID(inode
);
2294 __entry
->dev
= inode
->i_sb
->s_dev
;
2295 __entry
->offset
= hdr
->args
.offset
;
2296 __entry
->count
= hdr
->args
.count
;
2297 __entry
->stateid_seq
=
2298 be32_to_cpu(hdr
->args
.stateid
.seqid
);
2299 __entry
->stateid_hash
=
2300 nfs_stateid_hash(&hdr
->args
.stateid
);
2301 __assign_str(dstaddr
, hdr
->ds_clp
?
2302 rpc_peeraddr2str(hdr
->ds_clp
->cl_rpcclient
,
2303 RPC_DISPLAY_ADDR
) : "unknown");
2307 "error=%ld (%s) fileid=%02x:%02x:%llu fhandle=0x%08x "
2308 "offset=%llu count=%u stateid=%d:0x%08x dstaddr=%s",
2310 show_nfsv4_errors(__entry
->error
),
2311 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
2312 (unsigned long long)__entry
->fileid
,
2314 __entry
->offset
, __entry
->count
,
2315 __entry
->stateid_seq
, __entry
->stateid_hash
,
2320 #define DEFINE_NFS4_FLEXFILES_IO_EVENT(name) \
2321 DEFINE_EVENT(nfs4_flexfiles_io_event, name, \
2323 const struct nfs_pgio_header *hdr \
2326 DEFINE_NFS4_FLEXFILES_IO_EVENT(ff_layout_read_error
);
2327 DEFINE_NFS4_FLEXFILES_IO_EVENT(ff_layout_write_error
);
2329 TRACE_EVENT(ff_layout_commit_error
,
2331 const struct nfs_commit_data
*data
2337 __field(unsigned long, error
)
2339 __field(u32
, fhandle
)
2340 __field(u64
, fileid
)
2341 __field(loff_t
, offset
)
2343 __string(dstaddr
, data
->ds_clp
?
2344 rpc_peeraddr2str(data
->ds_clp
->cl_rpcclient
,
2345 RPC_DISPLAY_ADDR
) : "unknown")
2349 const struct inode
*inode
= data
->inode
;
2351 __entry
->error
= data
->res
.op_status
;
2352 __entry
->fhandle
= nfs_fhandle_hash(data
->args
.fh
);
2353 __entry
->fileid
= NFS_FILEID(inode
);
2354 __entry
->dev
= inode
->i_sb
->s_dev
;
2355 __entry
->offset
= data
->args
.offset
;
2356 __entry
->count
= data
->args
.count
;
2357 __assign_str(dstaddr
, data
->ds_clp
?
2358 rpc_peeraddr2str(data
->ds_clp
->cl_rpcclient
,
2359 RPC_DISPLAY_ADDR
) : "unknown");
2363 "error=%ld (%s) fileid=%02x:%02x:%llu fhandle=0x%08x "
2364 "offset=%llu count=%u dstaddr=%s",
2366 show_nfsv4_errors(__entry
->error
),
2367 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
2368 (unsigned long long)__entry
->fileid
,
2370 __entry
->offset
, __entry
->count
,
2376 #endif /* CONFIG_NFS_V4_1 */
2378 #endif /* _TRACE_NFS4_H */
2380 #undef TRACE_INCLUDE_PATH
2381 #define TRACE_INCLUDE_PATH .
2382 #define TRACE_INCLUDE_FILE nfs4trace
2383 /* This part must be outside protection */
2384 #include <trace/define_trace.h>