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 | f23f658 | 2019-02-11 11:24:26 -0500 | [diff] [blame] | 565 | TRACE_EVENT(nfs4_xdr_status, |
| 566 | TP_PROTO( |
| 567 | u32 op, |
| 568 | int error |
| 569 | ), |
| 570 | |
| 571 | TP_ARGS(op, error), |
| 572 | |
| 573 | TP_STRUCT__entry( |
| 574 | __field(u32, op) |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame^] | 575 | __field(unsigned long, error) |
Chuck Lever | f23f658 | 2019-02-11 11:24:26 -0500 | [diff] [blame] | 576 | ), |
| 577 | |
| 578 | TP_fast_assign( |
| 579 | __entry->op = op; |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame^] | 580 | __entry->error = error; |
Chuck Lever | f23f658 | 2019-02-11 11:24:26 -0500 | [diff] [blame] | 581 | ), |
| 582 | |
| 583 | TP_printk( |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame^] | 584 | "error=%ld (%s) operation %d:", |
| 585 | -__entry->error, show_nfsv4_errors(__entry->error), |
| 586 | __entry->op |
Chuck Lever | f23f658 | 2019-02-11 11:24:26 -0500 | [diff] [blame] | 587 | ) |
| 588 | ); |
| 589 | |
Trond Myklebust | 42113a7 | 2013-08-12 16:19:27 -0400 | [diff] [blame] | 590 | DECLARE_EVENT_CLASS(nfs4_open_event, |
| 591 | TP_PROTO( |
| 592 | const struct nfs_open_context *ctx, |
| 593 | int flags, |
| 594 | int error |
| 595 | ), |
| 596 | |
| 597 | TP_ARGS(ctx, flags, error), |
| 598 | |
| 599 | TP_STRUCT__entry( |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame^] | 600 | __field(unsigned long, error) |
Trond Myklebust | 42113a7 | 2013-08-12 16:19:27 -0400 | [diff] [blame] | 601 | __field(unsigned int, flags) |
| 602 | __field(unsigned int, fmode) |
| 603 | __field(dev_t, dev) |
| 604 | __field(u32, fhandle) |
| 605 | __field(u64, fileid) |
| 606 | __field(u64, dir) |
| 607 | __string(name, ctx->dentry->d_name.name) |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 608 | __field(int, stateid_seq) |
| 609 | __field(u32, stateid_hash) |
| 610 | __field(int, openstateid_seq) |
| 611 | __field(u32, openstateid_hash) |
Trond Myklebust | 42113a7 | 2013-08-12 16:19:27 -0400 | [diff] [blame] | 612 | ), |
| 613 | |
| 614 | TP_fast_assign( |
| 615 | const struct nfs4_state *state = ctx->state; |
| 616 | const struct inode *inode = NULL; |
| 617 | |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame^] | 618 | __entry->error = -error; |
Trond Myklebust | 42113a7 | 2013-08-12 16:19:27 -0400 | [diff] [blame] | 619 | __entry->flags = flags; |
| 620 | __entry->fmode = (__force unsigned int)ctx->mode; |
| 621 | __entry->dev = ctx->dentry->d_sb->s_dev; |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 622 | if (!IS_ERR_OR_NULL(state)) { |
Trond Myklebust | 42113a7 | 2013-08-12 16:19:27 -0400 | [diff] [blame] | 623 | inode = state->inode; |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 624 | __entry->stateid_seq = |
| 625 | be32_to_cpu(state->stateid.seqid); |
| 626 | __entry->stateid_hash = |
| 627 | nfs_stateid_hash(&state->stateid); |
| 628 | __entry->openstateid_seq = |
| 629 | be32_to_cpu(state->open_stateid.seqid); |
| 630 | __entry->openstateid_hash = |
| 631 | nfs_stateid_hash(&state->open_stateid); |
| 632 | } else { |
| 633 | __entry->stateid_seq = 0; |
| 634 | __entry->stateid_hash = 0; |
| 635 | __entry->openstateid_seq = 0; |
| 636 | __entry->openstateid_hash = 0; |
| 637 | } |
Trond Myklebust | 42113a7 | 2013-08-12 16:19:27 -0400 | [diff] [blame] | 638 | if (inode != NULL) { |
| 639 | __entry->fileid = NFS_FILEID(inode); |
| 640 | __entry->fhandle = nfs_fhandle_hash(NFS_FH(inode)); |
| 641 | } else { |
| 642 | __entry->fileid = 0; |
| 643 | __entry->fhandle = 0; |
| 644 | } |
David Howells | 2b0143b | 2015-03-17 22:25:59 +0000 | [diff] [blame] | 645 | __entry->dir = NFS_FILEID(d_inode(ctx->dentry->d_parent)); |
Trond Myklebust | 42113a7 | 2013-08-12 16:19:27 -0400 | [diff] [blame] | 646 | __assign_str(name, ctx->dentry->d_name.name); |
| 647 | ), |
| 648 | |
| 649 | TP_printk( |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame^] | 650 | "error=%ld (%s) flags=%d (%s) fmode=%s " |
Trond Myklebust | 42113a7 | 2013-08-12 16:19:27 -0400 | [diff] [blame] | 651 | "fileid=%02x:%02x:%llu fhandle=0x%08x " |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 652 | "name=%02x:%02x:%llu/%s stateid=%d:0x%08x " |
| 653 | "openstateid=%d:0x%08x", |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame^] | 654 | -__entry->error, |
Trond Myklebust | 42113a7 | 2013-08-12 16:19:27 -0400 | [diff] [blame] | 655 | show_nfsv4_errors(__entry->error), |
| 656 | __entry->flags, |
| 657 | show_open_flags(__entry->flags), |
| 658 | show_fmode_flags(__entry->fmode), |
| 659 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 660 | (unsigned long long)__entry->fileid, |
| 661 | __entry->fhandle, |
| 662 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 663 | (unsigned long long)__entry->dir, |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 664 | __get_str(name), |
| 665 | __entry->stateid_seq, __entry->stateid_hash, |
| 666 | __entry->openstateid_seq, __entry->openstateid_hash |
Trond Myklebust | 42113a7 | 2013-08-12 16:19:27 -0400 | [diff] [blame] | 667 | ) |
| 668 | ); |
| 669 | |
| 670 | #define DEFINE_NFS4_OPEN_EVENT(name) \ |
| 671 | DEFINE_EVENT(nfs4_open_event, name, \ |
| 672 | TP_PROTO( \ |
| 673 | const struct nfs_open_context *ctx, \ |
| 674 | int flags, \ |
| 675 | int error \ |
| 676 | ), \ |
| 677 | TP_ARGS(ctx, flags, error)) |
| 678 | DEFINE_NFS4_OPEN_EVENT(nfs4_open_reclaim); |
| 679 | DEFINE_NFS4_OPEN_EVENT(nfs4_open_expired); |
| 680 | DEFINE_NFS4_OPEN_EVENT(nfs4_open_file); |
| 681 | |
Olga Kornievskaia | 9759b0f | 2015-11-24 13:29:42 -0500 | [diff] [blame] | 682 | TRACE_EVENT(nfs4_cached_open, |
| 683 | TP_PROTO( |
| 684 | const struct nfs4_state *state |
| 685 | ), |
| 686 | TP_ARGS(state), |
| 687 | TP_STRUCT__entry( |
| 688 | __field(dev_t, dev) |
| 689 | __field(u32, fhandle) |
| 690 | __field(u64, fileid) |
| 691 | __field(unsigned int, fmode) |
| 692 | __field(int, stateid_seq) |
| 693 | __field(u32, stateid_hash) |
| 694 | ), |
| 695 | |
| 696 | TP_fast_assign( |
| 697 | const struct inode *inode = state->inode; |
| 698 | |
| 699 | __entry->dev = inode->i_sb->s_dev; |
| 700 | __entry->fileid = NFS_FILEID(inode); |
| 701 | __entry->fhandle = nfs_fhandle_hash(NFS_FH(inode)); |
| 702 | __entry->fmode = (__force unsigned int)state->state; |
| 703 | __entry->stateid_seq = |
| 704 | be32_to_cpu(state->stateid.seqid); |
| 705 | __entry->stateid_hash = |
| 706 | nfs_stateid_hash(&state->stateid); |
| 707 | ), |
| 708 | |
| 709 | TP_printk( |
| 710 | "fmode=%s fileid=%02x:%02x:%llu " |
| 711 | "fhandle=0x%08x stateid=%d:0x%08x", |
| 712 | __entry->fmode ? show_fmode_flags(__entry->fmode) : |
| 713 | "closed", |
| 714 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 715 | (unsigned long long)__entry->fileid, |
| 716 | __entry->fhandle, |
| 717 | __entry->stateid_seq, __entry->stateid_hash |
| 718 | ) |
| 719 | ); |
| 720 | |
Trond Myklebust | 42113a7 | 2013-08-12 16:19:27 -0400 | [diff] [blame] | 721 | TRACE_EVENT(nfs4_close, |
| 722 | TP_PROTO( |
| 723 | const struct nfs4_state *state, |
| 724 | const struct nfs_closeargs *args, |
| 725 | const struct nfs_closeres *res, |
| 726 | int error |
| 727 | ), |
| 728 | |
| 729 | TP_ARGS(state, args, res, error), |
| 730 | |
| 731 | TP_STRUCT__entry( |
| 732 | __field(dev_t, dev) |
| 733 | __field(u32, fhandle) |
| 734 | __field(u64, fileid) |
| 735 | __field(unsigned int, fmode) |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame^] | 736 | __field(unsigned long, error) |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 737 | __field(int, stateid_seq) |
| 738 | __field(u32, stateid_hash) |
Trond Myklebust | 42113a7 | 2013-08-12 16:19:27 -0400 | [diff] [blame] | 739 | ), |
| 740 | |
| 741 | TP_fast_assign( |
| 742 | const struct inode *inode = state->inode; |
| 743 | |
| 744 | __entry->dev = inode->i_sb->s_dev; |
| 745 | __entry->fileid = NFS_FILEID(inode); |
| 746 | __entry->fhandle = nfs_fhandle_hash(NFS_FH(inode)); |
| 747 | __entry->fmode = (__force unsigned int)state->state; |
| 748 | __entry->error = error; |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 749 | __entry->stateid_seq = |
| 750 | be32_to_cpu(args->stateid.seqid); |
| 751 | __entry->stateid_hash = |
| 752 | nfs_stateid_hash(&args->stateid); |
Trond Myklebust | 42113a7 | 2013-08-12 16:19:27 -0400 | [diff] [blame] | 753 | ), |
| 754 | |
| 755 | TP_printk( |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame^] | 756 | "error=%ld (%s) fmode=%s fileid=%02x:%02x:%llu " |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 757 | "fhandle=0x%08x openstateid=%d:0x%08x", |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame^] | 758 | -__entry->error, |
Trond Myklebust | 42113a7 | 2013-08-12 16:19:27 -0400 | [diff] [blame] | 759 | show_nfsv4_errors(__entry->error), |
| 760 | __entry->fmode ? show_fmode_flags(__entry->fmode) : |
| 761 | "closed", |
| 762 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 763 | (unsigned long long)__entry->fileid, |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 764 | __entry->fhandle, |
| 765 | __entry->stateid_seq, __entry->stateid_hash |
Trond Myklebust | 42113a7 | 2013-08-12 16:19:27 -0400 | [diff] [blame] | 766 | ) |
| 767 | ); |
| 768 | |
Chuck Lever | 5b2095d | 2018-12-19 11:00:11 -0500 | [diff] [blame] | 769 | TRACE_DEFINE_ENUM(F_GETLK); |
| 770 | TRACE_DEFINE_ENUM(F_SETLK); |
| 771 | TRACE_DEFINE_ENUM(F_SETLKW); |
| 772 | TRACE_DEFINE_ENUM(F_RDLCK); |
| 773 | TRACE_DEFINE_ENUM(F_WRLCK); |
| 774 | TRACE_DEFINE_ENUM(F_UNLCK); |
| 775 | |
Trond Myklebust | d1b748a | 2013-08-12 16:35:20 -0400 | [diff] [blame] | 776 | #define show_lock_cmd(type) \ |
| 777 | __print_symbolic((int)type, \ |
| 778 | { F_GETLK, "GETLK" }, \ |
| 779 | { F_SETLK, "SETLK" }, \ |
| 780 | { F_SETLKW, "SETLKW" }) |
| 781 | #define show_lock_type(type) \ |
| 782 | __print_symbolic((int)type, \ |
| 783 | { F_RDLCK, "RDLCK" }, \ |
| 784 | { F_WRLCK, "WRLCK" }, \ |
| 785 | { F_UNLCK, "UNLCK" }) |
| 786 | |
| 787 | DECLARE_EVENT_CLASS(nfs4_lock_event, |
| 788 | TP_PROTO( |
| 789 | const struct file_lock *request, |
| 790 | const struct nfs4_state *state, |
| 791 | int cmd, |
| 792 | int error |
| 793 | ), |
| 794 | |
| 795 | TP_ARGS(request, state, cmd, error), |
| 796 | |
| 797 | TP_STRUCT__entry( |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame^] | 798 | __field(unsigned long, error) |
Trond Myklebust | d1b748a | 2013-08-12 16:35:20 -0400 | [diff] [blame] | 799 | __field(int, cmd) |
| 800 | __field(char, type) |
| 801 | __field(loff_t, start) |
| 802 | __field(loff_t, end) |
| 803 | __field(dev_t, dev) |
| 804 | __field(u32, fhandle) |
| 805 | __field(u64, fileid) |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 806 | __field(int, stateid_seq) |
| 807 | __field(u32, stateid_hash) |
Trond Myklebust | d1b748a | 2013-08-12 16:35:20 -0400 | [diff] [blame] | 808 | ), |
| 809 | |
| 810 | TP_fast_assign( |
| 811 | const struct inode *inode = state->inode; |
| 812 | |
| 813 | __entry->error = error; |
| 814 | __entry->cmd = cmd; |
| 815 | __entry->type = request->fl_type; |
| 816 | __entry->start = request->fl_start; |
| 817 | __entry->end = request->fl_end; |
| 818 | __entry->dev = inode->i_sb->s_dev; |
| 819 | __entry->fileid = NFS_FILEID(inode); |
| 820 | __entry->fhandle = nfs_fhandle_hash(NFS_FH(inode)); |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 821 | __entry->stateid_seq = |
| 822 | be32_to_cpu(state->stateid.seqid); |
| 823 | __entry->stateid_hash = |
| 824 | nfs_stateid_hash(&state->stateid); |
Trond Myklebust | d1b748a | 2013-08-12 16:35:20 -0400 | [diff] [blame] | 825 | ), |
| 826 | |
| 827 | TP_printk( |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame^] | 828 | "error=%ld (%s) cmd=%s:%s range=%lld:%lld " |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 829 | "fileid=%02x:%02x:%llu fhandle=0x%08x " |
| 830 | "stateid=%d:0x%08x", |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame^] | 831 | -__entry->error, |
Trond Myklebust | d1b748a | 2013-08-12 16:35:20 -0400 | [diff] [blame] | 832 | show_nfsv4_errors(__entry->error), |
| 833 | show_lock_cmd(__entry->cmd), |
| 834 | show_lock_type(__entry->type), |
| 835 | (long long)__entry->start, |
| 836 | (long long)__entry->end, |
| 837 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 838 | (unsigned long long)__entry->fileid, |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 839 | __entry->fhandle, |
| 840 | __entry->stateid_seq, __entry->stateid_hash |
Trond Myklebust | d1b748a | 2013-08-12 16:35:20 -0400 | [diff] [blame] | 841 | ) |
| 842 | ); |
| 843 | |
| 844 | #define DEFINE_NFS4_LOCK_EVENT(name) \ |
| 845 | DEFINE_EVENT(nfs4_lock_event, name, \ |
| 846 | TP_PROTO( \ |
| 847 | const struct file_lock *request, \ |
| 848 | const struct nfs4_state *state, \ |
| 849 | int cmd, \ |
| 850 | int error \ |
| 851 | ), \ |
| 852 | TP_ARGS(request, state, cmd, error)) |
| 853 | DEFINE_NFS4_LOCK_EVENT(nfs4_get_lock); |
Trond Myklebust | d1b748a | 2013-08-12 16:35:20 -0400 | [diff] [blame] | 854 | DEFINE_NFS4_LOCK_EVENT(nfs4_unlock); |
| 855 | |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 856 | TRACE_EVENT(nfs4_set_lock, |
| 857 | TP_PROTO( |
| 858 | const struct file_lock *request, |
| 859 | const struct nfs4_state *state, |
| 860 | const nfs4_stateid *lockstateid, |
| 861 | int cmd, |
| 862 | int error |
| 863 | ), |
| 864 | |
| 865 | TP_ARGS(request, state, lockstateid, cmd, error), |
| 866 | |
| 867 | TP_STRUCT__entry( |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame^] | 868 | __field(unsigned long, error) |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 869 | __field(int, cmd) |
| 870 | __field(char, type) |
| 871 | __field(loff_t, start) |
| 872 | __field(loff_t, end) |
| 873 | __field(dev_t, dev) |
| 874 | __field(u32, fhandle) |
| 875 | __field(u64, fileid) |
| 876 | __field(int, stateid_seq) |
| 877 | __field(u32, stateid_hash) |
| 878 | __field(int, lockstateid_seq) |
| 879 | __field(u32, lockstateid_hash) |
| 880 | ), |
| 881 | |
| 882 | TP_fast_assign( |
| 883 | const struct inode *inode = state->inode; |
| 884 | |
| 885 | __entry->error = error; |
| 886 | __entry->cmd = cmd; |
| 887 | __entry->type = request->fl_type; |
| 888 | __entry->start = request->fl_start; |
| 889 | __entry->end = request->fl_end; |
| 890 | __entry->dev = inode->i_sb->s_dev; |
| 891 | __entry->fileid = NFS_FILEID(inode); |
| 892 | __entry->fhandle = nfs_fhandle_hash(NFS_FH(inode)); |
| 893 | __entry->stateid_seq = |
| 894 | be32_to_cpu(state->stateid.seqid); |
| 895 | __entry->stateid_hash = |
| 896 | nfs_stateid_hash(&state->stateid); |
| 897 | __entry->lockstateid_seq = |
| 898 | be32_to_cpu(lockstateid->seqid); |
| 899 | __entry->lockstateid_hash = |
| 900 | nfs_stateid_hash(lockstateid); |
| 901 | ), |
| 902 | |
| 903 | TP_printk( |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame^] | 904 | "error=%ld (%s) cmd=%s:%s range=%lld:%lld " |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 905 | "fileid=%02x:%02x:%llu fhandle=0x%08x " |
| 906 | "stateid=%d:0x%08x lockstateid=%d:0x%08x", |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame^] | 907 | -__entry->error, |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 908 | show_nfsv4_errors(__entry->error), |
| 909 | show_lock_cmd(__entry->cmd), |
| 910 | show_lock_type(__entry->type), |
| 911 | (long long)__entry->start, |
| 912 | (long long)__entry->end, |
| 913 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 914 | (unsigned long long)__entry->fileid, |
| 915 | __entry->fhandle, |
| 916 | __entry->stateid_seq, __entry->stateid_hash, |
| 917 | __entry->lockstateid_seq, __entry->lockstateid_hash |
| 918 | ) |
| 919 | ); |
| 920 | |
Trond Myklebust | ca8acf8 | 2013-08-13 10:36:56 -0400 | [diff] [blame] | 921 | DECLARE_EVENT_CLASS(nfs4_set_delegation_event, |
| 922 | TP_PROTO( |
| 923 | const struct inode *inode, |
| 924 | fmode_t fmode |
| 925 | ), |
| 926 | |
| 927 | TP_ARGS(inode, fmode), |
| 928 | |
| 929 | TP_STRUCT__entry( |
| 930 | __field(dev_t, dev) |
| 931 | __field(u32, fhandle) |
| 932 | __field(u64, fileid) |
| 933 | __field(unsigned int, fmode) |
| 934 | ), |
| 935 | |
| 936 | TP_fast_assign( |
| 937 | __entry->dev = inode->i_sb->s_dev; |
| 938 | __entry->fileid = NFS_FILEID(inode); |
| 939 | __entry->fhandle = nfs_fhandle_hash(NFS_FH(inode)); |
| 940 | __entry->fmode = (__force unsigned int)fmode; |
| 941 | ), |
| 942 | |
| 943 | TP_printk( |
| 944 | "fmode=%s fileid=%02x:%02x:%llu fhandle=0x%08x", |
| 945 | show_fmode_flags(__entry->fmode), |
| 946 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 947 | (unsigned long long)__entry->fileid, |
| 948 | __entry->fhandle |
| 949 | ) |
| 950 | ); |
| 951 | #define DEFINE_NFS4_SET_DELEGATION_EVENT(name) \ |
| 952 | DEFINE_EVENT(nfs4_set_delegation_event, name, \ |
| 953 | TP_PROTO( \ |
| 954 | const struct inode *inode, \ |
| 955 | fmode_t fmode \ |
| 956 | ), \ |
| 957 | TP_ARGS(inode, fmode)) |
| 958 | DEFINE_NFS4_SET_DELEGATION_EVENT(nfs4_set_delegation); |
| 959 | DEFINE_NFS4_SET_DELEGATION_EVENT(nfs4_reclaim_delegation); |
| 960 | |
| 961 | TRACE_EVENT(nfs4_delegreturn_exit, |
| 962 | TP_PROTO( |
| 963 | const struct nfs4_delegreturnargs *args, |
| 964 | const struct nfs4_delegreturnres *res, |
| 965 | int error |
| 966 | ), |
| 967 | |
| 968 | TP_ARGS(args, res, error), |
| 969 | |
| 970 | TP_STRUCT__entry( |
| 971 | __field(dev_t, dev) |
| 972 | __field(u32, fhandle) |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame^] | 973 | __field(unsigned long, error) |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 974 | __field(int, stateid_seq) |
| 975 | __field(u32, stateid_hash) |
Trond Myklebust | ca8acf8 | 2013-08-13 10:36:56 -0400 | [diff] [blame] | 976 | ), |
| 977 | |
| 978 | TP_fast_assign( |
| 979 | __entry->dev = res->server->s_dev; |
| 980 | __entry->fhandle = nfs_fhandle_hash(args->fhandle); |
| 981 | __entry->error = error; |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 982 | __entry->stateid_seq = |
| 983 | be32_to_cpu(args->stateid->seqid); |
| 984 | __entry->stateid_hash = |
| 985 | nfs_stateid_hash(args->stateid); |
Trond Myklebust | ca8acf8 | 2013-08-13 10:36:56 -0400 | [diff] [blame] | 986 | ), |
| 987 | |
| 988 | TP_printk( |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame^] | 989 | "error=%ld (%s) dev=%02x:%02x fhandle=0x%08x " |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 990 | "stateid=%d:0x%08x", |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame^] | 991 | -__entry->error, |
Trond Myklebust | ca8acf8 | 2013-08-13 10:36:56 -0400 | [diff] [blame] | 992 | show_nfsv4_errors(__entry->error), |
| 993 | MAJOR(__entry->dev), MINOR(__entry->dev), |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 994 | __entry->fhandle, |
| 995 | __entry->stateid_seq, __entry->stateid_hash |
Trond Myklebust | ca8acf8 | 2013-08-13 10:36:56 -0400 | [diff] [blame] | 996 | ) |
| 997 | ); |
| 998 | |
Trond Myklebust | 08cb47f | 2013-08-20 21:59:40 -0400 | [diff] [blame] | 999 | #ifdef CONFIG_NFS_V4_1 |
| 1000 | DECLARE_EVENT_CLASS(nfs4_test_stateid_event, |
| 1001 | TP_PROTO( |
| 1002 | const struct nfs4_state *state, |
| 1003 | const struct nfs4_lock_state *lsp, |
| 1004 | int error |
| 1005 | ), |
| 1006 | |
| 1007 | TP_ARGS(state, lsp, error), |
| 1008 | |
| 1009 | TP_STRUCT__entry( |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame^] | 1010 | __field(unsigned long, error) |
Trond Myklebust | 08cb47f | 2013-08-20 21:59:40 -0400 | [diff] [blame] | 1011 | __field(dev_t, dev) |
| 1012 | __field(u32, fhandle) |
| 1013 | __field(u64, fileid) |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 1014 | __field(int, stateid_seq) |
| 1015 | __field(u32, stateid_hash) |
Trond Myklebust | 08cb47f | 2013-08-20 21:59:40 -0400 | [diff] [blame] | 1016 | ), |
| 1017 | |
| 1018 | TP_fast_assign( |
| 1019 | const struct inode *inode = state->inode; |
| 1020 | |
| 1021 | __entry->error = error; |
| 1022 | __entry->dev = inode->i_sb->s_dev; |
| 1023 | __entry->fileid = NFS_FILEID(inode); |
| 1024 | __entry->fhandle = nfs_fhandle_hash(NFS_FH(inode)); |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 1025 | __entry->stateid_seq = |
| 1026 | be32_to_cpu(state->stateid.seqid); |
| 1027 | __entry->stateid_hash = |
| 1028 | nfs_stateid_hash(&state->stateid); |
Trond Myklebust | 08cb47f | 2013-08-20 21:59:40 -0400 | [diff] [blame] | 1029 | ), |
| 1030 | |
| 1031 | TP_printk( |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame^] | 1032 | "error=%ld (%s) fileid=%02x:%02x:%llu fhandle=0x%08x " |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 1033 | "stateid=%d:0x%08x", |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame^] | 1034 | -__entry->error, |
Trond Myklebust | 08cb47f | 2013-08-20 21:59:40 -0400 | [diff] [blame] | 1035 | show_nfsv4_errors(__entry->error), |
| 1036 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 1037 | (unsigned long long)__entry->fileid, |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 1038 | __entry->fhandle, |
| 1039 | __entry->stateid_seq, __entry->stateid_hash |
Trond Myklebust | 08cb47f | 2013-08-20 21:59:40 -0400 | [diff] [blame] | 1040 | ) |
| 1041 | ); |
| 1042 | |
| 1043 | #define DEFINE_NFS4_TEST_STATEID_EVENT(name) \ |
| 1044 | DEFINE_EVENT(nfs4_test_stateid_event, name, \ |
| 1045 | TP_PROTO( \ |
| 1046 | const struct nfs4_state *state, \ |
| 1047 | const struct nfs4_lock_state *lsp, \ |
| 1048 | int error \ |
| 1049 | ), \ |
| 1050 | TP_ARGS(state, lsp, error)) |
| 1051 | DEFINE_NFS4_TEST_STATEID_EVENT(nfs4_test_delegation_stateid); |
| 1052 | DEFINE_NFS4_TEST_STATEID_EVENT(nfs4_test_open_stateid); |
| 1053 | DEFINE_NFS4_TEST_STATEID_EVENT(nfs4_test_lock_stateid); |
| 1054 | #endif /* CONFIG_NFS_V4_1 */ |
| 1055 | |
Trond Myklebust | 078ea3d | 2013-08-12 16:45:55 -0400 | [diff] [blame] | 1056 | DECLARE_EVENT_CLASS(nfs4_lookup_event, |
| 1057 | TP_PROTO( |
| 1058 | const struct inode *dir, |
| 1059 | const struct qstr *name, |
| 1060 | int error |
| 1061 | ), |
| 1062 | |
| 1063 | TP_ARGS(dir, name, error), |
| 1064 | |
| 1065 | TP_STRUCT__entry( |
| 1066 | __field(dev_t, dev) |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame^] | 1067 | __field(unsigned long, error) |
Trond Myklebust | 078ea3d | 2013-08-12 16:45:55 -0400 | [diff] [blame] | 1068 | __field(u64, dir) |
| 1069 | __string(name, name->name) |
| 1070 | ), |
| 1071 | |
| 1072 | TP_fast_assign( |
| 1073 | __entry->dev = dir->i_sb->s_dev; |
| 1074 | __entry->dir = NFS_FILEID(dir); |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame^] | 1075 | __entry->error = -error; |
Trond Myklebust | 078ea3d | 2013-08-12 16:45:55 -0400 | [diff] [blame] | 1076 | __assign_str(name, name->name); |
| 1077 | ), |
| 1078 | |
| 1079 | TP_printk( |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame^] | 1080 | "error=%ld (%s) name=%02x:%02x:%llu/%s", |
| 1081 | -__entry->error, |
Trond Myklebust | 078ea3d | 2013-08-12 16:45:55 -0400 | [diff] [blame] | 1082 | show_nfsv4_errors(__entry->error), |
| 1083 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 1084 | (unsigned long long)__entry->dir, |
| 1085 | __get_str(name) |
| 1086 | ) |
| 1087 | ); |
| 1088 | |
| 1089 | #define DEFINE_NFS4_LOOKUP_EVENT(name) \ |
| 1090 | DEFINE_EVENT(nfs4_lookup_event, name, \ |
| 1091 | TP_PROTO( \ |
| 1092 | const struct inode *dir, \ |
| 1093 | const struct qstr *name, \ |
| 1094 | int error \ |
| 1095 | ), \ |
| 1096 | TP_ARGS(dir, name, error)) |
| 1097 | |
| 1098 | DEFINE_NFS4_LOOKUP_EVENT(nfs4_lookup); |
| 1099 | DEFINE_NFS4_LOOKUP_EVENT(nfs4_symlink); |
| 1100 | DEFINE_NFS4_LOOKUP_EVENT(nfs4_mkdir); |
| 1101 | DEFINE_NFS4_LOOKUP_EVENT(nfs4_mknod); |
| 1102 | DEFINE_NFS4_LOOKUP_EVENT(nfs4_remove); |
| 1103 | DEFINE_NFS4_LOOKUP_EVENT(nfs4_get_fs_locations); |
| 1104 | DEFINE_NFS4_LOOKUP_EVENT(nfs4_secinfo); |
| 1105 | |
Jeff Layton | 5b5faaf | 2017-06-29 06:34:52 -0700 | [diff] [blame] | 1106 | TRACE_EVENT(nfs4_lookupp, |
| 1107 | TP_PROTO( |
| 1108 | const struct inode *inode, |
| 1109 | int error |
| 1110 | ), |
| 1111 | |
| 1112 | TP_ARGS(inode, error), |
| 1113 | |
| 1114 | TP_STRUCT__entry( |
| 1115 | __field(dev_t, dev) |
| 1116 | __field(u64, ino) |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame^] | 1117 | __field(unsigned long, error) |
Jeff Layton | 5b5faaf | 2017-06-29 06:34:52 -0700 | [diff] [blame] | 1118 | ), |
| 1119 | |
| 1120 | TP_fast_assign( |
| 1121 | __entry->dev = inode->i_sb->s_dev; |
| 1122 | __entry->ino = NFS_FILEID(inode); |
| 1123 | __entry->error = error; |
| 1124 | ), |
| 1125 | |
| 1126 | TP_printk( |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame^] | 1127 | "error=%ld (%s) inode=%02x:%02x:%llu", |
| 1128 | -__entry->error, |
Jeff Layton | 5b5faaf | 2017-06-29 06:34:52 -0700 | [diff] [blame] | 1129 | show_nfsv4_errors(__entry->error), |
| 1130 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 1131 | (unsigned long long)__entry->ino |
| 1132 | ) |
| 1133 | ); |
| 1134 | |
Trond Myklebust | fbc6f7c | 2013-08-12 17:08:26 -0400 | [diff] [blame] | 1135 | TRACE_EVENT(nfs4_rename, |
| 1136 | TP_PROTO( |
| 1137 | const struct inode *olddir, |
| 1138 | const struct qstr *oldname, |
| 1139 | const struct inode *newdir, |
| 1140 | const struct qstr *newname, |
| 1141 | int error |
| 1142 | ), |
| 1143 | |
| 1144 | TP_ARGS(olddir, oldname, newdir, newname, error), |
| 1145 | |
| 1146 | TP_STRUCT__entry( |
| 1147 | __field(dev_t, dev) |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame^] | 1148 | __field(unsigned long, error) |
Trond Myklebust | fbc6f7c | 2013-08-12 17:08:26 -0400 | [diff] [blame] | 1149 | __field(u64, olddir) |
| 1150 | __string(oldname, oldname->name) |
| 1151 | __field(u64, newdir) |
| 1152 | __string(newname, newname->name) |
| 1153 | ), |
| 1154 | |
| 1155 | TP_fast_assign( |
| 1156 | __entry->dev = olddir->i_sb->s_dev; |
| 1157 | __entry->olddir = NFS_FILEID(olddir); |
| 1158 | __entry->newdir = NFS_FILEID(newdir); |
| 1159 | __entry->error = error; |
| 1160 | __assign_str(oldname, oldname->name); |
| 1161 | __assign_str(newname, newname->name); |
| 1162 | ), |
| 1163 | |
| 1164 | TP_printk( |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame^] | 1165 | "error=%ld (%s) oldname=%02x:%02x:%llu/%s " |
Trond Myklebust | fbc6f7c | 2013-08-12 17:08:26 -0400 | [diff] [blame] | 1166 | "newname=%02x:%02x:%llu/%s", |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame^] | 1167 | -__entry->error, |
Trond Myklebust | fbc6f7c | 2013-08-12 17:08:26 -0400 | [diff] [blame] | 1168 | show_nfsv4_errors(__entry->error), |
| 1169 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 1170 | (unsigned long long)__entry->olddir, |
| 1171 | __get_str(oldname), |
| 1172 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 1173 | (unsigned long long)__entry->newdir, |
| 1174 | __get_str(newname) |
| 1175 | ) |
| 1176 | ); |
| 1177 | |
Trond Myklebust | c1578b7 | 2013-08-12 16:58:42 -0400 | [diff] [blame] | 1178 | DECLARE_EVENT_CLASS(nfs4_inode_event, |
| 1179 | TP_PROTO( |
| 1180 | const struct inode *inode, |
| 1181 | int error |
| 1182 | ), |
| 1183 | |
| 1184 | TP_ARGS(inode, error), |
| 1185 | |
| 1186 | TP_STRUCT__entry( |
| 1187 | __field(dev_t, dev) |
| 1188 | __field(u32, fhandle) |
| 1189 | __field(u64, fileid) |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame^] | 1190 | __field(unsigned long, error) |
Trond Myklebust | c1578b7 | 2013-08-12 16:58:42 -0400 | [diff] [blame] | 1191 | ), |
| 1192 | |
| 1193 | TP_fast_assign( |
| 1194 | __entry->dev = inode->i_sb->s_dev; |
| 1195 | __entry->fileid = NFS_FILEID(inode); |
| 1196 | __entry->fhandle = nfs_fhandle_hash(NFS_FH(inode)); |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame^] | 1197 | __entry->error = error < 0 ? -error : 0; |
Trond Myklebust | c1578b7 | 2013-08-12 16:58:42 -0400 | [diff] [blame] | 1198 | ), |
| 1199 | |
| 1200 | TP_printk( |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame^] | 1201 | "error=%ld (%s) fileid=%02x:%02x:%llu fhandle=0x%08x", |
| 1202 | -__entry->error, |
Trond Myklebust | c1578b7 | 2013-08-12 16:58:42 -0400 | [diff] [blame] | 1203 | show_nfsv4_errors(__entry->error), |
| 1204 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 1205 | (unsigned long long)__entry->fileid, |
| 1206 | __entry->fhandle |
| 1207 | ) |
| 1208 | ); |
| 1209 | |
| 1210 | #define DEFINE_NFS4_INODE_EVENT(name) \ |
| 1211 | DEFINE_EVENT(nfs4_inode_event, name, \ |
| 1212 | TP_PROTO( \ |
| 1213 | const struct inode *inode, \ |
| 1214 | int error \ |
| 1215 | ), \ |
| 1216 | TP_ARGS(inode, error)) |
| 1217 | |
Trond Myklebust | c1578b7 | 2013-08-12 16:58:42 -0400 | [diff] [blame] | 1218 | DEFINE_NFS4_INODE_EVENT(nfs4_access); |
| 1219 | DEFINE_NFS4_INODE_EVENT(nfs4_readlink); |
| 1220 | DEFINE_NFS4_INODE_EVENT(nfs4_readdir); |
| 1221 | DEFINE_NFS4_INODE_EVENT(nfs4_get_acl); |
| 1222 | DEFINE_NFS4_INODE_EVENT(nfs4_set_acl); |
| 1223 | #ifdef CONFIG_NFS_V4_SECURITY_LABEL |
| 1224 | DEFINE_NFS4_INODE_EVENT(nfs4_get_security_label); |
| 1225 | DEFINE_NFS4_INODE_EVENT(nfs4_set_security_label); |
| 1226 | #endif /* CONFIG_NFS_V4_SECURITY_LABEL */ |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 1227 | |
| 1228 | DECLARE_EVENT_CLASS(nfs4_inode_stateid_event, |
| 1229 | TP_PROTO( |
| 1230 | const struct inode *inode, |
| 1231 | const nfs4_stateid *stateid, |
| 1232 | int error |
| 1233 | ), |
| 1234 | |
| 1235 | TP_ARGS(inode, stateid, error), |
| 1236 | |
| 1237 | TP_STRUCT__entry( |
| 1238 | __field(dev_t, dev) |
| 1239 | __field(u32, fhandle) |
| 1240 | __field(u64, fileid) |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame^] | 1241 | __field(unsigned long, error) |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 1242 | __field(int, stateid_seq) |
| 1243 | __field(u32, stateid_hash) |
| 1244 | ), |
| 1245 | |
| 1246 | TP_fast_assign( |
| 1247 | __entry->dev = inode->i_sb->s_dev; |
| 1248 | __entry->fileid = NFS_FILEID(inode); |
| 1249 | __entry->fhandle = nfs_fhandle_hash(NFS_FH(inode)); |
| 1250 | __entry->error = error; |
| 1251 | __entry->stateid_seq = |
| 1252 | be32_to_cpu(stateid->seqid); |
| 1253 | __entry->stateid_hash = |
| 1254 | nfs_stateid_hash(stateid); |
| 1255 | ), |
| 1256 | |
| 1257 | TP_printk( |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame^] | 1258 | "error=%ld (%s) fileid=%02x:%02x:%llu fhandle=0x%08x " |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 1259 | "stateid=%d:0x%08x", |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame^] | 1260 | -__entry->error, |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 1261 | show_nfsv4_errors(__entry->error), |
| 1262 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 1263 | (unsigned long long)__entry->fileid, |
| 1264 | __entry->fhandle, |
| 1265 | __entry->stateid_seq, __entry->stateid_hash |
| 1266 | ) |
| 1267 | ); |
| 1268 | |
| 1269 | #define DEFINE_NFS4_INODE_STATEID_EVENT(name) \ |
| 1270 | DEFINE_EVENT(nfs4_inode_stateid_event, name, \ |
| 1271 | TP_PROTO( \ |
| 1272 | const struct inode *inode, \ |
| 1273 | const nfs4_stateid *stateid, \ |
| 1274 | int error \ |
| 1275 | ), \ |
| 1276 | TP_ARGS(inode, stateid, error)) |
| 1277 | |
| 1278 | DEFINE_NFS4_INODE_STATEID_EVENT(nfs4_setattr); |
| 1279 | DEFINE_NFS4_INODE_STATEID_EVENT(nfs4_delegreturn); |
Trond Myklebust | ad9e02d | 2017-11-06 15:28:02 -0500 | [diff] [blame] | 1280 | DEFINE_NFS4_INODE_STATEID_EVENT(nfs4_open_stateid_update); |
| 1281 | DEFINE_NFS4_INODE_STATEID_EVENT(nfs4_open_stateid_update_wait); |
Trond Myklebust | c1578b7 | 2013-08-12 16:58:42 -0400 | [diff] [blame] | 1282 | |
Trond Myklebust | b5f875a | 2013-08-13 13:01:39 -0400 | [diff] [blame] | 1283 | DECLARE_EVENT_CLASS(nfs4_getattr_event, |
| 1284 | TP_PROTO( |
| 1285 | const struct nfs_server *server, |
| 1286 | const struct nfs_fh *fhandle, |
| 1287 | const struct nfs_fattr *fattr, |
| 1288 | int error |
| 1289 | ), |
| 1290 | |
| 1291 | TP_ARGS(server, fhandle, fattr, error), |
| 1292 | |
| 1293 | TP_STRUCT__entry( |
| 1294 | __field(dev_t, dev) |
| 1295 | __field(u32, fhandle) |
| 1296 | __field(u64, fileid) |
| 1297 | __field(unsigned int, valid) |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame^] | 1298 | __field(unsigned long, error) |
Trond Myklebust | b5f875a | 2013-08-13 13:01:39 -0400 | [diff] [blame] | 1299 | ), |
| 1300 | |
| 1301 | TP_fast_assign( |
| 1302 | __entry->dev = server->s_dev; |
| 1303 | __entry->valid = fattr->valid; |
| 1304 | __entry->fhandle = nfs_fhandle_hash(fhandle); |
| 1305 | __entry->fileid = (fattr->valid & NFS_ATTR_FATTR_FILEID) ? fattr->fileid : 0; |
| 1306 | __entry->error = error; |
| 1307 | ), |
| 1308 | |
| 1309 | TP_printk( |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame^] | 1310 | "error=%ld (%s) fileid=%02x:%02x:%llu fhandle=0x%08x " |
Trond Myklebust | b5f875a | 2013-08-13 13:01:39 -0400 | [diff] [blame] | 1311 | "valid=%s", |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame^] | 1312 | -__entry->error, |
Trond Myklebust | b5f875a | 2013-08-13 13:01:39 -0400 | [diff] [blame] | 1313 | show_nfsv4_errors(__entry->error), |
| 1314 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 1315 | (unsigned long long)__entry->fileid, |
| 1316 | __entry->fhandle, |
| 1317 | show_nfs_fattr_flags(__entry->valid) |
| 1318 | ) |
| 1319 | ); |
| 1320 | |
| 1321 | #define DEFINE_NFS4_GETATTR_EVENT(name) \ |
| 1322 | DEFINE_EVENT(nfs4_getattr_event, name, \ |
| 1323 | TP_PROTO( \ |
| 1324 | const struct nfs_server *server, \ |
| 1325 | const struct nfs_fh *fhandle, \ |
| 1326 | const struct nfs_fattr *fattr, \ |
| 1327 | int error \ |
| 1328 | ), \ |
| 1329 | TP_ARGS(server, fhandle, fattr, error)) |
| 1330 | DEFINE_NFS4_GETATTR_EVENT(nfs4_getattr); |
| 1331 | DEFINE_NFS4_GETATTR_EVENT(nfs4_lookup_root); |
| 1332 | DEFINE_NFS4_GETATTR_EVENT(nfs4_fsinfo); |
| 1333 | |
Trond Myklebust | 7cd1486 | 2015-08-20 20:07:54 -0500 | [diff] [blame] | 1334 | DECLARE_EVENT_CLASS(nfs4_inode_callback_event, |
| 1335 | TP_PROTO( |
| 1336 | const struct nfs_client *clp, |
| 1337 | const struct nfs_fh *fhandle, |
| 1338 | const struct inode *inode, |
| 1339 | int error |
| 1340 | ), |
| 1341 | |
| 1342 | TP_ARGS(clp, fhandle, inode, error), |
| 1343 | |
| 1344 | TP_STRUCT__entry( |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame^] | 1345 | __field(unsigned long, error) |
Trond Myklebust | 7cd1486 | 2015-08-20 20:07:54 -0500 | [diff] [blame] | 1346 | __field(dev_t, dev) |
| 1347 | __field(u32, fhandle) |
| 1348 | __field(u64, fileid) |
Anna Schumaker | 3944369 | 2017-11-01 15:48:43 -0400 | [diff] [blame] | 1349 | __string(dstaddr, clp ? clp->cl_hostname : "unknown") |
Trond Myklebust | 7cd1486 | 2015-08-20 20:07:54 -0500 | [diff] [blame] | 1350 | ), |
| 1351 | |
| 1352 | TP_fast_assign( |
| 1353 | __entry->error = error; |
| 1354 | __entry->fhandle = nfs_fhandle_hash(fhandle); |
Trond Myklebust | 2edaead | 2018-09-05 14:07:13 -0400 | [diff] [blame] | 1355 | if (!IS_ERR_OR_NULL(inode)) { |
Trond Myklebust | 7cd1486 | 2015-08-20 20:07:54 -0500 | [diff] [blame] | 1356 | __entry->fileid = NFS_FILEID(inode); |
| 1357 | __entry->dev = inode->i_sb->s_dev; |
| 1358 | } else { |
| 1359 | __entry->fileid = 0; |
| 1360 | __entry->dev = 0; |
| 1361 | } |
Anna Schumaker | 3944369 | 2017-11-01 15:48:43 -0400 | [diff] [blame] | 1362 | __assign_str(dstaddr, clp ? clp->cl_hostname : "unknown") |
Trond Myklebust | 7cd1486 | 2015-08-20 20:07:54 -0500 | [diff] [blame] | 1363 | ), |
| 1364 | |
| 1365 | TP_printk( |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame^] | 1366 | "error=%ld (%s) fileid=%02x:%02x:%llu fhandle=0x%08x " |
Trond Myklebust | 7cd1486 | 2015-08-20 20:07:54 -0500 | [diff] [blame] | 1367 | "dstaddr=%s", |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame^] | 1368 | -__entry->error, |
Trond Myklebust | 7cd1486 | 2015-08-20 20:07:54 -0500 | [diff] [blame] | 1369 | show_nfsv4_errors(__entry->error), |
| 1370 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 1371 | (unsigned long long)__entry->fileid, |
| 1372 | __entry->fhandle, |
| 1373 | __get_str(dstaddr) |
| 1374 | ) |
| 1375 | ); |
| 1376 | |
| 1377 | #define DEFINE_NFS4_INODE_CALLBACK_EVENT(name) \ |
| 1378 | DEFINE_EVENT(nfs4_inode_callback_event, name, \ |
| 1379 | TP_PROTO( \ |
| 1380 | const struct nfs_client *clp, \ |
| 1381 | const struct nfs_fh *fhandle, \ |
| 1382 | const struct inode *inode, \ |
| 1383 | int error \ |
| 1384 | ), \ |
| 1385 | TP_ARGS(clp, fhandle, inode, error)) |
| 1386 | DEFINE_NFS4_INODE_CALLBACK_EVENT(nfs4_cb_getattr); |
| 1387 | |
Trond Myklebust | e07db90 | 2015-12-28 14:07:23 -0500 | [diff] [blame] | 1388 | DECLARE_EVENT_CLASS(nfs4_inode_stateid_callback_event, |
| 1389 | TP_PROTO( |
| 1390 | const struct nfs_client *clp, |
| 1391 | const struct nfs_fh *fhandle, |
| 1392 | const struct inode *inode, |
| 1393 | const nfs4_stateid *stateid, |
| 1394 | int error |
| 1395 | ), |
| 1396 | |
| 1397 | TP_ARGS(clp, fhandle, inode, stateid, error), |
| 1398 | |
| 1399 | TP_STRUCT__entry( |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame^] | 1400 | __field(unsigned long, error) |
Trond Myklebust | e07db90 | 2015-12-28 14:07:23 -0500 | [diff] [blame] | 1401 | __field(dev_t, dev) |
| 1402 | __field(u32, fhandle) |
| 1403 | __field(u64, fileid) |
Anna Schumaker | 3944369 | 2017-11-01 15:48:43 -0400 | [diff] [blame] | 1404 | __string(dstaddr, clp ? clp->cl_hostname : "unknown") |
Trond Myklebust | e07db90 | 2015-12-28 14:07:23 -0500 | [diff] [blame] | 1405 | __field(int, stateid_seq) |
| 1406 | __field(u32, stateid_hash) |
| 1407 | ), |
| 1408 | |
| 1409 | TP_fast_assign( |
| 1410 | __entry->error = error; |
| 1411 | __entry->fhandle = nfs_fhandle_hash(fhandle); |
Trond Myklebust | 2a534a7 | 2018-08-23 11:02:49 -0400 | [diff] [blame] | 1412 | if (!IS_ERR_OR_NULL(inode)) { |
Trond Myklebust | e07db90 | 2015-12-28 14:07:23 -0500 | [diff] [blame] | 1413 | __entry->fileid = NFS_FILEID(inode); |
| 1414 | __entry->dev = inode->i_sb->s_dev; |
| 1415 | } else { |
| 1416 | __entry->fileid = 0; |
| 1417 | __entry->dev = 0; |
| 1418 | } |
Anna Schumaker | 3944369 | 2017-11-01 15:48:43 -0400 | [diff] [blame] | 1419 | __assign_str(dstaddr, clp ? clp->cl_hostname : "unknown") |
Trond Myklebust | e07db90 | 2015-12-28 14:07:23 -0500 | [diff] [blame] | 1420 | __entry->stateid_seq = |
| 1421 | be32_to_cpu(stateid->seqid); |
| 1422 | __entry->stateid_hash = |
| 1423 | nfs_stateid_hash(stateid); |
| 1424 | ), |
| 1425 | |
| 1426 | TP_printk( |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame^] | 1427 | "error=%ld (%s) fileid=%02x:%02x:%llu fhandle=0x%08x " |
Trond Myklebust | e07db90 | 2015-12-28 14:07:23 -0500 | [diff] [blame] | 1428 | "stateid=%d:0x%08x dstaddr=%s", |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame^] | 1429 | -__entry->error, |
Trond Myklebust | e07db90 | 2015-12-28 14:07:23 -0500 | [diff] [blame] | 1430 | show_nfsv4_errors(__entry->error), |
| 1431 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 1432 | (unsigned long long)__entry->fileid, |
| 1433 | __entry->fhandle, |
| 1434 | __entry->stateid_seq, __entry->stateid_hash, |
| 1435 | __get_str(dstaddr) |
| 1436 | ) |
| 1437 | ); |
| 1438 | |
| 1439 | #define DEFINE_NFS4_INODE_STATEID_CALLBACK_EVENT(name) \ |
| 1440 | DEFINE_EVENT(nfs4_inode_stateid_callback_event, name, \ |
| 1441 | TP_PROTO( \ |
| 1442 | const struct nfs_client *clp, \ |
| 1443 | const struct nfs_fh *fhandle, \ |
| 1444 | const struct inode *inode, \ |
| 1445 | const nfs4_stateid *stateid, \ |
| 1446 | int error \ |
| 1447 | ), \ |
| 1448 | TP_ARGS(clp, fhandle, inode, stateid, error)) |
| 1449 | DEFINE_NFS4_INODE_STATEID_CALLBACK_EVENT(nfs4_cb_recall); |
| 1450 | DEFINE_NFS4_INODE_STATEID_CALLBACK_EVENT(nfs4_cb_layoutrecall_file); |
Trond Myklebust | 7cd1486 | 2015-08-20 20:07:54 -0500 | [diff] [blame] | 1451 | |
Trond Myklebust | 1f2d30b | 2013-08-13 11:34:01 -0400 | [diff] [blame] | 1452 | DECLARE_EVENT_CLASS(nfs4_idmap_event, |
| 1453 | TP_PROTO( |
| 1454 | const char *name, |
| 1455 | int len, |
| 1456 | u32 id, |
| 1457 | int error |
| 1458 | ), |
| 1459 | |
| 1460 | TP_ARGS(name, len, id, error), |
| 1461 | |
| 1462 | TP_STRUCT__entry( |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame^] | 1463 | __field(unsigned long, error) |
Trond Myklebust | 1f2d30b | 2013-08-13 11:34:01 -0400 | [diff] [blame] | 1464 | __field(u32, id) |
| 1465 | __dynamic_array(char, name, len > 0 ? len + 1 : 1) |
| 1466 | ), |
| 1467 | |
| 1468 | TP_fast_assign( |
| 1469 | if (len < 0) |
| 1470 | len = 0; |
| 1471 | __entry->error = error < 0 ? error : 0; |
| 1472 | __entry->id = id; |
Daniel Bristot de Oliveira | 752d596 | 2016-07-01 20:44:36 -0300 | [diff] [blame] | 1473 | memcpy(__get_str(name), name, len); |
| 1474 | __get_str(name)[len] = 0; |
Trond Myklebust | 1f2d30b | 2013-08-13 11:34:01 -0400 | [diff] [blame] | 1475 | ), |
| 1476 | |
| 1477 | TP_printk( |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame^] | 1478 | "error=%ld (%s) id=%u name=%s", |
| 1479 | -__entry->error, show_nfsv4_errors(__entry->error), |
Trond Myklebust | 1f2d30b | 2013-08-13 11:34:01 -0400 | [diff] [blame] | 1480 | __entry->id, |
| 1481 | __get_str(name) |
| 1482 | ) |
| 1483 | ); |
| 1484 | #define DEFINE_NFS4_IDMAP_EVENT(name) \ |
| 1485 | DEFINE_EVENT(nfs4_idmap_event, name, \ |
| 1486 | TP_PROTO( \ |
| 1487 | const char *name, \ |
| 1488 | int len, \ |
| 1489 | u32 id, \ |
| 1490 | int error \ |
| 1491 | ), \ |
| 1492 | TP_ARGS(name, len, id, error)) |
| 1493 | DEFINE_NFS4_IDMAP_EVENT(nfs4_map_name_to_uid); |
| 1494 | DEFINE_NFS4_IDMAP_EVENT(nfs4_map_group_to_gid); |
| 1495 | DEFINE_NFS4_IDMAP_EVENT(nfs4_map_uid_to_name); |
| 1496 | DEFINE_NFS4_IDMAP_EVENT(nfs4_map_gid_to_group); |
| 1497 | |
Trond Myklebust | cc668ab | 2013-08-14 15:31:28 -0400 | [diff] [blame] | 1498 | DECLARE_EVENT_CLASS(nfs4_read_event, |
| 1499 | TP_PROTO( |
Weston Andros Adamson | d45f60c | 2014-06-09 11:48:35 -0400 | [diff] [blame] | 1500 | const struct nfs_pgio_header *hdr, |
Trond Myklebust | cc668ab | 2013-08-14 15:31:28 -0400 | [diff] [blame] | 1501 | int error |
| 1502 | ), |
| 1503 | |
Weston Andros Adamson | d45f60c | 2014-06-09 11:48:35 -0400 | [diff] [blame] | 1504 | TP_ARGS(hdr, error), |
Trond Myklebust | cc668ab | 2013-08-14 15:31:28 -0400 | [diff] [blame] | 1505 | |
| 1506 | TP_STRUCT__entry( |
| 1507 | __field(dev_t, dev) |
| 1508 | __field(u32, fhandle) |
| 1509 | __field(u64, fileid) |
| 1510 | __field(loff_t, offset) |
| 1511 | __field(size_t, count) |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame^] | 1512 | __field(unsigned long, error) |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 1513 | __field(int, stateid_seq) |
| 1514 | __field(u32, stateid_hash) |
Trond Myklebust | cc668ab | 2013-08-14 15:31:28 -0400 | [diff] [blame] | 1515 | ), |
| 1516 | |
| 1517 | TP_fast_assign( |
Weston Andros Adamson | d45f60c | 2014-06-09 11:48:35 -0400 | [diff] [blame] | 1518 | const struct inode *inode = hdr->inode; |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 1519 | const struct nfs4_state *state = |
| 1520 | hdr->args.context->state; |
Trond Myklebust | cc668ab | 2013-08-14 15:31:28 -0400 | [diff] [blame] | 1521 | __entry->dev = inode->i_sb->s_dev; |
| 1522 | __entry->fileid = NFS_FILEID(inode); |
| 1523 | __entry->fhandle = nfs_fhandle_hash(NFS_FH(inode)); |
Weston Andros Adamson | d45f60c | 2014-06-09 11:48:35 -0400 | [diff] [blame] | 1524 | __entry->offset = hdr->args.offset; |
| 1525 | __entry->count = hdr->args.count; |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame^] | 1526 | __entry->error = error < 0 ? -error : 0; |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 1527 | __entry->stateid_seq = |
| 1528 | be32_to_cpu(state->stateid.seqid); |
| 1529 | __entry->stateid_hash = |
| 1530 | nfs_stateid_hash(&state->stateid); |
Trond Myklebust | cc668ab | 2013-08-14 15:31:28 -0400 | [diff] [blame] | 1531 | ), |
| 1532 | |
| 1533 | TP_printk( |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame^] | 1534 | "error=%ld (%s) fileid=%02x:%02x:%llu fhandle=0x%08x " |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 1535 | "offset=%lld count=%zu stateid=%d:0x%08x", |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame^] | 1536 | -__entry->error, |
Trond Myklebust | cc668ab | 2013-08-14 15:31:28 -0400 | [diff] [blame] | 1537 | show_nfsv4_errors(__entry->error), |
| 1538 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 1539 | (unsigned long long)__entry->fileid, |
| 1540 | __entry->fhandle, |
| 1541 | (long long)__entry->offset, |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 1542 | __entry->count, |
| 1543 | __entry->stateid_seq, __entry->stateid_hash |
Trond Myklebust | cc668ab | 2013-08-14 15:31:28 -0400 | [diff] [blame] | 1544 | ) |
| 1545 | ); |
| 1546 | #define DEFINE_NFS4_READ_EVENT(name) \ |
| 1547 | DEFINE_EVENT(nfs4_read_event, name, \ |
| 1548 | TP_PROTO( \ |
Weston Andros Adamson | d45f60c | 2014-06-09 11:48:35 -0400 | [diff] [blame] | 1549 | const struct nfs_pgio_header *hdr, \ |
Trond Myklebust | cc668ab | 2013-08-14 15:31:28 -0400 | [diff] [blame] | 1550 | int error \ |
| 1551 | ), \ |
Weston Andros Adamson | d45f60c | 2014-06-09 11:48:35 -0400 | [diff] [blame] | 1552 | TP_ARGS(hdr, error)) |
Trond Myklebust | cc668ab | 2013-08-14 15:31:28 -0400 | [diff] [blame] | 1553 | DEFINE_NFS4_READ_EVENT(nfs4_read); |
| 1554 | #ifdef CONFIG_NFS_V4_1 |
| 1555 | DEFINE_NFS4_READ_EVENT(nfs4_pnfs_read); |
| 1556 | #endif /* CONFIG_NFS_V4_1 */ |
| 1557 | |
| 1558 | DECLARE_EVENT_CLASS(nfs4_write_event, |
| 1559 | TP_PROTO( |
Weston Andros Adamson | d45f60c | 2014-06-09 11:48:35 -0400 | [diff] [blame] | 1560 | const struct nfs_pgio_header *hdr, |
Trond Myklebust | cc668ab | 2013-08-14 15:31:28 -0400 | [diff] [blame] | 1561 | int error |
| 1562 | ), |
| 1563 | |
Weston Andros Adamson | d45f60c | 2014-06-09 11:48:35 -0400 | [diff] [blame] | 1564 | TP_ARGS(hdr, error), |
Trond Myklebust | cc668ab | 2013-08-14 15:31:28 -0400 | [diff] [blame] | 1565 | |
| 1566 | TP_STRUCT__entry( |
| 1567 | __field(dev_t, dev) |
| 1568 | __field(u32, fhandle) |
| 1569 | __field(u64, fileid) |
| 1570 | __field(loff_t, offset) |
| 1571 | __field(size_t, count) |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame^] | 1572 | __field(unsigned long, error) |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 1573 | __field(int, stateid_seq) |
| 1574 | __field(u32, stateid_hash) |
Trond Myklebust | cc668ab | 2013-08-14 15:31:28 -0400 | [diff] [blame] | 1575 | ), |
| 1576 | |
| 1577 | TP_fast_assign( |
Weston Andros Adamson | d45f60c | 2014-06-09 11:48:35 -0400 | [diff] [blame] | 1578 | const struct inode *inode = hdr->inode; |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 1579 | const struct nfs4_state *state = |
| 1580 | hdr->args.context->state; |
Trond Myklebust | cc668ab | 2013-08-14 15:31:28 -0400 | [diff] [blame] | 1581 | __entry->dev = inode->i_sb->s_dev; |
| 1582 | __entry->fileid = NFS_FILEID(inode); |
| 1583 | __entry->fhandle = nfs_fhandle_hash(NFS_FH(inode)); |
Weston Andros Adamson | d45f60c | 2014-06-09 11:48:35 -0400 | [diff] [blame] | 1584 | __entry->offset = hdr->args.offset; |
| 1585 | __entry->count = hdr->args.count; |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame^] | 1586 | __entry->error = error < 0 ? -error : 0; |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 1587 | __entry->stateid_seq = |
| 1588 | be32_to_cpu(state->stateid.seqid); |
| 1589 | __entry->stateid_hash = |
| 1590 | nfs_stateid_hash(&state->stateid); |
Trond Myklebust | cc668ab | 2013-08-14 15:31:28 -0400 | [diff] [blame] | 1591 | ), |
| 1592 | |
| 1593 | TP_printk( |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame^] | 1594 | "error=%ld (%s) fileid=%02x:%02x:%llu fhandle=0x%08x " |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 1595 | "offset=%lld count=%zu stateid=%d:0x%08x", |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame^] | 1596 | -__entry->error, |
Trond Myklebust | cc668ab | 2013-08-14 15:31:28 -0400 | [diff] [blame] | 1597 | show_nfsv4_errors(__entry->error), |
| 1598 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 1599 | (unsigned long long)__entry->fileid, |
| 1600 | __entry->fhandle, |
| 1601 | (long long)__entry->offset, |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 1602 | __entry->count, |
| 1603 | __entry->stateid_seq, __entry->stateid_hash |
Trond Myklebust | cc668ab | 2013-08-14 15:31:28 -0400 | [diff] [blame] | 1604 | ) |
| 1605 | ); |
| 1606 | |
| 1607 | #define DEFINE_NFS4_WRITE_EVENT(name) \ |
| 1608 | DEFINE_EVENT(nfs4_write_event, name, \ |
| 1609 | TP_PROTO( \ |
Weston Andros Adamson | d45f60c | 2014-06-09 11:48:35 -0400 | [diff] [blame] | 1610 | const struct nfs_pgio_header *hdr, \ |
Trond Myklebust | cc668ab | 2013-08-14 15:31:28 -0400 | [diff] [blame] | 1611 | int error \ |
| 1612 | ), \ |
Weston Andros Adamson | d45f60c | 2014-06-09 11:48:35 -0400 | [diff] [blame] | 1613 | TP_ARGS(hdr, error)) |
Trond Myklebust | cc668ab | 2013-08-14 15:31:28 -0400 | [diff] [blame] | 1614 | DEFINE_NFS4_WRITE_EVENT(nfs4_write); |
| 1615 | #ifdef CONFIG_NFS_V4_1 |
| 1616 | DEFINE_NFS4_WRITE_EVENT(nfs4_pnfs_write); |
| 1617 | #endif /* CONFIG_NFS_V4_1 */ |
| 1618 | |
| 1619 | DECLARE_EVENT_CLASS(nfs4_commit_event, |
| 1620 | TP_PROTO( |
| 1621 | const struct nfs_commit_data *data, |
| 1622 | int error |
| 1623 | ), |
| 1624 | |
| 1625 | TP_ARGS(data, error), |
| 1626 | |
| 1627 | TP_STRUCT__entry( |
| 1628 | __field(dev_t, dev) |
| 1629 | __field(u32, fhandle) |
| 1630 | __field(u64, fileid) |
| 1631 | __field(loff_t, offset) |
| 1632 | __field(size_t, count) |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame^] | 1633 | __field(unsigned long, error) |
Trond Myklebust | cc668ab | 2013-08-14 15:31:28 -0400 | [diff] [blame] | 1634 | ), |
| 1635 | |
| 1636 | TP_fast_assign( |
| 1637 | const struct inode *inode = data->inode; |
| 1638 | __entry->dev = inode->i_sb->s_dev; |
| 1639 | __entry->fileid = NFS_FILEID(inode); |
| 1640 | __entry->fhandle = nfs_fhandle_hash(NFS_FH(inode)); |
| 1641 | __entry->offset = data->args.offset; |
| 1642 | __entry->count = data->args.count; |
| 1643 | __entry->error = error; |
| 1644 | ), |
| 1645 | |
| 1646 | TP_printk( |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame^] | 1647 | "error=%ld (%s) fileid=%02x:%02x:%llu fhandle=0x%08x " |
Trond Myklebust | cc668ab | 2013-08-14 15:31:28 -0400 | [diff] [blame] | 1648 | "offset=%lld count=%zu", |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame^] | 1649 | -__entry->error, |
Trond Myklebust | cc668ab | 2013-08-14 15:31:28 -0400 | [diff] [blame] | 1650 | show_nfsv4_errors(__entry->error), |
| 1651 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 1652 | (unsigned long long)__entry->fileid, |
| 1653 | __entry->fhandle, |
| 1654 | (long long)__entry->offset, |
| 1655 | __entry->count |
| 1656 | ) |
| 1657 | ); |
| 1658 | #define DEFINE_NFS4_COMMIT_EVENT(name) \ |
| 1659 | DEFINE_EVENT(nfs4_commit_event, name, \ |
| 1660 | TP_PROTO( \ |
| 1661 | const struct nfs_commit_data *data, \ |
| 1662 | int error \ |
| 1663 | ), \ |
| 1664 | TP_ARGS(data, error)) |
| 1665 | DEFINE_NFS4_COMMIT_EVENT(nfs4_commit); |
| 1666 | #ifdef CONFIG_NFS_V4_1 |
| 1667 | DEFINE_NFS4_COMMIT_EVENT(nfs4_pnfs_commit_ds); |
Trond Myklebust | 1037e6e | 2013-08-14 16:36:51 -0400 | [diff] [blame] | 1668 | |
Chuck Lever | 5b2095d | 2018-12-19 11:00:11 -0500 | [diff] [blame] | 1669 | TRACE_DEFINE_ENUM(IOMODE_READ); |
| 1670 | TRACE_DEFINE_ENUM(IOMODE_RW); |
| 1671 | TRACE_DEFINE_ENUM(IOMODE_ANY); |
| 1672 | |
Trond Myklebust | 1037e6e | 2013-08-14 16:36:51 -0400 | [diff] [blame] | 1673 | #define show_pnfs_iomode(iomode) \ |
| 1674 | __print_symbolic(iomode, \ |
| 1675 | { IOMODE_READ, "READ" }, \ |
| 1676 | { IOMODE_RW, "RW" }, \ |
| 1677 | { IOMODE_ANY, "ANY" }) |
| 1678 | |
| 1679 | TRACE_EVENT(nfs4_layoutget, |
| 1680 | TP_PROTO( |
| 1681 | const struct nfs_open_context *ctx, |
| 1682 | const struct pnfs_layout_range *args, |
| 1683 | const struct pnfs_layout_range *res, |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 1684 | const nfs4_stateid *layout_stateid, |
Trond Myklebust | 1037e6e | 2013-08-14 16:36:51 -0400 | [diff] [blame] | 1685 | int error |
| 1686 | ), |
| 1687 | |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 1688 | TP_ARGS(ctx, args, res, layout_stateid, error), |
Trond Myklebust | 1037e6e | 2013-08-14 16:36:51 -0400 | [diff] [blame] | 1689 | |
| 1690 | TP_STRUCT__entry( |
| 1691 | __field(dev_t, dev) |
| 1692 | __field(u32, fhandle) |
| 1693 | __field(u64, fileid) |
| 1694 | __field(u32, iomode) |
| 1695 | __field(u64, offset) |
| 1696 | __field(u64, count) |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame^] | 1697 | __field(unsigned long, error) |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 1698 | __field(int, stateid_seq) |
| 1699 | __field(u32, stateid_hash) |
| 1700 | __field(int, layoutstateid_seq) |
| 1701 | __field(u32, layoutstateid_hash) |
Trond Myklebust | 1037e6e | 2013-08-14 16:36:51 -0400 | [diff] [blame] | 1702 | ), |
| 1703 | |
| 1704 | TP_fast_assign( |
David Howells | 2b0143b | 2015-03-17 22:25:59 +0000 | [diff] [blame] | 1705 | const struct inode *inode = d_inode(ctx->dentry); |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 1706 | const struct nfs4_state *state = ctx->state; |
Trond Myklebust | 1037e6e | 2013-08-14 16:36:51 -0400 | [diff] [blame] | 1707 | __entry->dev = inode->i_sb->s_dev; |
| 1708 | __entry->fileid = NFS_FILEID(inode); |
| 1709 | __entry->fhandle = nfs_fhandle_hash(NFS_FH(inode)); |
| 1710 | __entry->iomode = args->iomode; |
| 1711 | __entry->offset = args->offset; |
| 1712 | __entry->count = args->length; |
| 1713 | __entry->error = error; |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 1714 | __entry->stateid_seq = |
| 1715 | be32_to_cpu(state->stateid.seqid); |
| 1716 | __entry->stateid_hash = |
| 1717 | nfs_stateid_hash(&state->stateid); |
| 1718 | if (!error) { |
| 1719 | __entry->layoutstateid_seq = |
| 1720 | be32_to_cpu(layout_stateid->seqid); |
| 1721 | __entry->layoutstateid_hash = |
| 1722 | nfs_stateid_hash(layout_stateid); |
| 1723 | } else { |
| 1724 | __entry->layoutstateid_seq = 0; |
| 1725 | __entry->layoutstateid_hash = 0; |
| 1726 | } |
Trond Myklebust | 1037e6e | 2013-08-14 16:36:51 -0400 | [diff] [blame] | 1727 | ), |
| 1728 | |
| 1729 | TP_printk( |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame^] | 1730 | "error=%ld (%s) fileid=%02x:%02x:%llu fhandle=0x%08x " |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 1731 | "iomode=%s offset=%llu count=%llu stateid=%d:0x%08x " |
| 1732 | "layoutstateid=%d:0x%08x", |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame^] | 1733 | -__entry->error, |
Trond Myklebust | 1037e6e | 2013-08-14 16:36:51 -0400 | [diff] [blame] | 1734 | show_nfsv4_errors(__entry->error), |
| 1735 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 1736 | (unsigned long long)__entry->fileid, |
| 1737 | __entry->fhandle, |
| 1738 | show_pnfs_iomode(__entry->iomode), |
| 1739 | (unsigned long long)__entry->offset, |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 1740 | (unsigned long long)__entry->count, |
| 1741 | __entry->stateid_seq, __entry->stateid_hash, |
| 1742 | __entry->layoutstateid_seq, __entry->layoutstateid_hash |
Trond Myklebust | 1037e6e | 2013-08-14 16:36:51 -0400 | [diff] [blame] | 1743 | ) |
| 1744 | ); |
| 1745 | |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 1746 | DEFINE_NFS4_INODE_STATEID_EVENT(nfs4_layoutcommit); |
| 1747 | DEFINE_NFS4_INODE_STATEID_EVENT(nfs4_layoutreturn); |
Trond Myklebust | 6a463beb | 2015-08-20 15:40:47 -0500 | [diff] [blame] | 1748 | DEFINE_NFS4_INODE_EVENT(nfs4_layoutreturn_on_close); |
Trond Myklebust | 1037e6e | 2013-08-14 16:36:51 -0400 | [diff] [blame] | 1749 | |
Chuck Lever | 5b2095d | 2018-12-19 11:00:11 -0500 | [diff] [blame] | 1750 | TRACE_DEFINE_ENUM(PNFS_UPDATE_LAYOUT_UNKNOWN); |
| 1751 | TRACE_DEFINE_ENUM(PNFS_UPDATE_LAYOUT_NO_PNFS); |
| 1752 | TRACE_DEFINE_ENUM(PNFS_UPDATE_LAYOUT_RD_ZEROLEN); |
| 1753 | TRACE_DEFINE_ENUM(PNFS_UPDATE_LAYOUT_MDSTHRESH); |
| 1754 | TRACE_DEFINE_ENUM(PNFS_UPDATE_LAYOUT_NOMEM); |
| 1755 | TRACE_DEFINE_ENUM(PNFS_UPDATE_LAYOUT_BULK_RECALL); |
| 1756 | TRACE_DEFINE_ENUM(PNFS_UPDATE_LAYOUT_IO_TEST_FAIL); |
| 1757 | TRACE_DEFINE_ENUM(PNFS_UPDATE_LAYOUT_FOUND_CACHED); |
| 1758 | TRACE_DEFINE_ENUM(PNFS_UPDATE_LAYOUT_RETURN); |
| 1759 | TRACE_DEFINE_ENUM(PNFS_UPDATE_LAYOUT_BLOCKED); |
| 1760 | TRACE_DEFINE_ENUM(PNFS_UPDATE_LAYOUT_INVALID_OPEN); |
| 1761 | TRACE_DEFINE_ENUM(PNFS_UPDATE_LAYOUT_RETRY); |
| 1762 | TRACE_DEFINE_ENUM(PNFS_UPDATE_LAYOUT_SEND_LAYOUTGET); |
| 1763 | |
Jeff Layton | 9a4bf31 | 2015-12-10 10:41:58 -0500 | [diff] [blame] | 1764 | #define show_pnfs_update_layout_reason(reason) \ |
| 1765 | __print_symbolic(reason, \ |
| 1766 | { PNFS_UPDATE_LAYOUT_UNKNOWN, "unknown" }, \ |
| 1767 | { PNFS_UPDATE_LAYOUT_NO_PNFS, "no pnfs" }, \ |
| 1768 | { PNFS_UPDATE_LAYOUT_RD_ZEROLEN, "read+zerolen" }, \ |
| 1769 | { PNFS_UPDATE_LAYOUT_MDSTHRESH, "mdsthresh" }, \ |
| 1770 | { PNFS_UPDATE_LAYOUT_NOMEM, "nomem" }, \ |
| 1771 | { PNFS_UPDATE_LAYOUT_BULK_RECALL, "bulk recall" }, \ |
| 1772 | { PNFS_UPDATE_LAYOUT_IO_TEST_FAIL, "io test fail" }, \ |
| 1773 | { PNFS_UPDATE_LAYOUT_FOUND_CACHED, "found cached" }, \ |
| 1774 | { PNFS_UPDATE_LAYOUT_RETURN, "layoutreturn" }, \ |
| 1775 | { PNFS_UPDATE_LAYOUT_BLOCKED, "layouts blocked" }, \ |
Jeff Layton | 183d9e7 | 2016-05-17 12:28:47 -0400 | [diff] [blame] | 1776 | { PNFS_UPDATE_LAYOUT_INVALID_OPEN, "invalid open" }, \ |
| 1777 | { PNFS_UPDATE_LAYOUT_RETRY, "retrying" }, \ |
Jeff Layton | 9a4bf31 | 2015-12-10 10:41:58 -0500 | [diff] [blame] | 1778 | { PNFS_UPDATE_LAYOUT_SEND_LAYOUTGET, "sent layoutget" }) |
| 1779 | |
| 1780 | TRACE_EVENT(pnfs_update_layout, |
| 1781 | TP_PROTO(struct inode *inode, |
| 1782 | loff_t pos, |
| 1783 | u64 count, |
| 1784 | enum pnfs_iomode iomode, |
Trond Myklebust | f484830 | 2015-12-26 18:03:07 -0500 | [diff] [blame] | 1785 | struct pnfs_layout_hdr *lo, |
Jeff Layton | 183d9e7 | 2016-05-17 12:28:47 -0400 | [diff] [blame] | 1786 | struct pnfs_layout_segment *lseg, |
Jeff Layton | 9a4bf31 | 2015-12-10 10:41:58 -0500 | [diff] [blame] | 1787 | enum pnfs_update_layout_reason reason |
| 1788 | ), |
Jeff Layton | 183d9e7 | 2016-05-17 12:28:47 -0400 | [diff] [blame] | 1789 | TP_ARGS(inode, pos, count, iomode, lo, lseg, reason), |
Jeff Layton | 9a4bf31 | 2015-12-10 10:41:58 -0500 | [diff] [blame] | 1790 | TP_STRUCT__entry( |
| 1791 | __field(dev_t, dev) |
| 1792 | __field(u64, fileid) |
| 1793 | __field(u32, fhandle) |
| 1794 | __field(loff_t, pos) |
| 1795 | __field(u64, count) |
| 1796 | __field(enum pnfs_iomode, iomode) |
Trond Myklebust | f484830 | 2015-12-26 18:03:07 -0500 | [diff] [blame] | 1797 | __field(int, layoutstateid_seq) |
| 1798 | __field(u32, layoutstateid_hash) |
Jeff Layton | 183d9e7 | 2016-05-17 12:28:47 -0400 | [diff] [blame] | 1799 | __field(long, lseg) |
Jeff Layton | 9a4bf31 | 2015-12-10 10:41:58 -0500 | [diff] [blame] | 1800 | __field(enum pnfs_update_layout_reason, reason) |
| 1801 | ), |
| 1802 | TP_fast_assign( |
| 1803 | __entry->dev = inode->i_sb->s_dev; |
| 1804 | __entry->fileid = NFS_FILEID(inode); |
| 1805 | __entry->fhandle = nfs_fhandle_hash(NFS_FH(inode)); |
| 1806 | __entry->pos = pos; |
| 1807 | __entry->count = count; |
| 1808 | __entry->iomode = iomode; |
Jeff Layton | 9a4bf31 | 2015-12-10 10:41:58 -0500 | [diff] [blame] | 1809 | __entry->reason = reason; |
Trond Myklebust | f484830 | 2015-12-26 18:03:07 -0500 | [diff] [blame] | 1810 | if (lo != NULL) { |
| 1811 | __entry->layoutstateid_seq = |
| 1812 | be32_to_cpu(lo->plh_stateid.seqid); |
| 1813 | __entry->layoutstateid_hash = |
| 1814 | nfs_stateid_hash(&lo->plh_stateid); |
| 1815 | } else { |
| 1816 | __entry->layoutstateid_seq = 0; |
| 1817 | __entry->layoutstateid_hash = 0; |
| 1818 | } |
Jeff Layton | 183d9e7 | 2016-05-17 12:28:47 -0400 | [diff] [blame] | 1819 | __entry->lseg = (long)lseg; |
Jeff Layton | 9a4bf31 | 2015-12-10 10:41:58 -0500 | [diff] [blame] | 1820 | ), |
| 1821 | TP_printk( |
| 1822 | "fileid=%02x:%02x:%llu fhandle=0x%08x " |
Trond Myklebust | f484830 | 2015-12-26 18:03:07 -0500 | [diff] [blame] | 1823 | "iomode=%s pos=%llu count=%llu " |
Jeff Layton | 183d9e7 | 2016-05-17 12:28:47 -0400 | [diff] [blame] | 1824 | "layoutstateid=%d:0x%08x lseg=0x%lx (%s)", |
Jeff Layton | 9a4bf31 | 2015-12-10 10:41:58 -0500 | [diff] [blame] | 1825 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 1826 | (unsigned long long)__entry->fileid, |
| 1827 | __entry->fhandle, |
| 1828 | show_pnfs_iomode(__entry->iomode), |
| 1829 | (unsigned long long)__entry->pos, |
Trond Myklebust | f484830 | 2015-12-26 18:03:07 -0500 | [diff] [blame] | 1830 | (unsigned long long)__entry->count, |
| 1831 | __entry->layoutstateid_seq, __entry->layoutstateid_hash, |
Jeff Layton | 183d9e7 | 2016-05-17 12:28:47 -0400 | [diff] [blame] | 1832 | __entry->lseg, |
Jeff Layton | 9a4bf31 | 2015-12-10 10:41:58 -0500 | [diff] [blame] | 1833 | show_pnfs_update_layout_reason(__entry->reason) |
| 1834 | ) |
| 1835 | ); |
| 1836 | |
Trond Myklebust | cc668ab | 2013-08-14 15:31:28 -0400 | [diff] [blame] | 1837 | #endif /* CONFIG_NFS_V4_1 */ |
| 1838 | |
Trond Myklebust | c6d01c6 | 2013-08-09 11:51:26 -0400 | [diff] [blame] | 1839 | #endif /* _TRACE_NFS4_H */ |
| 1840 | |
| 1841 | #undef TRACE_INCLUDE_PATH |
| 1842 | #define TRACE_INCLUDE_PATH . |
| 1843 | #define TRACE_INCLUDE_FILE nfs4trace |
| 1844 | /* This part must be outside protection */ |
| 1845 | #include <trace/define_trace.h> |