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> |
Chuck Lever | b4776a3 | 2021-10-16 18:02:24 -0400 | [diff] [blame] | 12 | #include <trace/events/sunrpc_base.h> |
Trond Myklebust | c6d01c6 | 2013-08-09 11:51:26 -0400 | [diff] [blame] | 13 | |
Chuck Lever | 9d2d48b | 2021-10-22 16:16:56 -0400 | [diff] [blame^] | 14 | #include <trace/events/fs.h> |
| 15 | |
Chuck Lever | 5b2095d | 2018-12-19 11:00:11 -0500 | [diff] [blame] | 16 | TRACE_DEFINE_ENUM(EPERM); |
| 17 | TRACE_DEFINE_ENUM(ENOENT); |
| 18 | TRACE_DEFINE_ENUM(EIO); |
| 19 | TRACE_DEFINE_ENUM(ENXIO); |
| 20 | TRACE_DEFINE_ENUM(EACCES); |
| 21 | TRACE_DEFINE_ENUM(EEXIST); |
| 22 | TRACE_DEFINE_ENUM(EXDEV); |
| 23 | TRACE_DEFINE_ENUM(ENOTDIR); |
| 24 | TRACE_DEFINE_ENUM(EISDIR); |
| 25 | TRACE_DEFINE_ENUM(EFBIG); |
| 26 | TRACE_DEFINE_ENUM(ENOSPC); |
| 27 | TRACE_DEFINE_ENUM(EROFS); |
| 28 | TRACE_DEFINE_ENUM(EMLINK); |
| 29 | TRACE_DEFINE_ENUM(ENAMETOOLONG); |
| 30 | TRACE_DEFINE_ENUM(ENOTEMPTY); |
| 31 | TRACE_DEFINE_ENUM(EDQUOT); |
| 32 | TRACE_DEFINE_ENUM(ESTALE); |
| 33 | TRACE_DEFINE_ENUM(EBADHANDLE); |
| 34 | TRACE_DEFINE_ENUM(EBADCOOKIE); |
| 35 | TRACE_DEFINE_ENUM(ENOTSUPP); |
| 36 | TRACE_DEFINE_ENUM(ETOOSMALL); |
| 37 | TRACE_DEFINE_ENUM(EREMOTEIO); |
| 38 | TRACE_DEFINE_ENUM(EBADTYPE); |
| 39 | TRACE_DEFINE_ENUM(EAGAIN); |
| 40 | TRACE_DEFINE_ENUM(ELOOP); |
| 41 | TRACE_DEFINE_ENUM(EOPNOTSUPP); |
| 42 | TRACE_DEFINE_ENUM(EDEADLK); |
| 43 | TRACE_DEFINE_ENUM(ENOMEM); |
| 44 | TRACE_DEFINE_ENUM(EKEYEXPIRED); |
| 45 | TRACE_DEFINE_ENUM(ETIMEDOUT); |
| 46 | TRACE_DEFINE_ENUM(ERESTARTSYS); |
| 47 | TRACE_DEFINE_ENUM(ECONNREFUSED); |
| 48 | TRACE_DEFINE_ENUM(ECONNRESET); |
| 49 | TRACE_DEFINE_ENUM(ENETUNREACH); |
| 50 | TRACE_DEFINE_ENUM(EHOSTUNREACH); |
| 51 | TRACE_DEFINE_ENUM(EHOSTDOWN); |
| 52 | TRACE_DEFINE_ENUM(EPIPE); |
| 53 | TRACE_DEFINE_ENUM(EPFNOSUPPORT); |
| 54 | TRACE_DEFINE_ENUM(EPROTONOSUPPORT); |
| 55 | |
| 56 | TRACE_DEFINE_ENUM(NFS4_OK); |
| 57 | TRACE_DEFINE_ENUM(NFS4ERR_ACCESS); |
| 58 | TRACE_DEFINE_ENUM(NFS4ERR_ATTRNOTSUPP); |
| 59 | TRACE_DEFINE_ENUM(NFS4ERR_ADMIN_REVOKED); |
| 60 | TRACE_DEFINE_ENUM(NFS4ERR_BACK_CHAN_BUSY); |
| 61 | TRACE_DEFINE_ENUM(NFS4ERR_BADCHAR); |
| 62 | TRACE_DEFINE_ENUM(NFS4ERR_BADHANDLE); |
| 63 | TRACE_DEFINE_ENUM(NFS4ERR_BADIOMODE); |
| 64 | TRACE_DEFINE_ENUM(NFS4ERR_BADLAYOUT); |
| 65 | TRACE_DEFINE_ENUM(NFS4ERR_BADLABEL); |
| 66 | TRACE_DEFINE_ENUM(NFS4ERR_BADNAME); |
| 67 | TRACE_DEFINE_ENUM(NFS4ERR_BADOWNER); |
| 68 | TRACE_DEFINE_ENUM(NFS4ERR_BADSESSION); |
| 69 | TRACE_DEFINE_ENUM(NFS4ERR_BADSLOT); |
| 70 | TRACE_DEFINE_ENUM(NFS4ERR_BADTYPE); |
| 71 | TRACE_DEFINE_ENUM(NFS4ERR_BADXDR); |
| 72 | TRACE_DEFINE_ENUM(NFS4ERR_BAD_COOKIE); |
| 73 | TRACE_DEFINE_ENUM(NFS4ERR_BAD_HIGH_SLOT); |
| 74 | TRACE_DEFINE_ENUM(NFS4ERR_BAD_RANGE); |
| 75 | TRACE_DEFINE_ENUM(NFS4ERR_BAD_SEQID); |
| 76 | TRACE_DEFINE_ENUM(NFS4ERR_BAD_SESSION_DIGEST); |
| 77 | TRACE_DEFINE_ENUM(NFS4ERR_BAD_STATEID); |
| 78 | TRACE_DEFINE_ENUM(NFS4ERR_CB_PATH_DOWN); |
| 79 | TRACE_DEFINE_ENUM(NFS4ERR_CLID_INUSE); |
| 80 | TRACE_DEFINE_ENUM(NFS4ERR_CLIENTID_BUSY); |
| 81 | TRACE_DEFINE_ENUM(NFS4ERR_COMPLETE_ALREADY); |
| 82 | TRACE_DEFINE_ENUM(NFS4ERR_CONN_NOT_BOUND_TO_SESSION); |
| 83 | TRACE_DEFINE_ENUM(NFS4ERR_DEADLOCK); |
| 84 | TRACE_DEFINE_ENUM(NFS4ERR_DEADSESSION); |
| 85 | TRACE_DEFINE_ENUM(NFS4ERR_DELAY); |
| 86 | TRACE_DEFINE_ENUM(NFS4ERR_DELEG_ALREADY_WANTED); |
| 87 | TRACE_DEFINE_ENUM(NFS4ERR_DELEG_REVOKED); |
| 88 | TRACE_DEFINE_ENUM(NFS4ERR_DENIED); |
| 89 | TRACE_DEFINE_ENUM(NFS4ERR_DIRDELEG_UNAVAIL); |
| 90 | TRACE_DEFINE_ENUM(NFS4ERR_DQUOT); |
| 91 | TRACE_DEFINE_ENUM(NFS4ERR_ENCR_ALG_UNSUPP); |
| 92 | TRACE_DEFINE_ENUM(NFS4ERR_EXIST); |
| 93 | TRACE_DEFINE_ENUM(NFS4ERR_EXPIRED); |
| 94 | TRACE_DEFINE_ENUM(NFS4ERR_FBIG); |
| 95 | TRACE_DEFINE_ENUM(NFS4ERR_FHEXPIRED); |
| 96 | TRACE_DEFINE_ENUM(NFS4ERR_FILE_OPEN); |
| 97 | TRACE_DEFINE_ENUM(NFS4ERR_GRACE); |
| 98 | TRACE_DEFINE_ENUM(NFS4ERR_HASH_ALG_UNSUPP); |
| 99 | TRACE_DEFINE_ENUM(NFS4ERR_INVAL); |
| 100 | TRACE_DEFINE_ENUM(NFS4ERR_IO); |
| 101 | TRACE_DEFINE_ENUM(NFS4ERR_ISDIR); |
| 102 | TRACE_DEFINE_ENUM(NFS4ERR_LAYOUTTRYLATER); |
| 103 | TRACE_DEFINE_ENUM(NFS4ERR_LAYOUTUNAVAILABLE); |
| 104 | TRACE_DEFINE_ENUM(NFS4ERR_LEASE_MOVED); |
| 105 | TRACE_DEFINE_ENUM(NFS4ERR_LOCKED); |
| 106 | TRACE_DEFINE_ENUM(NFS4ERR_LOCKS_HELD); |
| 107 | TRACE_DEFINE_ENUM(NFS4ERR_LOCK_RANGE); |
| 108 | TRACE_DEFINE_ENUM(NFS4ERR_MINOR_VERS_MISMATCH); |
| 109 | TRACE_DEFINE_ENUM(NFS4ERR_MLINK); |
| 110 | TRACE_DEFINE_ENUM(NFS4ERR_MOVED); |
| 111 | TRACE_DEFINE_ENUM(NFS4ERR_NAMETOOLONG); |
| 112 | TRACE_DEFINE_ENUM(NFS4ERR_NOENT); |
| 113 | TRACE_DEFINE_ENUM(NFS4ERR_NOFILEHANDLE); |
| 114 | TRACE_DEFINE_ENUM(NFS4ERR_NOMATCHING_LAYOUT); |
| 115 | TRACE_DEFINE_ENUM(NFS4ERR_NOSPC); |
| 116 | TRACE_DEFINE_ENUM(NFS4ERR_NOTDIR); |
| 117 | TRACE_DEFINE_ENUM(NFS4ERR_NOTEMPTY); |
| 118 | TRACE_DEFINE_ENUM(NFS4ERR_NOTSUPP); |
| 119 | TRACE_DEFINE_ENUM(NFS4ERR_NOT_ONLY_OP); |
| 120 | TRACE_DEFINE_ENUM(NFS4ERR_NOT_SAME); |
| 121 | TRACE_DEFINE_ENUM(NFS4ERR_NO_GRACE); |
| 122 | TRACE_DEFINE_ENUM(NFS4ERR_NXIO); |
| 123 | TRACE_DEFINE_ENUM(NFS4ERR_OLD_STATEID); |
| 124 | TRACE_DEFINE_ENUM(NFS4ERR_OPENMODE); |
| 125 | TRACE_DEFINE_ENUM(NFS4ERR_OP_ILLEGAL); |
| 126 | TRACE_DEFINE_ENUM(NFS4ERR_OP_NOT_IN_SESSION); |
| 127 | TRACE_DEFINE_ENUM(NFS4ERR_PERM); |
| 128 | TRACE_DEFINE_ENUM(NFS4ERR_PNFS_IO_HOLE); |
| 129 | TRACE_DEFINE_ENUM(NFS4ERR_PNFS_NO_LAYOUT); |
| 130 | TRACE_DEFINE_ENUM(NFS4ERR_RECALLCONFLICT); |
| 131 | TRACE_DEFINE_ENUM(NFS4ERR_RECLAIM_BAD); |
| 132 | TRACE_DEFINE_ENUM(NFS4ERR_RECLAIM_CONFLICT); |
| 133 | TRACE_DEFINE_ENUM(NFS4ERR_REJECT_DELEG); |
| 134 | TRACE_DEFINE_ENUM(NFS4ERR_REP_TOO_BIG); |
| 135 | TRACE_DEFINE_ENUM(NFS4ERR_REP_TOO_BIG_TO_CACHE); |
| 136 | TRACE_DEFINE_ENUM(NFS4ERR_REQ_TOO_BIG); |
| 137 | TRACE_DEFINE_ENUM(NFS4ERR_RESOURCE); |
| 138 | TRACE_DEFINE_ENUM(NFS4ERR_RESTOREFH); |
| 139 | TRACE_DEFINE_ENUM(NFS4ERR_RETRY_UNCACHED_REP); |
| 140 | TRACE_DEFINE_ENUM(NFS4ERR_RETURNCONFLICT); |
| 141 | TRACE_DEFINE_ENUM(NFS4ERR_ROFS); |
| 142 | TRACE_DEFINE_ENUM(NFS4ERR_SAME); |
| 143 | TRACE_DEFINE_ENUM(NFS4ERR_SHARE_DENIED); |
| 144 | TRACE_DEFINE_ENUM(NFS4ERR_SEQUENCE_POS); |
| 145 | TRACE_DEFINE_ENUM(NFS4ERR_SEQ_FALSE_RETRY); |
| 146 | TRACE_DEFINE_ENUM(NFS4ERR_SEQ_MISORDERED); |
| 147 | TRACE_DEFINE_ENUM(NFS4ERR_SERVERFAULT); |
| 148 | TRACE_DEFINE_ENUM(NFS4ERR_STALE); |
| 149 | TRACE_DEFINE_ENUM(NFS4ERR_STALE_CLIENTID); |
| 150 | TRACE_DEFINE_ENUM(NFS4ERR_STALE_STATEID); |
| 151 | TRACE_DEFINE_ENUM(NFS4ERR_SYMLINK); |
| 152 | TRACE_DEFINE_ENUM(NFS4ERR_TOOSMALL); |
| 153 | TRACE_DEFINE_ENUM(NFS4ERR_TOO_MANY_OPS); |
| 154 | TRACE_DEFINE_ENUM(NFS4ERR_UNKNOWN_LAYOUTTYPE); |
| 155 | TRACE_DEFINE_ENUM(NFS4ERR_UNSAFE_COMPOUND); |
| 156 | TRACE_DEFINE_ENUM(NFS4ERR_WRONGSEC); |
| 157 | TRACE_DEFINE_ENUM(NFS4ERR_WRONG_CRED); |
| 158 | TRACE_DEFINE_ENUM(NFS4ERR_WRONG_TYPE); |
| 159 | TRACE_DEFINE_ENUM(NFS4ERR_XDEV); |
| 160 | |
Trond Myklebust | 0722dc9 | 2020-01-06 15:25:07 -0500 | [diff] [blame] | 161 | TRACE_DEFINE_ENUM(NFS4ERR_RESET_TO_MDS); |
| 162 | TRACE_DEFINE_ENUM(NFS4ERR_RESET_TO_PNFS); |
| 163 | |
Trond Myklebust | c6d01c6 | 2013-08-09 11:51:26 -0400 | [diff] [blame] | 164 | #define show_nfsv4_errors(error) \ |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 165 | __print_symbolic(error, \ |
Trond Myklebust | c6d01c6 | 2013-08-09 11:51:26 -0400 | [diff] [blame] | 166 | { NFS4_OK, "OK" }, \ |
| 167 | /* Mapped by nfs4_stat_to_errno() */ \ |
Chuck Lever | 5b2095d | 2018-12-19 11:00:11 -0500 | [diff] [blame] | 168 | { EPERM, "EPERM" }, \ |
| 169 | { ENOENT, "ENOENT" }, \ |
| 170 | { EIO, "EIO" }, \ |
| 171 | { ENXIO, "ENXIO" }, \ |
| 172 | { EACCES, "EACCES" }, \ |
| 173 | { EEXIST, "EEXIST" }, \ |
| 174 | { EXDEV, "EXDEV" }, \ |
| 175 | { ENOTDIR, "ENOTDIR" }, \ |
| 176 | { EISDIR, "EISDIR" }, \ |
| 177 | { EFBIG, "EFBIG" }, \ |
| 178 | { ENOSPC, "ENOSPC" }, \ |
| 179 | { EROFS, "EROFS" }, \ |
| 180 | { EMLINK, "EMLINK" }, \ |
| 181 | { ENAMETOOLONG, "ENAMETOOLONG" }, \ |
| 182 | { ENOTEMPTY, "ENOTEMPTY" }, \ |
| 183 | { EDQUOT, "EDQUOT" }, \ |
| 184 | { ESTALE, "ESTALE" }, \ |
| 185 | { EBADHANDLE, "EBADHANDLE" }, \ |
| 186 | { EBADCOOKIE, "EBADCOOKIE" }, \ |
| 187 | { ENOTSUPP, "ENOTSUPP" }, \ |
| 188 | { ETOOSMALL, "ETOOSMALL" }, \ |
| 189 | { EREMOTEIO, "EREMOTEIO" }, \ |
| 190 | { EBADTYPE, "EBADTYPE" }, \ |
| 191 | { EAGAIN, "EAGAIN" }, \ |
| 192 | { ELOOP, "ELOOP" }, \ |
| 193 | { EOPNOTSUPP, "EOPNOTSUPP" }, \ |
| 194 | { EDEADLK, "EDEADLK" }, \ |
Trond Myklebust | c6d01c6 | 2013-08-09 11:51:26 -0400 | [diff] [blame] | 195 | /* RPC errors */ \ |
Chuck Lever | 5b2095d | 2018-12-19 11:00:11 -0500 | [diff] [blame] | 196 | { ENOMEM, "ENOMEM" }, \ |
| 197 | { EKEYEXPIRED, "EKEYEXPIRED" }, \ |
| 198 | { ETIMEDOUT, "ETIMEDOUT" }, \ |
| 199 | { ERESTARTSYS, "ERESTARTSYS" }, \ |
| 200 | { ECONNREFUSED, "ECONNREFUSED" }, \ |
| 201 | { ECONNRESET, "ECONNRESET" }, \ |
| 202 | { ENETUNREACH, "ENETUNREACH" }, \ |
| 203 | { EHOSTUNREACH, "EHOSTUNREACH" }, \ |
| 204 | { EHOSTDOWN, "EHOSTDOWN" }, \ |
| 205 | { EPIPE, "EPIPE" }, \ |
| 206 | { EPFNOSUPPORT, "EPFNOSUPPORT" }, \ |
| 207 | { EPROTONOSUPPORT, "EPROTONOSUPPORT" }, \ |
Trond Myklebust | c6d01c6 | 2013-08-09 11:51:26 -0400 | [diff] [blame] | 208 | /* NFSv4 native errors */ \ |
Chuck Lever | 5b2095d | 2018-12-19 11:00:11 -0500 | [diff] [blame] | 209 | { NFS4ERR_ACCESS, "ACCESS" }, \ |
| 210 | { NFS4ERR_ATTRNOTSUPP, "ATTRNOTSUPP" }, \ |
| 211 | { NFS4ERR_ADMIN_REVOKED, "ADMIN_REVOKED" }, \ |
| 212 | { NFS4ERR_BACK_CHAN_BUSY, "BACK_CHAN_BUSY" }, \ |
| 213 | { NFS4ERR_BADCHAR, "BADCHAR" }, \ |
| 214 | { NFS4ERR_BADHANDLE, "BADHANDLE" }, \ |
| 215 | { NFS4ERR_BADIOMODE, "BADIOMODE" }, \ |
| 216 | { NFS4ERR_BADLAYOUT, "BADLAYOUT" }, \ |
| 217 | { NFS4ERR_BADLABEL, "BADLABEL" }, \ |
| 218 | { NFS4ERR_BADNAME, "BADNAME" }, \ |
| 219 | { NFS4ERR_BADOWNER, "BADOWNER" }, \ |
| 220 | { NFS4ERR_BADSESSION, "BADSESSION" }, \ |
| 221 | { NFS4ERR_BADSLOT, "BADSLOT" }, \ |
| 222 | { NFS4ERR_BADTYPE, "BADTYPE" }, \ |
| 223 | { NFS4ERR_BADXDR, "BADXDR" }, \ |
| 224 | { NFS4ERR_BAD_COOKIE, "BAD_COOKIE" }, \ |
| 225 | { NFS4ERR_BAD_HIGH_SLOT, "BAD_HIGH_SLOT" }, \ |
| 226 | { NFS4ERR_BAD_RANGE, "BAD_RANGE" }, \ |
| 227 | { NFS4ERR_BAD_SEQID, "BAD_SEQID" }, \ |
| 228 | { NFS4ERR_BAD_SESSION_DIGEST, "BAD_SESSION_DIGEST" }, \ |
| 229 | { NFS4ERR_BAD_STATEID, "BAD_STATEID" }, \ |
| 230 | { NFS4ERR_CB_PATH_DOWN, "CB_PATH_DOWN" }, \ |
| 231 | { NFS4ERR_CLID_INUSE, "CLID_INUSE" }, \ |
| 232 | { NFS4ERR_CLIENTID_BUSY, "CLIENTID_BUSY" }, \ |
| 233 | { NFS4ERR_COMPLETE_ALREADY, "COMPLETE_ALREADY" }, \ |
| 234 | { NFS4ERR_CONN_NOT_BOUND_TO_SESSION, \ |
Trond Myklebust | c6d01c6 | 2013-08-09 11:51:26 -0400 | [diff] [blame] | 235 | "CONN_NOT_BOUND_TO_SESSION" }, \ |
Chuck Lever | 5b2095d | 2018-12-19 11:00:11 -0500 | [diff] [blame] | 236 | { NFS4ERR_DEADLOCK, "DEADLOCK" }, \ |
| 237 | { NFS4ERR_DEADSESSION, "DEAD_SESSION" }, \ |
| 238 | { NFS4ERR_DELAY, "DELAY" }, \ |
| 239 | { NFS4ERR_DELEG_ALREADY_WANTED, \ |
Trond Myklebust | c6d01c6 | 2013-08-09 11:51:26 -0400 | [diff] [blame] | 240 | "DELEG_ALREADY_WANTED" }, \ |
Chuck Lever | 5b2095d | 2018-12-19 11:00:11 -0500 | [diff] [blame] | 241 | { NFS4ERR_DELEG_REVOKED, "DELEG_REVOKED" }, \ |
| 242 | { NFS4ERR_DENIED, "DENIED" }, \ |
| 243 | { NFS4ERR_DIRDELEG_UNAVAIL, "DIRDELEG_UNAVAIL" }, \ |
| 244 | { NFS4ERR_DQUOT, "DQUOT" }, \ |
| 245 | { NFS4ERR_ENCR_ALG_UNSUPP, "ENCR_ALG_UNSUPP" }, \ |
| 246 | { NFS4ERR_EXIST, "EXIST" }, \ |
| 247 | { NFS4ERR_EXPIRED, "EXPIRED" }, \ |
| 248 | { NFS4ERR_FBIG, "FBIG" }, \ |
| 249 | { NFS4ERR_FHEXPIRED, "FHEXPIRED" }, \ |
| 250 | { NFS4ERR_FILE_OPEN, "FILE_OPEN" }, \ |
| 251 | { NFS4ERR_GRACE, "GRACE" }, \ |
| 252 | { NFS4ERR_HASH_ALG_UNSUPP, "HASH_ALG_UNSUPP" }, \ |
| 253 | { NFS4ERR_INVAL, "INVAL" }, \ |
| 254 | { NFS4ERR_IO, "IO" }, \ |
| 255 | { NFS4ERR_ISDIR, "ISDIR" }, \ |
| 256 | { NFS4ERR_LAYOUTTRYLATER, "LAYOUTTRYLATER" }, \ |
| 257 | { NFS4ERR_LAYOUTUNAVAILABLE, "LAYOUTUNAVAILABLE" }, \ |
| 258 | { NFS4ERR_LEASE_MOVED, "LEASE_MOVED" }, \ |
| 259 | { NFS4ERR_LOCKED, "LOCKED" }, \ |
| 260 | { NFS4ERR_LOCKS_HELD, "LOCKS_HELD" }, \ |
| 261 | { NFS4ERR_LOCK_RANGE, "LOCK_RANGE" }, \ |
| 262 | { NFS4ERR_MINOR_VERS_MISMATCH, "MINOR_VERS_MISMATCH" }, \ |
| 263 | { NFS4ERR_MLINK, "MLINK" }, \ |
| 264 | { NFS4ERR_MOVED, "MOVED" }, \ |
| 265 | { NFS4ERR_NAMETOOLONG, "NAMETOOLONG" }, \ |
| 266 | { NFS4ERR_NOENT, "NOENT" }, \ |
| 267 | { NFS4ERR_NOFILEHANDLE, "NOFILEHANDLE" }, \ |
| 268 | { NFS4ERR_NOMATCHING_LAYOUT, "NOMATCHING_LAYOUT" }, \ |
| 269 | { NFS4ERR_NOSPC, "NOSPC" }, \ |
| 270 | { NFS4ERR_NOTDIR, "NOTDIR" }, \ |
| 271 | { NFS4ERR_NOTEMPTY, "NOTEMPTY" }, \ |
| 272 | { NFS4ERR_NOTSUPP, "NOTSUPP" }, \ |
| 273 | { NFS4ERR_NOT_ONLY_OP, "NOT_ONLY_OP" }, \ |
| 274 | { NFS4ERR_NOT_SAME, "NOT_SAME" }, \ |
| 275 | { NFS4ERR_NO_GRACE, "NO_GRACE" }, \ |
| 276 | { NFS4ERR_NXIO, "NXIO" }, \ |
| 277 | { NFS4ERR_OLD_STATEID, "OLD_STATEID" }, \ |
| 278 | { NFS4ERR_OPENMODE, "OPENMODE" }, \ |
| 279 | { NFS4ERR_OP_ILLEGAL, "OP_ILLEGAL" }, \ |
| 280 | { NFS4ERR_OP_NOT_IN_SESSION, "OP_NOT_IN_SESSION" }, \ |
| 281 | { NFS4ERR_PERM, "PERM" }, \ |
| 282 | { NFS4ERR_PNFS_IO_HOLE, "PNFS_IO_HOLE" }, \ |
| 283 | { NFS4ERR_PNFS_NO_LAYOUT, "PNFS_NO_LAYOUT" }, \ |
| 284 | { NFS4ERR_RECALLCONFLICT, "RECALLCONFLICT" }, \ |
| 285 | { NFS4ERR_RECLAIM_BAD, "RECLAIM_BAD" }, \ |
| 286 | { NFS4ERR_RECLAIM_CONFLICT, "RECLAIM_CONFLICT" }, \ |
| 287 | { NFS4ERR_REJECT_DELEG, "REJECT_DELEG" }, \ |
| 288 | { NFS4ERR_REP_TOO_BIG, "REP_TOO_BIG" }, \ |
| 289 | { NFS4ERR_REP_TOO_BIG_TO_CACHE, \ |
Trond Myklebust | c6d01c6 | 2013-08-09 11:51:26 -0400 | [diff] [blame] | 290 | "REP_TOO_BIG_TO_CACHE" }, \ |
Chuck Lever | 5b2095d | 2018-12-19 11:00:11 -0500 | [diff] [blame] | 291 | { NFS4ERR_REQ_TOO_BIG, "REQ_TOO_BIG" }, \ |
| 292 | { NFS4ERR_RESOURCE, "RESOURCE" }, \ |
| 293 | { NFS4ERR_RESTOREFH, "RESTOREFH" }, \ |
| 294 | { NFS4ERR_RETRY_UNCACHED_REP, "RETRY_UNCACHED_REP" }, \ |
| 295 | { NFS4ERR_RETURNCONFLICT, "RETURNCONFLICT" }, \ |
| 296 | { NFS4ERR_ROFS, "ROFS" }, \ |
| 297 | { NFS4ERR_SAME, "SAME" }, \ |
| 298 | { NFS4ERR_SHARE_DENIED, "SHARE_DENIED" }, \ |
| 299 | { NFS4ERR_SEQUENCE_POS, "SEQUENCE_POS" }, \ |
| 300 | { NFS4ERR_SEQ_FALSE_RETRY, "SEQ_FALSE_RETRY" }, \ |
| 301 | { NFS4ERR_SEQ_MISORDERED, "SEQ_MISORDERED" }, \ |
| 302 | { NFS4ERR_SERVERFAULT, "SERVERFAULT" }, \ |
| 303 | { NFS4ERR_STALE, "STALE" }, \ |
| 304 | { NFS4ERR_STALE_CLIENTID, "STALE_CLIENTID" }, \ |
| 305 | { NFS4ERR_STALE_STATEID, "STALE_STATEID" }, \ |
| 306 | { NFS4ERR_SYMLINK, "SYMLINK" }, \ |
| 307 | { NFS4ERR_TOOSMALL, "TOOSMALL" }, \ |
| 308 | { NFS4ERR_TOO_MANY_OPS, "TOO_MANY_OPS" }, \ |
| 309 | { NFS4ERR_UNKNOWN_LAYOUTTYPE, "UNKNOWN_LAYOUTTYPE" }, \ |
| 310 | { NFS4ERR_UNSAFE_COMPOUND, "UNSAFE_COMPOUND" }, \ |
| 311 | { NFS4ERR_WRONGSEC, "WRONGSEC" }, \ |
| 312 | { NFS4ERR_WRONG_CRED, "WRONG_CRED" }, \ |
| 313 | { NFS4ERR_WRONG_TYPE, "WRONG_TYPE" }, \ |
Trond Myklebust | 0722dc9 | 2020-01-06 15:25:07 -0500 | [diff] [blame] | 314 | { NFS4ERR_XDEV, "XDEV" }, \ |
| 315 | /* ***** Internal to Linux NFS client ***** */ \ |
| 316 | { NFS4ERR_RESET_TO_MDS, "RESET_TO_MDS" }, \ |
| 317 | { NFS4ERR_RESET_TO_PNFS, "RESET_TO_PNFS" }) |
Trond Myklebust | c6d01c6 | 2013-08-09 11:51:26 -0400 | [diff] [blame] | 318 | |
Trond Myklebust | b5f875a | 2013-08-13 13:01:39 -0400 | [diff] [blame] | 319 | #define show_nfs_fattr_flags(valid) \ |
| 320 | __print_flags((unsigned long)valid, "|", \ |
| 321 | { NFS_ATTR_FATTR_TYPE, "TYPE" }, \ |
| 322 | { NFS_ATTR_FATTR_MODE, "MODE" }, \ |
| 323 | { NFS_ATTR_FATTR_NLINK, "NLINK" }, \ |
| 324 | { NFS_ATTR_FATTR_OWNER, "OWNER" }, \ |
| 325 | { NFS_ATTR_FATTR_GROUP, "GROUP" }, \ |
| 326 | { NFS_ATTR_FATTR_RDEV, "RDEV" }, \ |
| 327 | { NFS_ATTR_FATTR_SIZE, "SIZE" }, \ |
| 328 | { NFS_ATTR_FATTR_FSID, "FSID" }, \ |
| 329 | { NFS_ATTR_FATTR_FILEID, "FILEID" }, \ |
| 330 | { NFS_ATTR_FATTR_ATIME, "ATIME" }, \ |
| 331 | { NFS_ATTR_FATTR_MTIME, "MTIME" }, \ |
| 332 | { NFS_ATTR_FATTR_CTIME, "CTIME" }, \ |
| 333 | { NFS_ATTR_FATTR_CHANGE, "CHANGE" }, \ |
| 334 | { NFS_ATTR_FATTR_OWNER_NAME, "OWNER_NAME" }, \ |
| 335 | { NFS_ATTR_FATTR_GROUP_NAME, "GROUP_NAME" }) |
| 336 | |
Trond Myklebust | c6d01c6 | 2013-08-09 11:51:26 -0400 | [diff] [blame] | 337 | DECLARE_EVENT_CLASS(nfs4_clientid_event, |
| 338 | TP_PROTO( |
| 339 | const struct nfs_client *clp, |
| 340 | int error |
| 341 | ), |
| 342 | |
| 343 | TP_ARGS(clp, error), |
| 344 | |
| 345 | TP_STRUCT__entry( |
Anna Schumaker | 3944369 | 2017-11-01 15:48:43 -0400 | [diff] [blame] | 346 | __string(dstaddr, clp->cl_hostname) |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 347 | __field(unsigned long, error) |
Trond Myklebust | c6d01c6 | 2013-08-09 11:51:26 -0400 | [diff] [blame] | 348 | ), |
| 349 | |
| 350 | TP_fast_assign( |
Trond Myklebust | 118b629 | 2020-01-06 15:25:06 -0500 | [diff] [blame] | 351 | __entry->error = error < 0 ? -error : 0; |
Anna Schumaker | 3944369 | 2017-11-01 15:48:43 -0400 | [diff] [blame] | 352 | __assign_str(dstaddr, clp->cl_hostname); |
Trond Myklebust | c6d01c6 | 2013-08-09 11:51:26 -0400 | [diff] [blame] | 353 | ), |
| 354 | |
| 355 | TP_printk( |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 356 | "error=%ld (%s) dstaddr=%s", |
| 357 | -__entry->error, |
Trond Myklebust | c6d01c6 | 2013-08-09 11:51:26 -0400 | [diff] [blame] | 358 | show_nfsv4_errors(__entry->error), |
| 359 | __get_str(dstaddr) |
| 360 | ) |
| 361 | ); |
| 362 | #define DEFINE_NFS4_CLIENTID_EVENT(name) \ |
| 363 | DEFINE_EVENT(nfs4_clientid_event, name, \ |
| 364 | TP_PROTO( \ |
| 365 | const struct nfs_client *clp, \ |
| 366 | int error \ |
| 367 | ), \ |
| 368 | TP_ARGS(clp, error)) |
| 369 | DEFINE_NFS4_CLIENTID_EVENT(nfs4_setclientid); |
| 370 | DEFINE_NFS4_CLIENTID_EVENT(nfs4_setclientid_confirm); |
| 371 | DEFINE_NFS4_CLIENTID_EVENT(nfs4_renew); |
| 372 | DEFINE_NFS4_CLIENTID_EVENT(nfs4_renew_async); |
| 373 | #ifdef CONFIG_NFS_V4_1 |
| 374 | DEFINE_NFS4_CLIENTID_EVENT(nfs4_exchange_id); |
| 375 | DEFINE_NFS4_CLIENTID_EVENT(nfs4_create_session); |
| 376 | DEFINE_NFS4_CLIENTID_EVENT(nfs4_destroy_session); |
| 377 | DEFINE_NFS4_CLIENTID_EVENT(nfs4_destroy_clientid); |
| 378 | DEFINE_NFS4_CLIENTID_EVENT(nfs4_bind_conn_to_session); |
| 379 | DEFINE_NFS4_CLIENTID_EVENT(nfs4_sequence); |
| 380 | DEFINE_NFS4_CLIENTID_EVENT(nfs4_reclaim_complete); |
Trond Myklebust | 2f92ae3 | 2013-08-14 17:58:28 -0400 | [diff] [blame] | 381 | |
Trond Myklebust | 2f92ae3 | 2013-08-14 17:58:28 -0400 | [diff] [blame] | 382 | #define show_nfs4_sequence_status_flags(status) \ |
| 383 | __print_flags((unsigned long)status, "|", \ |
| 384 | { SEQ4_STATUS_CB_PATH_DOWN, "CB_PATH_DOWN" }, \ |
| 385 | { SEQ4_STATUS_CB_GSS_CONTEXTS_EXPIRING, \ |
| 386 | "CB_GSS_CONTEXTS_EXPIRING" }, \ |
| 387 | { SEQ4_STATUS_CB_GSS_CONTEXTS_EXPIRED, \ |
| 388 | "CB_GSS_CONTEXTS_EXPIRED" }, \ |
| 389 | { SEQ4_STATUS_EXPIRED_ALL_STATE_REVOKED, \ |
| 390 | "EXPIRED_ALL_STATE_REVOKED" }, \ |
| 391 | { SEQ4_STATUS_EXPIRED_SOME_STATE_REVOKED, \ |
| 392 | "EXPIRED_SOME_STATE_REVOKED" }, \ |
| 393 | { SEQ4_STATUS_ADMIN_STATE_REVOKED, \ |
| 394 | "ADMIN_STATE_REVOKED" }, \ |
| 395 | { SEQ4_STATUS_RECALLABLE_STATE_REVOKED, \ |
| 396 | "RECALLABLE_STATE_REVOKED" }, \ |
| 397 | { SEQ4_STATUS_LEASE_MOVED, "LEASE_MOVED" }, \ |
| 398 | { SEQ4_STATUS_RESTART_RECLAIM_NEEDED, \ |
| 399 | "RESTART_RECLAIM_NEEDED" }, \ |
| 400 | { SEQ4_STATUS_CB_PATH_DOWN_SESSION, \ |
| 401 | "CB_PATH_DOWN_SESSION" }, \ |
| 402 | { SEQ4_STATUS_BACKCHANNEL_FAULT, \ |
| 403 | "BACKCHANNEL_FAULT" }) |
| 404 | |
| 405 | TRACE_EVENT(nfs4_sequence_done, |
| 406 | TP_PROTO( |
| 407 | const struct nfs4_session *session, |
| 408 | const struct nfs4_sequence_res *res |
| 409 | ), |
| 410 | TP_ARGS(session, res), |
| 411 | |
| 412 | TP_STRUCT__entry( |
| 413 | __field(unsigned int, session) |
| 414 | __field(unsigned int, slot_nr) |
| 415 | __field(unsigned int, seq_nr) |
| 416 | __field(unsigned int, highest_slotid) |
| 417 | __field(unsigned int, target_highest_slotid) |
| 418 | __field(unsigned int, status_flags) |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 419 | __field(unsigned long, error) |
Trond Myklebust | 2f92ae3 | 2013-08-14 17:58:28 -0400 | [diff] [blame] | 420 | ), |
| 421 | |
| 422 | TP_fast_assign( |
| 423 | const struct nfs4_slot *sr_slot = res->sr_slot; |
| 424 | __entry->session = nfs_session_id_hash(&session->sess_id); |
| 425 | __entry->slot_nr = sr_slot->slot_nr; |
| 426 | __entry->seq_nr = sr_slot->seq_nr; |
| 427 | __entry->highest_slotid = res->sr_highest_slotid; |
| 428 | __entry->target_highest_slotid = |
| 429 | res->sr_target_highest_slotid; |
Andrew Elble | 52618df | 2015-12-02 09:19:43 -0500 | [diff] [blame] | 430 | __entry->status_flags = res->sr_status_flags; |
Trond Myklebust | 118b629 | 2020-01-06 15:25:06 -0500 | [diff] [blame] | 431 | __entry->error = res->sr_status < 0 ? |
| 432 | -res->sr_status : 0; |
Trond Myklebust | 2f92ae3 | 2013-08-14 17:58:28 -0400 | [diff] [blame] | 433 | ), |
| 434 | TP_printk( |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 435 | "error=%ld (%s) session=0x%08x slot_nr=%u seq_nr=%u " |
Trond Myklebust | 2f92ae3 | 2013-08-14 17:58:28 -0400 | [diff] [blame] | 436 | "highest_slotid=%u target_highest_slotid=%u " |
| 437 | "status_flags=%u (%s)", |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 438 | -__entry->error, |
Trond Myklebust | 2f92ae3 | 2013-08-14 17:58:28 -0400 | [diff] [blame] | 439 | show_nfsv4_errors(__entry->error), |
| 440 | __entry->session, |
| 441 | __entry->slot_nr, |
| 442 | __entry->seq_nr, |
| 443 | __entry->highest_slotid, |
| 444 | __entry->target_highest_slotid, |
| 445 | __entry->status_flags, |
| 446 | show_nfs4_sequence_status_flags(__entry->status_flags) |
| 447 | ) |
| 448 | ); |
| 449 | |
| 450 | struct cb_sequenceargs; |
| 451 | struct cb_sequenceres; |
| 452 | |
| 453 | TRACE_EVENT(nfs4_cb_sequence, |
| 454 | TP_PROTO( |
| 455 | const struct cb_sequenceargs *args, |
| 456 | const struct cb_sequenceres *res, |
| 457 | __be32 status |
| 458 | ), |
| 459 | TP_ARGS(args, res, status), |
| 460 | |
| 461 | TP_STRUCT__entry( |
| 462 | __field(unsigned int, session) |
| 463 | __field(unsigned int, slot_nr) |
| 464 | __field(unsigned int, seq_nr) |
| 465 | __field(unsigned int, highest_slotid) |
| 466 | __field(unsigned int, cachethis) |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 467 | __field(unsigned long, error) |
Trond Myklebust | 2f92ae3 | 2013-08-14 17:58:28 -0400 | [diff] [blame] | 468 | ), |
| 469 | |
| 470 | TP_fast_assign( |
| 471 | __entry->session = nfs_session_id_hash(&args->csa_sessionid); |
| 472 | __entry->slot_nr = args->csa_slotid; |
| 473 | __entry->seq_nr = args->csa_sequenceid; |
| 474 | __entry->highest_slotid = args->csa_highestslotid; |
| 475 | __entry->cachethis = args->csa_cachethis; |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 476 | __entry->error = be32_to_cpu(status); |
Trond Myklebust | 2f92ae3 | 2013-08-14 17:58:28 -0400 | [diff] [blame] | 477 | ), |
| 478 | |
| 479 | TP_printk( |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 480 | "error=%ld (%s) session=0x%08x slot_nr=%u seq_nr=%u " |
Trond Myklebust | 2f92ae3 | 2013-08-14 17:58:28 -0400 | [diff] [blame] | 481 | "highest_slotid=%u", |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 482 | -__entry->error, |
Trond Myklebust | 2f92ae3 | 2013-08-14 17:58:28 -0400 | [diff] [blame] | 483 | show_nfsv4_errors(__entry->error), |
| 484 | __entry->session, |
| 485 | __entry->slot_nr, |
| 486 | __entry->seq_nr, |
| 487 | __entry->highest_slotid |
| 488 | ) |
| 489 | ); |
Chuck Lever | c5833f0 | 2019-06-19 10:33:47 -0400 | [diff] [blame] | 490 | |
| 491 | TRACE_EVENT(nfs4_cb_seqid_err, |
| 492 | TP_PROTO( |
| 493 | const struct cb_sequenceargs *args, |
| 494 | __be32 status |
| 495 | ), |
| 496 | TP_ARGS(args, status), |
| 497 | |
| 498 | TP_STRUCT__entry( |
| 499 | __field(unsigned int, session) |
| 500 | __field(unsigned int, slot_nr) |
| 501 | __field(unsigned int, seq_nr) |
| 502 | __field(unsigned int, highest_slotid) |
| 503 | __field(unsigned int, cachethis) |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 504 | __field(unsigned long, error) |
Chuck Lever | c5833f0 | 2019-06-19 10:33:47 -0400 | [diff] [blame] | 505 | ), |
| 506 | |
| 507 | TP_fast_assign( |
| 508 | __entry->session = nfs_session_id_hash(&args->csa_sessionid); |
| 509 | __entry->slot_nr = args->csa_slotid; |
| 510 | __entry->seq_nr = args->csa_sequenceid; |
| 511 | __entry->highest_slotid = args->csa_highestslotid; |
| 512 | __entry->cachethis = args->csa_cachethis; |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 513 | __entry->error = be32_to_cpu(status); |
Chuck Lever | c5833f0 | 2019-06-19 10:33:47 -0400 | [diff] [blame] | 514 | ), |
| 515 | |
| 516 | TP_printk( |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 517 | "error=%ld (%s) session=0x%08x slot_nr=%u seq_nr=%u " |
Chuck Lever | c5833f0 | 2019-06-19 10:33:47 -0400 | [diff] [blame] | 518 | "highest_slotid=%u", |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 519 | -__entry->error, |
Chuck Lever | c5833f0 | 2019-06-19 10:33:47 -0400 | [diff] [blame] | 520 | show_nfsv4_errors(__entry->error), |
| 521 | __entry->session, |
| 522 | __entry->slot_nr, |
| 523 | __entry->seq_nr, |
| 524 | __entry->highest_slotid |
| 525 | ) |
| 526 | ); |
| 527 | |
Trond Myklebust | c6d01c6 | 2013-08-09 11:51:26 -0400 | [diff] [blame] | 528 | #endif /* CONFIG_NFS_V4_1 */ |
| 529 | |
Anna Schumaker | ad05cc0 | 2017-01-11 13:37:06 -0500 | [diff] [blame] | 530 | TRACE_EVENT(nfs4_setup_sequence, |
| 531 | TP_PROTO( |
| 532 | const struct nfs4_session *session, |
| 533 | const struct nfs4_sequence_args *args |
| 534 | ), |
| 535 | TP_ARGS(session, args), |
| 536 | |
| 537 | TP_STRUCT__entry( |
| 538 | __field(unsigned int, session) |
| 539 | __field(unsigned int, slot_nr) |
| 540 | __field(unsigned int, seq_nr) |
| 541 | __field(unsigned int, highest_used_slotid) |
| 542 | ), |
| 543 | |
| 544 | TP_fast_assign( |
| 545 | const struct nfs4_slot *sa_slot = args->sa_slot; |
| 546 | __entry->session = session ? nfs_session_id_hash(&session->sess_id) : 0; |
| 547 | __entry->slot_nr = sa_slot->slot_nr; |
| 548 | __entry->seq_nr = sa_slot->seq_nr; |
| 549 | __entry->highest_used_slotid = |
| 550 | sa_slot->table->highest_used_slotid; |
| 551 | ), |
| 552 | TP_printk( |
| 553 | "session=0x%08x slot_nr=%u seq_nr=%u " |
| 554 | "highest_used_slotid=%u", |
| 555 | __entry->session, |
| 556 | __entry->slot_nr, |
| 557 | __entry->seq_nr, |
| 558 | __entry->highest_used_slotid |
| 559 | ) |
| 560 | ); |
| 561 | |
Chuck Lever | 511ba52 | 2019-11-05 11:04:07 -0500 | [diff] [blame] | 562 | TRACE_DEFINE_ENUM(NFS4CLNT_MANAGER_RUNNING); |
| 563 | TRACE_DEFINE_ENUM(NFS4CLNT_CHECK_LEASE); |
| 564 | TRACE_DEFINE_ENUM(NFS4CLNT_LEASE_EXPIRED); |
| 565 | TRACE_DEFINE_ENUM(NFS4CLNT_RECLAIM_REBOOT); |
| 566 | TRACE_DEFINE_ENUM(NFS4CLNT_RECLAIM_NOGRACE); |
| 567 | TRACE_DEFINE_ENUM(NFS4CLNT_DELEGRETURN); |
| 568 | TRACE_DEFINE_ENUM(NFS4CLNT_SESSION_RESET); |
| 569 | TRACE_DEFINE_ENUM(NFS4CLNT_LEASE_CONFIRM); |
| 570 | TRACE_DEFINE_ENUM(NFS4CLNT_SERVER_SCOPE_MISMATCH); |
| 571 | TRACE_DEFINE_ENUM(NFS4CLNT_PURGE_STATE); |
| 572 | TRACE_DEFINE_ENUM(NFS4CLNT_BIND_CONN_TO_SESSION); |
| 573 | TRACE_DEFINE_ENUM(NFS4CLNT_MOVED); |
| 574 | TRACE_DEFINE_ENUM(NFS4CLNT_LEASE_MOVED); |
| 575 | TRACE_DEFINE_ENUM(NFS4CLNT_DELEGATION_EXPIRED); |
| 576 | TRACE_DEFINE_ENUM(NFS4CLNT_RUN_MANAGER); |
Trond Myklebust | b5fdf84 | 2020-02-18 15:58:31 -0500 | [diff] [blame] | 577 | TRACE_DEFINE_ENUM(NFS4CLNT_RECALL_RUNNING); |
| 578 | TRACE_DEFINE_ENUM(NFS4CLNT_RECALL_ANY_LAYOUT_READ); |
| 579 | TRACE_DEFINE_ENUM(NFS4CLNT_RECALL_ANY_LAYOUT_RW); |
Chuck Lever | 511ba52 | 2019-11-05 11:04:07 -0500 | [diff] [blame] | 580 | |
| 581 | #define show_nfs4_clp_state(state) \ |
| 582 | __print_flags(state, "|", \ |
| 583 | { NFS4CLNT_MANAGER_RUNNING, "MANAGER_RUNNING" }, \ |
| 584 | { NFS4CLNT_CHECK_LEASE, "CHECK_LEASE" }, \ |
| 585 | { NFS4CLNT_LEASE_EXPIRED, "LEASE_EXPIRED" }, \ |
| 586 | { NFS4CLNT_RECLAIM_REBOOT, "RECLAIM_REBOOT" }, \ |
| 587 | { NFS4CLNT_RECLAIM_NOGRACE, "RECLAIM_NOGRACE" }, \ |
| 588 | { NFS4CLNT_DELEGRETURN, "DELEGRETURN" }, \ |
| 589 | { NFS4CLNT_SESSION_RESET, "SESSION_RESET" }, \ |
| 590 | { NFS4CLNT_LEASE_CONFIRM, "LEASE_CONFIRM" }, \ |
| 591 | { NFS4CLNT_SERVER_SCOPE_MISMATCH, \ |
| 592 | "SERVER_SCOPE_MISMATCH" }, \ |
| 593 | { NFS4CLNT_PURGE_STATE, "PURGE_STATE" }, \ |
| 594 | { NFS4CLNT_BIND_CONN_TO_SESSION, \ |
| 595 | "BIND_CONN_TO_SESSION" }, \ |
| 596 | { NFS4CLNT_MOVED, "MOVED" }, \ |
| 597 | { NFS4CLNT_LEASE_MOVED, "LEASE_MOVED" }, \ |
| 598 | { NFS4CLNT_DELEGATION_EXPIRED, "DELEGATION_EXPIRED" }, \ |
| 599 | { NFS4CLNT_RUN_MANAGER, "RUN_MANAGER" }, \ |
Trond Myklebust | b5fdf84 | 2020-02-18 15:58:31 -0500 | [diff] [blame] | 600 | { NFS4CLNT_RECALL_RUNNING, "RECALL_RUNNING" }, \ |
| 601 | { NFS4CLNT_RECALL_ANY_LAYOUT_READ, "RECALL_ANY_LAYOUT_READ" }, \ |
| 602 | { NFS4CLNT_RECALL_ANY_LAYOUT_RW, "RECALL_ANY_LAYOUT_RW" }) |
Chuck Lever | 511ba52 | 2019-11-05 11:04:07 -0500 | [diff] [blame] | 603 | |
| 604 | TRACE_EVENT(nfs4_state_mgr, |
| 605 | TP_PROTO( |
| 606 | const struct nfs_client *clp |
| 607 | ), |
| 608 | |
| 609 | TP_ARGS(clp), |
| 610 | |
| 611 | TP_STRUCT__entry( |
| 612 | __field(unsigned long, state) |
| 613 | __string(hostname, clp->cl_hostname) |
| 614 | ), |
| 615 | |
| 616 | TP_fast_assign( |
| 617 | __entry->state = clp->cl_state; |
Joe Perches | 78c14b3 | 2021-06-12 08:42:27 -0700 | [diff] [blame] | 618 | __assign_str(hostname, clp->cl_hostname); |
Chuck Lever | 511ba52 | 2019-11-05 11:04:07 -0500 | [diff] [blame] | 619 | ), |
| 620 | |
| 621 | TP_printk( |
| 622 | "hostname=%s clp state=%s", __get_str(hostname), |
| 623 | show_nfs4_clp_state(__entry->state) |
| 624 | ) |
| 625 | ) |
| 626 | |
| 627 | TRACE_EVENT(nfs4_state_mgr_failed, |
| 628 | TP_PROTO( |
| 629 | const struct nfs_client *clp, |
| 630 | const char *section, |
| 631 | int status |
| 632 | ), |
| 633 | |
| 634 | TP_ARGS(clp, section, status), |
| 635 | |
| 636 | TP_STRUCT__entry( |
| 637 | __field(unsigned long, error) |
| 638 | __field(unsigned long, state) |
| 639 | __string(hostname, clp->cl_hostname) |
| 640 | __string(section, section) |
| 641 | ), |
| 642 | |
| 643 | TP_fast_assign( |
Trond Myklebust | 118b629 | 2020-01-06 15:25:06 -0500 | [diff] [blame] | 644 | __entry->error = status < 0 ? -status : 0; |
Chuck Lever | 511ba52 | 2019-11-05 11:04:07 -0500 | [diff] [blame] | 645 | __entry->state = clp->cl_state; |
| 646 | __assign_str(hostname, clp->cl_hostname); |
| 647 | __assign_str(section, section); |
| 648 | ), |
| 649 | |
| 650 | TP_printk( |
| 651 | "hostname=%s clp state=%s error=%ld (%s) section=%s", |
| 652 | __get_str(hostname), |
| 653 | show_nfs4_clp_state(__entry->state), -__entry->error, |
| 654 | show_nfsv4_errors(__entry->error), __get_str(section) |
| 655 | |
| 656 | ) |
| 657 | ) |
| 658 | |
Trond Myklebust | da934ae | 2021-04-01 14:38:13 -0400 | [diff] [blame] | 659 | TRACE_EVENT(nfs4_xdr_bad_operation, |
| 660 | TP_PROTO( |
| 661 | const struct xdr_stream *xdr, |
| 662 | u32 op, |
| 663 | u32 expected |
| 664 | ), |
| 665 | |
| 666 | TP_ARGS(xdr, op, expected), |
| 667 | |
| 668 | TP_STRUCT__entry( |
| 669 | __field(unsigned int, task_id) |
| 670 | __field(unsigned int, client_id) |
| 671 | __field(u32, xid) |
| 672 | __field(u32, op) |
| 673 | __field(u32, expected) |
| 674 | ), |
| 675 | |
| 676 | TP_fast_assign( |
| 677 | const struct rpc_rqst *rqstp = xdr->rqst; |
| 678 | const struct rpc_task *task = rqstp->rq_task; |
| 679 | |
| 680 | __entry->task_id = task->tk_pid; |
| 681 | __entry->client_id = task->tk_client->cl_clid; |
| 682 | __entry->xid = be32_to_cpu(rqstp->rq_xid); |
| 683 | __entry->op = op; |
| 684 | __entry->expected = expected; |
| 685 | ), |
| 686 | |
Chuck Lever | b4776a3 | 2021-10-16 18:02:24 -0400 | [diff] [blame] | 687 | TP_printk(SUNRPC_TRACE_TASK_SPECIFIER |
| 688 | " xid=0x%08x operation=%u, expected=%u", |
Trond Myklebust | da934ae | 2021-04-01 14:38:13 -0400 | [diff] [blame] | 689 | __entry->task_id, __entry->client_id, __entry->xid, |
| 690 | __entry->op, __entry->expected |
| 691 | ) |
| 692 | ); |
| 693 | |
Trond Myklebust | 3d66bae | 2021-04-01 13:54:19 -0400 | [diff] [blame] | 694 | DECLARE_EVENT_CLASS(nfs4_xdr_event, |
Chuck Lever | f23f658 | 2019-02-11 11:24:26 -0500 | [diff] [blame] | 695 | TP_PROTO( |
Chuck Lever | 62a92ba | 2019-06-19 10:34:09 -0400 | [diff] [blame] | 696 | const struct xdr_stream *xdr, |
Chuck Lever | f23f658 | 2019-02-11 11:24:26 -0500 | [diff] [blame] | 697 | u32 op, |
Trond Myklebust | 118b629 | 2020-01-06 15:25:06 -0500 | [diff] [blame] | 698 | u32 error |
Chuck Lever | f23f658 | 2019-02-11 11:24:26 -0500 | [diff] [blame] | 699 | ), |
| 700 | |
Chuck Lever | 62a92ba | 2019-06-19 10:34:09 -0400 | [diff] [blame] | 701 | TP_ARGS(xdr, op, error), |
Chuck Lever | f23f658 | 2019-02-11 11:24:26 -0500 | [diff] [blame] | 702 | |
| 703 | TP_STRUCT__entry( |
Chuck Lever | 62a92ba | 2019-06-19 10:34:09 -0400 | [diff] [blame] | 704 | __field(unsigned int, task_id) |
| 705 | __field(unsigned int, client_id) |
| 706 | __field(u32, xid) |
Chuck Lever | f23f658 | 2019-02-11 11:24:26 -0500 | [diff] [blame] | 707 | __field(u32, op) |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 708 | __field(unsigned long, error) |
Chuck Lever | f23f658 | 2019-02-11 11:24:26 -0500 | [diff] [blame] | 709 | ), |
| 710 | |
| 711 | TP_fast_assign( |
Chuck Lever | 62a92ba | 2019-06-19 10:34:09 -0400 | [diff] [blame] | 712 | const struct rpc_rqst *rqstp = xdr->rqst; |
| 713 | const struct rpc_task *task = rqstp->rq_task; |
| 714 | |
| 715 | __entry->task_id = task->tk_pid; |
| 716 | __entry->client_id = task->tk_client->cl_clid; |
| 717 | __entry->xid = be32_to_cpu(rqstp->rq_xid); |
Chuck Lever | f23f658 | 2019-02-11 11:24:26 -0500 | [diff] [blame] | 718 | __entry->op = op; |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 719 | __entry->error = error; |
Chuck Lever | f23f658 | 2019-02-11 11:24:26 -0500 | [diff] [blame] | 720 | ), |
| 721 | |
Chuck Lever | b4776a3 | 2021-10-16 18:02:24 -0400 | [diff] [blame] | 722 | TP_printk(SUNRPC_TRACE_TASK_SPECIFIER |
| 723 | " xid=0x%08x error=%ld (%s) operation=%u", |
Chuck Lever | 62a92ba | 2019-06-19 10:34:09 -0400 | [diff] [blame] | 724 | __entry->task_id, __entry->client_id, __entry->xid, |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 725 | -__entry->error, show_nfsv4_errors(__entry->error), |
| 726 | __entry->op |
Chuck Lever | f23f658 | 2019-02-11 11:24:26 -0500 | [diff] [blame] | 727 | ) |
| 728 | ); |
Trond Myklebust | 3d66bae | 2021-04-01 13:54:19 -0400 | [diff] [blame] | 729 | #define DEFINE_NFS4_XDR_EVENT(name) \ |
| 730 | DEFINE_EVENT(nfs4_xdr_event, name, \ |
| 731 | TP_PROTO( \ |
| 732 | const struct xdr_stream *xdr, \ |
| 733 | u32 op, \ |
| 734 | u32 error \ |
| 735 | ), \ |
| 736 | TP_ARGS(xdr, op, error)) |
| 737 | DEFINE_NFS4_XDR_EVENT(nfs4_xdr_status); |
Trond Myklebust | eb3d58c | 2021-04-01 14:03:26 -0400 | [diff] [blame] | 738 | DEFINE_NFS4_XDR_EVENT(nfs4_xdr_bad_filehandle); |
Chuck Lever | f23f658 | 2019-02-11 11:24:26 -0500 | [diff] [blame] | 739 | |
Chuck Lever | 2bb50aa | 2019-12-23 10:28:38 -0500 | [diff] [blame] | 740 | DECLARE_EVENT_CLASS(nfs4_cb_error_class, |
| 741 | TP_PROTO( |
| 742 | __be32 xid, |
| 743 | u32 cb_ident |
| 744 | ), |
| 745 | |
| 746 | TP_ARGS(xid, cb_ident), |
| 747 | |
| 748 | TP_STRUCT__entry( |
| 749 | __field(u32, xid) |
| 750 | __field(u32, cbident) |
| 751 | ), |
| 752 | |
| 753 | TP_fast_assign( |
| 754 | __entry->xid = be32_to_cpu(xid); |
| 755 | __entry->cbident = cb_ident; |
| 756 | ), |
| 757 | |
| 758 | TP_printk( |
| 759 | "xid=0x%08x cb_ident=0x%08x", |
| 760 | __entry->xid, __entry->cbident |
| 761 | ) |
| 762 | ); |
| 763 | |
| 764 | #define DEFINE_CB_ERROR_EVENT(name) \ |
| 765 | DEFINE_EVENT(nfs4_cb_error_class, nfs_cb_##name, \ |
| 766 | TP_PROTO( \ |
| 767 | __be32 xid, \ |
| 768 | u32 cb_ident \ |
| 769 | ), \ |
| 770 | TP_ARGS(xid, cb_ident)) |
| 771 | |
| 772 | DEFINE_CB_ERROR_EVENT(no_clp); |
| 773 | DEFINE_CB_ERROR_EVENT(badprinc); |
| 774 | |
Trond Myklebust | 42113a7 | 2013-08-12 16:19:27 -0400 | [diff] [blame] | 775 | DECLARE_EVENT_CLASS(nfs4_open_event, |
| 776 | TP_PROTO( |
| 777 | const struct nfs_open_context *ctx, |
| 778 | int flags, |
| 779 | int error |
| 780 | ), |
| 781 | |
| 782 | TP_ARGS(ctx, flags, error), |
| 783 | |
| 784 | TP_STRUCT__entry( |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 785 | __field(unsigned long, error) |
Chuck Lever | 9d2d48b | 2021-10-22 16:16:56 -0400 | [diff] [blame^] | 786 | __field(unsigned long, flags) |
| 787 | __field(unsigned long, fmode) |
Trond Myklebust | 42113a7 | 2013-08-12 16:19:27 -0400 | [diff] [blame] | 788 | __field(dev_t, dev) |
| 789 | __field(u32, fhandle) |
| 790 | __field(u64, fileid) |
| 791 | __field(u64, dir) |
| 792 | __string(name, ctx->dentry->d_name.name) |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 793 | __field(int, stateid_seq) |
| 794 | __field(u32, stateid_hash) |
| 795 | __field(int, openstateid_seq) |
| 796 | __field(u32, openstateid_hash) |
Trond Myklebust | 42113a7 | 2013-08-12 16:19:27 -0400 | [diff] [blame] | 797 | ), |
| 798 | |
| 799 | TP_fast_assign( |
| 800 | const struct nfs4_state *state = ctx->state; |
| 801 | const struct inode *inode = NULL; |
| 802 | |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 803 | __entry->error = -error; |
Trond Myklebust | 42113a7 | 2013-08-12 16:19:27 -0400 | [diff] [blame] | 804 | __entry->flags = flags; |
Chuck Lever | 9d2d48b | 2021-10-22 16:16:56 -0400 | [diff] [blame^] | 805 | __entry->fmode = (__force unsigned long)ctx->mode; |
Trond Myklebust | 42113a7 | 2013-08-12 16:19:27 -0400 | [diff] [blame] | 806 | __entry->dev = ctx->dentry->d_sb->s_dev; |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 807 | if (!IS_ERR_OR_NULL(state)) { |
Trond Myklebust | 42113a7 | 2013-08-12 16:19:27 -0400 | [diff] [blame] | 808 | inode = state->inode; |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 809 | __entry->stateid_seq = |
| 810 | be32_to_cpu(state->stateid.seqid); |
| 811 | __entry->stateid_hash = |
| 812 | nfs_stateid_hash(&state->stateid); |
| 813 | __entry->openstateid_seq = |
| 814 | be32_to_cpu(state->open_stateid.seqid); |
| 815 | __entry->openstateid_hash = |
| 816 | nfs_stateid_hash(&state->open_stateid); |
| 817 | } else { |
| 818 | __entry->stateid_seq = 0; |
| 819 | __entry->stateid_hash = 0; |
| 820 | __entry->openstateid_seq = 0; |
| 821 | __entry->openstateid_hash = 0; |
| 822 | } |
Trond Myklebust | 42113a7 | 2013-08-12 16:19:27 -0400 | [diff] [blame] | 823 | if (inode != NULL) { |
| 824 | __entry->fileid = NFS_FILEID(inode); |
| 825 | __entry->fhandle = nfs_fhandle_hash(NFS_FH(inode)); |
| 826 | } else { |
| 827 | __entry->fileid = 0; |
| 828 | __entry->fhandle = 0; |
| 829 | } |
David Howells | 2b0143b | 2015-03-17 22:25:59 +0000 | [diff] [blame] | 830 | __entry->dir = NFS_FILEID(d_inode(ctx->dentry->d_parent)); |
Trond Myklebust | 42113a7 | 2013-08-12 16:19:27 -0400 | [diff] [blame] | 831 | __assign_str(name, ctx->dentry->d_name.name); |
| 832 | ), |
| 833 | |
| 834 | TP_printk( |
Chuck Lever | 9d2d48b | 2021-10-22 16:16:56 -0400 | [diff] [blame^] | 835 | "error=%ld (%s) flags=%lu (%s) fmode=%s " |
Trond Myklebust | 42113a7 | 2013-08-12 16:19:27 -0400 | [diff] [blame] | 836 | "fileid=%02x:%02x:%llu fhandle=0x%08x " |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 837 | "name=%02x:%02x:%llu/%s stateid=%d:0x%08x " |
| 838 | "openstateid=%d:0x%08x", |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 839 | -__entry->error, |
Trond Myklebust | 42113a7 | 2013-08-12 16:19:27 -0400 | [diff] [blame] | 840 | show_nfsv4_errors(__entry->error), |
| 841 | __entry->flags, |
Chuck Lever | 9d2d48b | 2021-10-22 16:16:56 -0400 | [diff] [blame^] | 842 | show_fs_fcntl_open_flags(__entry->flags), |
| 843 | show_fs_fmode_flags(__entry->fmode), |
Trond Myklebust | 42113a7 | 2013-08-12 16:19:27 -0400 | [diff] [blame] | 844 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 845 | (unsigned long long)__entry->fileid, |
| 846 | __entry->fhandle, |
| 847 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 848 | (unsigned long long)__entry->dir, |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 849 | __get_str(name), |
| 850 | __entry->stateid_seq, __entry->stateid_hash, |
| 851 | __entry->openstateid_seq, __entry->openstateid_hash |
Trond Myklebust | 42113a7 | 2013-08-12 16:19:27 -0400 | [diff] [blame] | 852 | ) |
| 853 | ); |
| 854 | |
| 855 | #define DEFINE_NFS4_OPEN_EVENT(name) \ |
| 856 | DEFINE_EVENT(nfs4_open_event, name, \ |
| 857 | TP_PROTO( \ |
| 858 | const struct nfs_open_context *ctx, \ |
| 859 | int flags, \ |
| 860 | int error \ |
| 861 | ), \ |
| 862 | TP_ARGS(ctx, flags, error)) |
| 863 | DEFINE_NFS4_OPEN_EVENT(nfs4_open_reclaim); |
| 864 | DEFINE_NFS4_OPEN_EVENT(nfs4_open_expired); |
| 865 | DEFINE_NFS4_OPEN_EVENT(nfs4_open_file); |
| 866 | |
Olga Kornievskaia | 9759b0f | 2015-11-24 13:29:42 -0500 | [diff] [blame] | 867 | TRACE_EVENT(nfs4_cached_open, |
| 868 | TP_PROTO( |
| 869 | const struct nfs4_state *state |
| 870 | ), |
| 871 | TP_ARGS(state), |
| 872 | TP_STRUCT__entry( |
| 873 | __field(dev_t, dev) |
| 874 | __field(u32, fhandle) |
| 875 | __field(u64, fileid) |
| 876 | __field(unsigned int, fmode) |
| 877 | __field(int, stateid_seq) |
| 878 | __field(u32, stateid_hash) |
| 879 | ), |
| 880 | |
| 881 | TP_fast_assign( |
| 882 | const struct inode *inode = state->inode; |
| 883 | |
| 884 | __entry->dev = inode->i_sb->s_dev; |
| 885 | __entry->fileid = NFS_FILEID(inode); |
| 886 | __entry->fhandle = nfs_fhandle_hash(NFS_FH(inode)); |
| 887 | __entry->fmode = (__force unsigned int)state->state; |
| 888 | __entry->stateid_seq = |
| 889 | be32_to_cpu(state->stateid.seqid); |
| 890 | __entry->stateid_hash = |
| 891 | nfs_stateid_hash(&state->stateid); |
| 892 | ), |
| 893 | |
| 894 | TP_printk( |
| 895 | "fmode=%s fileid=%02x:%02x:%llu " |
| 896 | "fhandle=0x%08x stateid=%d:0x%08x", |
Chuck Lever | 9d2d48b | 2021-10-22 16:16:56 -0400 | [diff] [blame^] | 897 | __entry->fmode ? show_fs_fmode_flags(__entry->fmode) : |
Olga Kornievskaia | 9759b0f | 2015-11-24 13:29:42 -0500 | [diff] [blame] | 898 | "closed", |
| 899 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 900 | (unsigned long long)__entry->fileid, |
| 901 | __entry->fhandle, |
| 902 | __entry->stateid_seq, __entry->stateid_hash |
| 903 | ) |
| 904 | ); |
| 905 | |
Trond Myklebust | 42113a7 | 2013-08-12 16:19:27 -0400 | [diff] [blame] | 906 | TRACE_EVENT(nfs4_close, |
| 907 | TP_PROTO( |
| 908 | const struct nfs4_state *state, |
| 909 | const struct nfs_closeargs *args, |
| 910 | const struct nfs_closeres *res, |
| 911 | int error |
| 912 | ), |
| 913 | |
| 914 | TP_ARGS(state, args, res, error), |
| 915 | |
| 916 | TP_STRUCT__entry( |
| 917 | __field(dev_t, dev) |
| 918 | __field(u32, fhandle) |
| 919 | __field(u64, fileid) |
| 920 | __field(unsigned int, fmode) |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 921 | __field(unsigned long, error) |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 922 | __field(int, stateid_seq) |
| 923 | __field(u32, stateid_hash) |
Trond Myklebust | 42113a7 | 2013-08-12 16:19:27 -0400 | [diff] [blame] | 924 | ), |
| 925 | |
| 926 | TP_fast_assign( |
| 927 | const struct inode *inode = state->inode; |
| 928 | |
| 929 | __entry->dev = inode->i_sb->s_dev; |
| 930 | __entry->fileid = NFS_FILEID(inode); |
| 931 | __entry->fhandle = nfs_fhandle_hash(NFS_FH(inode)); |
| 932 | __entry->fmode = (__force unsigned int)state->state; |
Trond Myklebust | 118b629 | 2020-01-06 15:25:06 -0500 | [diff] [blame] | 933 | __entry->error = error < 0 ? -error : 0; |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 934 | __entry->stateid_seq = |
| 935 | be32_to_cpu(args->stateid.seqid); |
| 936 | __entry->stateid_hash = |
| 937 | nfs_stateid_hash(&args->stateid); |
Trond Myklebust | 42113a7 | 2013-08-12 16:19:27 -0400 | [diff] [blame] | 938 | ), |
| 939 | |
| 940 | TP_printk( |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 941 | "error=%ld (%s) fmode=%s fileid=%02x:%02x:%llu " |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 942 | "fhandle=0x%08x openstateid=%d:0x%08x", |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 943 | -__entry->error, |
Trond Myklebust | 42113a7 | 2013-08-12 16:19:27 -0400 | [diff] [blame] | 944 | show_nfsv4_errors(__entry->error), |
Chuck Lever | 9d2d48b | 2021-10-22 16:16:56 -0400 | [diff] [blame^] | 945 | __entry->fmode ? show_fs_fmode_flags(__entry->fmode) : |
Trond Myklebust | 42113a7 | 2013-08-12 16:19:27 -0400 | [diff] [blame] | 946 | "closed", |
| 947 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 948 | (unsigned long long)__entry->fileid, |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 949 | __entry->fhandle, |
| 950 | __entry->stateid_seq, __entry->stateid_hash |
Trond Myklebust | 42113a7 | 2013-08-12 16:19:27 -0400 | [diff] [blame] | 951 | ) |
| 952 | ); |
| 953 | |
Trond Myklebust | d1b748a | 2013-08-12 16:35:20 -0400 | [diff] [blame] | 954 | DECLARE_EVENT_CLASS(nfs4_lock_event, |
| 955 | TP_PROTO( |
| 956 | const struct file_lock *request, |
| 957 | const struct nfs4_state *state, |
| 958 | int cmd, |
| 959 | int error |
| 960 | ), |
| 961 | |
| 962 | TP_ARGS(request, state, cmd, error), |
| 963 | |
| 964 | TP_STRUCT__entry( |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 965 | __field(unsigned long, error) |
Chuck Lever | 9d2d48b | 2021-10-22 16:16:56 -0400 | [diff] [blame^] | 966 | __field(unsigned long, cmd) |
| 967 | __field(unsigned long, type) |
Trond Myklebust | d1b748a | 2013-08-12 16:35:20 -0400 | [diff] [blame] | 968 | __field(loff_t, start) |
| 969 | __field(loff_t, end) |
| 970 | __field(dev_t, dev) |
| 971 | __field(u32, fhandle) |
| 972 | __field(u64, fileid) |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 973 | __field(int, stateid_seq) |
| 974 | __field(u32, stateid_hash) |
Trond Myklebust | d1b748a | 2013-08-12 16:35:20 -0400 | [diff] [blame] | 975 | ), |
| 976 | |
| 977 | TP_fast_assign( |
| 978 | const struct inode *inode = state->inode; |
| 979 | |
Trond Myklebust | 118b629 | 2020-01-06 15:25:06 -0500 | [diff] [blame] | 980 | __entry->error = error < 0 ? -error : 0; |
Trond Myklebust | d1b748a | 2013-08-12 16:35:20 -0400 | [diff] [blame] | 981 | __entry->cmd = cmd; |
| 982 | __entry->type = request->fl_type; |
| 983 | __entry->start = request->fl_start; |
| 984 | __entry->end = request->fl_end; |
| 985 | __entry->dev = inode->i_sb->s_dev; |
| 986 | __entry->fileid = NFS_FILEID(inode); |
| 987 | __entry->fhandle = nfs_fhandle_hash(NFS_FH(inode)); |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 988 | __entry->stateid_seq = |
| 989 | be32_to_cpu(state->stateid.seqid); |
| 990 | __entry->stateid_hash = |
| 991 | nfs_stateid_hash(&state->stateid); |
Trond Myklebust | d1b748a | 2013-08-12 16:35:20 -0400 | [diff] [blame] | 992 | ), |
| 993 | |
| 994 | TP_printk( |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 995 | "error=%ld (%s) cmd=%s:%s range=%lld:%lld " |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 996 | "fileid=%02x:%02x:%llu fhandle=0x%08x " |
| 997 | "stateid=%d:0x%08x", |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 998 | -__entry->error, |
Trond Myklebust | d1b748a | 2013-08-12 16:35:20 -0400 | [diff] [blame] | 999 | show_nfsv4_errors(__entry->error), |
Chuck Lever | 9d2d48b | 2021-10-22 16:16:56 -0400 | [diff] [blame^] | 1000 | show_fs_fcntl_cmd(__entry->cmd), |
| 1001 | show_fs_fcntl_lock_type(__entry->type), |
Trond Myklebust | d1b748a | 2013-08-12 16:35:20 -0400 | [diff] [blame] | 1002 | (long long)__entry->start, |
| 1003 | (long long)__entry->end, |
| 1004 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 1005 | (unsigned long long)__entry->fileid, |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 1006 | __entry->fhandle, |
| 1007 | __entry->stateid_seq, __entry->stateid_hash |
Trond Myklebust | d1b748a | 2013-08-12 16:35:20 -0400 | [diff] [blame] | 1008 | ) |
| 1009 | ); |
| 1010 | |
| 1011 | #define DEFINE_NFS4_LOCK_EVENT(name) \ |
| 1012 | DEFINE_EVENT(nfs4_lock_event, name, \ |
| 1013 | TP_PROTO( \ |
| 1014 | const struct file_lock *request, \ |
| 1015 | const struct nfs4_state *state, \ |
| 1016 | int cmd, \ |
| 1017 | int error \ |
| 1018 | ), \ |
| 1019 | TP_ARGS(request, state, cmd, error)) |
| 1020 | DEFINE_NFS4_LOCK_EVENT(nfs4_get_lock); |
Trond Myklebust | d1b748a | 2013-08-12 16:35:20 -0400 | [diff] [blame] | 1021 | DEFINE_NFS4_LOCK_EVENT(nfs4_unlock); |
| 1022 | |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 1023 | TRACE_EVENT(nfs4_set_lock, |
| 1024 | TP_PROTO( |
| 1025 | const struct file_lock *request, |
| 1026 | const struct nfs4_state *state, |
| 1027 | const nfs4_stateid *lockstateid, |
| 1028 | int cmd, |
| 1029 | int error |
| 1030 | ), |
| 1031 | |
| 1032 | TP_ARGS(request, state, lockstateid, cmd, error), |
| 1033 | |
| 1034 | TP_STRUCT__entry( |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 1035 | __field(unsigned long, error) |
Chuck Lever | 9d2d48b | 2021-10-22 16:16:56 -0400 | [diff] [blame^] | 1036 | __field(unsigned long, cmd) |
| 1037 | __field(unsigned long, type) |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 1038 | __field(loff_t, start) |
| 1039 | __field(loff_t, end) |
| 1040 | __field(dev_t, dev) |
| 1041 | __field(u32, fhandle) |
| 1042 | __field(u64, fileid) |
| 1043 | __field(int, stateid_seq) |
| 1044 | __field(u32, stateid_hash) |
| 1045 | __field(int, lockstateid_seq) |
| 1046 | __field(u32, lockstateid_hash) |
| 1047 | ), |
| 1048 | |
| 1049 | TP_fast_assign( |
| 1050 | const struct inode *inode = state->inode; |
| 1051 | |
Trond Myklebust | 118b629 | 2020-01-06 15:25:06 -0500 | [diff] [blame] | 1052 | __entry->error = error < 0 ? -error : 0; |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 1053 | __entry->cmd = cmd; |
| 1054 | __entry->type = request->fl_type; |
| 1055 | __entry->start = request->fl_start; |
| 1056 | __entry->end = request->fl_end; |
| 1057 | __entry->dev = inode->i_sb->s_dev; |
| 1058 | __entry->fileid = NFS_FILEID(inode); |
| 1059 | __entry->fhandle = nfs_fhandle_hash(NFS_FH(inode)); |
| 1060 | __entry->stateid_seq = |
| 1061 | be32_to_cpu(state->stateid.seqid); |
| 1062 | __entry->stateid_hash = |
| 1063 | nfs_stateid_hash(&state->stateid); |
| 1064 | __entry->lockstateid_seq = |
| 1065 | be32_to_cpu(lockstateid->seqid); |
| 1066 | __entry->lockstateid_hash = |
| 1067 | nfs_stateid_hash(lockstateid); |
| 1068 | ), |
| 1069 | |
| 1070 | TP_printk( |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 1071 | "error=%ld (%s) cmd=%s:%s range=%lld:%lld " |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 1072 | "fileid=%02x:%02x:%llu fhandle=0x%08x " |
| 1073 | "stateid=%d:0x%08x lockstateid=%d:0x%08x", |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 1074 | -__entry->error, |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 1075 | show_nfsv4_errors(__entry->error), |
Chuck Lever | 9d2d48b | 2021-10-22 16:16:56 -0400 | [diff] [blame^] | 1076 | show_fs_fcntl_cmd(__entry->cmd), |
| 1077 | show_fs_fcntl_lock_type(__entry->type), |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 1078 | (long long)__entry->start, |
| 1079 | (long long)__entry->end, |
| 1080 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 1081 | (unsigned long long)__entry->fileid, |
| 1082 | __entry->fhandle, |
| 1083 | __entry->stateid_seq, __entry->stateid_hash, |
| 1084 | __entry->lockstateid_seq, __entry->lockstateid_hash |
| 1085 | ) |
| 1086 | ); |
| 1087 | |
Chuck Lever | 21f86d2 | 2019-11-05 11:04:13 -0500 | [diff] [blame] | 1088 | TRACE_DEFINE_ENUM(LK_STATE_IN_USE); |
| 1089 | TRACE_DEFINE_ENUM(NFS_DELEGATED_STATE); |
| 1090 | TRACE_DEFINE_ENUM(NFS_OPEN_STATE); |
| 1091 | TRACE_DEFINE_ENUM(NFS_O_RDONLY_STATE); |
| 1092 | TRACE_DEFINE_ENUM(NFS_O_WRONLY_STATE); |
| 1093 | TRACE_DEFINE_ENUM(NFS_O_RDWR_STATE); |
| 1094 | TRACE_DEFINE_ENUM(NFS_STATE_RECLAIM_REBOOT); |
| 1095 | TRACE_DEFINE_ENUM(NFS_STATE_RECLAIM_NOGRACE); |
| 1096 | TRACE_DEFINE_ENUM(NFS_STATE_POSIX_LOCKS); |
| 1097 | TRACE_DEFINE_ENUM(NFS_STATE_RECOVERY_FAILED); |
| 1098 | TRACE_DEFINE_ENUM(NFS_STATE_MAY_NOTIFY_LOCK); |
| 1099 | TRACE_DEFINE_ENUM(NFS_STATE_CHANGE_WAIT); |
| 1100 | TRACE_DEFINE_ENUM(NFS_CLNT_DST_SSC_COPY_STATE); |
| 1101 | TRACE_DEFINE_ENUM(NFS_CLNT_SRC_SSC_COPY_STATE); |
| 1102 | TRACE_DEFINE_ENUM(NFS_SRV_SSC_COPY_STATE); |
| 1103 | |
| 1104 | #define show_nfs4_state_flags(flags) \ |
| 1105 | __print_flags(flags, "|", \ |
| 1106 | { LK_STATE_IN_USE, "IN_USE" }, \ |
| 1107 | { NFS_DELEGATED_STATE, "DELEGATED" }, \ |
| 1108 | { NFS_OPEN_STATE, "OPEN" }, \ |
| 1109 | { NFS_O_RDONLY_STATE, "O_RDONLY" }, \ |
| 1110 | { NFS_O_WRONLY_STATE, "O_WRONLY" }, \ |
| 1111 | { NFS_O_RDWR_STATE, "O_RDWR" }, \ |
| 1112 | { NFS_STATE_RECLAIM_REBOOT, "RECLAIM_REBOOT" }, \ |
| 1113 | { NFS_STATE_RECLAIM_NOGRACE, "RECLAIM_NOGRACE" }, \ |
| 1114 | { NFS_STATE_POSIX_LOCKS, "POSIX_LOCKS" }, \ |
| 1115 | { NFS_STATE_RECOVERY_FAILED, "RECOVERY_FAILED" }, \ |
| 1116 | { NFS_STATE_MAY_NOTIFY_LOCK, "MAY_NOTIFY_LOCK" }, \ |
| 1117 | { NFS_STATE_CHANGE_WAIT, "CHANGE_WAIT" }, \ |
| 1118 | { NFS_CLNT_DST_SSC_COPY_STATE, "CLNT_DST_SSC_COPY" }, \ |
| 1119 | { NFS_CLNT_SRC_SSC_COPY_STATE, "CLNT_SRC_SSC_COPY" }, \ |
| 1120 | { NFS_SRV_SSC_COPY_STATE, "SRV_SSC_COPY" }) |
| 1121 | |
| 1122 | #define show_nfs4_lock_flags(flags) \ |
| 1123 | __print_flags(flags, "|", \ |
| 1124 | { BIT(NFS_LOCK_INITIALIZED), "INITIALIZED" }, \ |
| 1125 | { BIT(NFS_LOCK_LOST), "LOST" }) |
| 1126 | |
| 1127 | TRACE_EVENT(nfs4_state_lock_reclaim, |
| 1128 | TP_PROTO( |
| 1129 | const struct nfs4_state *state, |
| 1130 | const struct nfs4_lock_state *lock |
| 1131 | ), |
| 1132 | |
| 1133 | TP_ARGS(state, lock), |
| 1134 | |
| 1135 | TP_STRUCT__entry( |
| 1136 | __field(dev_t, dev) |
| 1137 | __field(u32, fhandle) |
| 1138 | __field(u64, fileid) |
| 1139 | __field(unsigned long, state_flags) |
| 1140 | __field(unsigned long, lock_flags) |
| 1141 | __field(int, stateid_seq) |
| 1142 | __field(u32, stateid_hash) |
| 1143 | ), |
| 1144 | |
| 1145 | TP_fast_assign( |
| 1146 | const struct inode *inode = state->inode; |
| 1147 | |
| 1148 | __entry->dev = inode->i_sb->s_dev; |
| 1149 | __entry->fileid = NFS_FILEID(inode); |
| 1150 | __entry->fhandle = nfs_fhandle_hash(NFS_FH(inode)); |
| 1151 | __entry->state_flags = state->flags; |
| 1152 | __entry->lock_flags = lock->ls_flags; |
| 1153 | __entry->stateid_seq = |
| 1154 | be32_to_cpu(state->stateid.seqid); |
| 1155 | __entry->stateid_hash = |
| 1156 | nfs_stateid_hash(&state->stateid); |
| 1157 | ), |
| 1158 | |
| 1159 | TP_printk( |
| 1160 | "fileid=%02x:%02x:%llu fhandle=0x%08x " |
| 1161 | "stateid=%d:0x%08x state_flags=%s lock_flags=%s", |
| 1162 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 1163 | (unsigned long long)__entry->fileid, __entry->fhandle, |
| 1164 | __entry->stateid_seq, __entry->stateid_hash, |
| 1165 | show_nfs4_state_flags(__entry->state_flags), |
| 1166 | show_nfs4_lock_flags(__entry->lock_flags) |
| 1167 | ) |
| 1168 | ) |
| 1169 | |
Trond Myklebust | ca8acf8 | 2013-08-13 10:36:56 -0400 | [diff] [blame] | 1170 | DECLARE_EVENT_CLASS(nfs4_set_delegation_event, |
| 1171 | TP_PROTO( |
| 1172 | const struct inode *inode, |
| 1173 | fmode_t fmode |
| 1174 | ), |
| 1175 | |
| 1176 | TP_ARGS(inode, fmode), |
| 1177 | |
| 1178 | TP_STRUCT__entry( |
| 1179 | __field(dev_t, dev) |
| 1180 | __field(u32, fhandle) |
| 1181 | __field(u64, fileid) |
| 1182 | __field(unsigned int, fmode) |
| 1183 | ), |
| 1184 | |
| 1185 | TP_fast_assign( |
| 1186 | __entry->dev = inode->i_sb->s_dev; |
| 1187 | __entry->fileid = NFS_FILEID(inode); |
| 1188 | __entry->fhandle = nfs_fhandle_hash(NFS_FH(inode)); |
| 1189 | __entry->fmode = (__force unsigned int)fmode; |
| 1190 | ), |
| 1191 | |
| 1192 | TP_printk( |
| 1193 | "fmode=%s fileid=%02x:%02x:%llu fhandle=0x%08x", |
Chuck Lever | 9d2d48b | 2021-10-22 16:16:56 -0400 | [diff] [blame^] | 1194 | show_fs_fmode_flags(__entry->fmode), |
Trond Myklebust | ca8acf8 | 2013-08-13 10:36:56 -0400 | [diff] [blame] | 1195 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 1196 | (unsigned long long)__entry->fileid, |
| 1197 | __entry->fhandle |
| 1198 | ) |
| 1199 | ); |
| 1200 | #define DEFINE_NFS4_SET_DELEGATION_EVENT(name) \ |
| 1201 | DEFINE_EVENT(nfs4_set_delegation_event, name, \ |
| 1202 | TP_PROTO( \ |
| 1203 | const struct inode *inode, \ |
| 1204 | fmode_t fmode \ |
| 1205 | ), \ |
| 1206 | TP_ARGS(inode, fmode)) |
| 1207 | DEFINE_NFS4_SET_DELEGATION_EVENT(nfs4_set_delegation); |
| 1208 | DEFINE_NFS4_SET_DELEGATION_EVENT(nfs4_reclaim_delegation); |
| 1209 | |
| 1210 | TRACE_EVENT(nfs4_delegreturn_exit, |
| 1211 | TP_PROTO( |
| 1212 | const struct nfs4_delegreturnargs *args, |
| 1213 | const struct nfs4_delegreturnres *res, |
| 1214 | int error |
| 1215 | ), |
| 1216 | |
| 1217 | TP_ARGS(args, res, error), |
| 1218 | |
| 1219 | TP_STRUCT__entry( |
| 1220 | __field(dev_t, dev) |
| 1221 | __field(u32, fhandle) |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 1222 | __field(unsigned long, error) |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 1223 | __field(int, stateid_seq) |
| 1224 | __field(u32, stateid_hash) |
Trond Myklebust | ca8acf8 | 2013-08-13 10:36:56 -0400 | [diff] [blame] | 1225 | ), |
| 1226 | |
| 1227 | TP_fast_assign( |
| 1228 | __entry->dev = res->server->s_dev; |
| 1229 | __entry->fhandle = nfs_fhandle_hash(args->fhandle); |
Trond Myklebust | 118b629 | 2020-01-06 15:25:06 -0500 | [diff] [blame] | 1230 | __entry->error = error < 0 ? -error : 0; |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 1231 | __entry->stateid_seq = |
| 1232 | be32_to_cpu(args->stateid->seqid); |
| 1233 | __entry->stateid_hash = |
| 1234 | nfs_stateid_hash(args->stateid); |
Trond Myklebust | ca8acf8 | 2013-08-13 10:36:56 -0400 | [diff] [blame] | 1235 | ), |
| 1236 | |
| 1237 | TP_printk( |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 1238 | "error=%ld (%s) dev=%02x:%02x fhandle=0x%08x " |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 1239 | "stateid=%d:0x%08x", |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 1240 | -__entry->error, |
Trond Myklebust | ca8acf8 | 2013-08-13 10:36:56 -0400 | [diff] [blame] | 1241 | show_nfsv4_errors(__entry->error), |
| 1242 | MAJOR(__entry->dev), MINOR(__entry->dev), |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 1243 | __entry->fhandle, |
| 1244 | __entry->stateid_seq, __entry->stateid_hash |
Trond Myklebust | ca8acf8 | 2013-08-13 10:36:56 -0400 | [diff] [blame] | 1245 | ) |
| 1246 | ); |
| 1247 | |
Trond Myklebust | 08cb47f | 2013-08-20 21:59:40 -0400 | [diff] [blame] | 1248 | #ifdef CONFIG_NFS_V4_1 |
| 1249 | DECLARE_EVENT_CLASS(nfs4_test_stateid_event, |
| 1250 | TP_PROTO( |
| 1251 | const struct nfs4_state *state, |
| 1252 | const struct nfs4_lock_state *lsp, |
| 1253 | int error |
| 1254 | ), |
| 1255 | |
| 1256 | TP_ARGS(state, lsp, error), |
| 1257 | |
| 1258 | TP_STRUCT__entry( |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 1259 | __field(unsigned long, error) |
Trond Myklebust | 08cb47f | 2013-08-20 21:59:40 -0400 | [diff] [blame] | 1260 | __field(dev_t, dev) |
| 1261 | __field(u32, fhandle) |
| 1262 | __field(u64, fileid) |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 1263 | __field(int, stateid_seq) |
| 1264 | __field(u32, stateid_hash) |
Trond Myklebust | 08cb47f | 2013-08-20 21:59:40 -0400 | [diff] [blame] | 1265 | ), |
| 1266 | |
| 1267 | TP_fast_assign( |
| 1268 | const struct inode *inode = state->inode; |
| 1269 | |
Trond Myklebust | 118b629 | 2020-01-06 15:25:06 -0500 | [diff] [blame] | 1270 | __entry->error = error < 0 ? -error : 0; |
Trond Myklebust | 08cb47f | 2013-08-20 21:59:40 -0400 | [diff] [blame] | 1271 | __entry->dev = inode->i_sb->s_dev; |
| 1272 | __entry->fileid = NFS_FILEID(inode); |
| 1273 | __entry->fhandle = nfs_fhandle_hash(NFS_FH(inode)); |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 1274 | __entry->stateid_seq = |
| 1275 | be32_to_cpu(state->stateid.seqid); |
| 1276 | __entry->stateid_hash = |
| 1277 | nfs_stateid_hash(&state->stateid); |
Trond Myklebust | 08cb47f | 2013-08-20 21:59:40 -0400 | [diff] [blame] | 1278 | ), |
| 1279 | |
| 1280 | TP_printk( |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 1281 | "error=%ld (%s) fileid=%02x:%02x:%llu fhandle=0x%08x " |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 1282 | "stateid=%d:0x%08x", |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 1283 | -__entry->error, |
Trond Myklebust | 08cb47f | 2013-08-20 21:59:40 -0400 | [diff] [blame] | 1284 | show_nfsv4_errors(__entry->error), |
| 1285 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 1286 | (unsigned long long)__entry->fileid, |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 1287 | __entry->fhandle, |
| 1288 | __entry->stateid_seq, __entry->stateid_hash |
Trond Myklebust | 08cb47f | 2013-08-20 21:59:40 -0400 | [diff] [blame] | 1289 | ) |
| 1290 | ); |
| 1291 | |
| 1292 | #define DEFINE_NFS4_TEST_STATEID_EVENT(name) \ |
| 1293 | DEFINE_EVENT(nfs4_test_stateid_event, name, \ |
| 1294 | TP_PROTO( \ |
| 1295 | const struct nfs4_state *state, \ |
| 1296 | const struct nfs4_lock_state *lsp, \ |
| 1297 | int error \ |
| 1298 | ), \ |
| 1299 | TP_ARGS(state, lsp, error)) |
| 1300 | DEFINE_NFS4_TEST_STATEID_EVENT(nfs4_test_delegation_stateid); |
| 1301 | DEFINE_NFS4_TEST_STATEID_EVENT(nfs4_test_open_stateid); |
| 1302 | DEFINE_NFS4_TEST_STATEID_EVENT(nfs4_test_lock_stateid); |
| 1303 | #endif /* CONFIG_NFS_V4_1 */ |
| 1304 | |
Trond Myklebust | 078ea3d | 2013-08-12 16:45:55 -0400 | [diff] [blame] | 1305 | DECLARE_EVENT_CLASS(nfs4_lookup_event, |
| 1306 | TP_PROTO( |
| 1307 | const struct inode *dir, |
| 1308 | const struct qstr *name, |
| 1309 | int error |
| 1310 | ), |
| 1311 | |
| 1312 | TP_ARGS(dir, name, error), |
| 1313 | |
| 1314 | TP_STRUCT__entry( |
| 1315 | __field(dev_t, dev) |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 1316 | __field(unsigned long, error) |
Trond Myklebust | 078ea3d | 2013-08-12 16:45:55 -0400 | [diff] [blame] | 1317 | __field(u64, dir) |
| 1318 | __string(name, name->name) |
| 1319 | ), |
| 1320 | |
| 1321 | TP_fast_assign( |
| 1322 | __entry->dev = dir->i_sb->s_dev; |
| 1323 | __entry->dir = NFS_FILEID(dir); |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 1324 | __entry->error = -error; |
Trond Myklebust | 078ea3d | 2013-08-12 16:45:55 -0400 | [diff] [blame] | 1325 | __assign_str(name, name->name); |
| 1326 | ), |
| 1327 | |
| 1328 | TP_printk( |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 1329 | "error=%ld (%s) name=%02x:%02x:%llu/%s", |
| 1330 | -__entry->error, |
Trond Myklebust | 078ea3d | 2013-08-12 16:45:55 -0400 | [diff] [blame] | 1331 | show_nfsv4_errors(__entry->error), |
| 1332 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 1333 | (unsigned long long)__entry->dir, |
| 1334 | __get_str(name) |
| 1335 | ) |
| 1336 | ); |
| 1337 | |
| 1338 | #define DEFINE_NFS4_LOOKUP_EVENT(name) \ |
| 1339 | DEFINE_EVENT(nfs4_lookup_event, name, \ |
| 1340 | TP_PROTO( \ |
| 1341 | const struct inode *dir, \ |
| 1342 | const struct qstr *name, \ |
| 1343 | int error \ |
| 1344 | ), \ |
| 1345 | TP_ARGS(dir, name, error)) |
| 1346 | |
| 1347 | DEFINE_NFS4_LOOKUP_EVENT(nfs4_lookup); |
| 1348 | DEFINE_NFS4_LOOKUP_EVENT(nfs4_symlink); |
| 1349 | DEFINE_NFS4_LOOKUP_EVENT(nfs4_mkdir); |
| 1350 | DEFINE_NFS4_LOOKUP_EVENT(nfs4_mknod); |
| 1351 | DEFINE_NFS4_LOOKUP_EVENT(nfs4_remove); |
| 1352 | DEFINE_NFS4_LOOKUP_EVENT(nfs4_get_fs_locations); |
| 1353 | DEFINE_NFS4_LOOKUP_EVENT(nfs4_secinfo); |
| 1354 | |
Jeff Layton | 5b5faaf | 2017-06-29 06:34:52 -0700 | [diff] [blame] | 1355 | TRACE_EVENT(nfs4_lookupp, |
| 1356 | TP_PROTO( |
| 1357 | const struct inode *inode, |
| 1358 | int error |
| 1359 | ), |
| 1360 | |
| 1361 | TP_ARGS(inode, error), |
| 1362 | |
| 1363 | TP_STRUCT__entry( |
| 1364 | __field(dev_t, dev) |
| 1365 | __field(u64, ino) |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 1366 | __field(unsigned long, error) |
Jeff Layton | 5b5faaf | 2017-06-29 06:34:52 -0700 | [diff] [blame] | 1367 | ), |
| 1368 | |
| 1369 | TP_fast_assign( |
| 1370 | __entry->dev = inode->i_sb->s_dev; |
| 1371 | __entry->ino = NFS_FILEID(inode); |
Trond Myklebust | 118b629 | 2020-01-06 15:25:06 -0500 | [diff] [blame] | 1372 | __entry->error = error < 0 ? -error : 0; |
Jeff Layton | 5b5faaf | 2017-06-29 06:34:52 -0700 | [diff] [blame] | 1373 | ), |
| 1374 | |
| 1375 | TP_printk( |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 1376 | "error=%ld (%s) inode=%02x:%02x:%llu", |
| 1377 | -__entry->error, |
Jeff Layton | 5b5faaf | 2017-06-29 06:34:52 -0700 | [diff] [blame] | 1378 | show_nfsv4_errors(__entry->error), |
| 1379 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 1380 | (unsigned long long)__entry->ino |
| 1381 | ) |
| 1382 | ); |
| 1383 | |
Trond Myklebust | fbc6f7c | 2013-08-12 17:08:26 -0400 | [diff] [blame] | 1384 | TRACE_EVENT(nfs4_rename, |
| 1385 | TP_PROTO( |
| 1386 | const struct inode *olddir, |
| 1387 | const struct qstr *oldname, |
| 1388 | const struct inode *newdir, |
| 1389 | const struct qstr *newname, |
| 1390 | int error |
| 1391 | ), |
| 1392 | |
| 1393 | TP_ARGS(olddir, oldname, newdir, newname, error), |
| 1394 | |
| 1395 | TP_STRUCT__entry( |
| 1396 | __field(dev_t, dev) |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 1397 | __field(unsigned long, error) |
Trond Myklebust | fbc6f7c | 2013-08-12 17:08:26 -0400 | [diff] [blame] | 1398 | __field(u64, olddir) |
| 1399 | __string(oldname, oldname->name) |
| 1400 | __field(u64, newdir) |
| 1401 | __string(newname, newname->name) |
| 1402 | ), |
| 1403 | |
| 1404 | TP_fast_assign( |
| 1405 | __entry->dev = olddir->i_sb->s_dev; |
| 1406 | __entry->olddir = NFS_FILEID(olddir); |
| 1407 | __entry->newdir = NFS_FILEID(newdir); |
Trond Myklebust | 118b629 | 2020-01-06 15:25:06 -0500 | [diff] [blame] | 1408 | __entry->error = error < 0 ? -error : 0; |
Trond Myklebust | fbc6f7c | 2013-08-12 17:08:26 -0400 | [diff] [blame] | 1409 | __assign_str(oldname, oldname->name); |
| 1410 | __assign_str(newname, newname->name); |
| 1411 | ), |
| 1412 | |
| 1413 | TP_printk( |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 1414 | "error=%ld (%s) oldname=%02x:%02x:%llu/%s " |
Trond Myklebust | fbc6f7c | 2013-08-12 17:08:26 -0400 | [diff] [blame] | 1415 | "newname=%02x:%02x:%llu/%s", |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 1416 | -__entry->error, |
Trond Myklebust | fbc6f7c | 2013-08-12 17:08:26 -0400 | [diff] [blame] | 1417 | show_nfsv4_errors(__entry->error), |
| 1418 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 1419 | (unsigned long long)__entry->olddir, |
| 1420 | __get_str(oldname), |
| 1421 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 1422 | (unsigned long long)__entry->newdir, |
| 1423 | __get_str(newname) |
| 1424 | ) |
| 1425 | ); |
| 1426 | |
Trond Myklebust | c1578b7 | 2013-08-12 16:58:42 -0400 | [diff] [blame] | 1427 | DECLARE_EVENT_CLASS(nfs4_inode_event, |
| 1428 | TP_PROTO( |
| 1429 | const struct inode *inode, |
| 1430 | int error |
| 1431 | ), |
| 1432 | |
| 1433 | TP_ARGS(inode, error), |
| 1434 | |
| 1435 | TP_STRUCT__entry( |
| 1436 | __field(dev_t, dev) |
| 1437 | __field(u32, fhandle) |
| 1438 | __field(u64, fileid) |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 1439 | __field(unsigned long, error) |
Trond Myklebust | c1578b7 | 2013-08-12 16:58:42 -0400 | [diff] [blame] | 1440 | ), |
| 1441 | |
| 1442 | TP_fast_assign( |
| 1443 | __entry->dev = inode->i_sb->s_dev; |
| 1444 | __entry->fileid = NFS_FILEID(inode); |
| 1445 | __entry->fhandle = nfs_fhandle_hash(NFS_FH(inode)); |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 1446 | __entry->error = error < 0 ? -error : 0; |
Trond Myklebust | c1578b7 | 2013-08-12 16:58:42 -0400 | [diff] [blame] | 1447 | ), |
| 1448 | |
| 1449 | TP_printk( |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 1450 | "error=%ld (%s) fileid=%02x:%02x:%llu fhandle=0x%08x", |
| 1451 | -__entry->error, |
Trond Myklebust | c1578b7 | 2013-08-12 16:58:42 -0400 | [diff] [blame] | 1452 | show_nfsv4_errors(__entry->error), |
| 1453 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 1454 | (unsigned long long)__entry->fileid, |
| 1455 | __entry->fhandle |
| 1456 | ) |
| 1457 | ); |
| 1458 | |
| 1459 | #define DEFINE_NFS4_INODE_EVENT(name) \ |
| 1460 | DEFINE_EVENT(nfs4_inode_event, name, \ |
| 1461 | TP_PROTO( \ |
| 1462 | const struct inode *inode, \ |
| 1463 | int error \ |
| 1464 | ), \ |
| 1465 | TP_ARGS(inode, error)) |
| 1466 | |
Trond Myklebust | c1578b7 | 2013-08-12 16:58:42 -0400 | [diff] [blame] | 1467 | DEFINE_NFS4_INODE_EVENT(nfs4_access); |
| 1468 | DEFINE_NFS4_INODE_EVENT(nfs4_readlink); |
| 1469 | DEFINE_NFS4_INODE_EVENT(nfs4_readdir); |
| 1470 | DEFINE_NFS4_INODE_EVENT(nfs4_get_acl); |
| 1471 | DEFINE_NFS4_INODE_EVENT(nfs4_set_acl); |
| 1472 | #ifdef CONFIG_NFS_V4_SECURITY_LABEL |
| 1473 | DEFINE_NFS4_INODE_EVENT(nfs4_get_security_label); |
| 1474 | DEFINE_NFS4_INODE_EVENT(nfs4_set_security_label); |
| 1475 | #endif /* CONFIG_NFS_V4_SECURITY_LABEL */ |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 1476 | |
| 1477 | DECLARE_EVENT_CLASS(nfs4_inode_stateid_event, |
| 1478 | TP_PROTO( |
| 1479 | const struct inode *inode, |
| 1480 | const nfs4_stateid *stateid, |
| 1481 | int error |
| 1482 | ), |
| 1483 | |
| 1484 | TP_ARGS(inode, stateid, error), |
| 1485 | |
| 1486 | TP_STRUCT__entry( |
| 1487 | __field(dev_t, dev) |
| 1488 | __field(u32, fhandle) |
| 1489 | __field(u64, fileid) |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 1490 | __field(unsigned long, error) |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 1491 | __field(int, stateid_seq) |
| 1492 | __field(u32, stateid_hash) |
| 1493 | ), |
| 1494 | |
| 1495 | TP_fast_assign( |
| 1496 | __entry->dev = inode->i_sb->s_dev; |
| 1497 | __entry->fileid = NFS_FILEID(inode); |
| 1498 | __entry->fhandle = nfs_fhandle_hash(NFS_FH(inode)); |
Trond Myklebust | 118b629 | 2020-01-06 15:25:06 -0500 | [diff] [blame] | 1499 | __entry->error = error < 0 ? -error : 0; |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 1500 | __entry->stateid_seq = |
| 1501 | be32_to_cpu(stateid->seqid); |
| 1502 | __entry->stateid_hash = |
| 1503 | nfs_stateid_hash(stateid); |
| 1504 | ), |
| 1505 | |
| 1506 | TP_printk( |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 1507 | "error=%ld (%s) fileid=%02x:%02x:%llu fhandle=0x%08x " |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 1508 | "stateid=%d:0x%08x", |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 1509 | -__entry->error, |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 1510 | show_nfsv4_errors(__entry->error), |
| 1511 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 1512 | (unsigned long long)__entry->fileid, |
| 1513 | __entry->fhandle, |
| 1514 | __entry->stateid_seq, __entry->stateid_hash |
| 1515 | ) |
| 1516 | ); |
| 1517 | |
| 1518 | #define DEFINE_NFS4_INODE_STATEID_EVENT(name) \ |
| 1519 | DEFINE_EVENT(nfs4_inode_stateid_event, name, \ |
| 1520 | TP_PROTO( \ |
| 1521 | const struct inode *inode, \ |
| 1522 | const nfs4_stateid *stateid, \ |
| 1523 | int error \ |
| 1524 | ), \ |
| 1525 | TP_ARGS(inode, stateid, error)) |
| 1526 | |
| 1527 | DEFINE_NFS4_INODE_STATEID_EVENT(nfs4_setattr); |
| 1528 | DEFINE_NFS4_INODE_STATEID_EVENT(nfs4_delegreturn); |
Trond Myklebust | ad9e02d | 2017-11-06 15:28:02 -0500 | [diff] [blame] | 1529 | DEFINE_NFS4_INODE_STATEID_EVENT(nfs4_open_stateid_update); |
| 1530 | DEFINE_NFS4_INODE_STATEID_EVENT(nfs4_open_stateid_update_wait); |
Benjamin Coddington | b4868b4 | 2020-09-25 15:48:39 -0400 | [diff] [blame] | 1531 | DEFINE_NFS4_INODE_STATEID_EVENT(nfs4_close_stateid_update_wait); |
Trond Myklebust | c1578b7 | 2013-08-12 16:58:42 -0400 | [diff] [blame] | 1532 | |
Trond Myklebust | b5f875a | 2013-08-13 13:01:39 -0400 | [diff] [blame] | 1533 | DECLARE_EVENT_CLASS(nfs4_getattr_event, |
| 1534 | TP_PROTO( |
| 1535 | const struct nfs_server *server, |
| 1536 | const struct nfs_fh *fhandle, |
| 1537 | const struct nfs_fattr *fattr, |
| 1538 | int error |
| 1539 | ), |
| 1540 | |
| 1541 | TP_ARGS(server, fhandle, fattr, error), |
| 1542 | |
| 1543 | TP_STRUCT__entry( |
| 1544 | __field(dev_t, dev) |
| 1545 | __field(u32, fhandle) |
| 1546 | __field(u64, fileid) |
| 1547 | __field(unsigned int, valid) |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 1548 | __field(unsigned long, error) |
Trond Myklebust | b5f875a | 2013-08-13 13:01:39 -0400 | [diff] [blame] | 1549 | ), |
| 1550 | |
| 1551 | TP_fast_assign( |
| 1552 | __entry->dev = server->s_dev; |
| 1553 | __entry->valid = fattr->valid; |
| 1554 | __entry->fhandle = nfs_fhandle_hash(fhandle); |
| 1555 | __entry->fileid = (fattr->valid & NFS_ATTR_FATTR_FILEID) ? fattr->fileid : 0; |
Trond Myklebust | 118b629 | 2020-01-06 15:25:06 -0500 | [diff] [blame] | 1556 | __entry->error = error < 0 ? -error : 0; |
Trond Myklebust | b5f875a | 2013-08-13 13:01:39 -0400 | [diff] [blame] | 1557 | ), |
| 1558 | |
| 1559 | TP_printk( |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 1560 | "error=%ld (%s) fileid=%02x:%02x:%llu fhandle=0x%08x " |
Trond Myklebust | b5f875a | 2013-08-13 13:01:39 -0400 | [diff] [blame] | 1561 | "valid=%s", |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 1562 | -__entry->error, |
Trond Myklebust | b5f875a | 2013-08-13 13:01:39 -0400 | [diff] [blame] | 1563 | show_nfsv4_errors(__entry->error), |
| 1564 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 1565 | (unsigned long long)__entry->fileid, |
| 1566 | __entry->fhandle, |
| 1567 | show_nfs_fattr_flags(__entry->valid) |
| 1568 | ) |
| 1569 | ); |
| 1570 | |
| 1571 | #define DEFINE_NFS4_GETATTR_EVENT(name) \ |
| 1572 | DEFINE_EVENT(nfs4_getattr_event, name, \ |
| 1573 | TP_PROTO( \ |
| 1574 | const struct nfs_server *server, \ |
| 1575 | const struct nfs_fh *fhandle, \ |
| 1576 | const struct nfs_fattr *fattr, \ |
| 1577 | int error \ |
| 1578 | ), \ |
| 1579 | TP_ARGS(server, fhandle, fattr, error)) |
| 1580 | DEFINE_NFS4_GETATTR_EVENT(nfs4_getattr); |
| 1581 | DEFINE_NFS4_GETATTR_EVENT(nfs4_lookup_root); |
| 1582 | DEFINE_NFS4_GETATTR_EVENT(nfs4_fsinfo); |
| 1583 | |
Trond Myklebust | 7cd1486 | 2015-08-20 20:07:54 -0500 | [diff] [blame] | 1584 | DECLARE_EVENT_CLASS(nfs4_inode_callback_event, |
| 1585 | TP_PROTO( |
| 1586 | const struct nfs_client *clp, |
| 1587 | const struct nfs_fh *fhandle, |
| 1588 | const struct inode *inode, |
| 1589 | int error |
| 1590 | ), |
| 1591 | |
| 1592 | TP_ARGS(clp, fhandle, inode, error), |
| 1593 | |
| 1594 | TP_STRUCT__entry( |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 1595 | __field(unsigned long, error) |
Trond Myklebust | 7cd1486 | 2015-08-20 20:07:54 -0500 | [diff] [blame] | 1596 | __field(dev_t, dev) |
| 1597 | __field(u32, fhandle) |
| 1598 | __field(u64, fileid) |
Anna Schumaker | 3944369 | 2017-11-01 15:48:43 -0400 | [diff] [blame] | 1599 | __string(dstaddr, clp ? clp->cl_hostname : "unknown") |
Trond Myklebust | 7cd1486 | 2015-08-20 20:07:54 -0500 | [diff] [blame] | 1600 | ), |
| 1601 | |
| 1602 | TP_fast_assign( |
Trond Myklebust | 118b629 | 2020-01-06 15:25:06 -0500 | [diff] [blame] | 1603 | __entry->error = error < 0 ? -error : 0; |
Trond Myklebust | 7cd1486 | 2015-08-20 20:07:54 -0500 | [diff] [blame] | 1604 | __entry->fhandle = nfs_fhandle_hash(fhandle); |
Trond Myklebust | 2edaead | 2018-09-05 14:07:13 -0400 | [diff] [blame] | 1605 | if (!IS_ERR_OR_NULL(inode)) { |
Trond Myklebust | 7cd1486 | 2015-08-20 20:07:54 -0500 | [diff] [blame] | 1606 | __entry->fileid = NFS_FILEID(inode); |
| 1607 | __entry->dev = inode->i_sb->s_dev; |
| 1608 | } else { |
| 1609 | __entry->fileid = 0; |
| 1610 | __entry->dev = 0; |
| 1611 | } |
Joe Perches | 78c14b3 | 2021-06-12 08:42:27 -0700 | [diff] [blame] | 1612 | __assign_str(dstaddr, clp ? clp->cl_hostname : "unknown"); |
Trond Myklebust | 7cd1486 | 2015-08-20 20:07:54 -0500 | [diff] [blame] | 1613 | ), |
| 1614 | |
| 1615 | TP_printk( |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 1616 | "error=%ld (%s) fileid=%02x:%02x:%llu fhandle=0x%08x " |
Trond Myklebust | 7cd1486 | 2015-08-20 20:07:54 -0500 | [diff] [blame] | 1617 | "dstaddr=%s", |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 1618 | -__entry->error, |
Trond Myklebust | 7cd1486 | 2015-08-20 20:07:54 -0500 | [diff] [blame] | 1619 | show_nfsv4_errors(__entry->error), |
| 1620 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 1621 | (unsigned long long)__entry->fileid, |
| 1622 | __entry->fhandle, |
| 1623 | __get_str(dstaddr) |
| 1624 | ) |
| 1625 | ); |
| 1626 | |
| 1627 | #define DEFINE_NFS4_INODE_CALLBACK_EVENT(name) \ |
| 1628 | DEFINE_EVENT(nfs4_inode_callback_event, name, \ |
| 1629 | TP_PROTO( \ |
| 1630 | const struct nfs_client *clp, \ |
| 1631 | const struct nfs_fh *fhandle, \ |
| 1632 | const struct inode *inode, \ |
| 1633 | int error \ |
| 1634 | ), \ |
| 1635 | TP_ARGS(clp, fhandle, inode, error)) |
| 1636 | DEFINE_NFS4_INODE_CALLBACK_EVENT(nfs4_cb_getattr); |
| 1637 | |
Trond Myklebust | e07db90 | 2015-12-28 14:07:23 -0500 | [diff] [blame] | 1638 | DECLARE_EVENT_CLASS(nfs4_inode_stateid_callback_event, |
| 1639 | TP_PROTO( |
| 1640 | const struct nfs_client *clp, |
| 1641 | const struct nfs_fh *fhandle, |
| 1642 | const struct inode *inode, |
| 1643 | const nfs4_stateid *stateid, |
| 1644 | int error |
| 1645 | ), |
| 1646 | |
| 1647 | TP_ARGS(clp, fhandle, inode, stateid, error), |
| 1648 | |
| 1649 | TP_STRUCT__entry( |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 1650 | __field(unsigned long, error) |
Trond Myklebust | e07db90 | 2015-12-28 14:07:23 -0500 | [diff] [blame] | 1651 | __field(dev_t, dev) |
| 1652 | __field(u32, fhandle) |
| 1653 | __field(u64, fileid) |
Anna Schumaker | 3944369 | 2017-11-01 15:48:43 -0400 | [diff] [blame] | 1654 | __string(dstaddr, clp ? clp->cl_hostname : "unknown") |
Trond Myklebust | e07db90 | 2015-12-28 14:07:23 -0500 | [diff] [blame] | 1655 | __field(int, stateid_seq) |
| 1656 | __field(u32, stateid_hash) |
| 1657 | ), |
| 1658 | |
| 1659 | TP_fast_assign( |
Trond Myklebust | 118b629 | 2020-01-06 15:25:06 -0500 | [diff] [blame] | 1660 | __entry->error = error < 0 ? -error : 0; |
Trond Myklebust | e07db90 | 2015-12-28 14:07:23 -0500 | [diff] [blame] | 1661 | __entry->fhandle = nfs_fhandle_hash(fhandle); |
Trond Myklebust | 2a534a7 | 2018-08-23 11:02:49 -0400 | [diff] [blame] | 1662 | if (!IS_ERR_OR_NULL(inode)) { |
Trond Myklebust | e07db90 | 2015-12-28 14:07:23 -0500 | [diff] [blame] | 1663 | __entry->fileid = NFS_FILEID(inode); |
| 1664 | __entry->dev = inode->i_sb->s_dev; |
| 1665 | } else { |
| 1666 | __entry->fileid = 0; |
| 1667 | __entry->dev = 0; |
| 1668 | } |
Joe Perches | 78c14b3 | 2021-06-12 08:42:27 -0700 | [diff] [blame] | 1669 | __assign_str(dstaddr, clp ? clp->cl_hostname : "unknown"); |
Trond Myklebust | e07db90 | 2015-12-28 14:07:23 -0500 | [diff] [blame] | 1670 | __entry->stateid_seq = |
| 1671 | be32_to_cpu(stateid->seqid); |
| 1672 | __entry->stateid_hash = |
| 1673 | nfs_stateid_hash(stateid); |
| 1674 | ), |
| 1675 | |
| 1676 | TP_printk( |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 1677 | "error=%ld (%s) fileid=%02x:%02x:%llu fhandle=0x%08x " |
Trond Myklebust | e07db90 | 2015-12-28 14:07:23 -0500 | [diff] [blame] | 1678 | "stateid=%d:0x%08x dstaddr=%s", |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 1679 | -__entry->error, |
Trond Myklebust | e07db90 | 2015-12-28 14:07:23 -0500 | [diff] [blame] | 1680 | show_nfsv4_errors(__entry->error), |
| 1681 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 1682 | (unsigned long long)__entry->fileid, |
| 1683 | __entry->fhandle, |
| 1684 | __entry->stateid_seq, __entry->stateid_hash, |
| 1685 | __get_str(dstaddr) |
| 1686 | ) |
| 1687 | ); |
| 1688 | |
| 1689 | #define DEFINE_NFS4_INODE_STATEID_CALLBACK_EVENT(name) \ |
| 1690 | DEFINE_EVENT(nfs4_inode_stateid_callback_event, name, \ |
| 1691 | TP_PROTO( \ |
| 1692 | const struct nfs_client *clp, \ |
| 1693 | const struct nfs_fh *fhandle, \ |
| 1694 | const struct inode *inode, \ |
| 1695 | const nfs4_stateid *stateid, \ |
| 1696 | int error \ |
| 1697 | ), \ |
| 1698 | TP_ARGS(clp, fhandle, inode, stateid, error)) |
| 1699 | DEFINE_NFS4_INODE_STATEID_CALLBACK_EVENT(nfs4_cb_recall); |
| 1700 | DEFINE_NFS4_INODE_STATEID_CALLBACK_EVENT(nfs4_cb_layoutrecall_file); |
Trond Myklebust | 7cd1486 | 2015-08-20 20:07:54 -0500 | [diff] [blame] | 1701 | |
Trond Myklebust | 1f2d30b | 2013-08-13 11:34:01 -0400 | [diff] [blame] | 1702 | DECLARE_EVENT_CLASS(nfs4_idmap_event, |
| 1703 | TP_PROTO( |
| 1704 | const char *name, |
| 1705 | int len, |
| 1706 | u32 id, |
| 1707 | int error |
| 1708 | ), |
| 1709 | |
| 1710 | TP_ARGS(name, len, id, error), |
| 1711 | |
| 1712 | TP_STRUCT__entry( |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 1713 | __field(unsigned long, error) |
Trond Myklebust | 1f2d30b | 2013-08-13 11:34:01 -0400 | [diff] [blame] | 1714 | __field(u32, id) |
| 1715 | __dynamic_array(char, name, len > 0 ? len + 1 : 1) |
| 1716 | ), |
| 1717 | |
| 1718 | TP_fast_assign( |
| 1719 | if (len < 0) |
| 1720 | len = 0; |
| 1721 | __entry->error = error < 0 ? error : 0; |
| 1722 | __entry->id = id; |
Daniel Bristot de Oliveira | 752d596 | 2016-07-01 20:44:36 -0300 | [diff] [blame] | 1723 | memcpy(__get_str(name), name, len); |
| 1724 | __get_str(name)[len] = 0; |
Trond Myklebust | 1f2d30b | 2013-08-13 11:34:01 -0400 | [diff] [blame] | 1725 | ), |
| 1726 | |
| 1727 | TP_printk( |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 1728 | "error=%ld (%s) id=%u name=%s", |
| 1729 | -__entry->error, show_nfsv4_errors(__entry->error), |
Trond Myklebust | 1f2d30b | 2013-08-13 11:34:01 -0400 | [diff] [blame] | 1730 | __entry->id, |
| 1731 | __get_str(name) |
| 1732 | ) |
| 1733 | ); |
| 1734 | #define DEFINE_NFS4_IDMAP_EVENT(name) \ |
| 1735 | DEFINE_EVENT(nfs4_idmap_event, name, \ |
| 1736 | TP_PROTO( \ |
| 1737 | const char *name, \ |
| 1738 | int len, \ |
| 1739 | u32 id, \ |
| 1740 | int error \ |
| 1741 | ), \ |
| 1742 | TP_ARGS(name, len, id, error)) |
| 1743 | DEFINE_NFS4_IDMAP_EVENT(nfs4_map_name_to_uid); |
| 1744 | DEFINE_NFS4_IDMAP_EVENT(nfs4_map_group_to_gid); |
| 1745 | DEFINE_NFS4_IDMAP_EVENT(nfs4_map_uid_to_name); |
| 1746 | DEFINE_NFS4_IDMAP_EVENT(nfs4_map_gid_to_group); |
| 1747 | |
Trond Myklebust | 54898f7 | 2020-08-04 22:16:06 -0400 | [diff] [blame] | 1748 | #ifdef CONFIG_NFS_V4_1 |
| 1749 | #define NFS4_LSEG_LAYOUT_STATEID_HASH(lseg) \ |
| 1750 | (lseg ? nfs_stateid_hash(&lseg->pls_layout->plh_stateid) : 0) |
| 1751 | #else |
| 1752 | #define NFS4_LSEG_LAYOUT_STATEID_HASH(lseg) (0) |
| 1753 | #endif |
| 1754 | |
Trond Myklebust | cc668ab | 2013-08-14 15:31:28 -0400 | [diff] [blame] | 1755 | DECLARE_EVENT_CLASS(nfs4_read_event, |
| 1756 | TP_PROTO( |
Weston Andros Adamson | d45f60c | 2014-06-09 11:48:35 -0400 | [diff] [blame] | 1757 | const struct nfs_pgio_header *hdr, |
Trond Myklebust | cc668ab | 2013-08-14 15:31:28 -0400 | [diff] [blame] | 1758 | int error |
| 1759 | ), |
| 1760 | |
Weston Andros Adamson | d45f60c | 2014-06-09 11:48:35 -0400 | [diff] [blame] | 1761 | TP_ARGS(hdr, error), |
Trond Myklebust | cc668ab | 2013-08-14 15:31:28 -0400 | [diff] [blame] | 1762 | |
| 1763 | TP_STRUCT__entry( |
| 1764 | __field(dev_t, dev) |
| 1765 | __field(u32, fhandle) |
| 1766 | __field(u64, fileid) |
| 1767 | __field(loff_t, offset) |
Trond Myklebust | 25925b0 | 2020-01-06 15:25:05 -0500 | [diff] [blame] | 1768 | __field(u32, arg_count) |
| 1769 | __field(u32, res_count) |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 1770 | __field(unsigned long, error) |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 1771 | __field(int, stateid_seq) |
| 1772 | __field(u32, stateid_hash) |
Trond Myklebust | 54898f7 | 2020-08-04 22:16:06 -0400 | [diff] [blame] | 1773 | __field(int, layoutstateid_seq) |
| 1774 | __field(u32, layoutstateid_hash) |
Trond Myklebust | cc668ab | 2013-08-14 15:31:28 -0400 | [diff] [blame] | 1775 | ), |
| 1776 | |
| 1777 | TP_fast_assign( |
Weston Andros Adamson | d45f60c | 2014-06-09 11:48:35 -0400 | [diff] [blame] | 1778 | const struct inode *inode = hdr->inode; |
Trond Myklebust | 25925b0 | 2020-01-06 15:25:05 -0500 | [diff] [blame] | 1779 | const struct nfs_inode *nfsi = NFS_I(inode); |
| 1780 | const struct nfs_fh *fh = hdr->args.fh ? |
| 1781 | hdr->args.fh : &nfsi->fh; |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 1782 | const struct nfs4_state *state = |
| 1783 | hdr->args.context->state; |
Trond Myklebust | 54898f7 | 2020-08-04 22:16:06 -0400 | [diff] [blame] | 1784 | const struct pnfs_layout_segment *lseg = hdr->lseg; |
Trond Myklebust | 25925b0 | 2020-01-06 15:25:05 -0500 | [diff] [blame] | 1785 | |
Trond Myklebust | cc668ab | 2013-08-14 15:31:28 -0400 | [diff] [blame] | 1786 | __entry->dev = inode->i_sb->s_dev; |
Trond Myklebust | 25925b0 | 2020-01-06 15:25:05 -0500 | [diff] [blame] | 1787 | __entry->fileid = nfsi->fileid; |
| 1788 | __entry->fhandle = nfs_fhandle_hash(fh); |
Weston Andros Adamson | d45f60c | 2014-06-09 11:48:35 -0400 | [diff] [blame] | 1789 | __entry->offset = hdr->args.offset; |
Trond Myklebust | 25925b0 | 2020-01-06 15:25:05 -0500 | [diff] [blame] | 1790 | __entry->arg_count = hdr->args.count; |
| 1791 | __entry->res_count = hdr->res.count; |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 1792 | __entry->error = error < 0 ? -error : 0; |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 1793 | __entry->stateid_seq = |
| 1794 | be32_to_cpu(state->stateid.seqid); |
| 1795 | __entry->stateid_hash = |
| 1796 | nfs_stateid_hash(&state->stateid); |
Trond Myklebust | 54898f7 | 2020-08-04 22:16:06 -0400 | [diff] [blame] | 1797 | __entry->layoutstateid_seq = lseg ? lseg->pls_seq : 0; |
| 1798 | __entry->layoutstateid_hash = |
| 1799 | NFS4_LSEG_LAYOUT_STATEID_HASH(lseg); |
Trond Myklebust | cc668ab | 2013-08-14 15:31:28 -0400 | [diff] [blame] | 1800 | ), |
| 1801 | |
| 1802 | TP_printk( |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 1803 | "error=%ld (%s) fileid=%02x:%02x:%llu fhandle=0x%08x " |
Trond Myklebust | 54898f7 | 2020-08-04 22:16:06 -0400 | [diff] [blame] | 1804 | "offset=%lld count=%u res=%u stateid=%d:0x%08x " |
| 1805 | "layoutstateid=%d:0x%08x", |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 1806 | -__entry->error, |
Trond Myklebust | cc668ab | 2013-08-14 15:31:28 -0400 | [diff] [blame] | 1807 | show_nfsv4_errors(__entry->error), |
| 1808 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 1809 | (unsigned long long)__entry->fileid, |
| 1810 | __entry->fhandle, |
| 1811 | (long long)__entry->offset, |
Trond Myklebust | 25925b0 | 2020-01-06 15:25:05 -0500 | [diff] [blame] | 1812 | __entry->arg_count, __entry->res_count, |
Trond Myklebust | 54898f7 | 2020-08-04 22:16:06 -0400 | [diff] [blame] | 1813 | __entry->stateid_seq, __entry->stateid_hash, |
| 1814 | __entry->layoutstateid_seq, __entry->layoutstateid_hash |
Trond Myklebust | cc668ab | 2013-08-14 15:31:28 -0400 | [diff] [blame] | 1815 | ) |
| 1816 | ); |
| 1817 | #define DEFINE_NFS4_READ_EVENT(name) \ |
| 1818 | DEFINE_EVENT(nfs4_read_event, name, \ |
| 1819 | TP_PROTO( \ |
Weston Andros Adamson | d45f60c | 2014-06-09 11:48:35 -0400 | [diff] [blame] | 1820 | const struct nfs_pgio_header *hdr, \ |
Trond Myklebust | cc668ab | 2013-08-14 15:31:28 -0400 | [diff] [blame] | 1821 | int error \ |
| 1822 | ), \ |
Weston Andros Adamson | d45f60c | 2014-06-09 11:48:35 -0400 | [diff] [blame] | 1823 | TP_ARGS(hdr, error)) |
Trond Myklebust | cc668ab | 2013-08-14 15:31:28 -0400 | [diff] [blame] | 1824 | DEFINE_NFS4_READ_EVENT(nfs4_read); |
| 1825 | #ifdef CONFIG_NFS_V4_1 |
| 1826 | DEFINE_NFS4_READ_EVENT(nfs4_pnfs_read); |
| 1827 | #endif /* CONFIG_NFS_V4_1 */ |
| 1828 | |
| 1829 | DECLARE_EVENT_CLASS(nfs4_write_event, |
| 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 | ), |
| 1834 | |
Weston Andros Adamson | d45f60c | 2014-06-09 11:48:35 -0400 | [diff] [blame] | 1835 | TP_ARGS(hdr, error), |
Trond Myklebust | cc668ab | 2013-08-14 15:31:28 -0400 | [diff] [blame] | 1836 | |
| 1837 | TP_STRUCT__entry( |
| 1838 | __field(dev_t, dev) |
| 1839 | __field(u32, fhandle) |
| 1840 | __field(u64, fileid) |
| 1841 | __field(loff_t, offset) |
Trond Myklebust | 25925b0 | 2020-01-06 15:25:05 -0500 | [diff] [blame] | 1842 | __field(u32, arg_count) |
| 1843 | __field(u32, res_count) |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 1844 | __field(unsigned long, error) |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 1845 | __field(int, stateid_seq) |
| 1846 | __field(u32, stateid_hash) |
Trond Myklebust | 54898f7 | 2020-08-04 22:16:06 -0400 | [diff] [blame] | 1847 | __field(int, layoutstateid_seq) |
| 1848 | __field(u32, layoutstateid_hash) |
Trond Myklebust | cc668ab | 2013-08-14 15:31:28 -0400 | [diff] [blame] | 1849 | ), |
| 1850 | |
| 1851 | TP_fast_assign( |
Weston Andros Adamson | d45f60c | 2014-06-09 11:48:35 -0400 | [diff] [blame] | 1852 | const struct inode *inode = hdr->inode; |
Trond Myklebust | 25925b0 | 2020-01-06 15:25:05 -0500 | [diff] [blame] | 1853 | const struct nfs_inode *nfsi = NFS_I(inode); |
| 1854 | const struct nfs_fh *fh = hdr->args.fh ? |
| 1855 | hdr->args.fh : &nfsi->fh; |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 1856 | const struct nfs4_state *state = |
| 1857 | hdr->args.context->state; |
Trond Myklebust | 54898f7 | 2020-08-04 22:16:06 -0400 | [diff] [blame] | 1858 | const struct pnfs_layout_segment *lseg = hdr->lseg; |
Trond Myklebust | 25925b0 | 2020-01-06 15:25:05 -0500 | [diff] [blame] | 1859 | |
Trond Myklebust | cc668ab | 2013-08-14 15:31:28 -0400 | [diff] [blame] | 1860 | __entry->dev = inode->i_sb->s_dev; |
Trond Myklebust | 25925b0 | 2020-01-06 15:25:05 -0500 | [diff] [blame] | 1861 | __entry->fileid = nfsi->fileid; |
| 1862 | __entry->fhandle = nfs_fhandle_hash(fh); |
Weston Andros Adamson | d45f60c | 2014-06-09 11:48:35 -0400 | [diff] [blame] | 1863 | __entry->offset = hdr->args.offset; |
Trond Myklebust | 25925b0 | 2020-01-06 15:25:05 -0500 | [diff] [blame] | 1864 | __entry->arg_count = hdr->args.count; |
| 1865 | __entry->res_count = hdr->res.count; |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 1866 | __entry->error = error < 0 ? -error : 0; |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 1867 | __entry->stateid_seq = |
| 1868 | be32_to_cpu(state->stateid.seqid); |
| 1869 | __entry->stateid_hash = |
| 1870 | nfs_stateid_hash(&state->stateid); |
Trond Myklebust | 54898f7 | 2020-08-04 22:16:06 -0400 | [diff] [blame] | 1871 | __entry->layoutstateid_seq = lseg ? lseg->pls_seq : 0; |
| 1872 | __entry->layoutstateid_hash = |
| 1873 | NFS4_LSEG_LAYOUT_STATEID_HASH(lseg); |
Trond Myklebust | cc668ab | 2013-08-14 15:31:28 -0400 | [diff] [blame] | 1874 | ), |
| 1875 | |
| 1876 | TP_printk( |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 1877 | "error=%ld (%s) fileid=%02x:%02x:%llu fhandle=0x%08x " |
Trond Myklebust | 54898f7 | 2020-08-04 22:16:06 -0400 | [diff] [blame] | 1878 | "offset=%lld count=%u res=%u stateid=%d:0x%08x " |
| 1879 | "layoutstateid=%d:0x%08x", |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 1880 | -__entry->error, |
Trond Myklebust | cc668ab | 2013-08-14 15:31:28 -0400 | [diff] [blame] | 1881 | show_nfsv4_errors(__entry->error), |
| 1882 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 1883 | (unsigned long long)__entry->fileid, |
| 1884 | __entry->fhandle, |
| 1885 | (long long)__entry->offset, |
Trond Myklebust | 25925b0 | 2020-01-06 15:25:05 -0500 | [diff] [blame] | 1886 | __entry->arg_count, __entry->res_count, |
Trond Myklebust | 54898f7 | 2020-08-04 22:16:06 -0400 | [diff] [blame] | 1887 | __entry->stateid_seq, __entry->stateid_hash, |
| 1888 | __entry->layoutstateid_seq, __entry->layoutstateid_hash |
Trond Myklebust | cc668ab | 2013-08-14 15:31:28 -0400 | [diff] [blame] | 1889 | ) |
| 1890 | ); |
| 1891 | |
| 1892 | #define DEFINE_NFS4_WRITE_EVENT(name) \ |
| 1893 | DEFINE_EVENT(nfs4_write_event, name, \ |
| 1894 | TP_PROTO( \ |
Weston Andros Adamson | d45f60c | 2014-06-09 11:48:35 -0400 | [diff] [blame] | 1895 | const struct nfs_pgio_header *hdr, \ |
Trond Myklebust | cc668ab | 2013-08-14 15:31:28 -0400 | [diff] [blame] | 1896 | int error \ |
| 1897 | ), \ |
Weston Andros Adamson | d45f60c | 2014-06-09 11:48:35 -0400 | [diff] [blame] | 1898 | TP_ARGS(hdr, error)) |
Trond Myklebust | cc668ab | 2013-08-14 15:31:28 -0400 | [diff] [blame] | 1899 | DEFINE_NFS4_WRITE_EVENT(nfs4_write); |
| 1900 | #ifdef CONFIG_NFS_V4_1 |
| 1901 | DEFINE_NFS4_WRITE_EVENT(nfs4_pnfs_write); |
| 1902 | #endif /* CONFIG_NFS_V4_1 */ |
| 1903 | |
| 1904 | DECLARE_EVENT_CLASS(nfs4_commit_event, |
| 1905 | TP_PROTO( |
| 1906 | const struct nfs_commit_data *data, |
| 1907 | int error |
| 1908 | ), |
| 1909 | |
| 1910 | TP_ARGS(data, error), |
| 1911 | |
| 1912 | TP_STRUCT__entry( |
| 1913 | __field(dev_t, dev) |
| 1914 | __field(u32, fhandle) |
| 1915 | __field(u64, fileid) |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 1916 | __field(unsigned long, error) |
Trond Myklebust | 25925b0 | 2020-01-06 15:25:05 -0500 | [diff] [blame] | 1917 | __field(loff_t, offset) |
| 1918 | __field(u32, count) |
Trond Myklebust | 54898f7 | 2020-08-04 22:16:06 -0400 | [diff] [blame] | 1919 | __field(int, layoutstateid_seq) |
| 1920 | __field(u32, layoutstateid_hash) |
Trond Myklebust | cc668ab | 2013-08-14 15:31:28 -0400 | [diff] [blame] | 1921 | ), |
| 1922 | |
| 1923 | TP_fast_assign( |
| 1924 | const struct inode *inode = data->inode; |
Trond Myklebust | 25925b0 | 2020-01-06 15:25:05 -0500 | [diff] [blame] | 1925 | const struct nfs_inode *nfsi = NFS_I(inode); |
| 1926 | const struct nfs_fh *fh = data->args.fh ? |
| 1927 | data->args.fh : &nfsi->fh; |
Trond Myklebust | 54898f7 | 2020-08-04 22:16:06 -0400 | [diff] [blame] | 1928 | const struct pnfs_layout_segment *lseg = data->lseg; |
Trond Myklebust | 25925b0 | 2020-01-06 15:25:05 -0500 | [diff] [blame] | 1929 | |
Trond Myklebust | cc668ab | 2013-08-14 15:31:28 -0400 | [diff] [blame] | 1930 | __entry->dev = inode->i_sb->s_dev; |
Trond Myklebust | 25925b0 | 2020-01-06 15:25:05 -0500 | [diff] [blame] | 1931 | __entry->fileid = nfsi->fileid; |
| 1932 | __entry->fhandle = nfs_fhandle_hash(fh); |
Trond Myklebust | cc668ab | 2013-08-14 15:31:28 -0400 | [diff] [blame] | 1933 | __entry->offset = data->args.offset; |
| 1934 | __entry->count = data->args.count; |
Trond Myklebust | 25925b0 | 2020-01-06 15:25:05 -0500 | [diff] [blame] | 1935 | __entry->error = error < 0 ? -error : 0; |
Trond Myklebust | 54898f7 | 2020-08-04 22:16:06 -0400 | [diff] [blame] | 1936 | __entry->layoutstateid_seq = lseg ? lseg->pls_seq : 0; |
| 1937 | __entry->layoutstateid_hash = |
| 1938 | NFS4_LSEG_LAYOUT_STATEID_HASH(lseg); |
Trond Myklebust | cc668ab | 2013-08-14 15:31:28 -0400 | [diff] [blame] | 1939 | ), |
| 1940 | |
| 1941 | TP_printk( |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 1942 | "error=%ld (%s) fileid=%02x:%02x:%llu fhandle=0x%08x " |
Trond Myklebust | 54898f7 | 2020-08-04 22:16:06 -0400 | [diff] [blame] | 1943 | "offset=%lld count=%u layoutstateid=%d:0x%08x", |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 1944 | -__entry->error, |
Trond Myklebust | cc668ab | 2013-08-14 15:31:28 -0400 | [diff] [blame] | 1945 | show_nfsv4_errors(__entry->error), |
| 1946 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 1947 | (unsigned long long)__entry->fileid, |
| 1948 | __entry->fhandle, |
| 1949 | (long long)__entry->offset, |
Trond Myklebust | 54898f7 | 2020-08-04 22:16:06 -0400 | [diff] [blame] | 1950 | __entry->count, |
| 1951 | __entry->layoutstateid_seq, __entry->layoutstateid_hash |
Trond Myklebust | cc668ab | 2013-08-14 15:31:28 -0400 | [diff] [blame] | 1952 | ) |
| 1953 | ); |
| 1954 | #define DEFINE_NFS4_COMMIT_EVENT(name) \ |
| 1955 | DEFINE_EVENT(nfs4_commit_event, name, \ |
| 1956 | TP_PROTO( \ |
| 1957 | const struct nfs_commit_data *data, \ |
| 1958 | int error \ |
| 1959 | ), \ |
| 1960 | TP_ARGS(data, error)) |
| 1961 | DEFINE_NFS4_COMMIT_EVENT(nfs4_commit); |
| 1962 | #ifdef CONFIG_NFS_V4_1 |
| 1963 | DEFINE_NFS4_COMMIT_EVENT(nfs4_pnfs_commit_ds); |
Trond Myklebust | 1037e6e | 2013-08-14 16:36:51 -0400 | [diff] [blame] | 1964 | |
Chuck Lever | 5b2095d | 2018-12-19 11:00:11 -0500 | [diff] [blame] | 1965 | TRACE_DEFINE_ENUM(IOMODE_READ); |
| 1966 | TRACE_DEFINE_ENUM(IOMODE_RW); |
| 1967 | TRACE_DEFINE_ENUM(IOMODE_ANY); |
| 1968 | |
Trond Myklebust | 1037e6e | 2013-08-14 16:36:51 -0400 | [diff] [blame] | 1969 | #define show_pnfs_iomode(iomode) \ |
| 1970 | __print_symbolic(iomode, \ |
| 1971 | { IOMODE_READ, "READ" }, \ |
| 1972 | { IOMODE_RW, "RW" }, \ |
| 1973 | { IOMODE_ANY, "ANY" }) |
| 1974 | |
| 1975 | TRACE_EVENT(nfs4_layoutget, |
| 1976 | TP_PROTO( |
| 1977 | const struct nfs_open_context *ctx, |
| 1978 | const struct pnfs_layout_range *args, |
| 1979 | const struct pnfs_layout_range *res, |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 1980 | const nfs4_stateid *layout_stateid, |
Trond Myklebust | 1037e6e | 2013-08-14 16:36:51 -0400 | [diff] [blame] | 1981 | int error |
| 1982 | ), |
| 1983 | |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 1984 | TP_ARGS(ctx, args, res, layout_stateid, error), |
Trond Myklebust | 1037e6e | 2013-08-14 16:36:51 -0400 | [diff] [blame] | 1985 | |
| 1986 | TP_STRUCT__entry( |
| 1987 | __field(dev_t, dev) |
| 1988 | __field(u32, fhandle) |
| 1989 | __field(u64, fileid) |
| 1990 | __field(u32, iomode) |
| 1991 | __field(u64, offset) |
| 1992 | __field(u64, count) |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 1993 | __field(unsigned long, error) |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 1994 | __field(int, stateid_seq) |
| 1995 | __field(u32, stateid_hash) |
| 1996 | __field(int, layoutstateid_seq) |
| 1997 | __field(u32, layoutstateid_hash) |
Trond Myklebust | 1037e6e | 2013-08-14 16:36:51 -0400 | [diff] [blame] | 1998 | ), |
| 1999 | |
| 2000 | TP_fast_assign( |
David Howells | 2b0143b | 2015-03-17 22:25:59 +0000 | [diff] [blame] | 2001 | const struct inode *inode = d_inode(ctx->dentry); |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 2002 | const struct nfs4_state *state = ctx->state; |
Trond Myklebust | 1037e6e | 2013-08-14 16:36:51 -0400 | [diff] [blame] | 2003 | __entry->dev = inode->i_sb->s_dev; |
| 2004 | __entry->fileid = NFS_FILEID(inode); |
| 2005 | __entry->fhandle = nfs_fhandle_hash(NFS_FH(inode)); |
| 2006 | __entry->iomode = args->iomode; |
| 2007 | __entry->offset = args->offset; |
| 2008 | __entry->count = args->length; |
Trond Myklebust | 118b629 | 2020-01-06 15:25:06 -0500 | [diff] [blame] | 2009 | __entry->error = error < 0 ? -error : 0; |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 2010 | __entry->stateid_seq = |
| 2011 | be32_to_cpu(state->stateid.seqid); |
| 2012 | __entry->stateid_hash = |
| 2013 | nfs_stateid_hash(&state->stateid); |
| 2014 | if (!error) { |
| 2015 | __entry->layoutstateid_seq = |
| 2016 | be32_to_cpu(layout_stateid->seqid); |
| 2017 | __entry->layoutstateid_hash = |
| 2018 | nfs_stateid_hash(layout_stateid); |
| 2019 | } else { |
| 2020 | __entry->layoutstateid_seq = 0; |
| 2021 | __entry->layoutstateid_hash = 0; |
| 2022 | } |
Trond Myklebust | 1037e6e | 2013-08-14 16:36:51 -0400 | [diff] [blame] | 2023 | ), |
| 2024 | |
| 2025 | TP_printk( |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 2026 | "error=%ld (%s) fileid=%02x:%02x:%llu fhandle=0x%08x " |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 2027 | "iomode=%s offset=%llu count=%llu stateid=%d:0x%08x " |
| 2028 | "layoutstateid=%d:0x%08x", |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 2029 | -__entry->error, |
Trond Myklebust | 1037e6e | 2013-08-14 16:36:51 -0400 | [diff] [blame] | 2030 | show_nfsv4_errors(__entry->error), |
| 2031 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 2032 | (unsigned long long)__entry->fileid, |
| 2033 | __entry->fhandle, |
| 2034 | show_pnfs_iomode(__entry->iomode), |
| 2035 | (unsigned long long)__entry->offset, |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 2036 | (unsigned long long)__entry->count, |
| 2037 | __entry->stateid_seq, __entry->stateid_hash, |
| 2038 | __entry->layoutstateid_seq, __entry->layoutstateid_hash |
Trond Myklebust | 1037e6e | 2013-08-14 16:36:51 -0400 | [diff] [blame] | 2039 | ) |
| 2040 | ); |
| 2041 | |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 2042 | DEFINE_NFS4_INODE_STATEID_EVENT(nfs4_layoutcommit); |
| 2043 | DEFINE_NFS4_INODE_STATEID_EVENT(nfs4_layoutreturn); |
Trond Myklebust | a19b478 | 2020-08-03 18:32:28 -0400 | [diff] [blame] | 2044 | DEFINE_NFS4_INODE_STATEID_EVENT(nfs4_layoutreturn_on_close); |
Trond Myklebust | 638037b | 2020-08-04 11:02:44 -0400 | [diff] [blame] | 2045 | DEFINE_NFS4_INODE_STATEID_EVENT(nfs4_layouterror); |
| 2046 | DEFINE_NFS4_INODE_STATEID_EVENT(nfs4_layoutstats); |
Trond Myklebust | 1037e6e | 2013-08-14 16:36:51 -0400 | [diff] [blame] | 2047 | |
Chuck Lever | 5b2095d | 2018-12-19 11:00:11 -0500 | [diff] [blame] | 2048 | TRACE_DEFINE_ENUM(PNFS_UPDATE_LAYOUT_UNKNOWN); |
| 2049 | TRACE_DEFINE_ENUM(PNFS_UPDATE_LAYOUT_NO_PNFS); |
| 2050 | TRACE_DEFINE_ENUM(PNFS_UPDATE_LAYOUT_RD_ZEROLEN); |
| 2051 | TRACE_DEFINE_ENUM(PNFS_UPDATE_LAYOUT_MDSTHRESH); |
| 2052 | TRACE_DEFINE_ENUM(PNFS_UPDATE_LAYOUT_NOMEM); |
| 2053 | TRACE_DEFINE_ENUM(PNFS_UPDATE_LAYOUT_BULK_RECALL); |
| 2054 | TRACE_DEFINE_ENUM(PNFS_UPDATE_LAYOUT_IO_TEST_FAIL); |
| 2055 | TRACE_DEFINE_ENUM(PNFS_UPDATE_LAYOUT_FOUND_CACHED); |
| 2056 | TRACE_DEFINE_ENUM(PNFS_UPDATE_LAYOUT_RETURN); |
| 2057 | TRACE_DEFINE_ENUM(PNFS_UPDATE_LAYOUT_BLOCKED); |
| 2058 | TRACE_DEFINE_ENUM(PNFS_UPDATE_LAYOUT_INVALID_OPEN); |
| 2059 | TRACE_DEFINE_ENUM(PNFS_UPDATE_LAYOUT_RETRY); |
| 2060 | TRACE_DEFINE_ENUM(PNFS_UPDATE_LAYOUT_SEND_LAYOUTGET); |
Trond Myklebust | d5b9216 | 2019-07-18 09:32:17 -0400 | [diff] [blame] | 2061 | TRACE_DEFINE_ENUM(PNFS_UPDATE_LAYOUT_EXIT); |
Chuck Lever | 5b2095d | 2018-12-19 11:00:11 -0500 | [diff] [blame] | 2062 | |
Jeff Layton | 9a4bf31 | 2015-12-10 10:41:58 -0500 | [diff] [blame] | 2063 | #define show_pnfs_update_layout_reason(reason) \ |
| 2064 | __print_symbolic(reason, \ |
| 2065 | { PNFS_UPDATE_LAYOUT_UNKNOWN, "unknown" }, \ |
| 2066 | { PNFS_UPDATE_LAYOUT_NO_PNFS, "no pnfs" }, \ |
| 2067 | { PNFS_UPDATE_LAYOUT_RD_ZEROLEN, "read+zerolen" }, \ |
| 2068 | { PNFS_UPDATE_LAYOUT_MDSTHRESH, "mdsthresh" }, \ |
| 2069 | { PNFS_UPDATE_LAYOUT_NOMEM, "nomem" }, \ |
| 2070 | { PNFS_UPDATE_LAYOUT_BULK_RECALL, "bulk recall" }, \ |
| 2071 | { PNFS_UPDATE_LAYOUT_IO_TEST_FAIL, "io test fail" }, \ |
| 2072 | { PNFS_UPDATE_LAYOUT_FOUND_CACHED, "found cached" }, \ |
| 2073 | { PNFS_UPDATE_LAYOUT_RETURN, "layoutreturn" }, \ |
| 2074 | { PNFS_UPDATE_LAYOUT_BLOCKED, "layouts blocked" }, \ |
Jeff Layton | 183d9e7 | 2016-05-17 12:28:47 -0400 | [diff] [blame] | 2075 | { PNFS_UPDATE_LAYOUT_INVALID_OPEN, "invalid open" }, \ |
| 2076 | { PNFS_UPDATE_LAYOUT_RETRY, "retrying" }, \ |
Trond Myklebust | d5b9216 | 2019-07-18 09:32:17 -0400 | [diff] [blame] | 2077 | { PNFS_UPDATE_LAYOUT_SEND_LAYOUTGET, "sent layoutget" }, \ |
| 2078 | { PNFS_UPDATE_LAYOUT_EXIT, "exit" }) |
Jeff Layton | 9a4bf31 | 2015-12-10 10:41:58 -0500 | [diff] [blame] | 2079 | |
| 2080 | TRACE_EVENT(pnfs_update_layout, |
| 2081 | TP_PROTO(struct inode *inode, |
| 2082 | loff_t pos, |
| 2083 | u64 count, |
| 2084 | enum pnfs_iomode iomode, |
Trond Myklebust | f484830 | 2015-12-26 18:03:07 -0500 | [diff] [blame] | 2085 | struct pnfs_layout_hdr *lo, |
Jeff Layton | 183d9e7 | 2016-05-17 12:28:47 -0400 | [diff] [blame] | 2086 | struct pnfs_layout_segment *lseg, |
Jeff Layton | 9a4bf31 | 2015-12-10 10:41:58 -0500 | [diff] [blame] | 2087 | enum pnfs_update_layout_reason reason |
| 2088 | ), |
Jeff Layton | 183d9e7 | 2016-05-17 12:28:47 -0400 | [diff] [blame] | 2089 | TP_ARGS(inode, pos, count, iomode, lo, lseg, reason), |
Jeff Layton | 9a4bf31 | 2015-12-10 10:41:58 -0500 | [diff] [blame] | 2090 | TP_STRUCT__entry( |
| 2091 | __field(dev_t, dev) |
| 2092 | __field(u64, fileid) |
| 2093 | __field(u32, fhandle) |
| 2094 | __field(loff_t, pos) |
| 2095 | __field(u64, count) |
| 2096 | __field(enum pnfs_iomode, iomode) |
Trond Myklebust | f484830 | 2015-12-26 18:03:07 -0500 | [diff] [blame] | 2097 | __field(int, layoutstateid_seq) |
| 2098 | __field(u32, layoutstateid_hash) |
Jeff Layton | 183d9e7 | 2016-05-17 12:28:47 -0400 | [diff] [blame] | 2099 | __field(long, lseg) |
Jeff Layton | 9a4bf31 | 2015-12-10 10:41:58 -0500 | [diff] [blame] | 2100 | __field(enum pnfs_update_layout_reason, reason) |
| 2101 | ), |
| 2102 | TP_fast_assign( |
| 2103 | __entry->dev = inode->i_sb->s_dev; |
| 2104 | __entry->fileid = NFS_FILEID(inode); |
| 2105 | __entry->fhandle = nfs_fhandle_hash(NFS_FH(inode)); |
| 2106 | __entry->pos = pos; |
| 2107 | __entry->count = count; |
| 2108 | __entry->iomode = iomode; |
Jeff Layton | 9a4bf31 | 2015-12-10 10:41:58 -0500 | [diff] [blame] | 2109 | __entry->reason = reason; |
Trond Myklebust | f484830 | 2015-12-26 18:03:07 -0500 | [diff] [blame] | 2110 | if (lo != NULL) { |
| 2111 | __entry->layoutstateid_seq = |
| 2112 | be32_to_cpu(lo->plh_stateid.seqid); |
| 2113 | __entry->layoutstateid_hash = |
| 2114 | nfs_stateid_hash(&lo->plh_stateid); |
| 2115 | } else { |
| 2116 | __entry->layoutstateid_seq = 0; |
| 2117 | __entry->layoutstateid_hash = 0; |
| 2118 | } |
Jeff Layton | 183d9e7 | 2016-05-17 12:28:47 -0400 | [diff] [blame] | 2119 | __entry->lseg = (long)lseg; |
Jeff Layton | 9a4bf31 | 2015-12-10 10:41:58 -0500 | [diff] [blame] | 2120 | ), |
| 2121 | TP_printk( |
| 2122 | "fileid=%02x:%02x:%llu fhandle=0x%08x " |
Trond Myklebust | f484830 | 2015-12-26 18:03:07 -0500 | [diff] [blame] | 2123 | "iomode=%s pos=%llu count=%llu " |
Jeff Layton | 183d9e7 | 2016-05-17 12:28:47 -0400 | [diff] [blame] | 2124 | "layoutstateid=%d:0x%08x lseg=0x%lx (%s)", |
Jeff Layton | 9a4bf31 | 2015-12-10 10:41:58 -0500 | [diff] [blame] | 2125 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 2126 | (unsigned long long)__entry->fileid, |
| 2127 | __entry->fhandle, |
| 2128 | show_pnfs_iomode(__entry->iomode), |
| 2129 | (unsigned long long)__entry->pos, |
Trond Myklebust | f484830 | 2015-12-26 18:03:07 -0500 | [diff] [blame] | 2130 | (unsigned long long)__entry->count, |
| 2131 | __entry->layoutstateid_seq, __entry->layoutstateid_hash, |
Jeff Layton | 183d9e7 | 2016-05-17 12:28:47 -0400 | [diff] [blame] | 2132 | __entry->lseg, |
Jeff Layton | 9a4bf31 | 2015-12-10 10:41:58 -0500 | [diff] [blame] | 2133 | show_pnfs_update_layout_reason(__entry->reason) |
| 2134 | ) |
| 2135 | ); |
| 2136 | |
Trond Myklebust | d5b9216 | 2019-07-18 09:32:17 -0400 | [diff] [blame] | 2137 | DECLARE_EVENT_CLASS(pnfs_layout_event, |
| 2138 | TP_PROTO(struct inode *inode, |
| 2139 | loff_t pos, |
| 2140 | u64 count, |
| 2141 | enum pnfs_iomode iomode, |
| 2142 | struct pnfs_layout_hdr *lo, |
| 2143 | struct pnfs_layout_segment *lseg |
| 2144 | ), |
| 2145 | TP_ARGS(inode, pos, count, iomode, lo, lseg), |
| 2146 | TP_STRUCT__entry( |
| 2147 | __field(dev_t, dev) |
| 2148 | __field(u64, fileid) |
| 2149 | __field(u32, fhandle) |
| 2150 | __field(loff_t, pos) |
| 2151 | __field(u64, count) |
| 2152 | __field(enum pnfs_iomode, iomode) |
| 2153 | __field(int, layoutstateid_seq) |
| 2154 | __field(u32, layoutstateid_hash) |
| 2155 | __field(long, lseg) |
| 2156 | ), |
| 2157 | TP_fast_assign( |
| 2158 | __entry->dev = inode->i_sb->s_dev; |
| 2159 | __entry->fileid = NFS_FILEID(inode); |
| 2160 | __entry->fhandle = nfs_fhandle_hash(NFS_FH(inode)); |
| 2161 | __entry->pos = pos; |
| 2162 | __entry->count = count; |
| 2163 | __entry->iomode = iomode; |
| 2164 | if (lo != NULL) { |
| 2165 | __entry->layoutstateid_seq = |
| 2166 | be32_to_cpu(lo->plh_stateid.seqid); |
| 2167 | __entry->layoutstateid_hash = |
| 2168 | nfs_stateid_hash(&lo->plh_stateid); |
| 2169 | } else { |
| 2170 | __entry->layoutstateid_seq = 0; |
| 2171 | __entry->layoutstateid_hash = 0; |
| 2172 | } |
| 2173 | __entry->lseg = (long)lseg; |
| 2174 | ), |
| 2175 | TP_printk( |
| 2176 | "fileid=%02x:%02x:%llu fhandle=0x%08x " |
| 2177 | "iomode=%s pos=%llu count=%llu " |
| 2178 | "layoutstateid=%d:0x%08x lseg=0x%lx", |
| 2179 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 2180 | (unsigned long long)__entry->fileid, |
| 2181 | __entry->fhandle, |
| 2182 | show_pnfs_iomode(__entry->iomode), |
| 2183 | (unsigned long long)__entry->pos, |
| 2184 | (unsigned long long)__entry->count, |
| 2185 | __entry->layoutstateid_seq, __entry->layoutstateid_hash, |
| 2186 | __entry->lseg |
| 2187 | ) |
| 2188 | ); |
| 2189 | |
| 2190 | #define DEFINE_PNFS_LAYOUT_EVENT(name) \ |
| 2191 | DEFINE_EVENT(pnfs_layout_event, name, \ |
| 2192 | TP_PROTO(struct inode *inode, \ |
| 2193 | loff_t pos, \ |
| 2194 | u64 count, \ |
| 2195 | enum pnfs_iomode iomode, \ |
| 2196 | struct pnfs_layout_hdr *lo, \ |
| 2197 | struct pnfs_layout_segment *lseg \ |
| 2198 | ), \ |
| 2199 | TP_ARGS(inode, pos, count, iomode, lo, lseg)) |
| 2200 | |
| 2201 | DEFINE_PNFS_LAYOUT_EVENT(pnfs_mds_fallback_pg_init_read); |
| 2202 | DEFINE_PNFS_LAYOUT_EVENT(pnfs_mds_fallback_pg_init_write); |
| 2203 | DEFINE_PNFS_LAYOUT_EVENT(pnfs_mds_fallback_pg_get_mirror_count); |
| 2204 | DEFINE_PNFS_LAYOUT_EVENT(pnfs_mds_fallback_read_done); |
| 2205 | DEFINE_PNFS_LAYOUT_EVENT(pnfs_mds_fallback_write_done); |
| 2206 | DEFINE_PNFS_LAYOUT_EVENT(pnfs_mds_fallback_read_pagelist); |
| 2207 | DEFINE_PNFS_LAYOUT_EVENT(pnfs_mds_fallback_write_pagelist); |
| 2208 | |
Trond Myklebust | cac1d3a | 2020-12-16 16:31:26 -0500 | [diff] [blame] | 2209 | DECLARE_EVENT_CLASS(nfs4_deviceid_event, |
| 2210 | TP_PROTO( |
| 2211 | const struct nfs_client *clp, |
| 2212 | const struct nfs4_deviceid *deviceid |
| 2213 | ), |
| 2214 | |
| 2215 | TP_ARGS(clp, deviceid), |
| 2216 | |
| 2217 | TP_STRUCT__entry( |
| 2218 | __string(dstaddr, clp->cl_hostname) |
| 2219 | __array(unsigned char, deviceid, NFS4_DEVICEID4_SIZE) |
| 2220 | ), |
| 2221 | |
| 2222 | TP_fast_assign( |
| 2223 | __assign_str(dstaddr, clp->cl_hostname); |
| 2224 | memcpy(__entry->deviceid, deviceid->data, |
| 2225 | NFS4_DEVICEID4_SIZE); |
| 2226 | ), |
| 2227 | |
| 2228 | TP_printk( |
| 2229 | "deviceid=%s, dstaddr=%s", |
| 2230 | __print_hex(__entry->deviceid, NFS4_DEVICEID4_SIZE), |
| 2231 | __get_str(dstaddr) |
| 2232 | ) |
| 2233 | ); |
| 2234 | #define DEFINE_PNFS_DEVICEID_EVENT(name) \ |
| 2235 | DEFINE_EVENT(nfs4_deviceid_event, name, \ |
| 2236 | TP_PROTO(const struct nfs_client *clp, \ |
| 2237 | const struct nfs4_deviceid *deviceid \ |
| 2238 | ), \ |
| 2239 | TP_ARGS(clp, deviceid)) |
| 2240 | DEFINE_PNFS_DEVICEID_EVENT(nfs4_deviceid_free); |
| 2241 | |
| 2242 | DECLARE_EVENT_CLASS(nfs4_deviceid_status, |
| 2243 | TP_PROTO( |
| 2244 | const struct nfs_server *server, |
| 2245 | const struct nfs4_deviceid *deviceid, |
| 2246 | int status |
| 2247 | ), |
| 2248 | |
| 2249 | TP_ARGS(server, deviceid, status), |
| 2250 | |
| 2251 | TP_STRUCT__entry( |
| 2252 | __field(dev_t, dev) |
| 2253 | __field(int, status) |
| 2254 | __string(dstaddr, server->nfs_client->cl_hostname) |
| 2255 | __array(unsigned char, deviceid, NFS4_DEVICEID4_SIZE) |
| 2256 | ), |
| 2257 | |
| 2258 | TP_fast_assign( |
| 2259 | __entry->dev = server->s_dev; |
| 2260 | __entry->status = status; |
| 2261 | __assign_str(dstaddr, server->nfs_client->cl_hostname); |
| 2262 | memcpy(__entry->deviceid, deviceid->data, |
| 2263 | NFS4_DEVICEID4_SIZE); |
| 2264 | ), |
| 2265 | |
| 2266 | TP_printk( |
| 2267 | "dev=%02x:%02x: deviceid=%s, dstaddr=%s, status=%d", |
| 2268 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 2269 | __print_hex(__entry->deviceid, NFS4_DEVICEID4_SIZE), |
| 2270 | __get_str(dstaddr), |
| 2271 | __entry->status |
| 2272 | ) |
| 2273 | ); |
| 2274 | #define DEFINE_PNFS_DEVICEID_STATUS(name) \ |
| 2275 | DEFINE_EVENT(nfs4_deviceid_status, name, \ |
| 2276 | TP_PROTO(const struct nfs_server *server, \ |
| 2277 | const struct nfs4_deviceid *deviceid, \ |
| 2278 | int status \ |
| 2279 | ), \ |
| 2280 | TP_ARGS(server, deviceid, status)) |
| 2281 | DEFINE_PNFS_DEVICEID_STATUS(nfs4_getdeviceinfo); |
| 2282 | DEFINE_PNFS_DEVICEID_STATUS(nfs4_find_deviceid); |
| 2283 | |
Trond Myklebust | 088f3e6 | 2020-01-06 15:25:11 -0500 | [diff] [blame] | 2284 | DECLARE_EVENT_CLASS(nfs4_flexfiles_io_event, |
| 2285 | TP_PROTO( |
| 2286 | const struct nfs_pgio_header *hdr |
| 2287 | ), |
| 2288 | |
| 2289 | TP_ARGS(hdr), |
| 2290 | |
| 2291 | TP_STRUCT__entry( |
| 2292 | __field(unsigned long, error) |
| 2293 | __field(dev_t, dev) |
| 2294 | __field(u32, fhandle) |
| 2295 | __field(u64, fileid) |
| 2296 | __field(loff_t, offset) |
| 2297 | __field(u32, count) |
| 2298 | __field(int, stateid_seq) |
| 2299 | __field(u32, stateid_hash) |
| 2300 | __string(dstaddr, hdr->ds_clp ? |
| 2301 | rpc_peeraddr2str(hdr->ds_clp->cl_rpcclient, |
| 2302 | RPC_DISPLAY_ADDR) : "unknown") |
| 2303 | ), |
| 2304 | |
| 2305 | TP_fast_assign( |
| 2306 | const struct inode *inode = hdr->inode; |
| 2307 | |
| 2308 | __entry->error = hdr->res.op_status; |
| 2309 | __entry->fhandle = nfs_fhandle_hash(hdr->args.fh); |
| 2310 | __entry->fileid = NFS_FILEID(inode); |
| 2311 | __entry->dev = inode->i_sb->s_dev; |
| 2312 | __entry->offset = hdr->args.offset; |
| 2313 | __entry->count = hdr->args.count; |
| 2314 | __entry->stateid_seq = |
| 2315 | be32_to_cpu(hdr->args.stateid.seqid); |
| 2316 | __entry->stateid_hash = |
| 2317 | nfs_stateid_hash(&hdr->args.stateid); |
| 2318 | __assign_str(dstaddr, hdr->ds_clp ? |
| 2319 | rpc_peeraddr2str(hdr->ds_clp->cl_rpcclient, |
| 2320 | RPC_DISPLAY_ADDR) : "unknown"); |
| 2321 | ), |
| 2322 | |
| 2323 | TP_printk( |
| 2324 | "error=%ld (%s) fileid=%02x:%02x:%llu fhandle=0x%08x " |
| 2325 | "offset=%llu count=%u stateid=%d:0x%08x dstaddr=%s", |
| 2326 | -__entry->error, |
| 2327 | show_nfsv4_errors(__entry->error), |
| 2328 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 2329 | (unsigned long long)__entry->fileid, |
| 2330 | __entry->fhandle, |
| 2331 | __entry->offset, __entry->count, |
| 2332 | __entry->stateid_seq, __entry->stateid_hash, |
| 2333 | __get_str(dstaddr) |
| 2334 | ) |
| 2335 | ); |
| 2336 | |
| 2337 | #define DEFINE_NFS4_FLEXFILES_IO_EVENT(name) \ |
| 2338 | DEFINE_EVENT(nfs4_flexfiles_io_event, name, \ |
| 2339 | TP_PROTO( \ |
| 2340 | const struct nfs_pgio_header *hdr \ |
| 2341 | ), \ |
| 2342 | TP_ARGS(hdr)) |
| 2343 | DEFINE_NFS4_FLEXFILES_IO_EVENT(ff_layout_read_error); |
| 2344 | DEFINE_NFS4_FLEXFILES_IO_EVENT(ff_layout_write_error); |
| 2345 | |
| 2346 | TRACE_EVENT(ff_layout_commit_error, |
| 2347 | TP_PROTO( |
| 2348 | const struct nfs_commit_data *data |
| 2349 | ), |
| 2350 | |
| 2351 | TP_ARGS(data), |
| 2352 | |
| 2353 | TP_STRUCT__entry( |
| 2354 | __field(unsigned long, error) |
| 2355 | __field(dev_t, dev) |
| 2356 | __field(u32, fhandle) |
| 2357 | __field(u64, fileid) |
| 2358 | __field(loff_t, offset) |
| 2359 | __field(u32, count) |
| 2360 | __string(dstaddr, data->ds_clp ? |
| 2361 | rpc_peeraddr2str(data->ds_clp->cl_rpcclient, |
| 2362 | RPC_DISPLAY_ADDR) : "unknown") |
| 2363 | ), |
| 2364 | |
| 2365 | TP_fast_assign( |
| 2366 | const struct inode *inode = data->inode; |
| 2367 | |
| 2368 | __entry->error = data->res.op_status; |
| 2369 | __entry->fhandle = nfs_fhandle_hash(data->args.fh); |
| 2370 | __entry->fileid = NFS_FILEID(inode); |
| 2371 | __entry->dev = inode->i_sb->s_dev; |
| 2372 | __entry->offset = data->args.offset; |
| 2373 | __entry->count = data->args.count; |
| 2374 | __assign_str(dstaddr, data->ds_clp ? |
| 2375 | rpc_peeraddr2str(data->ds_clp->cl_rpcclient, |
| 2376 | RPC_DISPLAY_ADDR) : "unknown"); |
| 2377 | ), |
| 2378 | |
| 2379 | TP_printk( |
| 2380 | "error=%ld (%s) fileid=%02x:%02x:%llu fhandle=0x%08x " |
| 2381 | "offset=%llu count=%u dstaddr=%s", |
| 2382 | -__entry->error, |
| 2383 | show_nfsv4_errors(__entry->error), |
| 2384 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 2385 | (unsigned long long)__entry->fileid, |
| 2386 | __entry->fhandle, |
| 2387 | __entry->offset, __entry->count, |
| 2388 | __get_str(dstaddr) |
| 2389 | ) |
| 2390 | ); |
| 2391 | |
| 2392 | |
Trond Myklebust | cc668ab | 2013-08-14 15:31:28 -0400 | [diff] [blame] | 2393 | #endif /* CONFIG_NFS_V4_1 */ |
| 2394 | |
Trond Myklebust | c6d01c6 | 2013-08-09 11:51:26 -0400 | [diff] [blame] | 2395 | #endif /* _TRACE_NFS4_H */ |
| 2396 | |
| 2397 | #undef TRACE_INCLUDE_PATH |
| 2398 | #define TRACE_INCLUDE_PATH . |
| 2399 | #define TRACE_INCLUDE_FILE nfs4trace |
| 2400 | /* This part must be outside protection */ |
| 2401 | #include <trace/define_trace.h> |