Greg Kroah-Hartman | b244131 | 2017-11-01 15:07:57 +0100 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
Trond Myklebust | c6d01c6 | 2013-08-09 11:51:26 -0400 | [diff] [blame] | 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 | |
Chuck Lever | 5b2095d | 2018-12-19 11:00:11 -0500 | [diff] [blame] | 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 | |
Trond Myklebust | c6d01c6 | 2013-08-09 11:51:26 -0400 | [diff] [blame] | 158 | #define show_nfsv4_errors(error) \ |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 159 | __print_symbolic(error, \ |
Trond Myklebust | c6d01c6 | 2013-08-09 11:51:26 -0400 | [diff] [blame] | 160 | { NFS4_OK, "OK" }, \ |
| 161 | /* Mapped by nfs4_stat_to_errno() */ \ |
Chuck Lever | 5b2095d | 2018-12-19 11:00:11 -0500 | [diff] [blame] | 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" }, \ |
Trond Myklebust | c6d01c6 | 2013-08-09 11:51:26 -0400 | [diff] [blame] | 189 | /* RPC errors */ \ |
Chuck Lever | 5b2095d | 2018-12-19 11:00:11 -0500 | [diff] [blame] | 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" }, \ |
Trond Myklebust | c6d01c6 | 2013-08-09 11:51:26 -0400 | [diff] [blame] | 202 | /* NFSv4 native errors */ \ |
Chuck Lever | 5b2095d | 2018-12-19 11:00:11 -0500 | [diff] [blame] | 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, \ |
Trond Myklebust | c6d01c6 | 2013-08-09 11:51:26 -0400 | [diff] [blame] | 229 | "CONN_NOT_BOUND_TO_SESSION" }, \ |
Chuck Lever | 5b2095d | 2018-12-19 11:00:11 -0500 | [diff] [blame] | 230 | { NFS4ERR_DEADLOCK, "DEADLOCK" }, \ |
| 231 | { NFS4ERR_DEADSESSION, "DEAD_SESSION" }, \ |
| 232 | { NFS4ERR_DELAY, "DELAY" }, \ |
| 233 | { NFS4ERR_DELEG_ALREADY_WANTED, \ |
Trond Myklebust | c6d01c6 | 2013-08-09 11:51:26 -0400 | [diff] [blame] | 234 | "DELEG_ALREADY_WANTED" }, \ |
Chuck Lever | 5b2095d | 2018-12-19 11:00:11 -0500 | [diff] [blame] | 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, \ |
Trond Myklebust | c6d01c6 | 2013-08-09 11:51:26 -0400 | [diff] [blame] | 284 | "REP_TOO_BIG_TO_CACHE" }, \ |
Chuck Lever | 5b2095d | 2018-12-19 11:00:11 -0500 | [diff] [blame] | 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" }) |
Trond Myklebust | c6d01c6 | 2013-08-09 11:51:26 -0400 | [diff] [blame] | 309 | |
Trond Myklebust | 42113a7 | 2013-08-12 16:19:27 -0400 | [diff] [blame] | 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 | |
Trond Myklebust | b5f875a | 2013-08-13 13:01:39 -0400 | [diff] [blame] | 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 | |
Trond Myklebust | c6d01c6 | 2013-08-09 11:51:26 -0400 | [diff] [blame] | 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( |
Anna Schumaker | 3944369 | 2017-11-01 15:48:43 -0400 | [diff] [blame] | 350 | __string(dstaddr, clp->cl_hostname) |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 351 | __field(unsigned long, error) |
Trond Myklebust | c6d01c6 | 2013-08-09 11:51:26 -0400 | [diff] [blame] | 352 | ), |
| 353 | |
| 354 | TP_fast_assign( |
| 355 | __entry->error = error; |
Anna Schumaker | 3944369 | 2017-11-01 15:48:43 -0400 | [diff] [blame] | 356 | __assign_str(dstaddr, clp->cl_hostname); |
Trond Myklebust | c6d01c6 | 2013-08-09 11:51:26 -0400 | [diff] [blame] | 357 | ), |
| 358 | |
| 359 | TP_printk( |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 360 | "error=%ld (%s) dstaddr=%s", |
| 361 | -__entry->error, |
Trond Myklebust | c6d01c6 | 2013-08-09 11:51:26 -0400 | [diff] [blame] | 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); |
Trond Myklebust | 2f92ae3 | 2013-08-14 17:58:28 -0400 | [diff] [blame] | 385 | |
Trond Myklebust | 2f92ae3 | 2013-08-14 17:58:28 -0400 | [diff] [blame] | 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) |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 423 | __field(unsigned long, error) |
Trond Myklebust | 2f92ae3 | 2013-08-14 17:58:28 -0400 | [diff] [blame] | 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; |
Andrew Elble | 52618df | 2015-12-02 09:19:43 -0500 | [diff] [blame] | 434 | __entry->status_flags = res->sr_status_flags; |
Trond Myklebust | 2f92ae3 | 2013-08-14 17:58:28 -0400 | [diff] [blame] | 435 | __entry->error = res->sr_status; |
| 436 | ), |
| 437 | TP_printk( |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 438 | "error=%ld (%s) session=0x%08x slot_nr=%u seq_nr=%u " |
Trond Myklebust | 2f92ae3 | 2013-08-14 17:58:28 -0400 | [diff] [blame] | 439 | "highest_slotid=%u target_highest_slotid=%u " |
| 440 | "status_flags=%u (%s)", |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 441 | -__entry->error, |
Trond Myklebust | 2f92ae3 | 2013-08-14 17:58:28 -0400 | [diff] [blame] | 442 | show_nfsv4_errors(__entry->error), |
| 443 | __entry->session, |
| 444 | __entry->slot_nr, |
| 445 | __entry->seq_nr, |
| 446 | __entry->highest_slotid, |
| 447 | __entry->target_highest_slotid, |
| 448 | __entry->status_flags, |
| 449 | show_nfs4_sequence_status_flags(__entry->status_flags) |
| 450 | ) |
| 451 | ); |
| 452 | |
| 453 | struct cb_sequenceargs; |
| 454 | struct cb_sequenceres; |
| 455 | |
| 456 | TRACE_EVENT(nfs4_cb_sequence, |
| 457 | TP_PROTO( |
| 458 | const struct cb_sequenceargs *args, |
| 459 | const struct cb_sequenceres *res, |
| 460 | __be32 status |
| 461 | ), |
| 462 | TP_ARGS(args, res, status), |
| 463 | |
| 464 | TP_STRUCT__entry( |
| 465 | __field(unsigned int, session) |
| 466 | __field(unsigned int, slot_nr) |
| 467 | __field(unsigned int, seq_nr) |
| 468 | __field(unsigned int, highest_slotid) |
| 469 | __field(unsigned int, cachethis) |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 470 | __field(unsigned long, error) |
Trond Myklebust | 2f92ae3 | 2013-08-14 17:58:28 -0400 | [diff] [blame] | 471 | ), |
| 472 | |
| 473 | TP_fast_assign( |
| 474 | __entry->session = nfs_session_id_hash(&args->csa_sessionid); |
| 475 | __entry->slot_nr = args->csa_slotid; |
| 476 | __entry->seq_nr = args->csa_sequenceid; |
| 477 | __entry->highest_slotid = args->csa_highestslotid; |
| 478 | __entry->cachethis = args->csa_cachethis; |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 479 | __entry->error = be32_to_cpu(status); |
Trond Myklebust | 2f92ae3 | 2013-08-14 17:58:28 -0400 | [diff] [blame] | 480 | ), |
| 481 | |
| 482 | TP_printk( |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 483 | "error=%ld (%s) session=0x%08x slot_nr=%u seq_nr=%u " |
Trond Myklebust | 2f92ae3 | 2013-08-14 17:58:28 -0400 | [diff] [blame] | 484 | "highest_slotid=%u", |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 485 | -__entry->error, |
Trond Myklebust | 2f92ae3 | 2013-08-14 17:58:28 -0400 | [diff] [blame] | 486 | show_nfsv4_errors(__entry->error), |
| 487 | __entry->session, |
| 488 | __entry->slot_nr, |
| 489 | __entry->seq_nr, |
| 490 | __entry->highest_slotid |
| 491 | ) |
| 492 | ); |
Chuck Lever | c5833f0 | 2019-06-19 10:33:47 -0400 | [diff] [blame] | 493 | |
| 494 | TRACE_EVENT(nfs4_cb_seqid_err, |
| 495 | TP_PROTO( |
| 496 | const struct cb_sequenceargs *args, |
| 497 | __be32 status |
| 498 | ), |
| 499 | TP_ARGS(args, status), |
| 500 | |
| 501 | TP_STRUCT__entry( |
| 502 | __field(unsigned int, session) |
| 503 | __field(unsigned int, slot_nr) |
| 504 | __field(unsigned int, seq_nr) |
| 505 | __field(unsigned int, highest_slotid) |
| 506 | __field(unsigned int, cachethis) |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 507 | __field(unsigned long, error) |
Chuck Lever | c5833f0 | 2019-06-19 10:33:47 -0400 | [diff] [blame] | 508 | ), |
| 509 | |
| 510 | TP_fast_assign( |
| 511 | __entry->session = nfs_session_id_hash(&args->csa_sessionid); |
| 512 | __entry->slot_nr = args->csa_slotid; |
| 513 | __entry->seq_nr = args->csa_sequenceid; |
| 514 | __entry->highest_slotid = args->csa_highestslotid; |
| 515 | __entry->cachethis = args->csa_cachethis; |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 516 | __entry->error = be32_to_cpu(status); |
Chuck Lever | c5833f0 | 2019-06-19 10:33:47 -0400 | [diff] [blame] | 517 | ), |
| 518 | |
| 519 | TP_printk( |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 520 | "error=%ld (%s) session=0x%08x slot_nr=%u seq_nr=%u " |
Chuck Lever | c5833f0 | 2019-06-19 10:33:47 -0400 | [diff] [blame] | 521 | "highest_slotid=%u", |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 522 | -__entry->error, |
Chuck Lever | c5833f0 | 2019-06-19 10:33:47 -0400 | [diff] [blame] | 523 | show_nfsv4_errors(__entry->error), |
| 524 | __entry->session, |
| 525 | __entry->slot_nr, |
| 526 | __entry->seq_nr, |
| 527 | __entry->highest_slotid |
| 528 | ) |
| 529 | ); |
| 530 | |
Trond Myklebust | c6d01c6 | 2013-08-09 11:51:26 -0400 | [diff] [blame] | 531 | #endif /* CONFIG_NFS_V4_1 */ |
| 532 | |
Anna Schumaker | ad05cc0 | 2017-01-11 13:37:06 -0500 | [diff] [blame] | 533 | TRACE_EVENT(nfs4_setup_sequence, |
| 534 | TP_PROTO( |
| 535 | const struct nfs4_session *session, |
| 536 | const struct nfs4_sequence_args *args |
| 537 | ), |
| 538 | TP_ARGS(session, args), |
| 539 | |
| 540 | TP_STRUCT__entry( |
| 541 | __field(unsigned int, session) |
| 542 | __field(unsigned int, slot_nr) |
| 543 | __field(unsigned int, seq_nr) |
| 544 | __field(unsigned int, highest_used_slotid) |
| 545 | ), |
| 546 | |
| 547 | TP_fast_assign( |
| 548 | const struct nfs4_slot *sa_slot = args->sa_slot; |
| 549 | __entry->session = session ? nfs_session_id_hash(&session->sess_id) : 0; |
| 550 | __entry->slot_nr = sa_slot->slot_nr; |
| 551 | __entry->seq_nr = sa_slot->seq_nr; |
| 552 | __entry->highest_used_slotid = |
| 553 | sa_slot->table->highest_used_slotid; |
| 554 | ), |
| 555 | TP_printk( |
| 556 | "session=0x%08x slot_nr=%u seq_nr=%u " |
| 557 | "highest_used_slotid=%u", |
| 558 | __entry->session, |
| 559 | __entry->slot_nr, |
| 560 | __entry->seq_nr, |
| 561 | __entry->highest_used_slotid |
| 562 | ) |
| 563 | ); |
| 564 | |
Chuck Lever | 511ba52 | 2019-11-05 11:04:07 -0500 | [diff] [blame] | 565 | TRACE_DEFINE_ENUM(NFS4CLNT_MANAGER_RUNNING); |
| 566 | TRACE_DEFINE_ENUM(NFS4CLNT_CHECK_LEASE); |
| 567 | TRACE_DEFINE_ENUM(NFS4CLNT_LEASE_EXPIRED); |
| 568 | TRACE_DEFINE_ENUM(NFS4CLNT_RECLAIM_REBOOT); |
| 569 | TRACE_DEFINE_ENUM(NFS4CLNT_RECLAIM_NOGRACE); |
| 570 | TRACE_DEFINE_ENUM(NFS4CLNT_DELEGRETURN); |
| 571 | TRACE_DEFINE_ENUM(NFS4CLNT_SESSION_RESET); |
| 572 | TRACE_DEFINE_ENUM(NFS4CLNT_LEASE_CONFIRM); |
| 573 | TRACE_DEFINE_ENUM(NFS4CLNT_SERVER_SCOPE_MISMATCH); |
| 574 | TRACE_DEFINE_ENUM(NFS4CLNT_PURGE_STATE); |
| 575 | TRACE_DEFINE_ENUM(NFS4CLNT_BIND_CONN_TO_SESSION); |
| 576 | TRACE_DEFINE_ENUM(NFS4CLNT_MOVED); |
| 577 | TRACE_DEFINE_ENUM(NFS4CLNT_LEASE_MOVED); |
| 578 | TRACE_DEFINE_ENUM(NFS4CLNT_DELEGATION_EXPIRED); |
| 579 | TRACE_DEFINE_ENUM(NFS4CLNT_RUN_MANAGER); |
| 580 | TRACE_DEFINE_ENUM(NFS4CLNT_DELEGRETURN_RUNNING); |
| 581 | |
| 582 | #define show_nfs4_clp_state(state) \ |
| 583 | __print_flags(state, "|", \ |
| 584 | { NFS4CLNT_MANAGER_RUNNING, "MANAGER_RUNNING" }, \ |
| 585 | { NFS4CLNT_CHECK_LEASE, "CHECK_LEASE" }, \ |
| 586 | { NFS4CLNT_LEASE_EXPIRED, "LEASE_EXPIRED" }, \ |
| 587 | { NFS4CLNT_RECLAIM_REBOOT, "RECLAIM_REBOOT" }, \ |
| 588 | { NFS4CLNT_RECLAIM_NOGRACE, "RECLAIM_NOGRACE" }, \ |
| 589 | { NFS4CLNT_DELEGRETURN, "DELEGRETURN" }, \ |
| 590 | { NFS4CLNT_SESSION_RESET, "SESSION_RESET" }, \ |
| 591 | { NFS4CLNT_LEASE_CONFIRM, "LEASE_CONFIRM" }, \ |
| 592 | { NFS4CLNT_SERVER_SCOPE_MISMATCH, \ |
| 593 | "SERVER_SCOPE_MISMATCH" }, \ |
| 594 | { NFS4CLNT_PURGE_STATE, "PURGE_STATE" }, \ |
| 595 | { NFS4CLNT_BIND_CONN_TO_SESSION, \ |
| 596 | "BIND_CONN_TO_SESSION" }, \ |
| 597 | { NFS4CLNT_MOVED, "MOVED" }, \ |
| 598 | { NFS4CLNT_LEASE_MOVED, "LEASE_MOVED" }, \ |
| 599 | { NFS4CLNT_DELEGATION_EXPIRED, "DELEGATION_EXPIRED" }, \ |
| 600 | { NFS4CLNT_RUN_MANAGER, "RUN_MANAGER" }, \ |
| 601 | { NFS4CLNT_DELEGRETURN_RUNNING, "DELEGRETURN_RUNNING" }) |
| 602 | |
| 603 | TRACE_EVENT(nfs4_state_mgr, |
| 604 | TP_PROTO( |
| 605 | const struct nfs_client *clp |
| 606 | ), |
| 607 | |
| 608 | TP_ARGS(clp), |
| 609 | |
| 610 | TP_STRUCT__entry( |
| 611 | __field(unsigned long, state) |
| 612 | __string(hostname, clp->cl_hostname) |
| 613 | ), |
| 614 | |
| 615 | TP_fast_assign( |
| 616 | __entry->state = clp->cl_state; |
| 617 | __assign_str(hostname, clp->cl_hostname) |
| 618 | ), |
| 619 | |
| 620 | TP_printk( |
| 621 | "hostname=%s clp state=%s", __get_str(hostname), |
| 622 | show_nfs4_clp_state(__entry->state) |
| 623 | ) |
| 624 | ) |
| 625 | |
| 626 | TRACE_EVENT(nfs4_state_mgr_failed, |
| 627 | TP_PROTO( |
| 628 | const struct nfs_client *clp, |
| 629 | const char *section, |
| 630 | int status |
| 631 | ), |
| 632 | |
| 633 | TP_ARGS(clp, section, status), |
| 634 | |
| 635 | TP_STRUCT__entry( |
| 636 | __field(unsigned long, error) |
| 637 | __field(unsigned long, state) |
| 638 | __string(hostname, clp->cl_hostname) |
| 639 | __string(section, section) |
| 640 | ), |
| 641 | |
| 642 | TP_fast_assign( |
| 643 | __entry->error = status; |
| 644 | __entry->state = clp->cl_state; |
| 645 | __assign_str(hostname, clp->cl_hostname); |
| 646 | __assign_str(section, section); |
| 647 | ), |
| 648 | |
| 649 | TP_printk( |
| 650 | "hostname=%s clp state=%s error=%ld (%s) section=%s", |
| 651 | __get_str(hostname), |
| 652 | show_nfs4_clp_state(__entry->state), -__entry->error, |
| 653 | show_nfsv4_errors(__entry->error), __get_str(section) |
| 654 | |
| 655 | ) |
| 656 | ) |
| 657 | |
Chuck Lever | f23f658 | 2019-02-11 11:24:26 -0500 | [diff] [blame] | 658 | TRACE_EVENT(nfs4_xdr_status, |
| 659 | TP_PROTO( |
Chuck Lever | 62a92ba | 2019-06-19 10:34:09 -0400 | [diff] [blame] | 660 | const struct xdr_stream *xdr, |
Chuck Lever | f23f658 | 2019-02-11 11:24:26 -0500 | [diff] [blame] | 661 | u32 op, |
| 662 | int error |
| 663 | ), |
| 664 | |
Chuck Lever | 62a92ba | 2019-06-19 10:34:09 -0400 | [diff] [blame] | 665 | TP_ARGS(xdr, op, error), |
Chuck Lever | f23f658 | 2019-02-11 11:24:26 -0500 | [diff] [blame] | 666 | |
| 667 | TP_STRUCT__entry( |
Chuck Lever | 62a92ba | 2019-06-19 10:34:09 -0400 | [diff] [blame] | 668 | __field(unsigned int, task_id) |
| 669 | __field(unsigned int, client_id) |
| 670 | __field(u32, xid) |
Chuck Lever | f23f658 | 2019-02-11 11:24:26 -0500 | [diff] [blame] | 671 | __field(u32, op) |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 672 | __field(unsigned long, error) |
Chuck Lever | f23f658 | 2019-02-11 11:24:26 -0500 | [diff] [blame] | 673 | ), |
| 674 | |
| 675 | TP_fast_assign( |
Chuck Lever | 62a92ba | 2019-06-19 10:34:09 -0400 | [diff] [blame] | 676 | const struct rpc_rqst *rqstp = xdr->rqst; |
| 677 | const struct rpc_task *task = rqstp->rq_task; |
| 678 | |
| 679 | __entry->task_id = task->tk_pid; |
| 680 | __entry->client_id = task->tk_client->cl_clid; |
| 681 | __entry->xid = be32_to_cpu(rqstp->rq_xid); |
Chuck Lever | f23f658 | 2019-02-11 11:24:26 -0500 | [diff] [blame] | 682 | __entry->op = op; |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 683 | __entry->error = error; |
Chuck Lever | f23f658 | 2019-02-11 11:24:26 -0500 | [diff] [blame] | 684 | ), |
| 685 | |
| 686 | TP_printk( |
Chuck Lever | 62a92ba | 2019-06-19 10:34:09 -0400 | [diff] [blame] | 687 | "task:%u@%d xid=0x%08x error=%ld (%s) operation=%u", |
| 688 | __entry->task_id, __entry->client_id, __entry->xid, |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 689 | -__entry->error, show_nfsv4_errors(__entry->error), |
| 690 | __entry->op |
Chuck Lever | f23f658 | 2019-02-11 11:24:26 -0500 | [diff] [blame] | 691 | ) |
| 692 | ); |
| 693 | |
Chuck Lever | 2bb50aa | 2019-12-23 10:28:38 -0500 | [diff] [blame^] | 694 | DECLARE_EVENT_CLASS(nfs4_cb_error_class, |
| 695 | TP_PROTO( |
| 696 | __be32 xid, |
| 697 | u32 cb_ident |
| 698 | ), |
| 699 | |
| 700 | TP_ARGS(xid, cb_ident), |
| 701 | |
| 702 | TP_STRUCT__entry( |
| 703 | __field(u32, xid) |
| 704 | __field(u32, cbident) |
| 705 | ), |
| 706 | |
| 707 | TP_fast_assign( |
| 708 | __entry->xid = be32_to_cpu(xid); |
| 709 | __entry->cbident = cb_ident; |
| 710 | ), |
| 711 | |
| 712 | TP_printk( |
| 713 | "xid=0x%08x cb_ident=0x%08x", |
| 714 | __entry->xid, __entry->cbident |
| 715 | ) |
| 716 | ); |
| 717 | |
| 718 | #define DEFINE_CB_ERROR_EVENT(name) \ |
| 719 | DEFINE_EVENT(nfs4_cb_error_class, nfs_cb_##name, \ |
| 720 | TP_PROTO( \ |
| 721 | __be32 xid, \ |
| 722 | u32 cb_ident \ |
| 723 | ), \ |
| 724 | TP_ARGS(xid, cb_ident)) |
| 725 | |
| 726 | DEFINE_CB_ERROR_EVENT(no_clp); |
| 727 | DEFINE_CB_ERROR_EVENT(badprinc); |
| 728 | |
Trond Myklebust | 42113a7 | 2013-08-12 16:19:27 -0400 | [diff] [blame] | 729 | DECLARE_EVENT_CLASS(nfs4_open_event, |
| 730 | TP_PROTO( |
| 731 | const struct nfs_open_context *ctx, |
| 732 | int flags, |
| 733 | int error |
| 734 | ), |
| 735 | |
| 736 | TP_ARGS(ctx, flags, error), |
| 737 | |
| 738 | TP_STRUCT__entry( |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 739 | __field(unsigned long, error) |
Trond Myklebust | 42113a7 | 2013-08-12 16:19:27 -0400 | [diff] [blame] | 740 | __field(unsigned int, flags) |
| 741 | __field(unsigned int, fmode) |
| 742 | __field(dev_t, dev) |
| 743 | __field(u32, fhandle) |
| 744 | __field(u64, fileid) |
| 745 | __field(u64, dir) |
| 746 | __string(name, ctx->dentry->d_name.name) |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 747 | __field(int, stateid_seq) |
| 748 | __field(u32, stateid_hash) |
| 749 | __field(int, openstateid_seq) |
| 750 | __field(u32, openstateid_hash) |
Trond Myklebust | 42113a7 | 2013-08-12 16:19:27 -0400 | [diff] [blame] | 751 | ), |
| 752 | |
| 753 | TP_fast_assign( |
| 754 | const struct nfs4_state *state = ctx->state; |
| 755 | const struct inode *inode = NULL; |
| 756 | |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 757 | __entry->error = -error; |
Trond Myklebust | 42113a7 | 2013-08-12 16:19:27 -0400 | [diff] [blame] | 758 | __entry->flags = flags; |
| 759 | __entry->fmode = (__force unsigned int)ctx->mode; |
| 760 | __entry->dev = ctx->dentry->d_sb->s_dev; |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 761 | if (!IS_ERR_OR_NULL(state)) { |
Trond Myklebust | 42113a7 | 2013-08-12 16:19:27 -0400 | [diff] [blame] | 762 | inode = state->inode; |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 763 | __entry->stateid_seq = |
| 764 | be32_to_cpu(state->stateid.seqid); |
| 765 | __entry->stateid_hash = |
| 766 | nfs_stateid_hash(&state->stateid); |
| 767 | __entry->openstateid_seq = |
| 768 | be32_to_cpu(state->open_stateid.seqid); |
| 769 | __entry->openstateid_hash = |
| 770 | nfs_stateid_hash(&state->open_stateid); |
| 771 | } else { |
| 772 | __entry->stateid_seq = 0; |
| 773 | __entry->stateid_hash = 0; |
| 774 | __entry->openstateid_seq = 0; |
| 775 | __entry->openstateid_hash = 0; |
| 776 | } |
Trond Myklebust | 42113a7 | 2013-08-12 16:19:27 -0400 | [diff] [blame] | 777 | if (inode != NULL) { |
| 778 | __entry->fileid = NFS_FILEID(inode); |
| 779 | __entry->fhandle = nfs_fhandle_hash(NFS_FH(inode)); |
| 780 | } else { |
| 781 | __entry->fileid = 0; |
| 782 | __entry->fhandle = 0; |
| 783 | } |
David Howells | 2b0143b | 2015-03-17 22:25:59 +0000 | [diff] [blame] | 784 | __entry->dir = NFS_FILEID(d_inode(ctx->dentry->d_parent)); |
Trond Myklebust | 42113a7 | 2013-08-12 16:19:27 -0400 | [diff] [blame] | 785 | __assign_str(name, ctx->dentry->d_name.name); |
| 786 | ), |
| 787 | |
| 788 | TP_printk( |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 789 | "error=%ld (%s) flags=%d (%s) fmode=%s " |
Trond Myklebust | 42113a7 | 2013-08-12 16:19:27 -0400 | [diff] [blame] | 790 | "fileid=%02x:%02x:%llu fhandle=0x%08x " |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 791 | "name=%02x:%02x:%llu/%s stateid=%d:0x%08x " |
| 792 | "openstateid=%d:0x%08x", |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 793 | -__entry->error, |
Trond Myklebust | 42113a7 | 2013-08-12 16:19:27 -0400 | [diff] [blame] | 794 | show_nfsv4_errors(__entry->error), |
| 795 | __entry->flags, |
| 796 | show_open_flags(__entry->flags), |
| 797 | show_fmode_flags(__entry->fmode), |
| 798 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 799 | (unsigned long long)__entry->fileid, |
| 800 | __entry->fhandle, |
| 801 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 802 | (unsigned long long)__entry->dir, |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 803 | __get_str(name), |
| 804 | __entry->stateid_seq, __entry->stateid_hash, |
| 805 | __entry->openstateid_seq, __entry->openstateid_hash |
Trond Myklebust | 42113a7 | 2013-08-12 16:19:27 -0400 | [diff] [blame] | 806 | ) |
| 807 | ); |
| 808 | |
| 809 | #define DEFINE_NFS4_OPEN_EVENT(name) \ |
| 810 | DEFINE_EVENT(nfs4_open_event, name, \ |
| 811 | TP_PROTO( \ |
| 812 | const struct nfs_open_context *ctx, \ |
| 813 | int flags, \ |
| 814 | int error \ |
| 815 | ), \ |
| 816 | TP_ARGS(ctx, flags, error)) |
| 817 | DEFINE_NFS4_OPEN_EVENT(nfs4_open_reclaim); |
| 818 | DEFINE_NFS4_OPEN_EVENT(nfs4_open_expired); |
| 819 | DEFINE_NFS4_OPEN_EVENT(nfs4_open_file); |
| 820 | |
Olga Kornievskaia | 9759b0f | 2015-11-24 13:29:42 -0500 | [diff] [blame] | 821 | TRACE_EVENT(nfs4_cached_open, |
| 822 | TP_PROTO( |
| 823 | const struct nfs4_state *state |
| 824 | ), |
| 825 | TP_ARGS(state), |
| 826 | TP_STRUCT__entry( |
| 827 | __field(dev_t, dev) |
| 828 | __field(u32, fhandle) |
| 829 | __field(u64, fileid) |
| 830 | __field(unsigned int, fmode) |
| 831 | __field(int, stateid_seq) |
| 832 | __field(u32, stateid_hash) |
| 833 | ), |
| 834 | |
| 835 | TP_fast_assign( |
| 836 | const struct inode *inode = state->inode; |
| 837 | |
| 838 | __entry->dev = inode->i_sb->s_dev; |
| 839 | __entry->fileid = NFS_FILEID(inode); |
| 840 | __entry->fhandle = nfs_fhandle_hash(NFS_FH(inode)); |
| 841 | __entry->fmode = (__force unsigned int)state->state; |
| 842 | __entry->stateid_seq = |
| 843 | be32_to_cpu(state->stateid.seqid); |
| 844 | __entry->stateid_hash = |
| 845 | nfs_stateid_hash(&state->stateid); |
| 846 | ), |
| 847 | |
| 848 | TP_printk( |
| 849 | "fmode=%s fileid=%02x:%02x:%llu " |
| 850 | "fhandle=0x%08x stateid=%d:0x%08x", |
| 851 | __entry->fmode ? show_fmode_flags(__entry->fmode) : |
| 852 | "closed", |
| 853 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 854 | (unsigned long long)__entry->fileid, |
| 855 | __entry->fhandle, |
| 856 | __entry->stateid_seq, __entry->stateid_hash |
| 857 | ) |
| 858 | ); |
| 859 | |
Trond Myklebust | 42113a7 | 2013-08-12 16:19:27 -0400 | [diff] [blame] | 860 | TRACE_EVENT(nfs4_close, |
| 861 | TP_PROTO( |
| 862 | const struct nfs4_state *state, |
| 863 | const struct nfs_closeargs *args, |
| 864 | const struct nfs_closeres *res, |
| 865 | int error |
| 866 | ), |
| 867 | |
| 868 | TP_ARGS(state, args, res, error), |
| 869 | |
| 870 | TP_STRUCT__entry( |
| 871 | __field(dev_t, dev) |
| 872 | __field(u32, fhandle) |
| 873 | __field(u64, fileid) |
| 874 | __field(unsigned int, fmode) |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 875 | __field(unsigned long, error) |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 876 | __field(int, stateid_seq) |
| 877 | __field(u32, stateid_hash) |
Trond Myklebust | 42113a7 | 2013-08-12 16:19:27 -0400 | [diff] [blame] | 878 | ), |
| 879 | |
| 880 | TP_fast_assign( |
| 881 | const struct inode *inode = state->inode; |
| 882 | |
| 883 | __entry->dev = inode->i_sb->s_dev; |
| 884 | __entry->fileid = NFS_FILEID(inode); |
| 885 | __entry->fhandle = nfs_fhandle_hash(NFS_FH(inode)); |
| 886 | __entry->fmode = (__force unsigned int)state->state; |
| 887 | __entry->error = error; |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 888 | __entry->stateid_seq = |
| 889 | be32_to_cpu(args->stateid.seqid); |
| 890 | __entry->stateid_hash = |
| 891 | nfs_stateid_hash(&args->stateid); |
Trond Myklebust | 42113a7 | 2013-08-12 16:19:27 -0400 | [diff] [blame] | 892 | ), |
| 893 | |
| 894 | TP_printk( |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 895 | "error=%ld (%s) fmode=%s fileid=%02x:%02x:%llu " |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 896 | "fhandle=0x%08x openstateid=%d:0x%08x", |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 897 | -__entry->error, |
Trond Myklebust | 42113a7 | 2013-08-12 16:19:27 -0400 | [diff] [blame] | 898 | show_nfsv4_errors(__entry->error), |
| 899 | __entry->fmode ? show_fmode_flags(__entry->fmode) : |
| 900 | "closed", |
| 901 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 902 | (unsigned long long)__entry->fileid, |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 903 | __entry->fhandle, |
| 904 | __entry->stateid_seq, __entry->stateid_hash |
Trond Myklebust | 42113a7 | 2013-08-12 16:19:27 -0400 | [diff] [blame] | 905 | ) |
| 906 | ); |
| 907 | |
Chuck Lever | 5b2095d | 2018-12-19 11:00:11 -0500 | [diff] [blame] | 908 | TRACE_DEFINE_ENUM(F_GETLK); |
| 909 | TRACE_DEFINE_ENUM(F_SETLK); |
| 910 | TRACE_DEFINE_ENUM(F_SETLKW); |
| 911 | TRACE_DEFINE_ENUM(F_RDLCK); |
| 912 | TRACE_DEFINE_ENUM(F_WRLCK); |
| 913 | TRACE_DEFINE_ENUM(F_UNLCK); |
| 914 | |
Trond Myklebust | d1b748a | 2013-08-12 16:35:20 -0400 | [diff] [blame] | 915 | #define show_lock_cmd(type) \ |
| 916 | __print_symbolic((int)type, \ |
| 917 | { F_GETLK, "GETLK" }, \ |
| 918 | { F_SETLK, "SETLK" }, \ |
| 919 | { F_SETLKW, "SETLKW" }) |
| 920 | #define show_lock_type(type) \ |
| 921 | __print_symbolic((int)type, \ |
| 922 | { F_RDLCK, "RDLCK" }, \ |
| 923 | { F_WRLCK, "WRLCK" }, \ |
| 924 | { F_UNLCK, "UNLCK" }) |
| 925 | |
| 926 | DECLARE_EVENT_CLASS(nfs4_lock_event, |
| 927 | TP_PROTO( |
| 928 | const struct file_lock *request, |
| 929 | const struct nfs4_state *state, |
| 930 | int cmd, |
| 931 | int error |
| 932 | ), |
| 933 | |
| 934 | TP_ARGS(request, state, cmd, error), |
| 935 | |
| 936 | TP_STRUCT__entry( |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 937 | __field(unsigned long, error) |
Trond Myklebust | d1b748a | 2013-08-12 16:35:20 -0400 | [diff] [blame] | 938 | __field(int, cmd) |
| 939 | __field(char, type) |
| 940 | __field(loff_t, start) |
| 941 | __field(loff_t, end) |
| 942 | __field(dev_t, dev) |
| 943 | __field(u32, fhandle) |
| 944 | __field(u64, fileid) |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 945 | __field(int, stateid_seq) |
| 946 | __field(u32, stateid_hash) |
Trond Myklebust | d1b748a | 2013-08-12 16:35:20 -0400 | [diff] [blame] | 947 | ), |
| 948 | |
| 949 | TP_fast_assign( |
| 950 | const struct inode *inode = state->inode; |
| 951 | |
| 952 | __entry->error = error; |
| 953 | __entry->cmd = cmd; |
| 954 | __entry->type = request->fl_type; |
| 955 | __entry->start = request->fl_start; |
| 956 | __entry->end = request->fl_end; |
| 957 | __entry->dev = inode->i_sb->s_dev; |
| 958 | __entry->fileid = NFS_FILEID(inode); |
| 959 | __entry->fhandle = nfs_fhandle_hash(NFS_FH(inode)); |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 960 | __entry->stateid_seq = |
| 961 | be32_to_cpu(state->stateid.seqid); |
| 962 | __entry->stateid_hash = |
| 963 | nfs_stateid_hash(&state->stateid); |
Trond Myklebust | d1b748a | 2013-08-12 16:35:20 -0400 | [diff] [blame] | 964 | ), |
| 965 | |
| 966 | TP_printk( |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 967 | "error=%ld (%s) cmd=%s:%s range=%lld:%lld " |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 968 | "fileid=%02x:%02x:%llu fhandle=0x%08x " |
| 969 | "stateid=%d:0x%08x", |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 970 | -__entry->error, |
Trond Myklebust | d1b748a | 2013-08-12 16:35:20 -0400 | [diff] [blame] | 971 | show_nfsv4_errors(__entry->error), |
| 972 | show_lock_cmd(__entry->cmd), |
| 973 | show_lock_type(__entry->type), |
| 974 | (long long)__entry->start, |
| 975 | (long long)__entry->end, |
| 976 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 977 | (unsigned long long)__entry->fileid, |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 978 | __entry->fhandle, |
| 979 | __entry->stateid_seq, __entry->stateid_hash |
Trond Myklebust | d1b748a | 2013-08-12 16:35:20 -0400 | [diff] [blame] | 980 | ) |
| 981 | ); |
| 982 | |
| 983 | #define DEFINE_NFS4_LOCK_EVENT(name) \ |
| 984 | DEFINE_EVENT(nfs4_lock_event, name, \ |
| 985 | TP_PROTO( \ |
| 986 | const struct file_lock *request, \ |
| 987 | const struct nfs4_state *state, \ |
| 988 | int cmd, \ |
| 989 | int error \ |
| 990 | ), \ |
| 991 | TP_ARGS(request, state, cmd, error)) |
| 992 | DEFINE_NFS4_LOCK_EVENT(nfs4_get_lock); |
Trond Myklebust | d1b748a | 2013-08-12 16:35:20 -0400 | [diff] [blame] | 993 | DEFINE_NFS4_LOCK_EVENT(nfs4_unlock); |
| 994 | |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 995 | TRACE_EVENT(nfs4_set_lock, |
| 996 | TP_PROTO( |
| 997 | const struct file_lock *request, |
| 998 | const struct nfs4_state *state, |
| 999 | const nfs4_stateid *lockstateid, |
| 1000 | int cmd, |
| 1001 | int error |
| 1002 | ), |
| 1003 | |
| 1004 | TP_ARGS(request, state, lockstateid, cmd, error), |
| 1005 | |
| 1006 | TP_STRUCT__entry( |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 1007 | __field(unsigned long, error) |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 1008 | __field(int, cmd) |
| 1009 | __field(char, type) |
| 1010 | __field(loff_t, start) |
| 1011 | __field(loff_t, end) |
| 1012 | __field(dev_t, dev) |
| 1013 | __field(u32, fhandle) |
| 1014 | __field(u64, fileid) |
| 1015 | __field(int, stateid_seq) |
| 1016 | __field(u32, stateid_hash) |
| 1017 | __field(int, lockstateid_seq) |
| 1018 | __field(u32, lockstateid_hash) |
| 1019 | ), |
| 1020 | |
| 1021 | TP_fast_assign( |
| 1022 | const struct inode *inode = state->inode; |
| 1023 | |
| 1024 | __entry->error = error; |
| 1025 | __entry->cmd = cmd; |
| 1026 | __entry->type = request->fl_type; |
| 1027 | __entry->start = request->fl_start; |
| 1028 | __entry->end = request->fl_end; |
| 1029 | __entry->dev = inode->i_sb->s_dev; |
| 1030 | __entry->fileid = NFS_FILEID(inode); |
| 1031 | __entry->fhandle = nfs_fhandle_hash(NFS_FH(inode)); |
| 1032 | __entry->stateid_seq = |
| 1033 | be32_to_cpu(state->stateid.seqid); |
| 1034 | __entry->stateid_hash = |
| 1035 | nfs_stateid_hash(&state->stateid); |
| 1036 | __entry->lockstateid_seq = |
| 1037 | be32_to_cpu(lockstateid->seqid); |
| 1038 | __entry->lockstateid_hash = |
| 1039 | nfs_stateid_hash(lockstateid); |
| 1040 | ), |
| 1041 | |
| 1042 | TP_printk( |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 1043 | "error=%ld (%s) cmd=%s:%s range=%lld:%lld " |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 1044 | "fileid=%02x:%02x:%llu fhandle=0x%08x " |
| 1045 | "stateid=%d:0x%08x lockstateid=%d:0x%08x", |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 1046 | -__entry->error, |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 1047 | show_nfsv4_errors(__entry->error), |
| 1048 | show_lock_cmd(__entry->cmd), |
| 1049 | show_lock_type(__entry->type), |
| 1050 | (long long)__entry->start, |
| 1051 | (long long)__entry->end, |
| 1052 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 1053 | (unsigned long long)__entry->fileid, |
| 1054 | __entry->fhandle, |
| 1055 | __entry->stateid_seq, __entry->stateid_hash, |
| 1056 | __entry->lockstateid_seq, __entry->lockstateid_hash |
| 1057 | ) |
| 1058 | ); |
| 1059 | |
Chuck Lever | 21f86d2 | 2019-11-05 11:04:13 -0500 | [diff] [blame] | 1060 | TRACE_DEFINE_ENUM(LK_STATE_IN_USE); |
| 1061 | TRACE_DEFINE_ENUM(NFS_DELEGATED_STATE); |
| 1062 | TRACE_DEFINE_ENUM(NFS_OPEN_STATE); |
| 1063 | TRACE_DEFINE_ENUM(NFS_O_RDONLY_STATE); |
| 1064 | TRACE_DEFINE_ENUM(NFS_O_WRONLY_STATE); |
| 1065 | TRACE_DEFINE_ENUM(NFS_O_RDWR_STATE); |
| 1066 | TRACE_DEFINE_ENUM(NFS_STATE_RECLAIM_REBOOT); |
| 1067 | TRACE_DEFINE_ENUM(NFS_STATE_RECLAIM_NOGRACE); |
| 1068 | TRACE_DEFINE_ENUM(NFS_STATE_POSIX_LOCKS); |
| 1069 | TRACE_DEFINE_ENUM(NFS_STATE_RECOVERY_FAILED); |
| 1070 | TRACE_DEFINE_ENUM(NFS_STATE_MAY_NOTIFY_LOCK); |
| 1071 | TRACE_DEFINE_ENUM(NFS_STATE_CHANGE_WAIT); |
| 1072 | TRACE_DEFINE_ENUM(NFS_CLNT_DST_SSC_COPY_STATE); |
| 1073 | TRACE_DEFINE_ENUM(NFS_CLNT_SRC_SSC_COPY_STATE); |
| 1074 | TRACE_DEFINE_ENUM(NFS_SRV_SSC_COPY_STATE); |
| 1075 | |
| 1076 | #define show_nfs4_state_flags(flags) \ |
| 1077 | __print_flags(flags, "|", \ |
| 1078 | { LK_STATE_IN_USE, "IN_USE" }, \ |
| 1079 | { NFS_DELEGATED_STATE, "DELEGATED" }, \ |
| 1080 | { NFS_OPEN_STATE, "OPEN" }, \ |
| 1081 | { NFS_O_RDONLY_STATE, "O_RDONLY" }, \ |
| 1082 | { NFS_O_WRONLY_STATE, "O_WRONLY" }, \ |
| 1083 | { NFS_O_RDWR_STATE, "O_RDWR" }, \ |
| 1084 | { NFS_STATE_RECLAIM_REBOOT, "RECLAIM_REBOOT" }, \ |
| 1085 | { NFS_STATE_RECLAIM_NOGRACE, "RECLAIM_NOGRACE" }, \ |
| 1086 | { NFS_STATE_POSIX_LOCKS, "POSIX_LOCKS" }, \ |
| 1087 | { NFS_STATE_RECOVERY_FAILED, "RECOVERY_FAILED" }, \ |
| 1088 | { NFS_STATE_MAY_NOTIFY_LOCK, "MAY_NOTIFY_LOCK" }, \ |
| 1089 | { NFS_STATE_CHANGE_WAIT, "CHANGE_WAIT" }, \ |
| 1090 | { NFS_CLNT_DST_SSC_COPY_STATE, "CLNT_DST_SSC_COPY" }, \ |
| 1091 | { NFS_CLNT_SRC_SSC_COPY_STATE, "CLNT_SRC_SSC_COPY" }, \ |
| 1092 | { NFS_SRV_SSC_COPY_STATE, "SRV_SSC_COPY" }) |
| 1093 | |
| 1094 | #define show_nfs4_lock_flags(flags) \ |
| 1095 | __print_flags(flags, "|", \ |
| 1096 | { BIT(NFS_LOCK_INITIALIZED), "INITIALIZED" }, \ |
| 1097 | { BIT(NFS_LOCK_LOST), "LOST" }) |
| 1098 | |
| 1099 | TRACE_EVENT(nfs4_state_lock_reclaim, |
| 1100 | TP_PROTO( |
| 1101 | const struct nfs4_state *state, |
| 1102 | const struct nfs4_lock_state *lock |
| 1103 | ), |
| 1104 | |
| 1105 | TP_ARGS(state, lock), |
| 1106 | |
| 1107 | TP_STRUCT__entry( |
| 1108 | __field(dev_t, dev) |
| 1109 | __field(u32, fhandle) |
| 1110 | __field(u64, fileid) |
| 1111 | __field(unsigned long, state_flags) |
| 1112 | __field(unsigned long, lock_flags) |
| 1113 | __field(int, stateid_seq) |
| 1114 | __field(u32, stateid_hash) |
| 1115 | ), |
| 1116 | |
| 1117 | TP_fast_assign( |
| 1118 | const struct inode *inode = state->inode; |
| 1119 | |
| 1120 | __entry->dev = inode->i_sb->s_dev; |
| 1121 | __entry->fileid = NFS_FILEID(inode); |
| 1122 | __entry->fhandle = nfs_fhandle_hash(NFS_FH(inode)); |
| 1123 | __entry->state_flags = state->flags; |
| 1124 | __entry->lock_flags = lock->ls_flags; |
| 1125 | __entry->stateid_seq = |
| 1126 | be32_to_cpu(state->stateid.seqid); |
| 1127 | __entry->stateid_hash = |
| 1128 | nfs_stateid_hash(&state->stateid); |
| 1129 | ), |
| 1130 | |
| 1131 | TP_printk( |
| 1132 | "fileid=%02x:%02x:%llu fhandle=0x%08x " |
| 1133 | "stateid=%d:0x%08x state_flags=%s lock_flags=%s", |
| 1134 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 1135 | (unsigned long long)__entry->fileid, __entry->fhandle, |
| 1136 | __entry->stateid_seq, __entry->stateid_hash, |
| 1137 | show_nfs4_state_flags(__entry->state_flags), |
| 1138 | show_nfs4_lock_flags(__entry->lock_flags) |
| 1139 | ) |
| 1140 | ) |
| 1141 | |
Trond Myklebust | ca8acf8 | 2013-08-13 10:36:56 -0400 | [diff] [blame] | 1142 | DECLARE_EVENT_CLASS(nfs4_set_delegation_event, |
| 1143 | TP_PROTO( |
| 1144 | const struct inode *inode, |
| 1145 | fmode_t fmode |
| 1146 | ), |
| 1147 | |
| 1148 | TP_ARGS(inode, fmode), |
| 1149 | |
| 1150 | TP_STRUCT__entry( |
| 1151 | __field(dev_t, dev) |
| 1152 | __field(u32, fhandle) |
| 1153 | __field(u64, fileid) |
| 1154 | __field(unsigned int, fmode) |
| 1155 | ), |
| 1156 | |
| 1157 | TP_fast_assign( |
| 1158 | __entry->dev = inode->i_sb->s_dev; |
| 1159 | __entry->fileid = NFS_FILEID(inode); |
| 1160 | __entry->fhandle = nfs_fhandle_hash(NFS_FH(inode)); |
| 1161 | __entry->fmode = (__force unsigned int)fmode; |
| 1162 | ), |
| 1163 | |
| 1164 | TP_printk( |
| 1165 | "fmode=%s fileid=%02x:%02x:%llu fhandle=0x%08x", |
| 1166 | show_fmode_flags(__entry->fmode), |
| 1167 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 1168 | (unsigned long long)__entry->fileid, |
| 1169 | __entry->fhandle |
| 1170 | ) |
| 1171 | ); |
| 1172 | #define DEFINE_NFS4_SET_DELEGATION_EVENT(name) \ |
| 1173 | DEFINE_EVENT(nfs4_set_delegation_event, name, \ |
| 1174 | TP_PROTO( \ |
| 1175 | const struct inode *inode, \ |
| 1176 | fmode_t fmode \ |
| 1177 | ), \ |
| 1178 | TP_ARGS(inode, fmode)) |
| 1179 | DEFINE_NFS4_SET_DELEGATION_EVENT(nfs4_set_delegation); |
| 1180 | DEFINE_NFS4_SET_DELEGATION_EVENT(nfs4_reclaim_delegation); |
| 1181 | |
| 1182 | TRACE_EVENT(nfs4_delegreturn_exit, |
| 1183 | TP_PROTO( |
| 1184 | const struct nfs4_delegreturnargs *args, |
| 1185 | const struct nfs4_delegreturnres *res, |
| 1186 | int error |
| 1187 | ), |
| 1188 | |
| 1189 | TP_ARGS(args, res, error), |
| 1190 | |
| 1191 | TP_STRUCT__entry( |
| 1192 | __field(dev_t, dev) |
| 1193 | __field(u32, fhandle) |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 1194 | __field(unsigned long, error) |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 1195 | __field(int, stateid_seq) |
| 1196 | __field(u32, stateid_hash) |
Trond Myklebust | ca8acf8 | 2013-08-13 10:36:56 -0400 | [diff] [blame] | 1197 | ), |
| 1198 | |
| 1199 | TP_fast_assign( |
| 1200 | __entry->dev = res->server->s_dev; |
| 1201 | __entry->fhandle = nfs_fhandle_hash(args->fhandle); |
| 1202 | __entry->error = error; |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 1203 | __entry->stateid_seq = |
| 1204 | be32_to_cpu(args->stateid->seqid); |
| 1205 | __entry->stateid_hash = |
| 1206 | nfs_stateid_hash(args->stateid); |
Trond Myklebust | ca8acf8 | 2013-08-13 10:36:56 -0400 | [diff] [blame] | 1207 | ), |
| 1208 | |
| 1209 | TP_printk( |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 1210 | "error=%ld (%s) dev=%02x:%02x fhandle=0x%08x " |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 1211 | "stateid=%d:0x%08x", |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 1212 | -__entry->error, |
Trond Myklebust | ca8acf8 | 2013-08-13 10:36:56 -0400 | [diff] [blame] | 1213 | show_nfsv4_errors(__entry->error), |
| 1214 | MAJOR(__entry->dev), MINOR(__entry->dev), |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 1215 | __entry->fhandle, |
| 1216 | __entry->stateid_seq, __entry->stateid_hash |
Trond Myklebust | ca8acf8 | 2013-08-13 10:36:56 -0400 | [diff] [blame] | 1217 | ) |
| 1218 | ); |
| 1219 | |
Trond Myklebust | 08cb47f | 2013-08-20 21:59:40 -0400 | [diff] [blame] | 1220 | #ifdef CONFIG_NFS_V4_1 |
| 1221 | DECLARE_EVENT_CLASS(nfs4_test_stateid_event, |
| 1222 | TP_PROTO( |
| 1223 | const struct nfs4_state *state, |
| 1224 | const struct nfs4_lock_state *lsp, |
| 1225 | int error |
| 1226 | ), |
| 1227 | |
| 1228 | TP_ARGS(state, lsp, error), |
| 1229 | |
| 1230 | TP_STRUCT__entry( |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 1231 | __field(unsigned long, error) |
Trond Myklebust | 08cb47f | 2013-08-20 21:59:40 -0400 | [diff] [blame] | 1232 | __field(dev_t, dev) |
| 1233 | __field(u32, fhandle) |
| 1234 | __field(u64, fileid) |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 1235 | __field(int, stateid_seq) |
| 1236 | __field(u32, stateid_hash) |
Trond Myklebust | 08cb47f | 2013-08-20 21:59:40 -0400 | [diff] [blame] | 1237 | ), |
| 1238 | |
| 1239 | TP_fast_assign( |
| 1240 | const struct inode *inode = state->inode; |
| 1241 | |
| 1242 | __entry->error = error; |
| 1243 | __entry->dev = inode->i_sb->s_dev; |
| 1244 | __entry->fileid = NFS_FILEID(inode); |
| 1245 | __entry->fhandle = nfs_fhandle_hash(NFS_FH(inode)); |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 1246 | __entry->stateid_seq = |
| 1247 | be32_to_cpu(state->stateid.seqid); |
| 1248 | __entry->stateid_hash = |
| 1249 | nfs_stateid_hash(&state->stateid); |
Trond Myklebust | 08cb47f | 2013-08-20 21:59:40 -0400 | [diff] [blame] | 1250 | ), |
| 1251 | |
| 1252 | TP_printk( |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 1253 | "error=%ld (%s) fileid=%02x:%02x:%llu fhandle=0x%08x " |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 1254 | "stateid=%d:0x%08x", |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 1255 | -__entry->error, |
Trond Myklebust | 08cb47f | 2013-08-20 21:59:40 -0400 | [diff] [blame] | 1256 | show_nfsv4_errors(__entry->error), |
| 1257 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 1258 | (unsigned long long)__entry->fileid, |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 1259 | __entry->fhandle, |
| 1260 | __entry->stateid_seq, __entry->stateid_hash |
Trond Myklebust | 08cb47f | 2013-08-20 21:59:40 -0400 | [diff] [blame] | 1261 | ) |
| 1262 | ); |
| 1263 | |
| 1264 | #define DEFINE_NFS4_TEST_STATEID_EVENT(name) \ |
| 1265 | DEFINE_EVENT(nfs4_test_stateid_event, name, \ |
| 1266 | TP_PROTO( \ |
| 1267 | const struct nfs4_state *state, \ |
| 1268 | const struct nfs4_lock_state *lsp, \ |
| 1269 | int error \ |
| 1270 | ), \ |
| 1271 | TP_ARGS(state, lsp, error)) |
| 1272 | DEFINE_NFS4_TEST_STATEID_EVENT(nfs4_test_delegation_stateid); |
| 1273 | DEFINE_NFS4_TEST_STATEID_EVENT(nfs4_test_open_stateid); |
| 1274 | DEFINE_NFS4_TEST_STATEID_EVENT(nfs4_test_lock_stateid); |
| 1275 | #endif /* CONFIG_NFS_V4_1 */ |
| 1276 | |
Trond Myklebust | 078ea3d | 2013-08-12 16:45:55 -0400 | [diff] [blame] | 1277 | DECLARE_EVENT_CLASS(nfs4_lookup_event, |
| 1278 | TP_PROTO( |
| 1279 | const struct inode *dir, |
| 1280 | const struct qstr *name, |
| 1281 | int error |
| 1282 | ), |
| 1283 | |
| 1284 | TP_ARGS(dir, name, error), |
| 1285 | |
| 1286 | TP_STRUCT__entry( |
| 1287 | __field(dev_t, dev) |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 1288 | __field(unsigned long, error) |
Trond Myklebust | 078ea3d | 2013-08-12 16:45:55 -0400 | [diff] [blame] | 1289 | __field(u64, dir) |
| 1290 | __string(name, name->name) |
| 1291 | ), |
| 1292 | |
| 1293 | TP_fast_assign( |
| 1294 | __entry->dev = dir->i_sb->s_dev; |
| 1295 | __entry->dir = NFS_FILEID(dir); |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 1296 | __entry->error = -error; |
Trond Myklebust | 078ea3d | 2013-08-12 16:45:55 -0400 | [diff] [blame] | 1297 | __assign_str(name, name->name); |
| 1298 | ), |
| 1299 | |
| 1300 | TP_printk( |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 1301 | "error=%ld (%s) name=%02x:%02x:%llu/%s", |
| 1302 | -__entry->error, |
Trond Myklebust | 078ea3d | 2013-08-12 16:45:55 -0400 | [diff] [blame] | 1303 | show_nfsv4_errors(__entry->error), |
| 1304 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 1305 | (unsigned long long)__entry->dir, |
| 1306 | __get_str(name) |
| 1307 | ) |
| 1308 | ); |
| 1309 | |
| 1310 | #define DEFINE_NFS4_LOOKUP_EVENT(name) \ |
| 1311 | DEFINE_EVENT(nfs4_lookup_event, name, \ |
| 1312 | TP_PROTO( \ |
| 1313 | const struct inode *dir, \ |
| 1314 | const struct qstr *name, \ |
| 1315 | int error \ |
| 1316 | ), \ |
| 1317 | TP_ARGS(dir, name, error)) |
| 1318 | |
| 1319 | DEFINE_NFS4_LOOKUP_EVENT(nfs4_lookup); |
| 1320 | DEFINE_NFS4_LOOKUP_EVENT(nfs4_symlink); |
| 1321 | DEFINE_NFS4_LOOKUP_EVENT(nfs4_mkdir); |
| 1322 | DEFINE_NFS4_LOOKUP_EVENT(nfs4_mknod); |
| 1323 | DEFINE_NFS4_LOOKUP_EVENT(nfs4_remove); |
| 1324 | DEFINE_NFS4_LOOKUP_EVENT(nfs4_get_fs_locations); |
| 1325 | DEFINE_NFS4_LOOKUP_EVENT(nfs4_secinfo); |
| 1326 | |
Jeff Layton | 5b5faaf | 2017-06-29 06:34:52 -0700 | [diff] [blame] | 1327 | TRACE_EVENT(nfs4_lookupp, |
| 1328 | TP_PROTO( |
| 1329 | const struct inode *inode, |
| 1330 | int error |
| 1331 | ), |
| 1332 | |
| 1333 | TP_ARGS(inode, error), |
| 1334 | |
| 1335 | TP_STRUCT__entry( |
| 1336 | __field(dev_t, dev) |
| 1337 | __field(u64, ino) |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 1338 | __field(unsigned long, error) |
Jeff Layton | 5b5faaf | 2017-06-29 06:34:52 -0700 | [diff] [blame] | 1339 | ), |
| 1340 | |
| 1341 | TP_fast_assign( |
| 1342 | __entry->dev = inode->i_sb->s_dev; |
| 1343 | __entry->ino = NFS_FILEID(inode); |
| 1344 | __entry->error = error; |
| 1345 | ), |
| 1346 | |
| 1347 | TP_printk( |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 1348 | "error=%ld (%s) inode=%02x:%02x:%llu", |
| 1349 | -__entry->error, |
Jeff Layton | 5b5faaf | 2017-06-29 06:34:52 -0700 | [diff] [blame] | 1350 | show_nfsv4_errors(__entry->error), |
| 1351 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 1352 | (unsigned long long)__entry->ino |
| 1353 | ) |
| 1354 | ); |
| 1355 | |
Trond Myklebust | fbc6f7c | 2013-08-12 17:08:26 -0400 | [diff] [blame] | 1356 | TRACE_EVENT(nfs4_rename, |
| 1357 | TP_PROTO( |
| 1358 | const struct inode *olddir, |
| 1359 | const struct qstr *oldname, |
| 1360 | const struct inode *newdir, |
| 1361 | const struct qstr *newname, |
| 1362 | int error |
| 1363 | ), |
| 1364 | |
| 1365 | TP_ARGS(olddir, oldname, newdir, newname, error), |
| 1366 | |
| 1367 | TP_STRUCT__entry( |
| 1368 | __field(dev_t, dev) |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 1369 | __field(unsigned long, error) |
Trond Myklebust | fbc6f7c | 2013-08-12 17:08:26 -0400 | [diff] [blame] | 1370 | __field(u64, olddir) |
| 1371 | __string(oldname, oldname->name) |
| 1372 | __field(u64, newdir) |
| 1373 | __string(newname, newname->name) |
| 1374 | ), |
| 1375 | |
| 1376 | TP_fast_assign( |
| 1377 | __entry->dev = olddir->i_sb->s_dev; |
| 1378 | __entry->olddir = NFS_FILEID(olddir); |
| 1379 | __entry->newdir = NFS_FILEID(newdir); |
| 1380 | __entry->error = error; |
| 1381 | __assign_str(oldname, oldname->name); |
| 1382 | __assign_str(newname, newname->name); |
| 1383 | ), |
| 1384 | |
| 1385 | TP_printk( |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 1386 | "error=%ld (%s) oldname=%02x:%02x:%llu/%s " |
Trond Myklebust | fbc6f7c | 2013-08-12 17:08:26 -0400 | [diff] [blame] | 1387 | "newname=%02x:%02x:%llu/%s", |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 1388 | -__entry->error, |
Trond Myklebust | fbc6f7c | 2013-08-12 17:08:26 -0400 | [diff] [blame] | 1389 | show_nfsv4_errors(__entry->error), |
| 1390 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 1391 | (unsigned long long)__entry->olddir, |
| 1392 | __get_str(oldname), |
| 1393 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 1394 | (unsigned long long)__entry->newdir, |
| 1395 | __get_str(newname) |
| 1396 | ) |
| 1397 | ); |
| 1398 | |
Trond Myklebust | c1578b7 | 2013-08-12 16:58:42 -0400 | [diff] [blame] | 1399 | DECLARE_EVENT_CLASS(nfs4_inode_event, |
| 1400 | TP_PROTO( |
| 1401 | const struct inode *inode, |
| 1402 | int error |
| 1403 | ), |
| 1404 | |
| 1405 | TP_ARGS(inode, error), |
| 1406 | |
| 1407 | TP_STRUCT__entry( |
| 1408 | __field(dev_t, dev) |
| 1409 | __field(u32, fhandle) |
| 1410 | __field(u64, fileid) |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 1411 | __field(unsigned long, error) |
Trond Myklebust | c1578b7 | 2013-08-12 16:58:42 -0400 | [diff] [blame] | 1412 | ), |
| 1413 | |
| 1414 | TP_fast_assign( |
| 1415 | __entry->dev = inode->i_sb->s_dev; |
| 1416 | __entry->fileid = NFS_FILEID(inode); |
| 1417 | __entry->fhandle = nfs_fhandle_hash(NFS_FH(inode)); |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 1418 | __entry->error = error < 0 ? -error : 0; |
Trond Myklebust | c1578b7 | 2013-08-12 16:58:42 -0400 | [diff] [blame] | 1419 | ), |
| 1420 | |
| 1421 | TP_printk( |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 1422 | "error=%ld (%s) fileid=%02x:%02x:%llu fhandle=0x%08x", |
| 1423 | -__entry->error, |
Trond Myklebust | c1578b7 | 2013-08-12 16:58:42 -0400 | [diff] [blame] | 1424 | show_nfsv4_errors(__entry->error), |
| 1425 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 1426 | (unsigned long long)__entry->fileid, |
| 1427 | __entry->fhandle |
| 1428 | ) |
| 1429 | ); |
| 1430 | |
| 1431 | #define DEFINE_NFS4_INODE_EVENT(name) \ |
| 1432 | DEFINE_EVENT(nfs4_inode_event, name, \ |
| 1433 | TP_PROTO( \ |
| 1434 | const struct inode *inode, \ |
| 1435 | int error \ |
| 1436 | ), \ |
| 1437 | TP_ARGS(inode, error)) |
| 1438 | |
Trond Myklebust | c1578b7 | 2013-08-12 16:58:42 -0400 | [diff] [blame] | 1439 | DEFINE_NFS4_INODE_EVENT(nfs4_access); |
| 1440 | DEFINE_NFS4_INODE_EVENT(nfs4_readlink); |
| 1441 | DEFINE_NFS4_INODE_EVENT(nfs4_readdir); |
| 1442 | DEFINE_NFS4_INODE_EVENT(nfs4_get_acl); |
| 1443 | DEFINE_NFS4_INODE_EVENT(nfs4_set_acl); |
| 1444 | #ifdef CONFIG_NFS_V4_SECURITY_LABEL |
| 1445 | DEFINE_NFS4_INODE_EVENT(nfs4_get_security_label); |
| 1446 | DEFINE_NFS4_INODE_EVENT(nfs4_set_security_label); |
| 1447 | #endif /* CONFIG_NFS_V4_SECURITY_LABEL */ |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 1448 | |
| 1449 | DECLARE_EVENT_CLASS(nfs4_inode_stateid_event, |
| 1450 | TP_PROTO( |
| 1451 | const struct inode *inode, |
| 1452 | const nfs4_stateid *stateid, |
| 1453 | int error |
| 1454 | ), |
| 1455 | |
| 1456 | TP_ARGS(inode, stateid, error), |
| 1457 | |
| 1458 | TP_STRUCT__entry( |
| 1459 | __field(dev_t, dev) |
| 1460 | __field(u32, fhandle) |
| 1461 | __field(u64, fileid) |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 1462 | __field(unsigned long, error) |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 1463 | __field(int, stateid_seq) |
| 1464 | __field(u32, stateid_hash) |
| 1465 | ), |
| 1466 | |
| 1467 | TP_fast_assign( |
| 1468 | __entry->dev = inode->i_sb->s_dev; |
| 1469 | __entry->fileid = NFS_FILEID(inode); |
| 1470 | __entry->fhandle = nfs_fhandle_hash(NFS_FH(inode)); |
| 1471 | __entry->error = error; |
| 1472 | __entry->stateid_seq = |
| 1473 | be32_to_cpu(stateid->seqid); |
| 1474 | __entry->stateid_hash = |
| 1475 | nfs_stateid_hash(stateid); |
| 1476 | ), |
| 1477 | |
| 1478 | TP_printk( |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 1479 | "error=%ld (%s) fileid=%02x:%02x:%llu fhandle=0x%08x " |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 1480 | "stateid=%d:0x%08x", |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 1481 | -__entry->error, |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 1482 | show_nfsv4_errors(__entry->error), |
| 1483 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 1484 | (unsigned long long)__entry->fileid, |
| 1485 | __entry->fhandle, |
| 1486 | __entry->stateid_seq, __entry->stateid_hash |
| 1487 | ) |
| 1488 | ); |
| 1489 | |
| 1490 | #define DEFINE_NFS4_INODE_STATEID_EVENT(name) \ |
| 1491 | DEFINE_EVENT(nfs4_inode_stateid_event, name, \ |
| 1492 | TP_PROTO( \ |
| 1493 | const struct inode *inode, \ |
| 1494 | const nfs4_stateid *stateid, \ |
| 1495 | int error \ |
| 1496 | ), \ |
| 1497 | TP_ARGS(inode, stateid, error)) |
| 1498 | |
| 1499 | DEFINE_NFS4_INODE_STATEID_EVENT(nfs4_setattr); |
| 1500 | DEFINE_NFS4_INODE_STATEID_EVENT(nfs4_delegreturn); |
Trond Myklebust | ad9e02d | 2017-11-06 15:28:02 -0500 | [diff] [blame] | 1501 | DEFINE_NFS4_INODE_STATEID_EVENT(nfs4_open_stateid_update); |
| 1502 | DEFINE_NFS4_INODE_STATEID_EVENT(nfs4_open_stateid_update_wait); |
Trond Myklebust | c1578b7 | 2013-08-12 16:58:42 -0400 | [diff] [blame] | 1503 | |
Trond Myklebust | b5f875a | 2013-08-13 13:01:39 -0400 | [diff] [blame] | 1504 | DECLARE_EVENT_CLASS(nfs4_getattr_event, |
| 1505 | TP_PROTO( |
| 1506 | const struct nfs_server *server, |
| 1507 | const struct nfs_fh *fhandle, |
| 1508 | const struct nfs_fattr *fattr, |
| 1509 | int error |
| 1510 | ), |
| 1511 | |
| 1512 | TP_ARGS(server, fhandle, fattr, error), |
| 1513 | |
| 1514 | TP_STRUCT__entry( |
| 1515 | __field(dev_t, dev) |
| 1516 | __field(u32, fhandle) |
| 1517 | __field(u64, fileid) |
| 1518 | __field(unsigned int, valid) |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 1519 | __field(unsigned long, error) |
Trond Myklebust | b5f875a | 2013-08-13 13:01:39 -0400 | [diff] [blame] | 1520 | ), |
| 1521 | |
| 1522 | TP_fast_assign( |
| 1523 | __entry->dev = server->s_dev; |
| 1524 | __entry->valid = fattr->valid; |
| 1525 | __entry->fhandle = nfs_fhandle_hash(fhandle); |
| 1526 | __entry->fileid = (fattr->valid & NFS_ATTR_FATTR_FILEID) ? fattr->fileid : 0; |
| 1527 | __entry->error = error; |
| 1528 | ), |
| 1529 | |
| 1530 | TP_printk( |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 1531 | "error=%ld (%s) fileid=%02x:%02x:%llu fhandle=0x%08x " |
Trond Myklebust | b5f875a | 2013-08-13 13:01:39 -0400 | [diff] [blame] | 1532 | "valid=%s", |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 1533 | -__entry->error, |
Trond Myklebust | b5f875a | 2013-08-13 13:01:39 -0400 | [diff] [blame] | 1534 | show_nfsv4_errors(__entry->error), |
| 1535 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 1536 | (unsigned long long)__entry->fileid, |
| 1537 | __entry->fhandle, |
| 1538 | show_nfs_fattr_flags(__entry->valid) |
| 1539 | ) |
| 1540 | ); |
| 1541 | |
| 1542 | #define DEFINE_NFS4_GETATTR_EVENT(name) \ |
| 1543 | DEFINE_EVENT(nfs4_getattr_event, name, \ |
| 1544 | TP_PROTO( \ |
| 1545 | const struct nfs_server *server, \ |
| 1546 | const struct nfs_fh *fhandle, \ |
| 1547 | const struct nfs_fattr *fattr, \ |
| 1548 | int error \ |
| 1549 | ), \ |
| 1550 | TP_ARGS(server, fhandle, fattr, error)) |
| 1551 | DEFINE_NFS4_GETATTR_EVENT(nfs4_getattr); |
| 1552 | DEFINE_NFS4_GETATTR_EVENT(nfs4_lookup_root); |
| 1553 | DEFINE_NFS4_GETATTR_EVENT(nfs4_fsinfo); |
| 1554 | |
Trond Myklebust | 7cd1486 | 2015-08-20 20:07:54 -0500 | [diff] [blame] | 1555 | DECLARE_EVENT_CLASS(nfs4_inode_callback_event, |
| 1556 | TP_PROTO( |
| 1557 | const struct nfs_client *clp, |
| 1558 | const struct nfs_fh *fhandle, |
| 1559 | const struct inode *inode, |
| 1560 | int error |
| 1561 | ), |
| 1562 | |
| 1563 | TP_ARGS(clp, fhandle, inode, error), |
| 1564 | |
| 1565 | TP_STRUCT__entry( |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 1566 | __field(unsigned long, error) |
Trond Myklebust | 7cd1486 | 2015-08-20 20:07:54 -0500 | [diff] [blame] | 1567 | __field(dev_t, dev) |
| 1568 | __field(u32, fhandle) |
| 1569 | __field(u64, fileid) |
Anna Schumaker | 3944369 | 2017-11-01 15:48:43 -0400 | [diff] [blame] | 1570 | __string(dstaddr, clp ? clp->cl_hostname : "unknown") |
Trond Myklebust | 7cd1486 | 2015-08-20 20:07:54 -0500 | [diff] [blame] | 1571 | ), |
| 1572 | |
| 1573 | TP_fast_assign( |
| 1574 | __entry->error = error; |
| 1575 | __entry->fhandle = nfs_fhandle_hash(fhandle); |
Trond Myklebust | 2edaead | 2018-09-05 14:07:13 -0400 | [diff] [blame] | 1576 | if (!IS_ERR_OR_NULL(inode)) { |
Trond Myklebust | 7cd1486 | 2015-08-20 20:07:54 -0500 | [diff] [blame] | 1577 | __entry->fileid = NFS_FILEID(inode); |
| 1578 | __entry->dev = inode->i_sb->s_dev; |
| 1579 | } else { |
| 1580 | __entry->fileid = 0; |
| 1581 | __entry->dev = 0; |
| 1582 | } |
Anna Schumaker | 3944369 | 2017-11-01 15:48:43 -0400 | [diff] [blame] | 1583 | __assign_str(dstaddr, clp ? clp->cl_hostname : "unknown") |
Trond Myklebust | 7cd1486 | 2015-08-20 20:07:54 -0500 | [diff] [blame] | 1584 | ), |
| 1585 | |
| 1586 | TP_printk( |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 1587 | "error=%ld (%s) fileid=%02x:%02x:%llu fhandle=0x%08x " |
Trond Myklebust | 7cd1486 | 2015-08-20 20:07:54 -0500 | [diff] [blame] | 1588 | "dstaddr=%s", |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 1589 | -__entry->error, |
Trond Myklebust | 7cd1486 | 2015-08-20 20:07:54 -0500 | [diff] [blame] | 1590 | show_nfsv4_errors(__entry->error), |
| 1591 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 1592 | (unsigned long long)__entry->fileid, |
| 1593 | __entry->fhandle, |
| 1594 | __get_str(dstaddr) |
| 1595 | ) |
| 1596 | ); |
| 1597 | |
| 1598 | #define DEFINE_NFS4_INODE_CALLBACK_EVENT(name) \ |
| 1599 | DEFINE_EVENT(nfs4_inode_callback_event, name, \ |
| 1600 | TP_PROTO( \ |
| 1601 | const struct nfs_client *clp, \ |
| 1602 | const struct nfs_fh *fhandle, \ |
| 1603 | const struct inode *inode, \ |
| 1604 | int error \ |
| 1605 | ), \ |
| 1606 | TP_ARGS(clp, fhandle, inode, error)) |
| 1607 | DEFINE_NFS4_INODE_CALLBACK_EVENT(nfs4_cb_getattr); |
| 1608 | |
Trond Myklebust | e07db90 | 2015-12-28 14:07:23 -0500 | [diff] [blame] | 1609 | DECLARE_EVENT_CLASS(nfs4_inode_stateid_callback_event, |
| 1610 | TP_PROTO( |
| 1611 | const struct nfs_client *clp, |
| 1612 | const struct nfs_fh *fhandle, |
| 1613 | const struct inode *inode, |
| 1614 | const nfs4_stateid *stateid, |
| 1615 | int error |
| 1616 | ), |
| 1617 | |
| 1618 | TP_ARGS(clp, fhandle, inode, stateid, error), |
| 1619 | |
| 1620 | TP_STRUCT__entry( |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 1621 | __field(unsigned long, error) |
Trond Myklebust | e07db90 | 2015-12-28 14:07:23 -0500 | [diff] [blame] | 1622 | __field(dev_t, dev) |
| 1623 | __field(u32, fhandle) |
| 1624 | __field(u64, fileid) |
Anna Schumaker | 3944369 | 2017-11-01 15:48:43 -0400 | [diff] [blame] | 1625 | __string(dstaddr, clp ? clp->cl_hostname : "unknown") |
Trond Myklebust | e07db90 | 2015-12-28 14:07:23 -0500 | [diff] [blame] | 1626 | __field(int, stateid_seq) |
| 1627 | __field(u32, stateid_hash) |
| 1628 | ), |
| 1629 | |
| 1630 | TP_fast_assign( |
| 1631 | __entry->error = error; |
| 1632 | __entry->fhandle = nfs_fhandle_hash(fhandle); |
Trond Myklebust | 2a534a7 | 2018-08-23 11:02:49 -0400 | [diff] [blame] | 1633 | if (!IS_ERR_OR_NULL(inode)) { |
Trond Myklebust | e07db90 | 2015-12-28 14:07:23 -0500 | [diff] [blame] | 1634 | __entry->fileid = NFS_FILEID(inode); |
| 1635 | __entry->dev = inode->i_sb->s_dev; |
| 1636 | } else { |
| 1637 | __entry->fileid = 0; |
| 1638 | __entry->dev = 0; |
| 1639 | } |
Anna Schumaker | 3944369 | 2017-11-01 15:48:43 -0400 | [diff] [blame] | 1640 | __assign_str(dstaddr, clp ? clp->cl_hostname : "unknown") |
Trond Myklebust | e07db90 | 2015-12-28 14:07:23 -0500 | [diff] [blame] | 1641 | __entry->stateid_seq = |
| 1642 | be32_to_cpu(stateid->seqid); |
| 1643 | __entry->stateid_hash = |
| 1644 | nfs_stateid_hash(stateid); |
| 1645 | ), |
| 1646 | |
| 1647 | TP_printk( |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 1648 | "error=%ld (%s) fileid=%02x:%02x:%llu fhandle=0x%08x " |
Trond Myklebust | e07db90 | 2015-12-28 14:07:23 -0500 | [diff] [blame] | 1649 | "stateid=%d:0x%08x dstaddr=%s", |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 1650 | -__entry->error, |
Trond Myklebust | e07db90 | 2015-12-28 14:07:23 -0500 | [diff] [blame] | 1651 | show_nfsv4_errors(__entry->error), |
| 1652 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 1653 | (unsigned long long)__entry->fileid, |
| 1654 | __entry->fhandle, |
| 1655 | __entry->stateid_seq, __entry->stateid_hash, |
| 1656 | __get_str(dstaddr) |
| 1657 | ) |
| 1658 | ); |
| 1659 | |
| 1660 | #define DEFINE_NFS4_INODE_STATEID_CALLBACK_EVENT(name) \ |
| 1661 | DEFINE_EVENT(nfs4_inode_stateid_callback_event, name, \ |
| 1662 | TP_PROTO( \ |
| 1663 | const struct nfs_client *clp, \ |
| 1664 | const struct nfs_fh *fhandle, \ |
| 1665 | const struct inode *inode, \ |
| 1666 | const nfs4_stateid *stateid, \ |
| 1667 | int error \ |
| 1668 | ), \ |
| 1669 | TP_ARGS(clp, fhandle, inode, stateid, error)) |
| 1670 | DEFINE_NFS4_INODE_STATEID_CALLBACK_EVENT(nfs4_cb_recall); |
| 1671 | DEFINE_NFS4_INODE_STATEID_CALLBACK_EVENT(nfs4_cb_layoutrecall_file); |
Trond Myklebust | 7cd1486 | 2015-08-20 20:07:54 -0500 | [diff] [blame] | 1672 | |
Trond Myklebust | 1f2d30b | 2013-08-13 11:34:01 -0400 | [diff] [blame] | 1673 | DECLARE_EVENT_CLASS(nfs4_idmap_event, |
| 1674 | TP_PROTO( |
| 1675 | const char *name, |
| 1676 | int len, |
| 1677 | u32 id, |
| 1678 | int error |
| 1679 | ), |
| 1680 | |
| 1681 | TP_ARGS(name, len, id, error), |
| 1682 | |
| 1683 | TP_STRUCT__entry( |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 1684 | __field(unsigned long, error) |
Trond Myklebust | 1f2d30b | 2013-08-13 11:34:01 -0400 | [diff] [blame] | 1685 | __field(u32, id) |
| 1686 | __dynamic_array(char, name, len > 0 ? len + 1 : 1) |
| 1687 | ), |
| 1688 | |
| 1689 | TP_fast_assign( |
| 1690 | if (len < 0) |
| 1691 | len = 0; |
| 1692 | __entry->error = error < 0 ? error : 0; |
| 1693 | __entry->id = id; |
Daniel Bristot de Oliveira | 752d596 | 2016-07-01 20:44:36 -0300 | [diff] [blame] | 1694 | memcpy(__get_str(name), name, len); |
| 1695 | __get_str(name)[len] = 0; |
Trond Myklebust | 1f2d30b | 2013-08-13 11:34:01 -0400 | [diff] [blame] | 1696 | ), |
| 1697 | |
| 1698 | TP_printk( |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 1699 | "error=%ld (%s) id=%u name=%s", |
| 1700 | -__entry->error, show_nfsv4_errors(__entry->error), |
Trond Myklebust | 1f2d30b | 2013-08-13 11:34:01 -0400 | [diff] [blame] | 1701 | __entry->id, |
| 1702 | __get_str(name) |
| 1703 | ) |
| 1704 | ); |
| 1705 | #define DEFINE_NFS4_IDMAP_EVENT(name) \ |
| 1706 | DEFINE_EVENT(nfs4_idmap_event, name, \ |
| 1707 | TP_PROTO( \ |
| 1708 | const char *name, \ |
| 1709 | int len, \ |
| 1710 | u32 id, \ |
| 1711 | int error \ |
| 1712 | ), \ |
| 1713 | TP_ARGS(name, len, id, error)) |
| 1714 | DEFINE_NFS4_IDMAP_EVENT(nfs4_map_name_to_uid); |
| 1715 | DEFINE_NFS4_IDMAP_EVENT(nfs4_map_group_to_gid); |
| 1716 | DEFINE_NFS4_IDMAP_EVENT(nfs4_map_uid_to_name); |
| 1717 | DEFINE_NFS4_IDMAP_EVENT(nfs4_map_gid_to_group); |
| 1718 | |
Trond Myklebust | cc668ab | 2013-08-14 15:31:28 -0400 | [diff] [blame] | 1719 | DECLARE_EVENT_CLASS(nfs4_read_event, |
| 1720 | TP_PROTO( |
Weston Andros Adamson | d45f60c | 2014-06-09 11:48:35 -0400 | [diff] [blame] | 1721 | const struct nfs_pgio_header *hdr, |
Trond Myklebust | cc668ab | 2013-08-14 15:31:28 -0400 | [diff] [blame] | 1722 | int error |
| 1723 | ), |
| 1724 | |
Weston Andros Adamson | d45f60c | 2014-06-09 11:48:35 -0400 | [diff] [blame] | 1725 | TP_ARGS(hdr, error), |
Trond Myklebust | cc668ab | 2013-08-14 15:31:28 -0400 | [diff] [blame] | 1726 | |
| 1727 | TP_STRUCT__entry( |
| 1728 | __field(dev_t, dev) |
| 1729 | __field(u32, fhandle) |
| 1730 | __field(u64, fileid) |
| 1731 | __field(loff_t, offset) |
| 1732 | __field(size_t, count) |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 1733 | __field(unsigned long, error) |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 1734 | __field(int, stateid_seq) |
| 1735 | __field(u32, stateid_hash) |
Trond Myklebust | cc668ab | 2013-08-14 15:31:28 -0400 | [diff] [blame] | 1736 | ), |
| 1737 | |
| 1738 | TP_fast_assign( |
Weston Andros Adamson | d45f60c | 2014-06-09 11:48:35 -0400 | [diff] [blame] | 1739 | const struct inode *inode = hdr->inode; |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 1740 | const struct nfs4_state *state = |
| 1741 | hdr->args.context->state; |
Trond Myklebust | cc668ab | 2013-08-14 15:31:28 -0400 | [diff] [blame] | 1742 | __entry->dev = inode->i_sb->s_dev; |
| 1743 | __entry->fileid = NFS_FILEID(inode); |
| 1744 | __entry->fhandle = nfs_fhandle_hash(NFS_FH(inode)); |
Weston Andros Adamson | d45f60c | 2014-06-09 11:48:35 -0400 | [diff] [blame] | 1745 | __entry->offset = hdr->args.offset; |
| 1746 | __entry->count = hdr->args.count; |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 1747 | __entry->error = error < 0 ? -error : 0; |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 1748 | __entry->stateid_seq = |
| 1749 | be32_to_cpu(state->stateid.seqid); |
| 1750 | __entry->stateid_hash = |
| 1751 | nfs_stateid_hash(&state->stateid); |
Trond Myklebust | cc668ab | 2013-08-14 15:31:28 -0400 | [diff] [blame] | 1752 | ), |
| 1753 | |
| 1754 | TP_printk( |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 1755 | "error=%ld (%s) fileid=%02x:%02x:%llu fhandle=0x%08x " |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 1756 | "offset=%lld count=%zu stateid=%d:0x%08x", |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 1757 | -__entry->error, |
Trond Myklebust | cc668ab | 2013-08-14 15:31:28 -0400 | [diff] [blame] | 1758 | show_nfsv4_errors(__entry->error), |
| 1759 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 1760 | (unsigned long long)__entry->fileid, |
| 1761 | __entry->fhandle, |
| 1762 | (long long)__entry->offset, |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 1763 | __entry->count, |
| 1764 | __entry->stateid_seq, __entry->stateid_hash |
Trond Myklebust | cc668ab | 2013-08-14 15:31:28 -0400 | [diff] [blame] | 1765 | ) |
| 1766 | ); |
| 1767 | #define DEFINE_NFS4_READ_EVENT(name) \ |
| 1768 | DEFINE_EVENT(nfs4_read_event, name, \ |
| 1769 | TP_PROTO( \ |
Weston Andros Adamson | d45f60c | 2014-06-09 11:48:35 -0400 | [diff] [blame] | 1770 | const struct nfs_pgio_header *hdr, \ |
Trond Myklebust | cc668ab | 2013-08-14 15:31:28 -0400 | [diff] [blame] | 1771 | int error \ |
| 1772 | ), \ |
Weston Andros Adamson | d45f60c | 2014-06-09 11:48:35 -0400 | [diff] [blame] | 1773 | TP_ARGS(hdr, error)) |
Trond Myklebust | cc668ab | 2013-08-14 15:31:28 -0400 | [diff] [blame] | 1774 | DEFINE_NFS4_READ_EVENT(nfs4_read); |
| 1775 | #ifdef CONFIG_NFS_V4_1 |
| 1776 | DEFINE_NFS4_READ_EVENT(nfs4_pnfs_read); |
| 1777 | #endif /* CONFIG_NFS_V4_1 */ |
| 1778 | |
| 1779 | DECLARE_EVENT_CLASS(nfs4_write_event, |
| 1780 | TP_PROTO( |
Weston Andros Adamson | d45f60c | 2014-06-09 11:48:35 -0400 | [diff] [blame] | 1781 | const struct nfs_pgio_header *hdr, |
Trond Myklebust | cc668ab | 2013-08-14 15:31:28 -0400 | [diff] [blame] | 1782 | int error |
| 1783 | ), |
| 1784 | |
Weston Andros Adamson | d45f60c | 2014-06-09 11:48:35 -0400 | [diff] [blame] | 1785 | TP_ARGS(hdr, error), |
Trond Myklebust | cc668ab | 2013-08-14 15:31:28 -0400 | [diff] [blame] | 1786 | |
| 1787 | TP_STRUCT__entry( |
| 1788 | __field(dev_t, dev) |
| 1789 | __field(u32, fhandle) |
| 1790 | __field(u64, fileid) |
| 1791 | __field(loff_t, offset) |
| 1792 | __field(size_t, count) |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 1793 | __field(unsigned long, error) |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 1794 | __field(int, stateid_seq) |
| 1795 | __field(u32, stateid_hash) |
Trond Myklebust | cc668ab | 2013-08-14 15:31:28 -0400 | [diff] [blame] | 1796 | ), |
| 1797 | |
| 1798 | TP_fast_assign( |
Weston Andros Adamson | d45f60c | 2014-06-09 11:48:35 -0400 | [diff] [blame] | 1799 | const struct inode *inode = hdr->inode; |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 1800 | const struct nfs4_state *state = |
| 1801 | hdr->args.context->state; |
Trond Myklebust | cc668ab | 2013-08-14 15:31:28 -0400 | [diff] [blame] | 1802 | __entry->dev = inode->i_sb->s_dev; |
| 1803 | __entry->fileid = NFS_FILEID(inode); |
| 1804 | __entry->fhandle = nfs_fhandle_hash(NFS_FH(inode)); |
Weston Andros Adamson | d45f60c | 2014-06-09 11:48:35 -0400 | [diff] [blame] | 1805 | __entry->offset = hdr->args.offset; |
| 1806 | __entry->count = hdr->args.count; |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 1807 | __entry->error = error < 0 ? -error : 0; |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 1808 | __entry->stateid_seq = |
| 1809 | be32_to_cpu(state->stateid.seqid); |
| 1810 | __entry->stateid_hash = |
| 1811 | nfs_stateid_hash(&state->stateid); |
Trond Myklebust | cc668ab | 2013-08-14 15:31:28 -0400 | [diff] [blame] | 1812 | ), |
| 1813 | |
| 1814 | TP_printk( |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 1815 | "error=%ld (%s) fileid=%02x:%02x:%llu fhandle=0x%08x " |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 1816 | "offset=%lld count=%zu stateid=%d:0x%08x", |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 1817 | -__entry->error, |
Trond Myklebust | cc668ab | 2013-08-14 15:31:28 -0400 | [diff] [blame] | 1818 | show_nfsv4_errors(__entry->error), |
| 1819 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 1820 | (unsigned long long)__entry->fileid, |
| 1821 | __entry->fhandle, |
| 1822 | (long long)__entry->offset, |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 1823 | __entry->count, |
| 1824 | __entry->stateid_seq, __entry->stateid_hash |
Trond Myklebust | cc668ab | 2013-08-14 15:31:28 -0400 | [diff] [blame] | 1825 | ) |
| 1826 | ); |
| 1827 | |
| 1828 | #define DEFINE_NFS4_WRITE_EVENT(name) \ |
| 1829 | DEFINE_EVENT(nfs4_write_event, name, \ |
| 1830 | TP_PROTO( \ |
Weston Andros Adamson | d45f60c | 2014-06-09 11:48:35 -0400 | [diff] [blame] | 1831 | const struct nfs_pgio_header *hdr, \ |
Trond Myklebust | cc668ab | 2013-08-14 15:31:28 -0400 | [diff] [blame] | 1832 | int error \ |
| 1833 | ), \ |
Weston Andros Adamson | d45f60c | 2014-06-09 11:48:35 -0400 | [diff] [blame] | 1834 | TP_ARGS(hdr, error)) |
Trond Myklebust | cc668ab | 2013-08-14 15:31:28 -0400 | [diff] [blame] | 1835 | DEFINE_NFS4_WRITE_EVENT(nfs4_write); |
| 1836 | #ifdef CONFIG_NFS_V4_1 |
| 1837 | DEFINE_NFS4_WRITE_EVENT(nfs4_pnfs_write); |
| 1838 | #endif /* CONFIG_NFS_V4_1 */ |
| 1839 | |
| 1840 | DECLARE_EVENT_CLASS(nfs4_commit_event, |
| 1841 | TP_PROTO( |
| 1842 | const struct nfs_commit_data *data, |
| 1843 | int error |
| 1844 | ), |
| 1845 | |
| 1846 | TP_ARGS(data, error), |
| 1847 | |
| 1848 | TP_STRUCT__entry( |
| 1849 | __field(dev_t, dev) |
| 1850 | __field(u32, fhandle) |
| 1851 | __field(u64, fileid) |
| 1852 | __field(loff_t, offset) |
| 1853 | __field(size_t, count) |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 1854 | __field(unsigned long, error) |
Trond Myklebust | cc668ab | 2013-08-14 15:31:28 -0400 | [diff] [blame] | 1855 | ), |
| 1856 | |
| 1857 | TP_fast_assign( |
| 1858 | const struct inode *inode = data->inode; |
| 1859 | __entry->dev = inode->i_sb->s_dev; |
| 1860 | __entry->fileid = NFS_FILEID(inode); |
| 1861 | __entry->fhandle = nfs_fhandle_hash(NFS_FH(inode)); |
| 1862 | __entry->offset = data->args.offset; |
| 1863 | __entry->count = data->args.count; |
| 1864 | __entry->error = error; |
| 1865 | ), |
| 1866 | |
| 1867 | TP_printk( |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 1868 | "error=%ld (%s) fileid=%02x:%02x:%llu fhandle=0x%08x " |
Trond Myklebust | cc668ab | 2013-08-14 15:31:28 -0400 | [diff] [blame] | 1869 | "offset=%lld count=%zu", |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 1870 | -__entry->error, |
Trond Myklebust | cc668ab | 2013-08-14 15:31:28 -0400 | [diff] [blame] | 1871 | show_nfsv4_errors(__entry->error), |
| 1872 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 1873 | (unsigned long long)__entry->fileid, |
| 1874 | __entry->fhandle, |
| 1875 | (long long)__entry->offset, |
| 1876 | __entry->count |
| 1877 | ) |
| 1878 | ); |
| 1879 | #define DEFINE_NFS4_COMMIT_EVENT(name) \ |
| 1880 | DEFINE_EVENT(nfs4_commit_event, name, \ |
| 1881 | TP_PROTO( \ |
| 1882 | const struct nfs_commit_data *data, \ |
| 1883 | int error \ |
| 1884 | ), \ |
| 1885 | TP_ARGS(data, error)) |
| 1886 | DEFINE_NFS4_COMMIT_EVENT(nfs4_commit); |
| 1887 | #ifdef CONFIG_NFS_V4_1 |
| 1888 | DEFINE_NFS4_COMMIT_EVENT(nfs4_pnfs_commit_ds); |
Trond Myklebust | 1037e6e | 2013-08-14 16:36:51 -0400 | [diff] [blame] | 1889 | |
Chuck Lever | 5b2095d | 2018-12-19 11:00:11 -0500 | [diff] [blame] | 1890 | TRACE_DEFINE_ENUM(IOMODE_READ); |
| 1891 | TRACE_DEFINE_ENUM(IOMODE_RW); |
| 1892 | TRACE_DEFINE_ENUM(IOMODE_ANY); |
| 1893 | |
Trond Myklebust | 1037e6e | 2013-08-14 16:36:51 -0400 | [diff] [blame] | 1894 | #define show_pnfs_iomode(iomode) \ |
| 1895 | __print_symbolic(iomode, \ |
| 1896 | { IOMODE_READ, "READ" }, \ |
| 1897 | { IOMODE_RW, "RW" }, \ |
| 1898 | { IOMODE_ANY, "ANY" }) |
| 1899 | |
| 1900 | TRACE_EVENT(nfs4_layoutget, |
| 1901 | TP_PROTO( |
| 1902 | const struct nfs_open_context *ctx, |
| 1903 | const struct pnfs_layout_range *args, |
| 1904 | const struct pnfs_layout_range *res, |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 1905 | const nfs4_stateid *layout_stateid, |
Trond Myklebust | 1037e6e | 2013-08-14 16:36:51 -0400 | [diff] [blame] | 1906 | int error |
| 1907 | ), |
| 1908 | |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 1909 | TP_ARGS(ctx, args, res, layout_stateid, error), |
Trond Myklebust | 1037e6e | 2013-08-14 16:36:51 -0400 | [diff] [blame] | 1910 | |
| 1911 | TP_STRUCT__entry( |
| 1912 | __field(dev_t, dev) |
| 1913 | __field(u32, fhandle) |
| 1914 | __field(u64, fileid) |
| 1915 | __field(u32, iomode) |
| 1916 | __field(u64, offset) |
| 1917 | __field(u64, count) |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 1918 | __field(unsigned long, error) |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 1919 | __field(int, stateid_seq) |
| 1920 | __field(u32, stateid_hash) |
| 1921 | __field(int, layoutstateid_seq) |
| 1922 | __field(u32, layoutstateid_hash) |
Trond Myklebust | 1037e6e | 2013-08-14 16:36:51 -0400 | [diff] [blame] | 1923 | ), |
| 1924 | |
| 1925 | TP_fast_assign( |
David Howells | 2b0143b | 2015-03-17 22:25:59 +0000 | [diff] [blame] | 1926 | const struct inode *inode = d_inode(ctx->dentry); |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 1927 | const struct nfs4_state *state = ctx->state; |
Trond Myklebust | 1037e6e | 2013-08-14 16:36:51 -0400 | [diff] [blame] | 1928 | __entry->dev = inode->i_sb->s_dev; |
| 1929 | __entry->fileid = NFS_FILEID(inode); |
| 1930 | __entry->fhandle = nfs_fhandle_hash(NFS_FH(inode)); |
| 1931 | __entry->iomode = args->iomode; |
| 1932 | __entry->offset = args->offset; |
| 1933 | __entry->count = args->length; |
| 1934 | __entry->error = error; |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 1935 | __entry->stateid_seq = |
| 1936 | be32_to_cpu(state->stateid.seqid); |
| 1937 | __entry->stateid_hash = |
| 1938 | nfs_stateid_hash(&state->stateid); |
| 1939 | if (!error) { |
| 1940 | __entry->layoutstateid_seq = |
| 1941 | be32_to_cpu(layout_stateid->seqid); |
| 1942 | __entry->layoutstateid_hash = |
| 1943 | nfs_stateid_hash(layout_stateid); |
| 1944 | } else { |
| 1945 | __entry->layoutstateid_seq = 0; |
| 1946 | __entry->layoutstateid_hash = 0; |
| 1947 | } |
Trond Myklebust | 1037e6e | 2013-08-14 16:36:51 -0400 | [diff] [blame] | 1948 | ), |
| 1949 | |
| 1950 | TP_printk( |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 1951 | "error=%ld (%s) fileid=%02x:%02x:%llu fhandle=0x%08x " |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 1952 | "iomode=%s offset=%llu count=%llu stateid=%d:0x%08x " |
| 1953 | "layoutstateid=%d:0x%08x", |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 1954 | -__entry->error, |
Trond Myklebust | 1037e6e | 2013-08-14 16:36:51 -0400 | [diff] [blame] | 1955 | show_nfsv4_errors(__entry->error), |
| 1956 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 1957 | (unsigned long long)__entry->fileid, |
| 1958 | __entry->fhandle, |
| 1959 | show_pnfs_iomode(__entry->iomode), |
| 1960 | (unsigned long long)__entry->offset, |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 1961 | (unsigned long long)__entry->count, |
| 1962 | __entry->stateid_seq, __entry->stateid_hash, |
| 1963 | __entry->layoutstateid_seq, __entry->layoutstateid_hash |
Trond Myklebust | 1037e6e | 2013-08-14 16:36:51 -0400 | [diff] [blame] | 1964 | ) |
| 1965 | ); |
| 1966 | |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 1967 | DEFINE_NFS4_INODE_STATEID_EVENT(nfs4_layoutcommit); |
| 1968 | DEFINE_NFS4_INODE_STATEID_EVENT(nfs4_layoutreturn); |
Trond Myklebust | 6a463beb | 2015-08-20 15:40:47 -0500 | [diff] [blame] | 1969 | DEFINE_NFS4_INODE_EVENT(nfs4_layoutreturn_on_close); |
Trond Myklebust | 1037e6e | 2013-08-14 16:36:51 -0400 | [diff] [blame] | 1970 | |
Chuck Lever | 5b2095d | 2018-12-19 11:00:11 -0500 | [diff] [blame] | 1971 | TRACE_DEFINE_ENUM(PNFS_UPDATE_LAYOUT_UNKNOWN); |
| 1972 | TRACE_DEFINE_ENUM(PNFS_UPDATE_LAYOUT_NO_PNFS); |
| 1973 | TRACE_DEFINE_ENUM(PNFS_UPDATE_LAYOUT_RD_ZEROLEN); |
| 1974 | TRACE_DEFINE_ENUM(PNFS_UPDATE_LAYOUT_MDSTHRESH); |
| 1975 | TRACE_DEFINE_ENUM(PNFS_UPDATE_LAYOUT_NOMEM); |
| 1976 | TRACE_DEFINE_ENUM(PNFS_UPDATE_LAYOUT_BULK_RECALL); |
| 1977 | TRACE_DEFINE_ENUM(PNFS_UPDATE_LAYOUT_IO_TEST_FAIL); |
| 1978 | TRACE_DEFINE_ENUM(PNFS_UPDATE_LAYOUT_FOUND_CACHED); |
| 1979 | TRACE_DEFINE_ENUM(PNFS_UPDATE_LAYOUT_RETURN); |
| 1980 | TRACE_DEFINE_ENUM(PNFS_UPDATE_LAYOUT_BLOCKED); |
| 1981 | TRACE_DEFINE_ENUM(PNFS_UPDATE_LAYOUT_INVALID_OPEN); |
| 1982 | TRACE_DEFINE_ENUM(PNFS_UPDATE_LAYOUT_RETRY); |
| 1983 | TRACE_DEFINE_ENUM(PNFS_UPDATE_LAYOUT_SEND_LAYOUTGET); |
Trond Myklebust | d5b9216 | 2019-07-18 09:32:17 -0400 | [diff] [blame] | 1984 | TRACE_DEFINE_ENUM(PNFS_UPDATE_LAYOUT_EXIT); |
Chuck Lever | 5b2095d | 2018-12-19 11:00:11 -0500 | [diff] [blame] | 1985 | |
Jeff Layton | 9a4bf31 | 2015-12-10 10:41:58 -0500 | [diff] [blame] | 1986 | #define show_pnfs_update_layout_reason(reason) \ |
| 1987 | __print_symbolic(reason, \ |
| 1988 | { PNFS_UPDATE_LAYOUT_UNKNOWN, "unknown" }, \ |
| 1989 | { PNFS_UPDATE_LAYOUT_NO_PNFS, "no pnfs" }, \ |
| 1990 | { PNFS_UPDATE_LAYOUT_RD_ZEROLEN, "read+zerolen" }, \ |
| 1991 | { PNFS_UPDATE_LAYOUT_MDSTHRESH, "mdsthresh" }, \ |
| 1992 | { PNFS_UPDATE_LAYOUT_NOMEM, "nomem" }, \ |
| 1993 | { PNFS_UPDATE_LAYOUT_BULK_RECALL, "bulk recall" }, \ |
| 1994 | { PNFS_UPDATE_LAYOUT_IO_TEST_FAIL, "io test fail" }, \ |
| 1995 | { PNFS_UPDATE_LAYOUT_FOUND_CACHED, "found cached" }, \ |
| 1996 | { PNFS_UPDATE_LAYOUT_RETURN, "layoutreturn" }, \ |
| 1997 | { PNFS_UPDATE_LAYOUT_BLOCKED, "layouts blocked" }, \ |
Jeff Layton | 183d9e7 | 2016-05-17 12:28:47 -0400 | [diff] [blame] | 1998 | { PNFS_UPDATE_LAYOUT_INVALID_OPEN, "invalid open" }, \ |
| 1999 | { PNFS_UPDATE_LAYOUT_RETRY, "retrying" }, \ |
Trond Myklebust | d5b9216 | 2019-07-18 09:32:17 -0400 | [diff] [blame] | 2000 | { PNFS_UPDATE_LAYOUT_SEND_LAYOUTGET, "sent layoutget" }, \ |
| 2001 | { PNFS_UPDATE_LAYOUT_EXIT, "exit" }) |
Jeff Layton | 9a4bf31 | 2015-12-10 10:41:58 -0500 | [diff] [blame] | 2002 | |
| 2003 | TRACE_EVENT(pnfs_update_layout, |
| 2004 | TP_PROTO(struct inode *inode, |
| 2005 | loff_t pos, |
| 2006 | u64 count, |
| 2007 | enum pnfs_iomode iomode, |
Trond Myklebust | f484830 | 2015-12-26 18:03:07 -0500 | [diff] [blame] | 2008 | struct pnfs_layout_hdr *lo, |
Jeff Layton | 183d9e7 | 2016-05-17 12:28:47 -0400 | [diff] [blame] | 2009 | struct pnfs_layout_segment *lseg, |
Jeff Layton | 9a4bf31 | 2015-12-10 10:41:58 -0500 | [diff] [blame] | 2010 | enum pnfs_update_layout_reason reason |
| 2011 | ), |
Jeff Layton | 183d9e7 | 2016-05-17 12:28:47 -0400 | [diff] [blame] | 2012 | TP_ARGS(inode, pos, count, iomode, lo, lseg, reason), |
Jeff Layton | 9a4bf31 | 2015-12-10 10:41:58 -0500 | [diff] [blame] | 2013 | TP_STRUCT__entry( |
| 2014 | __field(dev_t, dev) |
| 2015 | __field(u64, fileid) |
| 2016 | __field(u32, fhandle) |
| 2017 | __field(loff_t, pos) |
| 2018 | __field(u64, count) |
| 2019 | __field(enum pnfs_iomode, iomode) |
Trond Myklebust | f484830 | 2015-12-26 18:03:07 -0500 | [diff] [blame] | 2020 | __field(int, layoutstateid_seq) |
| 2021 | __field(u32, layoutstateid_hash) |
Jeff Layton | 183d9e7 | 2016-05-17 12:28:47 -0400 | [diff] [blame] | 2022 | __field(long, lseg) |
Jeff Layton | 9a4bf31 | 2015-12-10 10:41:58 -0500 | [diff] [blame] | 2023 | __field(enum pnfs_update_layout_reason, reason) |
| 2024 | ), |
| 2025 | TP_fast_assign( |
| 2026 | __entry->dev = inode->i_sb->s_dev; |
| 2027 | __entry->fileid = NFS_FILEID(inode); |
| 2028 | __entry->fhandle = nfs_fhandle_hash(NFS_FH(inode)); |
| 2029 | __entry->pos = pos; |
| 2030 | __entry->count = count; |
| 2031 | __entry->iomode = iomode; |
Jeff Layton | 9a4bf31 | 2015-12-10 10:41:58 -0500 | [diff] [blame] | 2032 | __entry->reason = reason; |
Trond Myklebust | f484830 | 2015-12-26 18:03:07 -0500 | [diff] [blame] | 2033 | if (lo != NULL) { |
| 2034 | __entry->layoutstateid_seq = |
| 2035 | be32_to_cpu(lo->plh_stateid.seqid); |
| 2036 | __entry->layoutstateid_hash = |
| 2037 | nfs_stateid_hash(&lo->plh_stateid); |
| 2038 | } else { |
| 2039 | __entry->layoutstateid_seq = 0; |
| 2040 | __entry->layoutstateid_hash = 0; |
| 2041 | } |
Jeff Layton | 183d9e7 | 2016-05-17 12:28:47 -0400 | [diff] [blame] | 2042 | __entry->lseg = (long)lseg; |
Jeff Layton | 9a4bf31 | 2015-12-10 10:41:58 -0500 | [diff] [blame] | 2043 | ), |
| 2044 | TP_printk( |
| 2045 | "fileid=%02x:%02x:%llu fhandle=0x%08x " |
Trond Myklebust | f484830 | 2015-12-26 18:03:07 -0500 | [diff] [blame] | 2046 | "iomode=%s pos=%llu count=%llu " |
Jeff Layton | 183d9e7 | 2016-05-17 12:28:47 -0400 | [diff] [blame] | 2047 | "layoutstateid=%d:0x%08x lseg=0x%lx (%s)", |
Jeff Layton | 9a4bf31 | 2015-12-10 10:41:58 -0500 | [diff] [blame] | 2048 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 2049 | (unsigned long long)__entry->fileid, |
| 2050 | __entry->fhandle, |
| 2051 | show_pnfs_iomode(__entry->iomode), |
| 2052 | (unsigned long long)__entry->pos, |
Trond Myklebust | f484830 | 2015-12-26 18:03:07 -0500 | [diff] [blame] | 2053 | (unsigned long long)__entry->count, |
| 2054 | __entry->layoutstateid_seq, __entry->layoutstateid_hash, |
Jeff Layton | 183d9e7 | 2016-05-17 12:28:47 -0400 | [diff] [blame] | 2055 | __entry->lseg, |
Jeff Layton | 9a4bf31 | 2015-12-10 10:41:58 -0500 | [diff] [blame] | 2056 | show_pnfs_update_layout_reason(__entry->reason) |
| 2057 | ) |
| 2058 | ); |
| 2059 | |
Trond Myklebust | d5b9216 | 2019-07-18 09:32:17 -0400 | [diff] [blame] | 2060 | DECLARE_EVENT_CLASS(pnfs_layout_event, |
| 2061 | TP_PROTO(struct inode *inode, |
| 2062 | loff_t pos, |
| 2063 | u64 count, |
| 2064 | enum pnfs_iomode iomode, |
| 2065 | struct pnfs_layout_hdr *lo, |
| 2066 | struct pnfs_layout_segment *lseg |
| 2067 | ), |
| 2068 | TP_ARGS(inode, pos, count, iomode, lo, lseg), |
| 2069 | TP_STRUCT__entry( |
| 2070 | __field(dev_t, dev) |
| 2071 | __field(u64, fileid) |
| 2072 | __field(u32, fhandle) |
| 2073 | __field(loff_t, pos) |
| 2074 | __field(u64, count) |
| 2075 | __field(enum pnfs_iomode, iomode) |
| 2076 | __field(int, layoutstateid_seq) |
| 2077 | __field(u32, layoutstateid_hash) |
| 2078 | __field(long, lseg) |
| 2079 | ), |
| 2080 | TP_fast_assign( |
| 2081 | __entry->dev = inode->i_sb->s_dev; |
| 2082 | __entry->fileid = NFS_FILEID(inode); |
| 2083 | __entry->fhandle = nfs_fhandle_hash(NFS_FH(inode)); |
| 2084 | __entry->pos = pos; |
| 2085 | __entry->count = count; |
| 2086 | __entry->iomode = iomode; |
| 2087 | if (lo != NULL) { |
| 2088 | __entry->layoutstateid_seq = |
| 2089 | be32_to_cpu(lo->plh_stateid.seqid); |
| 2090 | __entry->layoutstateid_hash = |
| 2091 | nfs_stateid_hash(&lo->plh_stateid); |
| 2092 | } else { |
| 2093 | __entry->layoutstateid_seq = 0; |
| 2094 | __entry->layoutstateid_hash = 0; |
| 2095 | } |
| 2096 | __entry->lseg = (long)lseg; |
| 2097 | ), |
| 2098 | TP_printk( |
| 2099 | "fileid=%02x:%02x:%llu fhandle=0x%08x " |
| 2100 | "iomode=%s pos=%llu count=%llu " |
| 2101 | "layoutstateid=%d:0x%08x lseg=0x%lx", |
| 2102 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 2103 | (unsigned long long)__entry->fileid, |
| 2104 | __entry->fhandle, |
| 2105 | show_pnfs_iomode(__entry->iomode), |
| 2106 | (unsigned long long)__entry->pos, |
| 2107 | (unsigned long long)__entry->count, |
| 2108 | __entry->layoutstateid_seq, __entry->layoutstateid_hash, |
| 2109 | __entry->lseg |
| 2110 | ) |
| 2111 | ); |
| 2112 | |
| 2113 | #define DEFINE_PNFS_LAYOUT_EVENT(name) \ |
| 2114 | DEFINE_EVENT(pnfs_layout_event, name, \ |
| 2115 | TP_PROTO(struct inode *inode, \ |
| 2116 | loff_t pos, \ |
| 2117 | u64 count, \ |
| 2118 | enum pnfs_iomode iomode, \ |
| 2119 | struct pnfs_layout_hdr *lo, \ |
| 2120 | struct pnfs_layout_segment *lseg \ |
| 2121 | ), \ |
| 2122 | TP_ARGS(inode, pos, count, iomode, lo, lseg)) |
| 2123 | |
| 2124 | DEFINE_PNFS_LAYOUT_EVENT(pnfs_mds_fallback_pg_init_read); |
| 2125 | DEFINE_PNFS_LAYOUT_EVENT(pnfs_mds_fallback_pg_init_write); |
| 2126 | DEFINE_PNFS_LAYOUT_EVENT(pnfs_mds_fallback_pg_get_mirror_count); |
| 2127 | DEFINE_PNFS_LAYOUT_EVENT(pnfs_mds_fallback_read_done); |
| 2128 | DEFINE_PNFS_LAYOUT_EVENT(pnfs_mds_fallback_write_done); |
| 2129 | DEFINE_PNFS_LAYOUT_EVENT(pnfs_mds_fallback_read_pagelist); |
| 2130 | DEFINE_PNFS_LAYOUT_EVENT(pnfs_mds_fallback_write_pagelist); |
| 2131 | |
Trond Myklebust | cc668ab | 2013-08-14 15:31:28 -0400 | [diff] [blame] | 2132 | #endif /* CONFIG_NFS_V4_1 */ |
| 2133 | |
Trond Myklebust | c6d01c6 | 2013-08-09 11:51:26 -0400 | [diff] [blame] | 2134 | #endif /* _TRACE_NFS4_H */ |
| 2135 | |
| 2136 | #undef TRACE_INCLUDE_PATH |
| 2137 | #define TRACE_INCLUDE_PATH . |
| 2138 | #define TRACE_INCLUDE_FILE nfs4trace |
| 2139 | /* This part must be outside protection */ |
| 2140 | #include <trace/define_trace.h> |