1 /* SPDX-License-Identifier: GPL-2.0 */ 2 /* 3 * Copyright (c) 2013 Trond Myklebust <Trond.Myklebust@netapp.com> 4 */ 5 #undef TRACE_SYSTEM 6 #define TRACE_SYSTEM nfs4 7 8 #if !defined(_TRACE_NFS4_H) || defined(TRACE_HEADER_MULTI_READ) 9 #define _TRACE_NFS4_H 10 11 #include <linux/tracepoint.h> 12 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); 52 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); 157 158 #define show_nfsv4_errors(error) \ 159 __print_symbolic(error, \ 160 { NFS4_OK, "OK" }, \ 161 /* Mapped by nfs4_stat_to_errno() */ \ 162 { EPERM, "EPERM" }, \ 163 { ENOENT, "ENOENT" }, \ 164 { EIO, "EIO" }, \ 165 { ENXIO, "ENXIO" }, \ 166 { EACCES, "EACCES" }, \ 167 { EEXIST, "EEXIST" }, \ 168 { EXDEV, "EXDEV" }, \ 169 { ENOTDIR, "ENOTDIR" }, \ 170 { EISDIR, "EISDIR" }, \ 171 { EFBIG, "EFBIG" }, \ 172 { ENOSPC, "ENOSPC" }, \ 173 { EROFS, "EROFS" }, \ 174 { EMLINK, "EMLINK" }, \ 175 { ENAMETOOLONG, "ENAMETOOLONG" }, \ 176 { ENOTEMPTY, "ENOTEMPTY" }, \ 177 { EDQUOT, "EDQUOT" }, \ 178 { ESTALE, "ESTALE" }, \ 179 { EBADHANDLE, "EBADHANDLE" }, \ 180 { EBADCOOKIE, "EBADCOOKIE" }, \ 181 { ENOTSUPP, "ENOTSUPP" }, \ 182 { ETOOSMALL, "ETOOSMALL" }, \ 183 { EREMOTEIO, "EREMOTEIO" }, \ 184 { EBADTYPE, "EBADTYPE" }, \ 185 { EAGAIN, "EAGAIN" }, \ 186 { ELOOP, "ELOOP" }, \ 187 { EOPNOTSUPP, "EOPNOTSUPP" }, \ 188 { EDEADLK, "EDEADLK" }, \ 189 /* RPC errors */ \ 190 { ENOMEM, "ENOMEM" }, \ 191 { EKEYEXPIRED, "EKEYEXPIRED" }, \ 192 { ETIMEDOUT, "ETIMEDOUT" }, \ 193 { ERESTARTSYS, "ERESTARTSYS" }, \ 194 { ECONNREFUSED, "ECONNREFUSED" }, \ 195 { ECONNRESET, "ECONNRESET" }, \ 196 { ENETUNREACH, "ENETUNREACH" }, \ 197 { EHOSTUNREACH, "EHOSTUNREACH" }, \ 198 { EHOSTDOWN, "EHOSTDOWN" }, \ 199 { EPIPE, "EPIPE" }, \ 200 { EPFNOSUPPORT, "EPFNOSUPPORT" }, \ 201 { EPROTONOSUPPORT, "EPROTONOSUPPORT" }, \ 202 /* NFSv4 native errors */ \ 203 { NFS4ERR_ACCESS, "ACCESS" }, \ 204 { NFS4ERR_ATTRNOTSUPP, "ATTRNOTSUPP" }, \ 205 { NFS4ERR_ADMIN_REVOKED, "ADMIN_REVOKED" }, \ 206 { NFS4ERR_BACK_CHAN_BUSY, "BACK_CHAN_BUSY" }, \ 207 { NFS4ERR_BADCHAR, "BADCHAR" }, \ 208 { NFS4ERR_BADHANDLE, "BADHANDLE" }, \ 209 { NFS4ERR_BADIOMODE, "BADIOMODE" }, \ 210 { NFS4ERR_BADLAYOUT, "BADLAYOUT" }, \ 211 { NFS4ERR_BADLABEL, "BADLABEL" }, \ 212 { NFS4ERR_BADNAME, "BADNAME" }, \ 213 { NFS4ERR_BADOWNER, "BADOWNER" }, \ 214 { NFS4ERR_BADSESSION, "BADSESSION" }, \ 215 { NFS4ERR_BADSLOT, "BADSLOT" }, \ 216 { NFS4ERR_BADTYPE, "BADTYPE" }, \ 217 { NFS4ERR_BADXDR, "BADXDR" }, \ 218 { NFS4ERR_BAD_COOKIE, "BAD_COOKIE" }, \ 219 { NFS4ERR_BAD_HIGH_SLOT, "BAD_HIGH_SLOT" }, \ 220 { NFS4ERR_BAD_RANGE, "BAD_RANGE" }, \ 221 { NFS4ERR_BAD_SEQID, "BAD_SEQID" }, \ 222 { NFS4ERR_BAD_SESSION_DIGEST, "BAD_SESSION_DIGEST" }, \ 223 { NFS4ERR_BAD_STATEID, "BAD_STATEID" }, \ 224 { NFS4ERR_CB_PATH_DOWN, "CB_PATH_DOWN" }, \ 225 { NFS4ERR_CLID_INUSE, "CLID_INUSE" }, \ 226 { NFS4ERR_CLIENTID_BUSY, "CLIENTID_BUSY" }, \ 227 { NFS4ERR_COMPLETE_ALREADY, "COMPLETE_ALREADY" }, \ 228 { NFS4ERR_CONN_NOT_BOUND_TO_SESSION, \ 229 "CONN_NOT_BOUND_TO_SESSION" }, \ 230 { NFS4ERR_DEADLOCK, "DEADLOCK" }, \ 231 { NFS4ERR_DEADSESSION, "DEAD_SESSION" }, \ 232 { NFS4ERR_DELAY, "DELAY" }, \ 233 { NFS4ERR_DELEG_ALREADY_WANTED, \ 234 "DELEG_ALREADY_WANTED" }, \ 235 { NFS4ERR_DELEG_REVOKED, "DELEG_REVOKED" }, \ 236 { NFS4ERR_DENIED, "DENIED" }, \ 237 { NFS4ERR_DIRDELEG_UNAVAIL, "DIRDELEG_UNAVAIL" }, \ 238 { NFS4ERR_DQUOT, "DQUOT" }, \ 239 { NFS4ERR_ENCR_ALG_UNSUPP, "ENCR_ALG_UNSUPP" }, \ 240 { NFS4ERR_EXIST, "EXIST" }, \ 241 { NFS4ERR_EXPIRED, "EXPIRED" }, \ 242 { NFS4ERR_FBIG, "FBIG" }, \ 243 { NFS4ERR_FHEXPIRED, "FHEXPIRED" }, \ 244 { NFS4ERR_FILE_OPEN, "FILE_OPEN" }, \ 245 { NFS4ERR_GRACE, "GRACE" }, \ 246 { NFS4ERR_HASH_ALG_UNSUPP, "HASH_ALG_UNSUPP" }, \ 247 { NFS4ERR_INVAL, "INVAL" }, \ 248 { NFS4ERR_IO, "IO" }, \ 249 { NFS4ERR_ISDIR, "ISDIR" }, \ 250 { NFS4ERR_LAYOUTTRYLATER, "LAYOUTTRYLATER" }, \ 251 { NFS4ERR_LAYOUTUNAVAILABLE, "LAYOUTUNAVAILABLE" }, \ 252 { NFS4ERR_LEASE_MOVED, "LEASE_MOVED" }, \ 253 { NFS4ERR_LOCKED, "LOCKED" }, \ 254 { NFS4ERR_LOCKS_HELD, "LOCKS_HELD" }, \ 255 { NFS4ERR_LOCK_RANGE, "LOCK_RANGE" }, \ 256 { NFS4ERR_MINOR_VERS_MISMATCH, "MINOR_VERS_MISMATCH" }, \ 257 { NFS4ERR_MLINK, "MLINK" }, \ 258 { NFS4ERR_MOVED, "MOVED" }, \ 259 { NFS4ERR_NAMETOOLONG, "NAMETOOLONG" }, \ 260 { NFS4ERR_NOENT, "NOENT" }, \ 261 { NFS4ERR_NOFILEHANDLE, "NOFILEHANDLE" }, \ 262 { NFS4ERR_NOMATCHING_LAYOUT, "NOMATCHING_LAYOUT" }, \ 263 { NFS4ERR_NOSPC, "NOSPC" }, \ 264 { NFS4ERR_NOTDIR, "NOTDIR" }, \ 265 { NFS4ERR_NOTEMPTY, "NOTEMPTY" }, \ 266 { NFS4ERR_NOTSUPP, "NOTSUPP" }, \ 267 { NFS4ERR_NOT_ONLY_OP, "NOT_ONLY_OP" }, \ 268 { NFS4ERR_NOT_SAME, "NOT_SAME" }, \ 269 { NFS4ERR_NO_GRACE, "NO_GRACE" }, \ 270 { NFS4ERR_NXIO, "NXIO" }, \ 271 { NFS4ERR_OLD_STATEID, "OLD_STATEID" }, \ 272 { NFS4ERR_OPENMODE, "OPENMODE" }, \ 273 { NFS4ERR_OP_ILLEGAL, "OP_ILLEGAL" }, \ 274 { NFS4ERR_OP_NOT_IN_SESSION, "OP_NOT_IN_SESSION" }, \ 275 { NFS4ERR_PERM, "PERM" }, \ 276 { NFS4ERR_PNFS_IO_HOLE, "PNFS_IO_HOLE" }, \ 277 { NFS4ERR_PNFS_NO_LAYOUT, "PNFS_NO_LAYOUT" }, \ 278 { NFS4ERR_RECALLCONFLICT, "RECALLCONFLICT" }, \ 279 { NFS4ERR_RECLAIM_BAD, "RECLAIM_BAD" }, \ 280 { NFS4ERR_RECLAIM_CONFLICT, "RECLAIM_CONFLICT" }, \ 281 { NFS4ERR_REJECT_DELEG, "REJECT_DELEG" }, \ 282 { NFS4ERR_REP_TOO_BIG, "REP_TOO_BIG" }, \ 283 { NFS4ERR_REP_TOO_BIG_TO_CACHE, \ 284 "REP_TOO_BIG_TO_CACHE" }, \ 285 { NFS4ERR_REQ_TOO_BIG, "REQ_TOO_BIG" }, \ 286 { NFS4ERR_RESOURCE, "RESOURCE" }, \ 287 { NFS4ERR_RESTOREFH, "RESTOREFH" }, \ 288 { NFS4ERR_RETRY_UNCACHED_REP, "RETRY_UNCACHED_REP" }, \ 289 { NFS4ERR_RETURNCONFLICT, "RETURNCONFLICT" }, \ 290 { NFS4ERR_ROFS, "ROFS" }, \ 291 { NFS4ERR_SAME, "SAME" }, \ 292 { NFS4ERR_SHARE_DENIED, "SHARE_DENIED" }, \ 293 { NFS4ERR_SEQUENCE_POS, "SEQUENCE_POS" }, \ 294 { NFS4ERR_SEQ_FALSE_RETRY, "SEQ_FALSE_RETRY" }, \ 295 { NFS4ERR_SEQ_MISORDERED, "SEQ_MISORDERED" }, \ 296 { NFS4ERR_SERVERFAULT, "SERVERFAULT" }, \ 297 { NFS4ERR_STALE, "STALE" }, \ 298 { NFS4ERR_STALE_CLIENTID, "STALE_CLIENTID" }, \ 299 { NFS4ERR_STALE_STATEID, "STALE_STATEID" }, \ 300 { NFS4ERR_SYMLINK, "SYMLINK" }, \ 301 { NFS4ERR_TOOSMALL, "TOOSMALL" }, \ 302 { NFS4ERR_TOO_MANY_OPS, "TOO_MANY_OPS" }, \ 303 { NFS4ERR_UNKNOWN_LAYOUTTYPE, "UNKNOWN_LAYOUTTYPE" }, \ 304 { NFS4ERR_UNSAFE_COMPOUND, "UNSAFE_COMPOUND" }, \ 305 { NFS4ERR_WRONGSEC, "WRONGSEC" }, \ 306 { NFS4ERR_WRONG_CRED, "WRONG_CRED" }, \ 307 { NFS4ERR_WRONG_TYPE, "WRONG_TYPE" }, \ 308 { NFS4ERR_XDEV, "XDEV" }) 309 310 #define show_open_flags(flags) \ 311 __print_flags(flags, "|", \ 312 { O_CREAT, "O_CREAT" }, \ 313 { O_EXCL, "O_EXCL" }, \ 314 { O_TRUNC, "O_TRUNC" }, \ 315 { O_DIRECT, "O_DIRECT" }) 316 317 #define show_fmode_flags(mode) \ 318 __print_flags(mode, "|", \ 319 { ((__force unsigned long)FMODE_READ), "READ" }, \ 320 { ((__force unsigned long)FMODE_WRITE), "WRITE" }, \ 321 { ((__force unsigned long)FMODE_EXEC), "EXEC" }) 322 323 #define show_nfs_fattr_flags(valid) \ 324 __print_flags((unsigned long)valid, "|", \ 325 { NFS_ATTR_FATTR_TYPE, "TYPE" }, \ 326 { NFS_ATTR_FATTR_MODE, "MODE" }, \ 327 { NFS_ATTR_FATTR_NLINK, "NLINK" }, \ 328 { NFS_ATTR_FATTR_OWNER, "OWNER" }, \ 329 { NFS_ATTR_FATTR_GROUP, "GROUP" }, \ 330 { NFS_ATTR_FATTR_RDEV, "RDEV" }, \ 331 { NFS_ATTR_FATTR_SIZE, "SIZE" }, \ 332 { NFS_ATTR_FATTR_FSID, "FSID" }, \ 333 { NFS_ATTR_FATTR_FILEID, "FILEID" }, \ 334 { NFS_ATTR_FATTR_ATIME, "ATIME" }, \ 335 { NFS_ATTR_FATTR_MTIME, "MTIME" }, \ 336 { NFS_ATTR_FATTR_CTIME, "CTIME" }, \ 337 { NFS_ATTR_FATTR_CHANGE, "CHANGE" }, \ 338 { NFS_ATTR_FATTR_OWNER_NAME, "OWNER_NAME" }, \ 339 { NFS_ATTR_FATTR_GROUP_NAME, "GROUP_NAME" }) 340 341 DECLARE_EVENT_CLASS(nfs4_clientid_event, 342 TP_PROTO( 343 const struct nfs_client *clp, 344 int error 345 ), 346 347 TP_ARGS(clp, error), 348 349 TP_STRUCT__entry( 350 __string(dstaddr, clp->cl_hostname) 351 __field(unsigned long, error) 352 ), 353 354 TP_fast_assign( 355 __entry->error = error < 0 ? -error : 0; 356 __assign_str(dstaddr, clp->cl_hostname); 357 ), 358 359 TP_printk( 360 "error=%ld (%s) dstaddr=%s", 361 -__entry->error, 362 show_nfsv4_errors(__entry->error), 363 __get_str(dstaddr) 364 ) 365 ); 366 #define DEFINE_NFS4_CLIENTID_EVENT(name) \ 367 DEFINE_EVENT(nfs4_clientid_event, name, \ 368 TP_PROTO( \ 369 const struct nfs_client *clp, \ 370 int error \ 371 ), \ 372 TP_ARGS(clp, error)) 373 DEFINE_NFS4_CLIENTID_EVENT(nfs4_setclientid); 374 DEFINE_NFS4_CLIENTID_EVENT(nfs4_setclientid_confirm); 375 DEFINE_NFS4_CLIENTID_EVENT(nfs4_renew); 376 DEFINE_NFS4_CLIENTID_EVENT(nfs4_renew_async); 377 #ifdef CONFIG_NFS_V4_1 378 DEFINE_NFS4_CLIENTID_EVENT(nfs4_exchange_id); 379 DEFINE_NFS4_CLIENTID_EVENT(nfs4_create_session); 380 DEFINE_NFS4_CLIENTID_EVENT(nfs4_destroy_session); 381 DEFINE_NFS4_CLIENTID_EVENT(nfs4_destroy_clientid); 382 DEFINE_NFS4_CLIENTID_EVENT(nfs4_bind_conn_to_session); 383 DEFINE_NFS4_CLIENTID_EVENT(nfs4_sequence); 384 DEFINE_NFS4_CLIENTID_EVENT(nfs4_reclaim_complete); 385 386 #define show_nfs4_sequence_status_flags(status) \ 387 __print_flags((unsigned long)status, "|", \ 388 { SEQ4_STATUS_CB_PATH_DOWN, "CB_PATH_DOWN" }, \ 389 { SEQ4_STATUS_CB_GSS_CONTEXTS_EXPIRING, \ 390 "CB_GSS_CONTEXTS_EXPIRING" }, \ 391 { SEQ4_STATUS_CB_GSS_CONTEXTS_EXPIRED, \ 392 "CB_GSS_CONTEXTS_EXPIRED" }, \ 393 { SEQ4_STATUS_EXPIRED_ALL_STATE_REVOKED, \ 394 "EXPIRED_ALL_STATE_REVOKED" }, \ 395 { SEQ4_STATUS_EXPIRED_SOME_STATE_REVOKED, \ 396 "EXPIRED_SOME_STATE_REVOKED" }, \ 397 { SEQ4_STATUS_ADMIN_STATE_REVOKED, \ 398 "ADMIN_STATE_REVOKED" }, \ 399 { SEQ4_STATUS_RECALLABLE_STATE_REVOKED, \ 400 "RECALLABLE_STATE_REVOKED" }, \ 401 { SEQ4_STATUS_LEASE_MOVED, "LEASE_MOVED" }, \ 402 { SEQ4_STATUS_RESTART_RECLAIM_NEEDED, \ 403 "RESTART_RECLAIM_NEEDED" }, \ 404 { SEQ4_STATUS_CB_PATH_DOWN_SESSION, \ 405 "CB_PATH_DOWN_SESSION" }, \ 406 { SEQ4_STATUS_BACKCHANNEL_FAULT, \ 407 "BACKCHANNEL_FAULT" }) 408 409 TRACE_EVENT(nfs4_sequence_done, 410 TP_PROTO( 411 const struct nfs4_session *session, 412 const struct nfs4_sequence_res *res 413 ), 414 TP_ARGS(session, res), 415 416 TP_STRUCT__entry( 417 __field(unsigned int, session) 418 __field(unsigned int, slot_nr) 419 __field(unsigned int, seq_nr) 420 __field(unsigned int, highest_slotid) 421 __field(unsigned int, target_highest_slotid) 422 __field(unsigned int, status_flags) 423 __field(unsigned long, error) 424 ), 425 426 TP_fast_assign( 427 const struct nfs4_slot *sr_slot = res->sr_slot; 428 __entry->session = nfs_session_id_hash(&session->sess_id); 429 __entry->slot_nr = sr_slot->slot_nr; 430 __entry->seq_nr = sr_slot->seq_nr; 431 __entry->highest_slotid = res->sr_highest_slotid; 432 __entry->target_highest_slotid = 433 res->sr_target_highest_slotid; 434 __entry->status_flags = res->sr_status_flags; 435 __entry->error = res->sr_status < 0 ? 436 -res->sr_status : 0; 437 ), 438 TP_printk( 439 "error=%ld (%s) session=0x%08x slot_nr=%u seq_nr=%u " 440 "highest_slotid=%u target_highest_slotid=%u " 441 "status_flags=%u (%s)", 442 -__entry->error, 443 show_nfsv4_errors(__entry->error), 444 __entry->session, 445 __entry->slot_nr, 446 __entry->seq_nr, 447 __entry->highest_slotid, 448 __entry->target_highest_slotid, 449 __entry->status_flags, 450 show_nfs4_sequence_status_flags(__entry->status_flags) 451 ) 452 ); 453 454 struct cb_sequenceargs; 455 struct cb_sequenceres; 456 457 TRACE_EVENT(nfs4_cb_sequence, 458 TP_PROTO( 459 const struct cb_sequenceargs *args, 460 const struct cb_sequenceres *res, 461 __be32 status 462 ), 463 TP_ARGS(args, res, status), 464 465 TP_STRUCT__entry( 466 __field(unsigned int, session) 467 __field(unsigned int, slot_nr) 468 __field(unsigned int, seq_nr) 469 __field(unsigned int, highest_slotid) 470 __field(unsigned int, cachethis) 471 __field(unsigned long, error) 472 ), 473 474 TP_fast_assign( 475 __entry->session = nfs_session_id_hash(&args->csa_sessionid); 476 __entry->slot_nr = args->csa_slotid; 477 __entry->seq_nr = args->csa_sequenceid; 478 __entry->highest_slotid = args->csa_highestslotid; 479 __entry->cachethis = args->csa_cachethis; 480 __entry->error = be32_to_cpu(status); 481 ), 482 483 TP_printk( 484 "error=%ld (%s) session=0x%08x slot_nr=%u seq_nr=%u " 485 "highest_slotid=%u", 486 -__entry->error, 487 show_nfsv4_errors(__entry->error), 488 __entry->session, 489 __entry->slot_nr, 490 __entry->seq_nr, 491 __entry->highest_slotid 492 ) 493 ); 494 495 TRACE_EVENT(nfs4_cb_seqid_err, 496 TP_PROTO( 497 const struct cb_sequenceargs *args, 498 __be32 status 499 ), 500 TP_ARGS(args, status), 501 502 TP_STRUCT__entry( 503 __field(unsigned int, session) 504 __field(unsigned int, slot_nr) 505 __field(unsigned int, seq_nr) 506 __field(unsigned int, highest_slotid) 507 __field(unsigned int, cachethis) 508 __field(unsigned long, error) 509 ), 510 511 TP_fast_assign( 512 __entry->session = nfs_session_id_hash(&args->csa_sessionid); 513 __entry->slot_nr = args->csa_slotid; 514 __entry->seq_nr = args->csa_sequenceid; 515 __entry->highest_slotid = args->csa_highestslotid; 516 __entry->cachethis = args->csa_cachethis; 517 __entry->error = be32_to_cpu(status); 518 ), 519 520 TP_printk( 521 "error=%ld (%s) session=0x%08x slot_nr=%u seq_nr=%u " 522 "highest_slotid=%u", 523 -__entry->error, 524 show_nfsv4_errors(__entry->error), 525 __entry->session, 526 __entry->slot_nr, 527 __entry->seq_nr, 528 __entry->highest_slotid 529 ) 530 ); 531 532 #endif /* CONFIG_NFS_V4_1 */ 533 534 TRACE_EVENT(nfs4_setup_sequence, 535 TP_PROTO( 536 const struct nfs4_session *session, 537 const struct nfs4_sequence_args *args 538 ), 539 TP_ARGS(session, args), 540 541 TP_STRUCT__entry( 542 __field(unsigned int, session) 543 __field(unsigned int, slot_nr) 544 __field(unsigned int, seq_nr) 545 __field(unsigned int, highest_used_slotid) 546 ), 547 548 TP_fast_assign( 549 const struct nfs4_slot *sa_slot = args->sa_slot; 550 __entry->session = session ? nfs_session_id_hash(&session->sess_id) : 0; 551 __entry->slot_nr = sa_slot->slot_nr; 552 __entry->seq_nr = sa_slot->seq_nr; 553 __entry->highest_used_slotid = 554 sa_slot->table->highest_used_slotid; 555 ), 556 TP_printk( 557 "session=0x%08x slot_nr=%u seq_nr=%u " 558 "highest_used_slotid=%u", 559 __entry->session, 560 __entry->slot_nr, 561 __entry->seq_nr, 562 __entry->highest_used_slotid 563 ) 564 ); 565 566 TRACE_DEFINE_ENUM(NFS4CLNT_MANAGER_RUNNING); 567 TRACE_DEFINE_ENUM(NFS4CLNT_CHECK_LEASE); 568 TRACE_DEFINE_ENUM(NFS4CLNT_LEASE_EXPIRED); 569 TRACE_DEFINE_ENUM(NFS4CLNT_RECLAIM_REBOOT); 570 TRACE_DEFINE_ENUM(NFS4CLNT_RECLAIM_NOGRACE); 571 TRACE_DEFINE_ENUM(NFS4CLNT_DELEGRETURN); 572 TRACE_DEFINE_ENUM(NFS4CLNT_SESSION_RESET); 573 TRACE_DEFINE_ENUM(NFS4CLNT_LEASE_CONFIRM); 574 TRACE_DEFINE_ENUM(NFS4CLNT_SERVER_SCOPE_MISMATCH); 575 TRACE_DEFINE_ENUM(NFS4CLNT_PURGE_STATE); 576 TRACE_DEFINE_ENUM(NFS4CLNT_BIND_CONN_TO_SESSION); 577 TRACE_DEFINE_ENUM(NFS4CLNT_MOVED); 578 TRACE_DEFINE_ENUM(NFS4CLNT_LEASE_MOVED); 579 TRACE_DEFINE_ENUM(NFS4CLNT_DELEGATION_EXPIRED); 580 TRACE_DEFINE_ENUM(NFS4CLNT_RUN_MANAGER); 581 TRACE_DEFINE_ENUM(NFS4CLNT_DELEGRETURN_RUNNING); 582 583 #define show_nfs4_clp_state(state) \ 584 __print_flags(state, "|", \ 585 { NFS4CLNT_MANAGER_RUNNING, "MANAGER_RUNNING" }, \ 586 { NFS4CLNT_CHECK_LEASE, "CHECK_LEASE" }, \ 587 { NFS4CLNT_LEASE_EXPIRED, "LEASE_EXPIRED" }, \ 588 { NFS4CLNT_RECLAIM_REBOOT, "RECLAIM_REBOOT" }, \ 589 { NFS4CLNT_RECLAIM_NOGRACE, "RECLAIM_NOGRACE" }, \ 590 { NFS4CLNT_DELEGRETURN, "DELEGRETURN" }, \ 591 { NFS4CLNT_SESSION_RESET, "SESSION_RESET" }, \ 592 { NFS4CLNT_LEASE_CONFIRM, "LEASE_CONFIRM" }, \ 593 { NFS4CLNT_SERVER_SCOPE_MISMATCH, \ 594 "SERVER_SCOPE_MISMATCH" }, \ 595 { NFS4CLNT_PURGE_STATE, "PURGE_STATE" }, \ 596 { NFS4CLNT_BIND_CONN_TO_SESSION, \ 597 "BIND_CONN_TO_SESSION" }, \ 598 { NFS4CLNT_MOVED, "MOVED" }, \ 599 { NFS4CLNT_LEASE_MOVED, "LEASE_MOVED" }, \ 600 { NFS4CLNT_DELEGATION_EXPIRED, "DELEGATION_EXPIRED" }, \ 601 { NFS4CLNT_RUN_MANAGER, "RUN_MANAGER" }, \ 602 { NFS4CLNT_DELEGRETURN_RUNNING, "DELEGRETURN_RUNNING" }) 603 604 TRACE_EVENT(nfs4_state_mgr, 605 TP_PROTO( 606 const struct nfs_client *clp 607 ), 608 609 TP_ARGS(clp), 610 611 TP_STRUCT__entry( 612 __field(unsigned long, state) 613 __string(hostname, clp->cl_hostname) 614 ), 615 616 TP_fast_assign( 617 __entry->state = clp->cl_state; 618 __assign_str(hostname, clp->cl_hostname) 619 ), 620 621 TP_printk( 622 "hostname=%s clp state=%s", __get_str(hostname), 623 show_nfs4_clp_state(__entry->state) 624 ) 625 ) 626 627 TRACE_EVENT(nfs4_state_mgr_failed, 628 TP_PROTO( 629 const struct nfs_client *clp, 630 const char *section, 631 int status 632 ), 633 634 TP_ARGS(clp, section, status), 635 636 TP_STRUCT__entry( 637 __field(unsigned long, error) 638 __field(unsigned long, state) 639 __string(hostname, clp->cl_hostname) 640 __string(section, section) 641 ), 642 643 TP_fast_assign( 644 __entry->error = status; 645 __entry->state = clp->cl_state; 646 __assign_str(hostname, clp->cl_hostname); 647 __assign_str(section, section); 648 ), 649 650 TP_printk( 651 "hostname=%s clp state=%s error=%ld (%s) section=%s", 652 __get_str(hostname), 653 show_nfs4_clp_state(__entry->state), -__entry->error, 654 show_nfsv4_errors(__entry->error), __get_str(section) 655 656 ) 657 ) 658 659 TRACE_EVENT(nfs4_xdr_status, 660 TP_PROTO( 661 const struct xdr_stream *xdr, 662 u32 op, 663 u32 error 664 ), 665 666 TP_ARGS(xdr, op, error), 667 668 TP_STRUCT__entry( 669 __field(unsigned int, task_id) 670 __field(unsigned int, client_id) 671 __field(u32, xid) 672 __field(u32, op) 673 __field(unsigned long, error) 674 ), 675 676 TP_fast_assign( 677 const struct rpc_rqst *rqstp = xdr->rqst; 678 const struct rpc_task *task = rqstp->rq_task; 679 680 __entry->task_id = task->tk_pid; 681 __entry->client_id = task->tk_client->cl_clid; 682 __entry->xid = be32_to_cpu(rqstp->rq_xid); 683 __entry->op = op; 684 __entry->error = error; 685 ), 686 687 TP_printk( 688 "task:%u@%d xid=0x%08x error=%ld (%s) operation=%u", 689 __entry->task_id, __entry->client_id, __entry->xid, 690 -__entry->error, show_nfsv4_errors(__entry->error), 691 __entry->op 692 ) 693 ); 694 695 DECLARE_EVENT_CLASS(nfs4_open_event, 696 TP_PROTO( 697 const struct nfs_open_context *ctx, 698 int flags, 699 int error 700 ), 701 702 TP_ARGS(ctx, flags, error), 703 704 TP_STRUCT__entry( 705 __field(unsigned long, error) 706 __field(unsigned int, flags) 707 __field(unsigned int, fmode) 708 __field(dev_t, dev) 709 __field(u32, fhandle) 710 __field(u64, fileid) 711 __field(u64, dir) 712 __string(name, ctx->dentry->d_name.name) 713 __field(int, stateid_seq) 714 __field(u32, stateid_hash) 715 __field(int, openstateid_seq) 716 __field(u32, openstateid_hash) 717 ), 718 719 TP_fast_assign( 720 const struct nfs4_state *state = ctx->state; 721 const struct inode *inode = NULL; 722 723 __entry->error = -error; 724 __entry->flags = flags; 725 __entry->fmode = (__force unsigned int)ctx->mode; 726 __entry->dev = ctx->dentry->d_sb->s_dev; 727 if (!IS_ERR_OR_NULL(state)) { 728 inode = state->inode; 729 __entry->stateid_seq = 730 be32_to_cpu(state->stateid.seqid); 731 __entry->stateid_hash = 732 nfs_stateid_hash(&state->stateid); 733 __entry->openstateid_seq = 734 be32_to_cpu(state->open_stateid.seqid); 735 __entry->openstateid_hash = 736 nfs_stateid_hash(&state->open_stateid); 737 } else { 738 __entry->stateid_seq = 0; 739 __entry->stateid_hash = 0; 740 __entry->openstateid_seq = 0; 741 __entry->openstateid_hash = 0; 742 } 743 if (inode != NULL) { 744 __entry->fileid = NFS_FILEID(inode); 745 __entry->fhandle = nfs_fhandle_hash(NFS_FH(inode)); 746 } else { 747 __entry->fileid = 0; 748 __entry->fhandle = 0; 749 } 750 __entry->dir = NFS_FILEID(d_inode(ctx->dentry->d_parent)); 751 __assign_str(name, ctx->dentry->d_name.name); 752 ), 753 754 TP_printk( 755 "error=%ld (%s) flags=%d (%s) fmode=%s " 756 "fileid=%02x:%02x:%llu fhandle=0x%08x " 757 "name=%02x:%02x:%llu/%s stateid=%d:0x%08x " 758 "openstateid=%d:0x%08x", 759 -__entry->error, 760 show_nfsv4_errors(__entry->error), 761 __entry->flags, 762 show_open_flags(__entry->flags), 763 show_fmode_flags(__entry->fmode), 764 MAJOR(__entry->dev), MINOR(__entry->dev), 765 (unsigned long long)__entry->fileid, 766 __entry->fhandle, 767 MAJOR(__entry->dev), MINOR(__entry->dev), 768 (unsigned long long)__entry->dir, 769 __get_str(name), 770 __entry->stateid_seq, __entry->stateid_hash, 771 __entry->openstateid_seq, __entry->openstateid_hash 772 ) 773 ); 774 775 #define DEFINE_NFS4_OPEN_EVENT(name) \ 776 DEFINE_EVENT(nfs4_open_event, name, \ 777 TP_PROTO( \ 778 const struct nfs_open_context *ctx, \ 779 int flags, \ 780 int error \ 781 ), \ 782 TP_ARGS(ctx, flags, error)) 783 DEFINE_NFS4_OPEN_EVENT(nfs4_open_reclaim); 784 DEFINE_NFS4_OPEN_EVENT(nfs4_open_expired); 785 DEFINE_NFS4_OPEN_EVENT(nfs4_open_file); 786 787 TRACE_EVENT(nfs4_cached_open, 788 TP_PROTO( 789 const struct nfs4_state *state 790 ), 791 TP_ARGS(state), 792 TP_STRUCT__entry( 793 __field(dev_t, dev) 794 __field(u32, fhandle) 795 __field(u64, fileid) 796 __field(unsigned int, fmode) 797 __field(int, stateid_seq) 798 __field(u32, stateid_hash) 799 ), 800 801 TP_fast_assign( 802 const struct inode *inode = state->inode; 803 804 __entry->dev = inode->i_sb->s_dev; 805 __entry->fileid = NFS_FILEID(inode); 806 __entry->fhandle = nfs_fhandle_hash(NFS_FH(inode)); 807 __entry->fmode = (__force unsigned int)state->state; 808 __entry->stateid_seq = 809 be32_to_cpu(state->stateid.seqid); 810 __entry->stateid_hash = 811 nfs_stateid_hash(&state->stateid); 812 ), 813 814 TP_printk( 815 "fmode=%s fileid=%02x:%02x:%llu " 816 "fhandle=0x%08x stateid=%d:0x%08x", 817 __entry->fmode ? show_fmode_flags(__entry->fmode) : 818 "closed", 819 MAJOR(__entry->dev), MINOR(__entry->dev), 820 (unsigned long long)__entry->fileid, 821 __entry->fhandle, 822 __entry->stateid_seq, __entry->stateid_hash 823 ) 824 ); 825 826 TRACE_EVENT(nfs4_close, 827 TP_PROTO( 828 const struct nfs4_state *state, 829 const struct nfs_closeargs *args, 830 const struct nfs_closeres *res, 831 int error 832 ), 833 834 TP_ARGS(state, args, res, error), 835 836 TP_STRUCT__entry( 837 __field(dev_t, dev) 838 __field(u32, fhandle) 839 __field(u64, fileid) 840 __field(unsigned int, fmode) 841 __field(unsigned long, error) 842 __field(int, stateid_seq) 843 __field(u32, stateid_hash) 844 ), 845 846 TP_fast_assign( 847 const struct inode *inode = state->inode; 848 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->error = error < 0 ? -error : 0; 854 __entry->stateid_seq = 855 be32_to_cpu(args->stateid.seqid); 856 __entry->stateid_hash = 857 nfs_stateid_hash(&args->stateid); 858 ), 859 860 TP_printk( 861 "error=%ld (%s) fmode=%s fileid=%02x:%02x:%llu " 862 "fhandle=0x%08x openstateid=%d:0x%08x", 863 -__entry->error, 864 show_nfsv4_errors(__entry->error), 865 __entry->fmode ? show_fmode_flags(__entry->fmode) : 866 "closed", 867 MAJOR(__entry->dev), MINOR(__entry->dev), 868 (unsigned long long)__entry->fileid, 869 __entry->fhandle, 870 __entry->stateid_seq, __entry->stateid_hash 871 ) 872 ); 873 874 TRACE_DEFINE_ENUM(F_GETLK); 875 TRACE_DEFINE_ENUM(F_SETLK); 876 TRACE_DEFINE_ENUM(F_SETLKW); 877 TRACE_DEFINE_ENUM(F_RDLCK); 878 TRACE_DEFINE_ENUM(F_WRLCK); 879 TRACE_DEFINE_ENUM(F_UNLCK); 880 881 #define show_lock_cmd(type) \ 882 __print_symbolic((int)type, \ 883 { F_GETLK, "GETLK" }, \ 884 { F_SETLK, "SETLK" }, \ 885 { F_SETLKW, "SETLKW" }) 886 #define show_lock_type(type) \ 887 __print_symbolic((int)type, \ 888 { F_RDLCK, "RDLCK" }, \ 889 { F_WRLCK, "WRLCK" }, \ 890 { F_UNLCK, "UNLCK" }) 891 892 DECLARE_EVENT_CLASS(nfs4_lock_event, 893 TP_PROTO( 894 const struct file_lock *request, 895 const struct nfs4_state *state, 896 int cmd, 897 int error 898 ), 899 900 TP_ARGS(request, state, cmd, error), 901 902 TP_STRUCT__entry( 903 __field(unsigned long, error) 904 __field(int, cmd) 905 __field(char, type) 906 __field(loff_t, start) 907 __field(loff_t, end) 908 __field(dev_t, dev) 909 __field(u32, fhandle) 910 __field(u64, fileid) 911 __field(int, stateid_seq) 912 __field(u32, stateid_hash) 913 ), 914 915 TP_fast_assign( 916 const struct inode *inode = state->inode; 917 918 __entry->error = error < 0 ? -error : 0; 919 __entry->cmd = cmd; 920 __entry->type = request->fl_type; 921 __entry->start = request->fl_start; 922 __entry->end = request->fl_end; 923 __entry->dev = inode->i_sb->s_dev; 924 __entry->fileid = NFS_FILEID(inode); 925 __entry->fhandle = nfs_fhandle_hash(NFS_FH(inode)); 926 __entry->stateid_seq = 927 be32_to_cpu(state->stateid.seqid); 928 __entry->stateid_hash = 929 nfs_stateid_hash(&state->stateid); 930 ), 931 932 TP_printk( 933 "error=%ld (%s) cmd=%s:%s range=%lld:%lld " 934 "fileid=%02x:%02x:%llu fhandle=0x%08x " 935 "stateid=%d:0x%08x", 936 -__entry->error, 937 show_nfsv4_errors(__entry->error), 938 show_lock_cmd(__entry->cmd), 939 show_lock_type(__entry->type), 940 (long long)__entry->start, 941 (long long)__entry->end, 942 MAJOR(__entry->dev), MINOR(__entry->dev), 943 (unsigned long long)__entry->fileid, 944 __entry->fhandle, 945 __entry->stateid_seq, __entry->stateid_hash 946 ) 947 ); 948 949 #define DEFINE_NFS4_LOCK_EVENT(name) \ 950 DEFINE_EVENT(nfs4_lock_event, name, \ 951 TP_PROTO( \ 952 const struct file_lock *request, \ 953 const struct nfs4_state *state, \ 954 int cmd, \ 955 int error \ 956 ), \ 957 TP_ARGS(request, state, cmd, error)) 958 DEFINE_NFS4_LOCK_EVENT(nfs4_get_lock); 959 DEFINE_NFS4_LOCK_EVENT(nfs4_unlock); 960 961 TRACE_EVENT(nfs4_set_lock, 962 TP_PROTO( 963 const struct file_lock *request, 964 const struct nfs4_state *state, 965 const nfs4_stateid *lockstateid, 966 int cmd, 967 int error 968 ), 969 970 TP_ARGS(request, state, lockstateid, cmd, error), 971 972 TP_STRUCT__entry( 973 __field(unsigned long, error) 974 __field(int, cmd) 975 __field(char, type) 976 __field(loff_t, start) 977 __field(loff_t, end) 978 __field(dev_t, dev) 979 __field(u32, fhandle) 980 __field(u64, fileid) 981 __field(int, stateid_seq) 982 __field(u32, stateid_hash) 983 __field(int, lockstateid_seq) 984 __field(u32, lockstateid_hash) 985 ), 986 987 TP_fast_assign( 988 const struct inode *inode = state->inode; 989 990 __entry->error = error < 0 ? -error : 0; 991 __entry->cmd = cmd; 992 __entry->type = request->fl_type; 993 __entry->start = request->fl_start; 994 __entry->end = request->fl_end; 995 __entry->dev = inode->i_sb->s_dev; 996 __entry->fileid = NFS_FILEID(inode); 997 __entry->fhandle = nfs_fhandle_hash(NFS_FH(inode)); 998 __entry->stateid_seq = 999 be32_to_cpu(state->stateid.seqid); 1000 __entry->stateid_hash = 1001 nfs_stateid_hash(&state->stateid); 1002 __entry->lockstateid_seq = 1003 be32_to_cpu(lockstateid->seqid); 1004 __entry->lockstateid_hash = 1005 nfs_stateid_hash(lockstateid); 1006 ), 1007 1008 TP_printk( 1009 "error=%ld (%s) cmd=%s:%s range=%lld:%lld " 1010 "fileid=%02x:%02x:%llu fhandle=0x%08x " 1011 "stateid=%d:0x%08x lockstateid=%d:0x%08x", 1012 -__entry->error, 1013 show_nfsv4_errors(__entry->error), 1014 show_lock_cmd(__entry->cmd), 1015 show_lock_type(__entry->type), 1016 (long long)__entry->start, 1017 (long long)__entry->end, 1018 MAJOR(__entry->dev), MINOR(__entry->dev), 1019 (unsigned long long)__entry->fileid, 1020 __entry->fhandle, 1021 __entry->stateid_seq, __entry->stateid_hash, 1022 __entry->lockstateid_seq, __entry->lockstateid_hash 1023 ) 1024 ); 1025 1026 DECLARE_EVENT_CLASS(nfs4_set_delegation_event, 1027 TP_PROTO( 1028 const struct inode *inode, 1029 fmode_t fmode 1030 ), 1031 1032 TP_ARGS(inode, fmode), 1033 1034 TP_STRUCT__entry( 1035 __field(dev_t, dev) 1036 __field(u32, fhandle) 1037 __field(u64, fileid) 1038 __field(unsigned int, fmode) 1039 ), 1040 1041 TP_fast_assign( 1042 __entry->dev = inode->i_sb->s_dev; 1043 __entry->fileid = NFS_FILEID(inode); 1044 __entry->fhandle = nfs_fhandle_hash(NFS_FH(inode)); 1045 __entry->fmode = (__force unsigned int)fmode; 1046 ), 1047 1048 TP_printk( 1049 "fmode=%s fileid=%02x:%02x:%llu fhandle=0x%08x", 1050 show_fmode_flags(__entry->fmode), 1051 MAJOR(__entry->dev), MINOR(__entry->dev), 1052 (unsigned long long)__entry->fileid, 1053 __entry->fhandle 1054 ) 1055 ); 1056 #define DEFINE_NFS4_SET_DELEGATION_EVENT(name) \ 1057 DEFINE_EVENT(nfs4_set_delegation_event, name, \ 1058 TP_PROTO( \ 1059 const struct inode *inode, \ 1060 fmode_t fmode \ 1061 ), \ 1062 TP_ARGS(inode, fmode)) 1063 DEFINE_NFS4_SET_DELEGATION_EVENT(nfs4_set_delegation); 1064 DEFINE_NFS4_SET_DELEGATION_EVENT(nfs4_reclaim_delegation); 1065 1066 TRACE_EVENT(nfs4_delegreturn_exit, 1067 TP_PROTO( 1068 const struct nfs4_delegreturnargs *args, 1069 const struct nfs4_delegreturnres *res, 1070 int error 1071 ), 1072 1073 TP_ARGS(args, res, error), 1074 1075 TP_STRUCT__entry( 1076 __field(dev_t, dev) 1077 __field(u32, fhandle) 1078 __field(unsigned long, error) 1079 __field(int, stateid_seq) 1080 __field(u32, stateid_hash) 1081 ), 1082 1083 TP_fast_assign( 1084 __entry->dev = res->server->s_dev; 1085 __entry->fhandle = nfs_fhandle_hash(args->fhandle); 1086 __entry->error = error < 0 ? -error : 0; 1087 __entry->stateid_seq = 1088 be32_to_cpu(args->stateid->seqid); 1089 __entry->stateid_hash = 1090 nfs_stateid_hash(args->stateid); 1091 ), 1092 1093 TP_printk( 1094 "error=%ld (%s) dev=%02x:%02x fhandle=0x%08x " 1095 "stateid=%d:0x%08x", 1096 -__entry->error, 1097 show_nfsv4_errors(__entry->error), 1098 MAJOR(__entry->dev), MINOR(__entry->dev), 1099 __entry->fhandle, 1100 __entry->stateid_seq, __entry->stateid_hash 1101 ) 1102 ); 1103 1104 #ifdef CONFIG_NFS_V4_1 1105 DECLARE_EVENT_CLASS(nfs4_test_stateid_event, 1106 TP_PROTO( 1107 const struct nfs4_state *state, 1108 const struct nfs4_lock_state *lsp, 1109 int error 1110 ), 1111 1112 TP_ARGS(state, lsp, error), 1113 1114 TP_STRUCT__entry( 1115 __field(unsigned long, error) 1116 __field(dev_t, dev) 1117 __field(u32, fhandle) 1118 __field(u64, fileid) 1119 __field(int, stateid_seq) 1120 __field(u32, stateid_hash) 1121 ), 1122 1123 TP_fast_assign( 1124 const struct inode *inode = state->inode; 1125 1126 __entry->error = error < 0 ? -error : 0; 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->stateid_seq = 1131 be32_to_cpu(state->stateid.seqid); 1132 __entry->stateid_hash = 1133 nfs_stateid_hash(&state->stateid); 1134 ), 1135 1136 TP_printk( 1137 "error=%ld (%s) fileid=%02x:%02x:%llu fhandle=0x%08x " 1138 "stateid=%d:0x%08x", 1139 -__entry->error, 1140 show_nfsv4_errors(__entry->error), 1141 MAJOR(__entry->dev), MINOR(__entry->dev), 1142 (unsigned long long)__entry->fileid, 1143 __entry->fhandle, 1144 __entry->stateid_seq, __entry->stateid_hash 1145 ) 1146 ); 1147 1148 #define DEFINE_NFS4_TEST_STATEID_EVENT(name) \ 1149 DEFINE_EVENT(nfs4_test_stateid_event, name, \ 1150 TP_PROTO( \ 1151 const struct nfs4_state *state, \ 1152 const struct nfs4_lock_state *lsp, \ 1153 int error \ 1154 ), \ 1155 TP_ARGS(state, lsp, error)) 1156 DEFINE_NFS4_TEST_STATEID_EVENT(nfs4_test_delegation_stateid); 1157 DEFINE_NFS4_TEST_STATEID_EVENT(nfs4_test_open_stateid); 1158 DEFINE_NFS4_TEST_STATEID_EVENT(nfs4_test_lock_stateid); 1159 #endif /* CONFIG_NFS_V4_1 */ 1160 1161 DECLARE_EVENT_CLASS(nfs4_lookup_event, 1162 TP_PROTO( 1163 const struct inode *dir, 1164 const struct qstr *name, 1165 int error 1166 ), 1167 1168 TP_ARGS(dir, name, error), 1169 1170 TP_STRUCT__entry( 1171 __field(dev_t, dev) 1172 __field(unsigned long, error) 1173 __field(u64, dir) 1174 __string(name, name->name) 1175 ), 1176 1177 TP_fast_assign( 1178 __entry->dev = dir->i_sb->s_dev; 1179 __entry->dir = NFS_FILEID(dir); 1180 __entry->error = -error; 1181 __assign_str(name, name->name); 1182 ), 1183 1184 TP_printk( 1185 "error=%ld (%s) name=%02x:%02x:%llu/%s", 1186 -__entry->error, 1187 show_nfsv4_errors(__entry->error), 1188 MAJOR(__entry->dev), MINOR(__entry->dev), 1189 (unsigned long long)__entry->dir, 1190 __get_str(name) 1191 ) 1192 ); 1193 1194 #define DEFINE_NFS4_LOOKUP_EVENT(name) \ 1195 DEFINE_EVENT(nfs4_lookup_event, name, \ 1196 TP_PROTO( \ 1197 const struct inode *dir, \ 1198 const struct qstr *name, \ 1199 int error \ 1200 ), \ 1201 TP_ARGS(dir, name, error)) 1202 1203 DEFINE_NFS4_LOOKUP_EVENT(nfs4_lookup); 1204 DEFINE_NFS4_LOOKUP_EVENT(nfs4_symlink); 1205 DEFINE_NFS4_LOOKUP_EVENT(nfs4_mkdir); 1206 DEFINE_NFS4_LOOKUP_EVENT(nfs4_mknod); 1207 DEFINE_NFS4_LOOKUP_EVENT(nfs4_remove); 1208 DEFINE_NFS4_LOOKUP_EVENT(nfs4_get_fs_locations); 1209 DEFINE_NFS4_LOOKUP_EVENT(nfs4_secinfo); 1210 1211 TRACE_EVENT(nfs4_lookupp, 1212 TP_PROTO( 1213 const struct inode *inode, 1214 int error 1215 ), 1216 1217 TP_ARGS(inode, error), 1218 1219 TP_STRUCT__entry( 1220 __field(dev_t, dev) 1221 __field(u64, ino) 1222 __field(unsigned long, error) 1223 ), 1224 1225 TP_fast_assign( 1226 __entry->dev = inode->i_sb->s_dev; 1227 __entry->ino = NFS_FILEID(inode); 1228 __entry->error = error < 0 ? -error : 0; 1229 ), 1230 1231 TP_printk( 1232 "error=%ld (%s) inode=%02x:%02x:%llu", 1233 -__entry->error, 1234 show_nfsv4_errors(__entry->error), 1235 MAJOR(__entry->dev), MINOR(__entry->dev), 1236 (unsigned long long)__entry->ino 1237 ) 1238 ); 1239 1240 TRACE_EVENT(nfs4_rename, 1241 TP_PROTO( 1242 const struct inode *olddir, 1243 const struct qstr *oldname, 1244 const struct inode *newdir, 1245 const struct qstr *newname, 1246 int error 1247 ), 1248 1249 TP_ARGS(olddir, oldname, newdir, newname, error), 1250 1251 TP_STRUCT__entry( 1252 __field(dev_t, dev) 1253 __field(unsigned long, error) 1254 __field(u64, olddir) 1255 __string(oldname, oldname->name) 1256 __field(u64, newdir) 1257 __string(newname, newname->name) 1258 ), 1259 1260 TP_fast_assign( 1261 __entry->dev = olddir->i_sb->s_dev; 1262 __entry->olddir = NFS_FILEID(olddir); 1263 __entry->newdir = NFS_FILEID(newdir); 1264 __entry->error = error < 0 ? -error : 0; 1265 __assign_str(oldname, oldname->name); 1266 __assign_str(newname, newname->name); 1267 ), 1268 1269 TP_printk( 1270 "error=%ld (%s) oldname=%02x:%02x:%llu/%s " 1271 "newname=%02x:%02x:%llu/%s", 1272 -__entry->error, 1273 show_nfsv4_errors(__entry->error), 1274 MAJOR(__entry->dev), MINOR(__entry->dev), 1275 (unsigned long long)__entry->olddir, 1276 __get_str(oldname), 1277 MAJOR(__entry->dev), MINOR(__entry->dev), 1278 (unsigned long long)__entry->newdir, 1279 __get_str(newname) 1280 ) 1281 ); 1282 1283 DECLARE_EVENT_CLASS(nfs4_inode_event, 1284 TP_PROTO( 1285 const struct inode *inode, 1286 int error 1287 ), 1288 1289 TP_ARGS(inode, error), 1290 1291 TP_STRUCT__entry( 1292 __field(dev_t, dev) 1293 __field(u32, fhandle) 1294 __field(u64, fileid) 1295 __field(unsigned long, error) 1296 ), 1297 1298 TP_fast_assign( 1299 __entry->dev = inode->i_sb->s_dev; 1300 __entry->fileid = NFS_FILEID(inode); 1301 __entry->fhandle = nfs_fhandle_hash(NFS_FH(inode)); 1302 __entry->error = error < 0 ? -error : 0; 1303 ), 1304 1305 TP_printk( 1306 "error=%ld (%s) fileid=%02x:%02x:%llu fhandle=0x%08x", 1307 -__entry->error, 1308 show_nfsv4_errors(__entry->error), 1309 MAJOR(__entry->dev), MINOR(__entry->dev), 1310 (unsigned long long)__entry->fileid, 1311 __entry->fhandle 1312 ) 1313 ); 1314 1315 #define DEFINE_NFS4_INODE_EVENT(name) \ 1316 DEFINE_EVENT(nfs4_inode_event, name, \ 1317 TP_PROTO( \ 1318 const struct inode *inode, \ 1319 int error \ 1320 ), \ 1321 TP_ARGS(inode, error)) 1322 1323 DEFINE_NFS4_INODE_EVENT(nfs4_access); 1324 DEFINE_NFS4_INODE_EVENT(nfs4_readlink); 1325 DEFINE_NFS4_INODE_EVENT(nfs4_readdir); 1326 DEFINE_NFS4_INODE_EVENT(nfs4_get_acl); 1327 DEFINE_NFS4_INODE_EVENT(nfs4_set_acl); 1328 #ifdef CONFIG_NFS_V4_SECURITY_LABEL 1329 DEFINE_NFS4_INODE_EVENT(nfs4_get_security_label); 1330 DEFINE_NFS4_INODE_EVENT(nfs4_set_security_label); 1331 #endif /* CONFIG_NFS_V4_SECURITY_LABEL */ 1332 1333 DECLARE_EVENT_CLASS(nfs4_inode_stateid_event, 1334 TP_PROTO( 1335 const struct inode *inode, 1336 const nfs4_stateid *stateid, 1337 int error 1338 ), 1339 1340 TP_ARGS(inode, stateid, error), 1341 1342 TP_STRUCT__entry( 1343 __field(dev_t, dev) 1344 __field(u32, fhandle) 1345 __field(u64, fileid) 1346 __field(unsigned long, error) 1347 __field(int, stateid_seq) 1348 __field(u32, stateid_hash) 1349 ), 1350 1351 TP_fast_assign( 1352 __entry->dev = inode->i_sb->s_dev; 1353 __entry->fileid = NFS_FILEID(inode); 1354 __entry->fhandle = nfs_fhandle_hash(NFS_FH(inode)); 1355 __entry->error = error < 0 ? -error : 0; 1356 __entry->stateid_seq = 1357 be32_to_cpu(stateid->seqid); 1358 __entry->stateid_hash = 1359 nfs_stateid_hash(stateid); 1360 ), 1361 1362 TP_printk( 1363 "error=%ld (%s) fileid=%02x:%02x:%llu fhandle=0x%08x " 1364 "stateid=%d:0x%08x", 1365 -__entry->error, 1366 show_nfsv4_errors(__entry->error), 1367 MAJOR(__entry->dev), MINOR(__entry->dev), 1368 (unsigned long long)__entry->fileid, 1369 __entry->fhandle, 1370 __entry->stateid_seq, __entry->stateid_hash 1371 ) 1372 ); 1373 1374 #define DEFINE_NFS4_INODE_STATEID_EVENT(name) \ 1375 DEFINE_EVENT(nfs4_inode_stateid_event, name, \ 1376 TP_PROTO( \ 1377 const struct inode *inode, \ 1378 const nfs4_stateid *stateid, \ 1379 int error \ 1380 ), \ 1381 TP_ARGS(inode, stateid, error)) 1382 1383 DEFINE_NFS4_INODE_STATEID_EVENT(nfs4_setattr); 1384 DEFINE_NFS4_INODE_STATEID_EVENT(nfs4_delegreturn); 1385 DEFINE_NFS4_INODE_STATEID_EVENT(nfs4_open_stateid_update); 1386 DEFINE_NFS4_INODE_STATEID_EVENT(nfs4_open_stateid_update_wait); 1387 DEFINE_NFS4_INODE_STATEID_EVENT(nfs4_close_stateid_update_wait); 1388 1389 DECLARE_EVENT_CLASS(nfs4_getattr_event, 1390 TP_PROTO( 1391 const struct nfs_server *server, 1392 const struct nfs_fh *fhandle, 1393 const struct nfs_fattr *fattr, 1394 int error 1395 ), 1396 1397 TP_ARGS(server, fhandle, fattr, error), 1398 1399 TP_STRUCT__entry( 1400 __field(dev_t, dev) 1401 __field(u32, fhandle) 1402 __field(u64, fileid) 1403 __field(unsigned int, valid) 1404 __field(unsigned long, error) 1405 ), 1406 1407 TP_fast_assign( 1408 __entry->dev = server->s_dev; 1409 __entry->valid = fattr->valid; 1410 __entry->fhandle = nfs_fhandle_hash(fhandle); 1411 __entry->fileid = (fattr->valid & NFS_ATTR_FATTR_FILEID) ? fattr->fileid : 0; 1412 __entry->error = error < 0 ? -error : 0; 1413 ), 1414 1415 TP_printk( 1416 "error=%ld (%s) fileid=%02x:%02x:%llu fhandle=0x%08x " 1417 "valid=%s", 1418 -__entry->error, 1419 show_nfsv4_errors(__entry->error), 1420 MAJOR(__entry->dev), MINOR(__entry->dev), 1421 (unsigned long long)__entry->fileid, 1422 __entry->fhandle, 1423 show_nfs_fattr_flags(__entry->valid) 1424 ) 1425 ); 1426 1427 #define DEFINE_NFS4_GETATTR_EVENT(name) \ 1428 DEFINE_EVENT(nfs4_getattr_event, name, \ 1429 TP_PROTO( \ 1430 const struct nfs_server *server, \ 1431 const struct nfs_fh *fhandle, \ 1432 const struct nfs_fattr *fattr, \ 1433 int error \ 1434 ), \ 1435 TP_ARGS(server, fhandle, fattr, error)) 1436 DEFINE_NFS4_GETATTR_EVENT(nfs4_getattr); 1437 DEFINE_NFS4_GETATTR_EVENT(nfs4_lookup_root); 1438 DEFINE_NFS4_GETATTR_EVENT(nfs4_fsinfo); 1439 1440 DECLARE_EVENT_CLASS(nfs4_inode_callback_event, 1441 TP_PROTO( 1442 const struct nfs_client *clp, 1443 const struct nfs_fh *fhandle, 1444 const struct inode *inode, 1445 int error 1446 ), 1447 1448 TP_ARGS(clp, fhandle, inode, error), 1449 1450 TP_STRUCT__entry( 1451 __field(unsigned long, error) 1452 __field(dev_t, dev) 1453 __field(u32, fhandle) 1454 __field(u64, fileid) 1455 __string(dstaddr, clp ? clp->cl_hostname : "unknown") 1456 ), 1457 1458 TP_fast_assign( 1459 __entry->error = error < 0 ? -error : 0; 1460 __entry->fhandle = nfs_fhandle_hash(fhandle); 1461 if (!IS_ERR_OR_NULL(inode)) { 1462 __entry->fileid = NFS_FILEID(inode); 1463 __entry->dev = inode->i_sb->s_dev; 1464 } else { 1465 __entry->fileid = 0; 1466 __entry->dev = 0; 1467 } 1468 __assign_str(dstaddr, clp ? clp->cl_hostname : "unknown") 1469 ), 1470 1471 TP_printk( 1472 "error=%ld (%s) fileid=%02x:%02x:%llu fhandle=0x%08x " 1473 "dstaddr=%s", 1474 -__entry->error, 1475 show_nfsv4_errors(__entry->error), 1476 MAJOR(__entry->dev), MINOR(__entry->dev), 1477 (unsigned long long)__entry->fileid, 1478 __entry->fhandle, 1479 __get_str(dstaddr) 1480 ) 1481 ); 1482 1483 #define DEFINE_NFS4_INODE_CALLBACK_EVENT(name) \ 1484 DEFINE_EVENT(nfs4_inode_callback_event, name, \ 1485 TP_PROTO( \ 1486 const struct nfs_client *clp, \ 1487 const struct nfs_fh *fhandle, \ 1488 const struct inode *inode, \ 1489 int error \ 1490 ), \ 1491 TP_ARGS(clp, fhandle, inode, error)) 1492 DEFINE_NFS4_INODE_CALLBACK_EVENT(nfs4_cb_getattr); 1493 1494 DECLARE_EVENT_CLASS(nfs4_inode_stateid_callback_event, 1495 TP_PROTO( 1496 const struct nfs_client *clp, 1497 const struct nfs_fh *fhandle, 1498 const struct inode *inode, 1499 const nfs4_stateid *stateid, 1500 int error 1501 ), 1502 1503 TP_ARGS(clp, fhandle, inode, stateid, error), 1504 1505 TP_STRUCT__entry( 1506 __field(unsigned long, error) 1507 __field(dev_t, dev) 1508 __field(u32, fhandle) 1509 __field(u64, fileid) 1510 __string(dstaddr, clp ? clp->cl_hostname : "unknown") 1511 __field(int, stateid_seq) 1512 __field(u32, stateid_hash) 1513 ), 1514 1515 TP_fast_assign( 1516 __entry->error = error < 0 ? -error : 0; 1517 __entry->fhandle = nfs_fhandle_hash(fhandle); 1518 if (!IS_ERR_OR_NULL(inode)) { 1519 __entry->fileid = NFS_FILEID(inode); 1520 __entry->dev = inode->i_sb->s_dev; 1521 } else { 1522 __entry->fileid = 0; 1523 __entry->dev = 0; 1524 } 1525 __assign_str(dstaddr, clp ? clp->cl_hostname : "unknown") 1526 __entry->stateid_seq = 1527 be32_to_cpu(stateid->seqid); 1528 __entry->stateid_hash = 1529 nfs_stateid_hash(stateid); 1530 ), 1531 1532 TP_printk( 1533 "error=%ld (%s) fileid=%02x:%02x:%llu fhandle=0x%08x " 1534 "stateid=%d:0x%08x dstaddr=%s", 1535 -__entry->error, 1536 show_nfsv4_errors(__entry->error), 1537 MAJOR(__entry->dev), MINOR(__entry->dev), 1538 (unsigned long long)__entry->fileid, 1539 __entry->fhandle, 1540 __entry->stateid_seq, __entry->stateid_hash, 1541 __get_str(dstaddr) 1542 ) 1543 ); 1544 1545 #define DEFINE_NFS4_INODE_STATEID_CALLBACK_EVENT(name) \ 1546 DEFINE_EVENT(nfs4_inode_stateid_callback_event, name, \ 1547 TP_PROTO( \ 1548 const struct nfs_client *clp, \ 1549 const struct nfs_fh *fhandle, \ 1550 const struct inode *inode, \ 1551 const nfs4_stateid *stateid, \ 1552 int error \ 1553 ), \ 1554 TP_ARGS(clp, fhandle, inode, stateid, error)) 1555 DEFINE_NFS4_INODE_STATEID_CALLBACK_EVENT(nfs4_cb_recall); 1556 DEFINE_NFS4_INODE_STATEID_CALLBACK_EVENT(nfs4_cb_layoutrecall_file); 1557 1558 DECLARE_EVENT_CLASS(nfs4_idmap_event, 1559 TP_PROTO( 1560 const char *name, 1561 int len, 1562 u32 id, 1563 int error 1564 ), 1565 1566 TP_ARGS(name, len, id, error), 1567 1568 TP_STRUCT__entry( 1569 __field(unsigned long, error) 1570 __field(u32, id) 1571 __dynamic_array(char, name, len > 0 ? len + 1 : 1) 1572 ), 1573 1574 TP_fast_assign( 1575 if (len < 0) 1576 len = 0; 1577 __entry->error = error < 0 ? error : 0; 1578 __entry->id = id; 1579 memcpy(__get_str(name), name, len); 1580 __get_str(name)[len] = 0; 1581 ), 1582 1583 TP_printk( 1584 "error=%ld (%s) id=%u name=%s", 1585 -__entry->error, show_nfsv4_errors(__entry->error), 1586 __entry->id, 1587 __get_str(name) 1588 ) 1589 ); 1590 #define DEFINE_NFS4_IDMAP_EVENT(name) \ 1591 DEFINE_EVENT(nfs4_idmap_event, name, \ 1592 TP_PROTO( \ 1593 const char *name, \ 1594 int len, \ 1595 u32 id, \ 1596 int error \ 1597 ), \ 1598 TP_ARGS(name, len, id, error)) 1599 DEFINE_NFS4_IDMAP_EVENT(nfs4_map_name_to_uid); 1600 DEFINE_NFS4_IDMAP_EVENT(nfs4_map_group_to_gid); 1601 DEFINE_NFS4_IDMAP_EVENT(nfs4_map_uid_to_name); 1602 DEFINE_NFS4_IDMAP_EVENT(nfs4_map_gid_to_group); 1603 1604 DECLARE_EVENT_CLASS(nfs4_read_event, 1605 TP_PROTO( 1606 const struct nfs_pgio_header *hdr, 1607 int error 1608 ), 1609 1610 TP_ARGS(hdr, error), 1611 1612 TP_STRUCT__entry( 1613 __field(dev_t, dev) 1614 __field(u32, fhandle) 1615 __field(u64, fileid) 1616 __field(loff_t, offset) 1617 __field(size_t, count) 1618 __field(unsigned long, error) 1619 __field(int, stateid_seq) 1620 __field(u32, stateid_hash) 1621 ), 1622 1623 TP_fast_assign( 1624 const struct inode *inode = hdr->inode; 1625 const struct nfs4_state *state = 1626 hdr->args.context->state; 1627 __entry->dev = inode->i_sb->s_dev; 1628 __entry->fileid = NFS_FILEID(inode); 1629 __entry->fhandle = nfs_fhandle_hash(NFS_FH(inode)); 1630 __entry->offset = hdr->args.offset; 1631 __entry->count = hdr->args.count; 1632 __entry->error = error < 0 ? -error : 0; 1633 __entry->stateid_seq = 1634 be32_to_cpu(state->stateid.seqid); 1635 __entry->stateid_hash = 1636 nfs_stateid_hash(&state->stateid); 1637 ), 1638 1639 TP_printk( 1640 "error=%ld (%s) fileid=%02x:%02x:%llu fhandle=0x%08x " 1641 "offset=%lld count=%zu stateid=%d:0x%08x", 1642 -__entry->error, 1643 show_nfsv4_errors(__entry->error), 1644 MAJOR(__entry->dev), MINOR(__entry->dev), 1645 (unsigned long long)__entry->fileid, 1646 __entry->fhandle, 1647 (long long)__entry->offset, 1648 __entry->count, 1649 __entry->stateid_seq, __entry->stateid_hash 1650 ) 1651 ); 1652 #define DEFINE_NFS4_READ_EVENT(name) \ 1653 DEFINE_EVENT(nfs4_read_event, name, \ 1654 TP_PROTO( \ 1655 const struct nfs_pgio_header *hdr, \ 1656 int error \ 1657 ), \ 1658 TP_ARGS(hdr, error)) 1659 DEFINE_NFS4_READ_EVENT(nfs4_read); 1660 #ifdef CONFIG_NFS_V4_1 1661 DEFINE_NFS4_READ_EVENT(nfs4_pnfs_read); 1662 #endif /* CONFIG_NFS_V4_1 */ 1663 1664 DECLARE_EVENT_CLASS(nfs4_write_event, 1665 TP_PROTO( 1666 const struct nfs_pgio_header *hdr, 1667 int error 1668 ), 1669 1670 TP_ARGS(hdr, error), 1671 1672 TP_STRUCT__entry( 1673 __field(dev_t, dev) 1674 __field(u32, fhandle) 1675 __field(u64, fileid) 1676 __field(loff_t, offset) 1677 __field(size_t, count) 1678 __field(unsigned long, error) 1679 __field(int, stateid_seq) 1680 __field(u32, stateid_hash) 1681 ), 1682 1683 TP_fast_assign( 1684 const struct inode *inode = hdr->inode; 1685 const struct nfs4_state *state = 1686 hdr->args.context->state; 1687 __entry->dev = inode->i_sb->s_dev; 1688 __entry->fileid = NFS_FILEID(inode); 1689 __entry->fhandle = nfs_fhandle_hash(NFS_FH(inode)); 1690 __entry->offset = hdr->args.offset; 1691 __entry->count = hdr->args.count; 1692 __entry->error = error < 0 ? -error : 0; 1693 __entry->stateid_seq = 1694 be32_to_cpu(state->stateid.seqid); 1695 __entry->stateid_hash = 1696 nfs_stateid_hash(&state->stateid); 1697 ), 1698 1699 TP_printk( 1700 "error=%ld (%s) fileid=%02x:%02x:%llu fhandle=0x%08x " 1701 "offset=%lld count=%zu stateid=%d:0x%08x", 1702 -__entry->error, 1703 show_nfsv4_errors(__entry->error), 1704 MAJOR(__entry->dev), MINOR(__entry->dev), 1705 (unsigned long long)__entry->fileid, 1706 __entry->fhandle, 1707 (long long)__entry->offset, 1708 __entry->count, 1709 __entry->stateid_seq, __entry->stateid_hash 1710 ) 1711 ); 1712 1713 #define DEFINE_NFS4_WRITE_EVENT(name) \ 1714 DEFINE_EVENT(nfs4_write_event, name, \ 1715 TP_PROTO( \ 1716 const struct nfs_pgio_header *hdr, \ 1717 int error \ 1718 ), \ 1719 TP_ARGS(hdr, error)) 1720 DEFINE_NFS4_WRITE_EVENT(nfs4_write); 1721 #ifdef CONFIG_NFS_V4_1 1722 DEFINE_NFS4_WRITE_EVENT(nfs4_pnfs_write); 1723 #endif /* CONFIG_NFS_V4_1 */ 1724 1725 DECLARE_EVENT_CLASS(nfs4_commit_event, 1726 TP_PROTO( 1727 const struct nfs_commit_data *data, 1728 int error 1729 ), 1730 1731 TP_ARGS(data, error), 1732 1733 TP_STRUCT__entry( 1734 __field(dev_t, dev) 1735 __field(u32, fhandle) 1736 __field(u64, fileid) 1737 __field(loff_t, offset) 1738 __field(size_t, count) 1739 __field(unsigned long, error) 1740 ), 1741 1742 TP_fast_assign( 1743 const struct inode *inode = data->inode; 1744 __entry->dev = inode->i_sb->s_dev; 1745 __entry->fileid = NFS_FILEID(inode); 1746 __entry->fhandle = nfs_fhandle_hash(NFS_FH(inode)); 1747 __entry->offset = data->args.offset; 1748 __entry->count = data->args.count; 1749 __entry->error = error; 1750 ), 1751 1752 TP_printk( 1753 "error=%ld (%s) fileid=%02x:%02x:%llu fhandle=0x%08x " 1754 "offset=%lld count=%zu", 1755 -__entry->error, 1756 show_nfsv4_errors(__entry->error), 1757 MAJOR(__entry->dev), MINOR(__entry->dev), 1758 (unsigned long long)__entry->fileid, 1759 __entry->fhandle, 1760 (long long)__entry->offset, 1761 __entry->count 1762 ) 1763 ); 1764 #define DEFINE_NFS4_COMMIT_EVENT(name) \ 1765 DEFINE_EVENT(nfs4_commit_event, name, \ 1766 TP_PROTO( \ 1767 const struct nfs_commit_data *data, \ 1768 int error \ 1769 ), \ 1770 TP_ARGS(data, error)) 1771 DEFINE_NFS4_COMMIT_EVENT(nfs4_commit); 1772 #ifdef CONFIG_NFS_V4_1 1773 DEFINE_NFS4_COMMIT_EVENT(nfs4_pnfs_commit_ds); 1774 1775 TRACE_DEFINE_ENUM(IOMODE_READ); 1776 TRACE_DEFINE_ENUM(IOMODE_RW); 1777 TRACE_DEFINE_ENUM(IOMODE_ANY); 1778 1779 #define show_pnfs_iomode(iomode) \ 1780 __print_symbolic(iomode, \ 1781 { IOMODE_READ, "READ" }, \ 1782 { IOMODE_RW, "RW" }, \ 1783 { IOMODE_ANY, "ANY" }) 1784 1785 TRACE_EVENT(nfs4_layoutget, 1786 TP_PROTO( 1787 const struct nfs_open_context *ctx, 1788 const struct pnfs_layout_range *args, 1789 const struct pnfs_layout_range *res, 1790 const nfs4_stateid *layout_stateid, 1791 int error 1792 ), 1793 1794 TP_ARGS(ctx, args, res, layout_stateid, error), 1795 1796 TP_STRUCT__entry( 1797 __field(dev_t, dev) 1798 __field(u32, fhandle) 1799 __field(u64, fileid) 1800 __field(u32, iomode) 1801 __field(u64, offset) 1802 __field(u64, count) 1803 __field(unsigned long, error) 1804 __field(int, stateid_seq) 1805 __field(u32, stateid_hash) 1806 __field(int, layoutstateid_seq) 1807 __field(u32, layoutstateid_hash) 1808 ), 1809 1810 TP_fast_assign( 1811 const struct inode *inode = d_inode(ctx->dentry); 1812 const struct nfs4_state *state = ctx->state; 1813 __entry->dev = inode->i_sb->s_dev; 1814 __entry->fileid = NFS_FILEID(inode); 1815 __entry->fhandle = nfs_fhandle_hash(NFS_FH(inode)); 1816 __entry->iomode = args->iomode; 1817 __entry->offset = args->offset; 1818 __entry->count = args->length; 1819 __entry->error = error < 0 ? -error : 0; 1820 __entry->stateid_seq = 1821 be32_to_cpu(state->stateid.seqid); 1822 __entry->stateid_hash = 1823 nfs_stateid_hash(&state->stateid); 1824 if (!error) { 1825 __entry->layoutstateid_seq = 1826 be32_to_cpu(layout_stateid->seqid); 1827 __entry->layoutstateid_hash = 1828 nfs_stateid_hash(layout_stateid); 1829 } else { 1830 __entry->layoutstateid_seq = 0; 1831 __entry->layoutstateid_hash = 0; 1832 } 1833 ), 1834 1835 TP_printk( 1836 "error=%ld (%s) fileid=%02x:%02x:%llu fhandle=0x%08x " 1837 "iomode=%s offset=%llu count=%llu stateid=%d:0x%08x " 1838 "layoutstateid=%d:0x%08x", 1839 -__entry->error, 1840 show_nfsv4_errors(__entry->error), 1841 MAJOR(__entry->dev), MINOR(__entry->dev), 1842 (unsigned long long)__entry->fileid, 1843 __entry->fhandle, 1844 show_pnfs_iomode(__entry->iomode), 1845 (unsigned long long)__entry->offset, 1846 (unsigned long long)__entry->count, 1847 __entry->stateid_seq, __entry->stateid_hash, 1848 __entry->layoutstateid_seq, __entry->layoutstateid_hash 1849 ) 1850 ); 1851 1852 DEFINE_NFS4_INODE_STATEID_EVENT(nfs4_layoutcommit); 1853 DEFINE_NFS4_INODE_STATEID_EVENT(nfs4_layoutreturn); 1854 DEFINE_NFS4_INODE_EVENT(nfs4_layoutreturn_on_close); 1855 1856 TRACE_DEFINE_ENUM(PNFS_UPDATE_LAYOUT_UNKNOWN); 1857 TRACE_DEFINE_ENUM(PNFS_UPDATE_LAYOUT_NO_PNFS); 1858 TRACE_DEFINE_ENUM(PNFS_UPDATE_LAYOUT_RD_ZEROLEN); 1859 TRACE_DEFINE_ENUM(PNFS_UPDATE_LAYOUT_MDSTHRESH); 1860 TRACE_DEFINE_ENUM(PNFS_UPDATE_LAYOUT_NOMEM); 1861 TRACE_DEFINE_ENUM(PNFS_UPDATE_LAYOUT_BULK_RECALL); 1862 TRACE_DEFINE_ENUM(PNFS_UPDATE_LAYOUT_IO_TEST_FAIL); 1863 TRACE_DEFINE_ENUM(PNFS_UPDATE_LAYOUT_FOUND_CACHED); 1864 TRACE_DEFINE_ENUM(PNFS_UPDATE_LAYOUT_RETURN); 1865 TRACE_DEFINE_ENUM(PNFS_UPDATE_LAYOUT_BLOCKED); 1866 TRACE_DEFINE_ENUM(PNFS_UPDATE_LAYOUT_INVALID_OPEN); 1867 TRACE_DEFINE_ENUM(PNFS_UPDATE_LAYOUT_RETRY); 1868 TRACE_DEFINE_ENUM(PNFS_UPDATE_LAYOUT_SEND_LAYOUTGET); 1869 TRACE_DEFINE_ENUM(PNFS_UPDATE_LAYOUT_EXIT); 1870 1871 #define show_pnfs_update_layout_reason(reason) \ 1872 __print_symbolic(reason, \ 1873 { PNFS_UPDATE_LAYOUT_UNKNOWN, "unknown" }, \ 1874 { PNFS_UPDATE_LAYOUT_NO_PNFS, "no pnfs" }, \ 1875 { PNFS_UPDATE_LAYOUT_RD_ZEROLEN, "read+zerolen" }, \ 1876 { PNFS_UPDATE_LAYOUT_MDSTHRESH, "mdsthresh" }, \ 1877 { PNFS_UPDATE_LAYOUT_NOMEM, "nomem" }, \ 1878 { PNFS_UPDATE_LAYOUT_BULK_RECALL, "bulk recall" }, \ 1879 { PNFS_UPDATE_LAYOUT_IO_TEST_FAIL, "io test fail" }, \ 1880 { PNFS_UPDATE_LAYOUT_FOUND_CACHED, "found cached" }, \ 1881 { PNFS_UPDATE_LAYOUT_RETURN, "layoutreturn" }, \ 1882 { PNFS_UPDATE_LAYOUT_BLOCKED, "layouts blocked" }, \ 1883 { PNFS_UPDATE_LAYOUT_INVALID_OPEN, "invalid open" }, \ 1884 { PNFS_UPDATE_LAYOUT_RETRY, "retrying" }, \ 1885 { PNFS_UPDATE_LAYOUT_SEND_LAYOUTGET, "sent layoutget" }, \ 1886 { PNFS_UPDATE_LAYOUT_EXIT, "exit" }) 1887 1888 TRACE_EVENT(pnfs_update_layout, 1889 TP_PROTO(struct inode *inode, 1890 loff_t pos, 1891 u64 count, 1892 enum pnfs_iomode iomode, 1893 struct pnfs_layout_hdr *lo, 1894 struct pnfs_layout_segment *lseg, 1895 enum pnfs_update_layout_reason reason 1896 ), 1897 TP_ARGS(inode, pos, count, iomode, lo, lseg, reason), 1898 TP_STRUCT__entry( 1899 __field(dev_t, dev) 1900 __field(u64, fileid) 1901 __field(u32, fhandle) 1902 __field(loff_t, pos) 1903 __field(u64, count) 1904 __field(enum pnfs_iomode, iomode) 1905 __field(int, layoutstateid_seq) 1906 __field(u32, layoutstateid_hash) 1907 __field(long, lseg) 1908 __field(enum pnfs_update_layout_reason, reason) 1909 ), 1910 TP_fast_assign( 1911 __entry->dev = inode->i_sb->s_dev; 1912 __entry->fileid = NFS_FILEID(inode); 1913 __entry->fhandle = nfs_fhandle_hash(NFS_FH(inode)); 1914 __entry->pos = pos; 1915 __entry->count = count; 1916 __entry->iomode = iomode; 1917 __entry->reason = reason; 1918 if (lo != NULL) { 1919 __entry->layoutstateid_seq = 1920 be32_to_cpu(lo->plh_stateid.seqid); 1921 __entry->layoutstateid_hash = 1922 nfs_stateid_hash(&lo->plh_stateid); 1923 } else { 1924 __entry->layoutstateid_seq = 0; 1925 __entry->layoutstateid_hash = 0; 1926 } 1927 __entry->lseg = (long)lseg; 1928 ), 1929 TP_printk( 1930 "fileid=%02x:%02x:%llu fhandle=0x%08x " 1931 "iomode=%s pos=%llu count=%llu " 1932 "layoutstateid=%d:0x%08x lseg=0x%lx (%s)", 1933 MAJOR(__entry->dev), MINOR(__entry->dev), 1934 (unsigned long long)__entry->fileid, 1935 __entry->fhandle, 1936 show_pnfs_iomode(__entry->iomode), 1937 (unsigned long long)__entry->pos, 1938 (unsigned long long)__entry->count, 1939 __entry->layoutstateid_seq, __entry->layoutstateid_hash, 1940 __entry->lseg, 1941 show_pnfs_update_layout_reason(__entry->reason) 1942 ) 1943 ); 1944 1945 DECLARE_EVENT_CLASS(pnfs_layout_event, 1946 TP_PROTO(struct inode *inode, 1947 loff_t pos, 1948 u64 count, 1949 enum pnfs_iomode iomode, 1950 struct pnfs_layout_hdr *lo, 1951 struct pnfs_layout_segment *lseg 1952 ), 1953 TP_ARGS(inode, pos, count, iomode, lo, lseg), 1954 TP_STRUCT__entry( 1955 __field(dev_t, dev) 1956 __field(u64, fileid) 1957 __field(u32, fhandle) 1958 __field(loff_t, pos) 1959 __field(u64, count) 1960 __field(enum pnfs_iomode, iomode) 1961 __field(int, layoutstateid_seq) 1962 __field(u32, layoutstateid_hash) 1963 __field(long, lseg) 1964 ), 1965 TP_fast_assign( 1966 __entry->dev = inode->i_sb->s_dev; 1967 __entry->fileid = NFS_FILEID(inode); 1968 __entry->fhandle = nfs_fhandle_hash(NFS_FH(inode)); 1969 __entry->pos = pos; 1970 __entry->count = count; 1971 __entry->iomode = iomode; 1972 if (lo != NULL) { 1973 __entry->layoutstateid_seq = 1974 be32_to_cpu(lo->plh_stateid.seqid); 1975 __entry->layoutstateid_hash = 1976 nfs_stateid_hash(&lo->plh_stateid); 1977 } else { 1978 __entry->layoutstateid_seq = 0; 1979 __entry->layoutstateid_hash = 0; 1980 } 1981 __entry->lseg = (long)lseg; 1982 ), 1983 TP_printk( 1984 "fileid=%02x:%02x:%llu fhandle=0x%08x " 1985 "iomode=%s pos=%llu count=%llu " 1986 "layoutstateid=%d:0x%08x lseg=0x%lx", 1987 MAJOR(__entry->dev), MINOR(__entry->dev), 1988 (unsigned long long)__entry->fileid, 1989 __entry->fhandle, 1990 show_pnfs_iomode(__entry->iomode), 1991 (unsigned long long)__entry->pos, 1992 (unsigned long long)__entry->count, 1993 __entry->layoutstateid_seq, __entry->layoutstateid_hash, 1994 __entry->lseg 1995 ) 1996 ); 1997 1998 #define DEFINE_PNFS_LAYOUT_EVENT(name) \ 1999 DEFINE_EVENT(pnfs_layout_event, name, \ 2000 TP_PROTO(struct inode *inode, \ 2001 loff_t pos, \ 2002 u64 count, \ 2003 enum pnfs_iomode iomode, \ 2004 struct pnfs_layout_hdr *lo, \ 2005 struct pnfs_layout_segment *lseg \ 2006 ), \ 2007 TP_ARGS(inode, pos, count, iomode, lo, lseg)) 2008 2009 DEFINE_PNFS_LAYOUT_EVENT(pnfs_mds_fallback_pg_init_read); 2010 DEFINE_PNFS_LAYOUT_EVENT(pnfs_mds_fallback_pg_init_write); 2011 DEFINE_PNFS_LAYOUT_EVENT(pnfs_mds_fallback_pg_get_mirror_count); 2012 DEFINE_PNFS_LAYOUT_EVENT(pnfs_mds_fallback_read_done); 2013 DEFINE_PNFS_LAYOUT_EVENT(pnfs_mds_fallback_write_done); 2014 DEFINE_PNFS_LAYOUT_EVENT(pnfs_mds_fallback_read_pagelist); 2015 DEFINE_PNFS_LAYOUT_EVENT(pnfs_mds_fallback_write_pagelist); 2016 2017 #endif /* CONFIG_NFS_V4_1 */ 2018 2019 #endif /* _TRACE_NFS4_H */ 2020 2021 #undef TRACE_INCLUDE_PATH 2022 #define TRACE_INCLUDE_PATH . 2023 #define TRACE_INCLUDE_FILE nfs4trace 2024 /* This part must be outside protection */ 2025 #include <trace/define_trace.h> 2026