Trond Myklebust | c6d01c6 | 2013-08-09 11:51:26 -0400 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2013 Trond Myklebust <Trond.Myklebust@netapp.com> |
| 3 | */ |
| 4 | #undef TRACE_SYSTEM |
| 5 | #define TRACE_SYSTEM nfs4 |
| 6 | |
| 7 | #if !defined(_TRACE_NFS4_H) || defined(TRACE_HEADER_MULTI_READ) |
| 8 | #define _TRACE_NFS4_H |
| 9 | |
| 10 | #include <linux/tracepoint.h> |
| 11 | |
| 12 | #define show_nfsv4_errors(error) \ |
| 13 | __print_symbolic(error, \ |
| 14 | { NFS4_OK, "OK" }, \ |
| 15 | /* Mapped by nfs4_stat_to_errno() */ \ |
| 16 | { -EPERM, "EPERM" }, \ |
| 17 | { -ENOENT, "ENOENT" }, \ |
| 18 | { -EIO, "EIO" }, \ |
| 19 | { -ENXIO, "ENXIO" }, \ |
| 20 | { -EACCES, "EACCES" }, \ |
| 21 | { -EEXIST, "EEXIST" }, \ |
| 22 | { -EXDEV, "EXDEV" }, \ |
| 23 | { -ENOTDIR, "ENOTDIR" }, \ |
| 24 | { -EISDIR, "EISDIR" }, \ |
| 25 | { -EFBIG, "EFBIG" }, \ |
| 26 | { -ENOSPC, "ENOSPC" }, \ |
| 27 | { -EROFS, "EROFS" }, \ |
| 28 | { -EMLINK, "EMLINK" }, \ |
| 29 | { -ENAMETOOLONG, "ENAMETOOLONG" }, \ |
| 30 | { -ENOTEMPTY, "ENOTEMPTY" }, \ |
| 31 | { -EDQUOT, "EDQUOT" }, \ |
| 32 | { -ESTALE, "ESTALE" }, \ |
| 33 | { -EBADHANDLE, "EBADHANDLE" }, \ |
| 34 | { -EBADCOOKIE, "EBADCOOKIE" }, \ |
| 35 | { -ENOTSUPP, "ENOTSUPP" }, \ |
| 36 | { -ETOOSMALL, "ETOOSMALL" }, \ |
| 37 | { -EREMOTEIO, "EREMOTEIO" }, \ |
| 38 | { -EBADTYPE, "EBADTYPE" }, \ |
| 39 | { -EAGAIN, "EAGAIN" }, \ |
| 40 | { -ELOOP, "ELOOP" }, \ |
| 41 | { -EOPNOTSUPP, "EOPNOTSUPP" }, \ |
| 42 | { -EDEADLK, "EDEADLK" }, \ |
| 43 | /* RPC errors */ \ |
| 44 | { -ENOMEM, "ENOMEM" }, \ |
| 45 | { -EKEYEXPIRED, "EKEYEXPIRED" }, \ |
| 46 | { -ETIMEDOUT, "ETIMEDOUT" }, \ |
| 47 | { -ERESTARTSYS, "ERESTARTSYS" }, \ |
| 48 | { -ECONNREFUSED, "ECONNREFUSED" }, \ |
| 49 | { -ECONNRESET, "ECONNRESET" }, \ |
| 50 | { -ENETUNREACH, "ENETUNREACH" }, \ |
| 51 | { -EHOSTUNREACH, "EHOSTUNREACH" }, \ |
| 52 | { -EHOSTDOWN, "EHOSTDOWN" }, \ |
| 53 | { -EPIPE, "EPIPE" }, \ |
| 54 | { -EPFNOSUPPORT, "EPFNOSUPPORT" }, \ |
| 55 | { -EPROTONOSUPPORT, "EPROTONOSUPPORT" }, \ |
| 56 | /* NFSv4 native errors */ \ |
| 57 | { -NFS4ERR_ACCESS, "ACCESS" }, \ |
| 58 | { -NFS4ERR_ATTRNOTSUPP, "ATTRNOTSUPP" }, \ |
| 59 | { -NFS4ERR_ADMIN_REVOKED, "ADMIN_REVOKED" }, \ |
| 60 | { -NFS4ERR_BACK_CHAN_BUSY, "BACK_CHAN_BUSY" }, \ |
| 61 | { -NFS4ERR_BADCHAR, "BADCHAR" }, \ |
| 62 | { -NFS4ERR_BADHANDLE, "BADHANDLE" }, \ |
| 63 | { -NFS4ERR_BADIOMODE, "BADIOMODE" }, \ |
| 64 | { -NFS4ERR_BADLAYOUT, "BADLAYOUT" }, \ |
| 65 | { -NFS4ERR_BADLABEL, "BADLABEL" }, \ |
| 66 | { -NFS4ERR_BADNAME, "BADNAME" }, \ |
| 67 | { -NFS4ERR_BADOWNER, "BADOWNER" }, \ |
| 68 | { -NFS4ERR_BADSESSION, "BADSESSION" }, \ |
| 69 | { -NFS4ERR_BADSLOT, "BADSLOT" }, \ |
| 70 | { -NFS4ERR_BADTYPE, "BADTYPE" }, \ |
| 71 | { -NFS4ERR_BADXDR, "BADXDR" }, \ |
| 72 | { -NFS4ERR_BAD_COOKIE, "BAD_COOKIE" }, \ |
| 73 | { -NFS4ERR_BAD_HIGH_SLOT, "BAD_HIGH_SLOT" }, \ |
| 74 | { -NFS4ERR_BAD_RANGE, "BAD_RANGE" }, \ |
| 75 | { -NFS4ERR_BAD_SEQID, "BAD_SEQID" }, \ |
| 76 | { -NFS4ERR_BAD_SESSION_DIGEST, "BAD_SESSION_DIGEST" }, \ |
| 77 | { -NFS4ERR_BAD_STATEID, "BAD_STATEID" }, \ |
| 78 | { -NFS4ERR_CB_PATH_DOWN, "CB_PATH_DOWN" }, \ |
| 79 | { -NFS4ERR_CLID_INUSE, "CLID_INUSE" }, \ |
| 80 | { -NFS4ERR_CLIENTID_BUSY, "CLIENTID_BUSY" }, \ |
| 81 | { -NFS4ERR_COMPLETE_ALREADY, "COMPLETE_ALREADY" }, \ |
| 82 | { -NFS4ERR_CONN_NOT_BOUND_TO_SESSION, \ |
| 83 | "CONN_NOT_BOUND_TO_SESSION" }, \ |
| 84 | { -NFS4ERR_DEADLOCK, "DEADLOCK" }, \ |
| 85 | { -NFS4ERR_DEADSESSION, "DEAD_SESSION" }, \ |
| 86 | { -NFS4ERR_DELAY, "DELAY" }, \ |
| 87 | { -NFS4ERR_DELEG_ALREADY_WANTED, \ |
| 88 | "DELEG_ALREADY_WANTED" }, \ |
| 89 | { -NFS4ERR_DELEG_REVOKED, "DELEG_REVOKED" }, \ |
| 90 | { -NFS4ERR_DENIED, "DENIED" }, \ |
| 91 | { -NFS4ERR_DIRDELEG_UNAVAIL, "DIRDELEG_UNAVAIL" }, \ |
| 92 | { -NFS4ERR_DQUOT, "DQUOT" }, \ |
| 93 | { -NFS4ERR_ENCR_ALG_UNSUPP, "ENCR_ALG_UNSUPP" }, \ |
| 94 | { -NFS4ERR_EXIST, "EXIST" }, \ |
| 95 | { -NFS4ERR_EXPIRED, "EXPIRED" }, \ |
| 96 | { -NFS4ERR_FBIG, "FBIG" }, \ |
| 97 | { -NFS4ERR_FHEXPIRED, "FHEXPIRED" }, \ |
| 98 | { -NFS4ERR_FILE_OPEN, "FILE_OPEN" }, \ |
| 99 | { -NFS4ERR_GRACE, "GRACE" }, \ |
| 100 | { -NFS4ERR_HASH_ALG_UNSUPP, "HASH_ALG_UNSUPP" }, \ |
| 101 | { -NFS4ERR_INVAL, "INVAL" }, \ |
| 102 | { -NFS4ERR_IO, "IO" }, \ |
| 103 | { -NFS4ERR_ISDIR, "ISDIR" }, \ |
| 104 | { -NFS4ERR_LAYOUTTRYLATER, "LAYOUTTRYLATER" }, \ |
| 105 | { -NFS4ERR_LAYOUTUNAVAILABLE, "LAYOUTUNAVAILABLE" }, \ |
| 106 | { -NFS4ERR_LEASE_MOVED, "LEASE_MOVED" }, \ |
| 107 | { -NFS4ERR_LOCKED, "LOCKED" }, \ |
| 108 | { -NFS4ERR_LOCKS_HELD, "LOCKS_HELD" }, \ |
| 109 | { -NFS4ERR_LOCK_RANGE, "LOCK_RANGE" }, \ |
| 110 | { -NFS4ERR_MINOR_VERS_MISMATCH, "MINOR_VERS_MISMATCH" }, \ |
| 111 | { -NFS4ERR_MLINK, "MLINK" }, \ |
| 112 | { -NFS4ERR_MOVED, "MOVED" }, \ |
| 113 | { -NFS4ERR_NAMETOOLONG, "NAMETOOLONG" }, \ |
| 114 | { -NFS4ERR_NOENT, "NOENT" }, \ |
| 115 | { -NFS4ERR_NOFILEHANDLE, "NOFILEHANDLE" }, \ |
| 116 | { -NFS4ERR_NOMATCHING_LAYOUT, "NOMATCHING_LAYOUT" }, \ |
| 117 | { -NFS4ERR_NOSPC, "NOSPC" }, \ |
| 118 | { -NFS4ERR_NOTDIR, "NOTDIR" }, \ |
| 119 | { -NFS4ERR_NOTEMPTY, "NOTEMPTY" }, \ |
| 120 | { -NFS4ERR_NOTSUPP, "NOTSUPP" }, \ |
| 121 | { -NFS4ERR_NOT_ONLY_OP, "NOT_ONLY_OP" }, \ |
| 122 | { -NFS4ERR_NOT_SAME, "NOT_SAME" }, \ |
| 123 | { -NFS4ERR_NO_GRACE, "NO_GRACE" }, \ |
| 124 | { -NFS4ERR_NXIO, "NXIO" }, \ |
| 125 | { -NFS4ERR_OLD_STATEID, "OLD_STATEID" }, \ |
| 126 | { -NFS4ERR_OPENMODE, "OPENMODE" }, \ |
| 127 | { -NFS4ERR_OP_ILLEGAL, "OP_ILLEGAL" }, \ |
| 128 | { -NFS4ERR_OP_NOT_IN_SESSION, "OP_NOT_IN_SESSION" }, \ |
| 129 | { -NFS4ERR_PERM, "PERM" }, \ |
| 130 | { -NFS4ERR_PNFS_IO_HOLE, "PNFS_IO_HOLE" }, \ |
| 131 | { -NFS4ERR_PNFS_NO_LAYOUT, "PNFS_NO_LAYOUT" }, \ |
| 132 | { -NFS4ERR_RECALLCONFLICT, "RECALLCONFLICT" }, \ |
| 133 | { -NFS4ERR_RECLAIM_BAD, "RECLAIM_BAD" }, \ |
| 134 | { -NFS4ERR_RECLAIM_CONFLICT, "RECLAIM_CONFLICT" }, \ |
| 135 | { -NFS4ERR_REJECT_DELEG, "REJECT_DELEG" }, \ |
| 136 | { -NFS4ERR_REP_TOO_BIG, "REP_TOO_BIG" }, \ |
| 137 | { -NFS4ERR_REP_TOO_BIG_TO_CACHE, \ |
| 138 | "REP_TOO_BIG_TO_CACHE" }, \ |
| 139 | { -NFS4ERR_REQ_TOO_BIG, "REQ_TOO_BIG" }, \ |
| 140 | { -NFS4ERR_RESOURCE, "RESOURCE" }, \ |
| 141 | { -NFS4ERR_RESTOREFH, "RESTOREFH" }, \ |
| 142 | { -NFS4ERR_RETRY_UNCACHED_REP, "RETRY_UNCACHED_REP" }, \ |
| 143 | { -NFS4ERR_RETURNCONFLICT, "RETURNCONFLICT" }, \ |
| 144 | { -NFS4ERR_ROFS, "ROFS" }, \ |
| 145 | { -NFS4ERR_SAME, "SAME" }, \ |
| 146 | { -NFS4ERR_SHARE_DENIED, "SHARE_DENIED" }, \ |
| 147 | { -NFS4ERR_SEQUENCE_POS, "SEQUENCE_POS" }, \ |
| 148 | { -NFS4ERR_SEQ_FALSE_RETRY, "SEQ_FALSE_RETRY" }, \ |
| 149 | { -NFS4ERR_SEQ_MISORDERED, "SEQ_MISORDERED" }, \ |
| 150 | { -NFS4ERR_SERVERFAULT, "SERVERFAULT" }, \ |
| 151 | { -NFS4ERR_STALE, "STALE" }, \ |
| 152 | { -NFS4ERR_STALE_CLIENTID, "STALE_CLIENTID" }, \ |
| 153 | { -NFS4ERR_STALE_STATEID, "STALE_STATEID" }, \ |
| 154 | { -NFS4ERR_SYMLINK, "SYMLINK" }, \ |
| 155 | { -NFS4ERR_TOOSMALL, "TOOSMALL" }, \ |
| 156 | { -NFS4ERR_TOO_MANY_OPS, "TOO_MANY_OPS" }, \ |
| 157 | { -NFS4ERR_UNKNOWN_LAYOUTTYPE, "UNKNOWN_LAYOUTTYPE" }, \ |
| 158 | { -NFS4ERR_UNSAFE_COMPOUND, "UNSAFE_COMPOUND" }, \ |
| 159 | { -NFS4ERR_WRONGSEC, "WRONGSEC" }, \ |
| 160 | { -NFS4ERR_WRONG_CRED, "WRONG_CRED" }, \ |
| 161 | { -NFS4ERR_WRONG_TYPE, "WRONG_TYPE" }, \ |
| 162 | { -NFS4ERR_XDEV, "XDEV" }) |
| 163 | |
Trond Myklebust | 42113a7 | 2013-08-12 16:19:27 -0400 | [diff] [blame] | 164 | #define show_open_flags(flags) \ |
| 165 | __print_flags(flags, "|", \ |
| 166 | { O_CREAT, "O_CREAT" }, \ |
| 167 | { O_EXCL, "O_EXCL" }, \ |
| 168 | { O_TRUNC, "O_TRUNC" }, \ |
| 169 | { O_DIRECT, "O_DIRECT" }) |
| 170 | |
| 171 | #define show_fmode_flags(mode) \ |
| 172 | __print_flags(mode, "|", \ |
| 173 | { ((__force unsigned long)FMODE_READ), "READ" }, \ |
| 174 | { ((__force unsigned long)FMODE_WRITE), "WRITE" }, \ |
| 175 | { ((__force unsigned long)FMODE_EXEC), "EXEC" }) |
| 176 | |
Trond Myklebust | b5f875a | 2013-08-13 13:01:39 -0400 | [diff] [blame] | 177 | #define show_nfs_fattr_flags(valid) \ |
| 178 | __print_flags((unsigned long)valid, "|", \ |
| 179 | { NFS_ATTR_FATTR_TYPE, "TYPE" }, \ |
| 180 | { NFS_ATTR_FATTR_MODE, "MODE" }, \ |
| 181 | { NFS_ATTR_FATTR_NLINK, "NLINK" }, \ |
| 182 | { NFS_ATTR_FATTR_OWNER, "OWNER" }, \ |
| 183 | { NFS_ATTR_FATTR_GROUP, "GROUP" }, \ |
| 184 | { NFS_ATTR_FATTR_RDEV, "RDEV" }, \ |
| 185 | { NFS_ATTR_FATTR_SIZE, "SIZE" }, \ |
| 186 | { NFS_ATTR_FATTR_FSID, "FSID" }, \ |
| 187 | { NFS_ATTR_FATTR_FILEID, "FILEID" }, \ |
| 188 | { NFS_ATTR_FATTR_ATIME, "ATIME" }, \ |
| 189 | { NFS_ATTR_FATTR_MTIME, "MTIME" }, \ |
| 190 | { NFS_ATTR_FATTR_CTIME, "CTIME" }, \ |
| 191 | { NFS_ATTR_FATTR_CHANGE, "CHANGE" }, \ |
| 192 | { NFS_ATTR_FATTR_OWNER_NAME, "OWNER_NAME" }, \ |
| 193 | { NFS_ATTR_FATTR_GROUP_NAME, "GROUP_NAME" }) |
| 194 | |
Trond Myklebust | c6d01c6 | 2013-08-09 11:51:26 -0400 | [diff] [blame] | 195 | DECLARE_EVENT_CLASS(nfs4_clientid_event, |
| 196 | TP_PROTO( |
| 197 | const struct nfs_client *clp, |
| 198 | int error |
| 199 | ), |
| 200 | |
| 201 | TP_ARGS(clp, error), |
| 202 | |
| 203 | TP_STRUCT__entry( |
Anna Schumaker | 8fb42f7 | 2017-11-01 15:48:43 -0400 | [diff] [blame] | 204 | __string(dstaddr, clp->cl_hostname) |
Trond Myklebust | c6d01c6 | 2013-08-09 11:51:26 -0400 | [diff] [blame] | 205 | __field(int, error) |
| 206 | ), |
| 207 | |
| 208 | TP_fast_assign( |
| 209 | __entry->error = error; |
Anna Schumaker | 8fb42f7 | 2017-11-01 15:48:43 -0400 | [diff] [blame] | 210 | __assign_str(dstaddr, clp->cl_hostname); |
Trond Myklebust | c6d01c6 | 2013-08-09 11:51:26 -0400 | [diff] [blame] | 211 | ), |
| 212 | |
| 213 | TP_printk( |
| 214 | "error=%d (%s) dstaddr=%s", |
| 215 | __entry->error, |
| 216 | show_nfsv4_errors(__entry->error), |
| 217 | __get_str(dstaddr) |
| 218 | ) |
| 219 | ); |
| 220 | #define DEFINE_NFS4_CLIENTID_EVENT(name) \ |
| 221 | DEFINE_EVENT(nfs4_clientid_event, name, \ |
| 222 | TP_PROTO( \ |
| 223 | const struct nfs_client *clp, \ |
| 224 | int error \ |
| 225 | ), \ |
| 226 | TP_ARGS(clp, error)) |
| 227 | DEFINE_NFS4_CLIENTID_EVENT(nfs4_setclientid); |
| 228 | DEFINE_NFS4_CLIENTID_EVENT(nfs4_setclientid_confirm); |
| 229 | DEFINE_NFS4_CLIENTID_EVENT(nfs4_renew); |
| 230 | DEFINE_NFS4_CLIENTID_EVENT(nfs4_renew_async); |
| 231 | #ifdef CONFIG_NFS_V4_1 |
| 232 | DEFINE_NFS4_CLIENTID_EVENT(nfs4_exchange_id); |
| 233 | DEFINE_NFS4_CLIENTID_EVENT(nfs4_create_session); |
| 234 | DEFINE_NFS4_CLIENTID_EVENT(nfs4_destroy_session); |
| 235 | DEFINE_NFS4_CLIENTID_EVENT(nfs4_destroy_clientid); |
| 236 | DEFINE_NFS4_CLIENTID_EVENT(nfs4_bind_conn_to_session); |
| 237 | DEFINE_NFS4_CLIENTID_EVENT(nfs4_sequence); |
| 238 | DEFINE_NFS4_CLIENTID_EVENT(nfs4_reclaim_complete); |
Trond Myklebust | 2f92ae3 | 2013-08-14 17:58:28 -0400 | [diff] [blame] | 239 | |
| 240 | TRACE_EVENT(nfs4_setup_sequence, |
| 241 | TP_PROTO( |
| 242 | const struct nfs4_session *session, |
| 243 | const struct nfs4_sequence_args *args |
| 244 | ), |
| 245 | TP_ARGS(session, args), |
| 246 | |
| 247 | TP_STRUCT__entry( |
| 248 | __field(unsigned int, session) |
| 249 | __field(unsigned int, slot_nr) |
| 250 | __field(unsigned int, seq_nr) |
| 251 | __field(unsigned int, highest_used_slotid) |
| 252 | ), |
| 253 | |
| 254 | TP_fast_assign( |
| 255 | const struct nfs4_slot *sa_slot = args->sa_slot; |
| 256 | __entry->session = nfs_session_id_hash(&session->sess_id); |
| 257 | __entry->slot_nr = sa_slot->slot_nr; |
| 258 | __entry->seq_nr = sa_slot->seq_nr; |
| 259 | __entry->highest_used_slotid = |
| 260 | sa_slot->table->highest_used_slotid; |
| 261 | ), |
| 262 | TP_printk( |
| 263 | "session=0x%08x slot_nr=%u seq_nr=%u " |
| 264 | "highest_used_slotid=%u", |
| 265 | __entry->session, |
| 266 | __entry->slot_nr, |
| 267 | __entry->seq_nr, |
| 268 | __entry->highest_used_slotid |
| 269 | ) |
| 270 | ); |
| 271 | |
| 272 | #define show_nfs4_sequence_status_flags(status) \ |
| 273 | __print_flags((unsigned long)status, "|", \ |
| 274 | { SEQ4_STATUS_CB_PATH_DOWN, "CB_PATH_DOWN" }, \ |
| 275 | { SEQ4_STATUS_CB_GSS_CONTEXTS_EXPIRING, \ |
| 276 | "CB_GSS_CONTEXTS_EXPIRING" }, \ |
| 277 | { SEQ4_STATUS_CB_GSS_CONTEXTS_EXPIRED, \ |
| 278 | "CB_GSS_CONTEXTS_EXPIRED" }, \ |
| 279 | { SEQ4_STATUS_EXPIRED_ALL_STATE_REVOKED, \ |
| 280 | "EXPIRED_ALL_STATE_REVOKED" }, \ |
| 281 | { SEQ4_STATUS_EXPIRED_SOME_STATE_REVOKED, \ |
| 282 | "EXPIRED_SOME_STATE_REVOKED" }, \ |
| 283 | { SEQ4_STATUS_ADMIN_STATE_REVOKED, \ |
| 284 | "ADMIN_STATE_REVOKED" }, \ |
| 285 | { SEQ4_STATUS_RECALLABLE_STATE_REVOKED, \ |
| 286 | "RECALLABLE_STATE_REVOKED" }, \ |
| 287 | { SEQ4_STATUS_LEASE_MOVED, "LEASE_MOVED" }, \ |
| 288 | { SEQ4_STATUS_RESTART_RECLAIM_NEEDED, \ |
| 289 | "RESTART_RECLAIM_NEEDED" }, \ |
| 290 | { SEQ4_STATUS_CB_PATH_DOWN_SESSION, \ |
| 291 | "CB_PATH_DOWN_SESSION" }, \ |
| 292 | { SEQ4_STATUS_BACKCHANNEL_FAULT, \ |
| 293 | "BACKCHANNEL_FAULT" }) |
| 294 | |
| 295 | TRACE_EVENT(nfs4_sequence_done, |
| 296 | TP_PROTO( |
| 297 | const struct nfs4_session *session, |
| 298 | const struct nfs4_sequence_res *res |
| 299 | ), |
| 300 | TP_ARGS(session, res), |
| 301 | |
| 302 | TP_STRUCT__entry( |
| 303 | __field(unsigned int, session) |
| 304 | __field(unsigned int, slot_nr) |
| 305 | __field(unsigned int, seq_nr) |
| 306 | __field(unsigned int, highest_slotid) |
| 307 | __field(unsigned int, target_highest_slotid) |
| 308 | __field(unsigned int, status_flags) |
| 309 | __field(int, error) |
| 310 | ), |
| 311 | |
| 312 | TP_fast_assign( |
| 313 | const struct nfs4_slot *sr_slot = res->sr_slot; |
| 314 | __entry->session = nfs_session_id_hash(&session->sess_id); |
| 315 | __entry->slot_nr = sr_slot->slot_nr; |
| 316 | __entry->seq_nr = sr_slot->seq_nr; |
| 317 | __entry->highest_slotid = res->sr_highest_slotid; |
| 318 | __entry->target_highest_slotid = |
| 319 | res->sr_target_highest_slotid; |
Andrew Elble | 52618df | 2015-12-02 09:19:43 -0500 | [diff] [blame] | 320 | __entry->status_flags = res->sr_status_flags; |
Trond Myklebust | 2f92ae3 | 2013-08-14 17:58:28 -0400 | [diff] [blame] | 321 | __entry->error = res->sr_status; |
| 322 | ), |
| 323 | TP_printk( |
| 324 | "error=%d (%s) session=0x%08x slot_nr=%u seq_nr=%u " |
| 325 | "highest_slotid=%u target_highest_slotid=%u " |
| 326 | "status_flags=%u (%s)", |
| 327 | __entry->error, |
| 328 | show_nfsv4_errors(__entry->error), |
| 329 | __entry->session, |
| 330 | __entry->slot_nr, |
| 331 | __entry->seq_nr, |
| 332 | __entry->highest_slotid, |
| 333 | __entry->target_highest_slotid, |
| 334 | __entry->status_flags, |
| 335 | show_nfs4_sequence_status_flags(__entry->status_flags) |
| 336 | ) |
| 337 | ); |
| 338 | |
| 339 | struct cb_sequenceargs; |
| 340 | struct cb_sequenceres; |
| 341 | |
| 342 | TRACE_EVENT(nfs4_cb_sequence, |
| 343 | TP_PROTO( |
| 344 | const struct cb_sequenceargs *args, |
| 345 | const struct cb_sequenceres *res, |
| 346 | __be32 status |
| 347 | ), |
| 348 | TP_ARGS(args, res, status), |
| 349 | |
| 350 | TP_STRUCT__entry( |
| 351 | __field(unsigned int, session) |
| 352 | __field(unsigned int, slot_nr) |
| 353 | __field(unsigned int, seq_nr) |
| 354 | __field(unsigned int, highest_slotid) |
| 355 | __field(unsigned int, cachethis) |
| 356 | __field(int, error) |
| 357 | ), |
| 358 | |
| 359 | TP_fast_assign( |
| 360 | __entry->session = nfs_session_id_hash(&args->csa_sessionid); |
| 361 | __entry->slot_nr = args->csa_slotid; |
| 362 | __entry->seq_nr = args->csa_sequenceid; |
| 363 | __entry->highest_slotid = args->csa_highestslotid; |
| 364 | __entry->cachethis = args->csa_cachethis; |
| 365 | __entry->error = -be32_to_cpu(status); |
| 366 | ), |
| 367 | |
| 368 | TP_printk( |
| 369 | "error=%d (%s) session=0x%08x slot_nr=%u seq_nr=%u " |
| 370 | "highest_slotid=%u", |
| 371 | __entry->error, |
| 372 | show_nfsv4_errors(__entry->error), |
| 373 | __entry->session, |
| 374 | __entry->slot_nr, |
| 375 | __entry->seq_nr, |
| 376 | __entry->highest_slotid |
| 377 | ) |
| 378 | ); |
Trond Myklebust | c6d01c6 | 2013-08-09 11:51:26 -0400 | [diff] [blame] | 379 | #endif /* CONFIG_NFS_V4_1 */ |
| 380 | |
Trond Myklebust | 42113a7 | 2013-08-12 16:19:27 -0400 | [diff] [blame] | 381 | DECLARE_EVENT_CLASS(nfs4_open_event, |
| 382 | TP_PROTO( |
| 383 | const struct nfs_open_context *ctx, |
| 384 | int flags, |
| 385 | int error |
| 386 | ), |
| 387 | |
| 388 | TP_ARGS(ctx, flags, error), |
| 389 | |
| 390 | TP_STRUCT__entry( |
| 391 | __field(int, error) |
| 392 | __field(unsigned int, flags) |
| 393 | __field(unsigned int, fmode) |
| 394 | __field(dev_t, dev) |
| 395 | __field(u32, fhandle) |
| 396 | __field(u64, fileid) |
| 397 | __field(u64, dir) |
| 398 | __string(name, ctx->dentry->d_name.name) |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 399 | __field(int, stateid_seq) |
| 400 | __field(u32, stateid_hash) |
| 401 | __field(int, openstateid_seq) |
| 402 | __field(u32, openstateid_hash) |
Trond Myklebust | 42113a7 | 2013-08-12 16:19:27 -0400 | [diff] [blame] | 403 | ), |
| 404 | |
| 405 | TP_fast_assign( |
| 406 | const struct nfs4_state *state = ctx->state; |
| 407 | const struct inode *inode = NULL; |
| 408 | |
| 409 | __entry->error = error; |
| 410 | __entry->flags = flags; |
| 411 | __entry->fmode = (__force unsigned int)ctx->mode; |
| 412 | __entry->dev = ctx->dentry->d_sb->s_dev; |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 413 | if (!IS_ERR_OR_NULL(state)) { |
Trond Myklebust | 42113a7 | 2013-08-12 16:19:27 -0400 | [diff] [blame] | 414 | inode = state->inode; |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 415 | __entry->stateid_seq = |
| 416 | be32_to_cpu(state->stateid.seqid); |
| 417 | __entry->stateid_hash = |
| 418 | nfs_stateid_hash(&state->stateid); |
| 419 | __entry->openstateid_seq = |
| 420 | be32_to_cpu(state->open_stateid.seqid); |
| 421 | __entry->openstateid_hash = |
| 422 | nfs_stateid_hash(&state->open_stateid); |
| 423 | } else { |
| 424 | __entry->stateid_seq = 0; |
| 425 | __entry->stateid_hash = 0; |
| 426 | __entry->openstateid_seq = 0; |
| 427 | __entry->openstateid_hash = 0; |
| 428 | } |
Trond Myklebust | 42113a7 | 2013-08-12 16:19:27 -0400 | [diff] [blame] | 429 | if (inode != NULL) { |
| 430 | __entry->fileid = NFS_FILEID(inode); |
| 431 | __entry->fhandle = nfs_fhandle_hash(NFS_FH(inode)); |
| 432 | } else { |
| 433 | __entry->fileid = 0; |
| 434 | __entry->fhandle = 0; |
| 435 | } |
David Howells | 2b0143b | 2015-03-17 22:25:59 +0000 | [diff] [blame] | 436 | __entry->dir = NFS_FILEID(d_inode(ctx->dentry->d_parent)); |
Trond Myklebust | 42113a7 | 2013-08-12 16:19:27 -0400 | [diff] [blame] | 437 | __assign_str(name, ctx->dentry->d_name.name); |
| 438 | ), |
| 439 | |
| 440 | TP_printk( |
| 441 | "error=%d (%s) flags=%d (%s) fmode=%s " |
| 442 | "fileid=%02x:%02x:%llu fhandle=0x%08x " |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 443 | "name=%02x:%02x:%llu/%s stateid=%d:0x%08x " |
| 444 | "openstateid=%d:0x%08x", |
Trond Myklebust | 42113a7 | 2013-08-12 16:19:27 -0400 | [diff] [blame] | 445 | __entry->error, |
| 446 | show_nfsv4_errors(__entry->error), |
| 447 | __entry->flags, |
| 448 | show_open_flags(__entry->flags), |
| 449 | show_fmode_flags(__entry->fmode), |
| 450 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 451 | (unsigned long long)__entry->fileid, |
| 452 | __entry->fhandle, |
| 453 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 454 | (unsigned long long)__entry->dir, |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 455 | __get_str(name), |
| 456 | __entry->stateid_seq, __entry->stateid_hash, |
| 457 | __entry->openstateid_seq, __entry->openstateid_hash |
Trond Myklebust | 42113a7 | 2013-08-12 16:19:27 -0400 | [diff] [blame] | 458 | ) |
| 459 | ); |
| 460 | |
| 461 | #define DEFINE_NFS4_OPEN_EVENT(name) \ |
| 462 | DEFINE_EVENT(nfs4_open_event, name, \ |
| 463 | TP_PROTO( \ |
| 464 | const struct nfs_open_context *ctx, \ |
| 465 | int flags, \ |
| 466 | int error \ |
| 467 | ), \ |
| 468 | TP_ARGS(ctx, flags, error)) |
| 469 | DEFINE_NFS4_OPEN_EVENT(nfs4_open_reclaim); |
| 470 | DEFINE_NFS4_OPEN_EVENT(nfs4_open_expired); |
| 471 | DEFINE_NFS4_OPEN_EVENT(nfs4_open_file); |
| 472 | |
Olga Kornievskaia | 9759b0f | 2015-11-24 13:29:42 -0500 | [diff] [blame] | 473 | TRACE_EVENT(nfs4_cached_open, |
| 474 | TP_PROTO( |
| 475 | const struct nfs4_state *state |
| 476 | ), |
| 477 | TP_ARGS(state), |
| 478 | TP_STRUCT__entry( |
| 479 | __field(dev_t, dev) |
| 480 | __field(u32, fhandle) |
| 481 | __field(u64, fileid) |
| 482 | __field(unsigned int, fmode) |
| 483 | __field(int, stateid_seq) |
| 484 | __field(u32, stateid_hash) |
| 485 | ), |
| 486 | |
| 487 | TP_fast_assign( |
| 488 | const struct inode *inode = state->inode; |
| 489 | |
| 490 | __entry->dev = inode->i_sb->s_dev; |
| 491 | __entry->fileid = NFS_FILEID(inode); |
| 492 | __entry->fhandle = nfs_fhandle_hash(NFS_FH(inode)); |
| 493 | __entry->fmode = (__force unsigned int)state->state; |
| 494 | __entry->stateid_seq = |
| 495 | be32_to_cpu(state->stateid.seqid); |
| 496 | __entry->stateid_hash = |
| 497 | nfs_stateid_hash(&state->stateid); |
| 498 | ), |
| 499 | |
| 500 | TP_printk( |
| 501 | "fmode=%s fileid=%02x:%02x:%llu " |
| 502 | "fhandle=0x%08x stateid=%d:0x%08x", |
| 503 | __entry->fmode ? show_fmode_flags(__entry->fmode) : |
| 504 | "closed", |
| 505 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 506 | (unsigned long long)__entry->fileid, |
| 507 | __entry->fhandle, |
| 508 | __entry->stateid_seq, __entry->stateid_hash |
| 509 | ) |
| 510 | ); |
| 511 | |
Trond Myklebust | 42113a7 | 2013-08-12 16:19:27 -0400 | [diff] [blame] | 512 | TRACE_EVENT(nfs4_close, |
| 513 | TP_PROTO( |
| 514 | const struct nfs4_state *state, |
| 515 | const struct nfs_closeargs *args, |
| 516 | const struct nfs_closeres *res, |
| 517 | int error |
| 518 | ), |
| 519 | |
| 520 | TP_ARGS(state, args, res, error), |
| 521 | |
| 522 | TP_STRUCT__entry( |
| 523 | __field(dev_t, dev) |
| 524 | __field(u32, fhandle) |
| 525 | __field(u64, fileid) |
| 526 | __field(unsigned int, fmode) |
| 527 | __field(int, error) |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 528 | __field(int, stateid_seq) |
| 529 | __field(u32, stateid_hash) |
Trond Myklebust | 42113a7 | 2013-08-12 16:19:27 -0400 | [diff] [blame] | 530 | ), |
| 531 | |
| 532 | TP_fast_assign( |
| 533 | const struct inode *inode = state->inode; |
| 534 | |
| 535 | __entry->dev = inode->i_sb->s_dev; |
| 536 | __entry->fileid = NFS_FILEID(inode); |
| 537 | __entry->fhandle = nfs_fhandle_hash(NFS_FH(inode)); |
| 538 | __entry->fmode = (__force unsigned int)state->state; |
| 539 | __entry->error = error; |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 540 | __entry->stateid_seq = |
| 541 | be32_to_cpu(args->stateid.seqid); |
| 542 | __entry->stateid_hash = |
| 543 | nfs_stateid_hash(&args->stateid); |
Trond Myklebust | 42113a7 | 2013-08-12 16:19:27 -0400 | [diff] [blame] | 544 | ), |
| 545 | |
| 546 | TP_printk( |
| 547 | "error=%d (%s) fmode=%s fileid=%02x:%02x:%llu " |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 548 | "fhandle=0x%08x openstateid=%d:0x%08x", |
Trond Myklebust | 42113a7 | 2013-08-12 16:19:27 -0400 | [diff] [blame] | 549 | __entry->error, |
| 550 | show_nfsv4_errors(__entry->error), |
| 551 | __entry->fmode ? show_fmode_flags(__entry->fmode) : |
| 552 | "closed", |
| 553 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 554 | (unsigned long long)__entry->fileid, |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 555 | __entry->fhandle, |
| 556 | __entry->stateid_seq, __entry->stateid_hash |
Trond Myklebust | 42113a7 | 2013-08-12 16:19:27 -0400 | [diff] [blame] | 557 | ) |
| 558 | ); |
| 559 | |
Trond Myklebust | d1b748a | 2013-08-12 16:35:20 -0400 | [diff] [blame] | 560 | #define show_lock_cmd(type) \ |
| 561 | __print_symbolic((int)type, \ |
| 562 | { F_GETLK, "GETLK" }, \ |
| 563 | { F_SETLK, "SETLK" }, \ |
| 564 | { F_SETLKW, "SETLKW" }) |
| 565 | #define show_lock_type(type) \ |
| 566 | __print_symbolic((int)type, \ |
| 567 | { F_RDLCK, "RDLCK" }, \ |
| 568 | { F_WRLCK, "WRLCK" }, \ |
| 569 | { F_UNLCK, "UNLCK" }) |
| 570 | |
| 571 | DECLARE_EVENT_CLASS(nfs4_lock_event, |
| 572 | TP_PROTO( |
| 573 | const struct file_lock *request, |
| 574 | const struct nfs4_state *state, |
| 575 | int cmd, |
| 576 | int error |
| 577 | ), |
| 578 | |
| 579 | TP_ARGS(request, state, cmd, error), |
| 580 | |
| 581 | TP_STRUCT__entry( |
| 582 | __field(int, error) |
| 583 | __field(int, cmd) |
| 584 | __field(char, type) |
| 585 | __field(loff_t, start) |
| 586 | __field(loff_t, end) |
| 587 | __field(dev_t, dev) |
| 588 | __field(u32, fhandle) |
| 589 | __field(u64, fileid) |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 590 | __field(int, stateid_seq) |
| 591 | __field(u32, stateid_hash) |
Trond Myklebust | d1b748a | 2013-08-12 16:35:20 -0400 | [diff] [blame] | 592 | ), |
| 593 | |
| 594 | TP_fast_assign( |
| 595 | const struct inode *inode = state->inode; |
| 596 | |
| 597 | __entry->error = error; |
| 598 | __entry->cmd = cmd; |
| 599 | __entry->type = request->fl_type; |
| 600 | __entry->start = request->fl_start; |
| 601 | __entry->end = request->fl_end; |
| 602 | __entry->dev = inode->i_sb->s_dev; |
| 603 | __entry->fileid = NFS_FILEID(inode); |
| 604 | __entry->fhandle = nfs_fhandle_hash(NFS_FH(inode)); |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 605 | __entry->stateid_seq = |
| 606 | be32_to_cpu(state->stateid.seqid); |
| 607 | __entry->stateid_hash = |
| 608 | nfs_stateid_hash(&state->stateid); |
Trond Myklebust | d1b748a | 2013-08-12 16:35:20 -0400 | [diff] [blame] | 609 | ), |
| 610 | |
| 611 | TP_printk( |
| 612 | "error=%d (%s) cmd=%s:%s range=%lld:%lld " |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 613 | "fileid=%02x:%02x:%llu fhandle=0x%08x " |
| 614 | "stateid=%d:0x%08x", |
Trond Myklebust | d1b748a | 2013-08-12 16:35:20 -0400 | [diff] [blame] | 615 | __entry->error, |
| 616 | show_nfsv4_errors(__entry->error), |
| 617 | show_lock_cmd(__entry->cmd), |
| 618 | show_lock_type(__entry->type), |
| 619 | (long long)__entry->start, |
| 620 | (long long)__entry->end, |
| 621 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 622 | (unsigned long long)__entry->fileid, |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 623 | __entry->fhandle, |
| 624 | __entry->stateid_seq, __entry->stateid_hash |
Trond Myklebust | d1b748a | 2013-08-12 16:35:20 -0400 | [diff] [blame] | 625 | ) |
| 626 | ); |
| 627 | |
| 628 | #define DEFINE_NFS4_LOCK_EVENT(name) \ |
| 629 | DEFINE_EVENT(nfs4_lock_event, name, \ |
| 630 | TP_PROTO( \ |
| 631 | const struct file_lock *request, \ |
| 632 | const struct nfs4_state *state, \ |
| 633 | int cmd, \ |
| 634 | int error \ |
| 635 | ), \ |
| 636 | TP_ARGS(request, state, cmd, error)) |
| 637 | DEFINE_NFS4_LOCK_EVENT(nfs4_get_lock); |
Trond Myklebust | d1b748a | 2013-08-12 16:35:20 -0400 | [diff] [blame] | 638 | DEFINE_NFS4_LOCK_EVENT(nfs4_unlock); |
| 639 | |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 640 | TRACE_EVENT(nfs4_set_lock, |
| 641 | TP_PROTO( |
| 642 | const struct file_lock *request, |
| 643 | const struct nfs4_state *state, |
| 644 | const nfs4_stateid *lockstateid, |
| 645 | int cmd, |
| 646 | int error |
| 647 | ), |
| 648 | |
| 649 | TP_ARGS(request, state, lockstateid, cmd, error), |
| 650 | |
| 651 | TP_STRUCT__entry( |
| 652 | __field(int, error) |
| 653 | __field(int, cmd) |
| 654 | __field(char, type) |
| 655 | __field(loff_t, start) |
| 656 | __field(loff_t, end) |
| 657 | __field(dev_t, dev) |
| 658 | __field(u32, fhandle) |
| 659 | __field(u64, fileid) |
| 660 | __field(int, stateid_seq) |
| 661 | __field(u32, stateid_hash) |
| 662 | __field(int, lockstateid_seq) |
| 663 | __field(u32, lockstateid_hash) |
| 664 | ), |
| 665 | |
| 666 | TP_fast_assign( |
| 667 | const struct inode *inode = state->inode; |
| 668 | |
| 669 | __entry->error = error; |
| 670 | __entry->cmd = cmd; |
| 671 | __entry->type = request->fl_type; |
| 672 | __entry->start = request->fl_start; |
| 673 | __entry->end = request->fl_end; |
| 674 | __entry->dev = inode->i_sb->s_dev; |
| 675 | __entry->fileid = NFS_FILEID(inode); |
| 676 | __entry->fhandle = nfs_fhandle_hash(NFS_FH(inode)); |
| 677 | __entry->stateid_seq = |
| 678 | be32_to_cpu(state->stateid.seqid); |
| 679 | __entry->stateid_hash = |
| 680 | nfs_stateid_hash(&state->stateid); |
| 681 | __entry->lockstateid_seq = |
| 682 | be32_to_cpu(lockstateid->seqid); |
| 683 | __entry->lockstateid_hash = |
| 684 | nfs_stateid_hash(lockstateid); |
| 685 | ), |
| 686 | |
| 687 | TP_printk( |
| 688 | "error=%d (%s) cmd=%s:%s range=%lld:%lld " |
| 689 | "fileid=%02x:%02x:%llu fhandle=0x%08x " |
| 690 | "stateid=%d:0x%08x lockstateid=%d:0x%08x", |
| 691 | __entry->error, |
| 692 | show_nfsv4_errors(__entry->error), |
| 693 | show_lock_cmd(__entry->cmd), |
| 694 | show_lock_type(__entry->type), |
| 695 | (long long)__entry->start, |
| 696 | (long long)__entry->end, |
| 697 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 698 | (unsigned long long)__entry->fileid, |
| 699 | __entry->fhandle, |
| 700 | __entry->stateid_seq, __entry->stateid_hash, |
| 701 | __entry->lockstateid_seq, __entry->lockstateid_hash |
| 702 | ) |
| 703 | ); |
| 704 | |
Trond Myklebust | ca8acf8 | 2013-08-13 10:36:56 -0400 | [diff] [blame] | 705 | DECLARE_EVENT_CLASS(nfs4_set_delegation_event, |
| 706 | TP_PROTO( |
| 707 | const struct inode *inode, |
| 708 | fmode_t fmode |
| 709 | ), |
| 710 | |
| 711 | TP_ARGS(inode, fmode), |
| 712 | |
| 713 | TP_STRUCT__entry( |
| 714 | __field(dev_t, dev) |
| 715 | __field(u32, fhandle) |
| 716 | __field(u64, fileid) |
| 717 | __field(unsigned int, fmode) |
| 718 | ), |
| 719 | |
| 720 | TP_fast_assign( |
| 721 | __entry->dev = inode->i_sb->s_dev; |
| 722 | __entry->fileid = NFS_FILEID(inode); |
| 723 | __entry->fhandle = nfs_fhandle_hash(NFS_FH(inode)); |
| 724 | __entry->fmode = (__force unsigned int)fmode; |
| 725 | ), |
| 726 | |
| 727 | TP_printk( |
| 728 | "fmode=%s fileid=%02x:%02x:%llu fhandle=0x%08x", |
| 729 | show_fmode_flags(__entry->fmode), |
| 730 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 731 | (unsigned long long)__entry->fileid, |
| 732 | __entry->fhandle |
| 733 | ) |
| 734 | ); |
| 735 | #define DEFINE_NFS4_SET_DELEGATION_EVENT(name) \ |
| 736 | DEFINE_EVENT(nfs4_set_delegation_event, name, \ |
| 737 | TP_PROTO( \ |
| 738 | const struct inode *inode, \ |
| 739 | fmode_t fmode \ |
| 740 | ), \ |
| 741 | TP_ARGS(inode, fmode)) |
| 742 | DEFINE_NFS4_SET_DELEGATION_EVENT(nfs4_set_delegation); |
| 743 | DEFINE_NFS4_SET_DELEGATION_EVENT(nfs4_reclaim_delegation); |
| 744 | |
| 745 | TRACE_EVENT(nfs4_delegreturn_exit, |
| 746 | TP_PROTO( |
| 747 | const struct nfs4_delegreturnargs *args, |
| 748 | const struct nfs4_delegreturnres *res, |
| 749 | int error |
| 750 | ), |
| 751 | |
| 752 | TP_ARGS(args, res, error), |
| 753 | |
| 754 | TP_STRUCT__entry( |
| 755 | __field(dev_t, dev) |
| 756 | __field(u32, fhandle) |
| 757 | __field(int, error) |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 758 | __field(int, stateid_seq) |
| 759 | __field(u32, stateid_hash) |
Trond Myklebust | ca8acf8 | 2013-08-13 10:36:56 -0400 | [diff] [blame] | 760 | ), |
| 761 | |
| 762 | TP_fast_assign( |
| 763 | __entry->dev = res->server->s_dev; |
| 764 | __entry->fhandle = nfs_fhandle_hash(args->fhandle); |
| 765 | __entry->error = error; |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 766 | __entry->stateid_seq = |
| 767 | be32_to_cpu(args->stateid->seqid); |
| 768 | __entry->stateid_hash = |
| 769 | nfs_stateid_hash(args->stateid); |
Trond Myklebust | ca8acf8 | 2013-08-13 10:36:56 -0400 | [diff] [blame] | 770 | ), |
| 771 | |
| 772 | TP_printk( |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 773 | "error=%d (%s) dev=%02x:%02x fhandle=0x%08x " |
| 774 | "stateid=%d:0x%08x", |
Trond Myklebust | ca8acf8 | 2013-08-13 10:36:56 -0400 | [diff] [blame] | 775 | __entry->error, |
| 776 | show_nfsv4_errors(__entry->error), |
| 777 | MAJOR(__entry->dev), MINOR(__entry->dev), |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 778 | __entry->fhandle, |
| 779 | __entry->stateid_seq, __entry->stateid_hash |
Trond Myklebust | ca8acf8 | 2013-08-13 10:36:56 -0400 | [diff] [blame] | 780 | ) |
| 781 | ); |
| 782 | |
Trond Myklebust | 08cb47f | 2013-08-20 21:59:40 -0400 | [diff] [blame] | 783 | #ifdef CONFIG_NFS_V4_1 |
| 784 | DECLARE_EVENT_CLASS(nfs4_test_stateid_event, |
| 785 | TP_PROTO( |
| 786 | const struct nfs4_state *state, |
| 787 | const struct nfs4_lock_state *lsp, |
| 788 | int error |
| 789 | ), |
| 790 | |
| 791 | TP_ARGS(state, lsp, error), |
| 792 | |
| 793 | TP_STRUCT__entry( |
| 794 | __field(int, error) |
| 795 | __field(dev_t, dev) |
| 796 | __field(u32, fhandle) |
| 797 | __field(u64, fileid) |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 798 | __field(int, stateid_seq) |
| 799 | __field(u32, stateid_hash) |
Trond Myklebust | 08cb47f | 2013-08-20 21:59:40 -0400 | [diff] [blame] | 800 | ), |
| 801 | |
| 802 | TP_fast_assign( |
| 803 | const struct inode *inode = state->inode; |
| 804 | |
| 805 | __entry->error = error; |
| 806 | __entry->dev = inode->i_sb->s_dev; |
| 807 | __entry->fileid = NFS_FILEID(inode); |
| 808 | __entry->fhandle = nfs_fhandle_hash(NFS_FH(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); |
Trond Myklebust | 08cb47f | 2013-08-20 21:59:40 -0400 | [diff] [blame] | 813 | ), |
| 814 | |
| 815 | TP_printk( |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 816 | "error=%d (%s) fileid=%02x:%02x:%llu fhandle=0x%08x " |
| 817 | "stateid=%d:0x%08x", |
Trond Myklebust | 08cb47f | 2013-08-20 21:59:40 -0400 | [diff] [blame] | 818 | __entry->error, |
| 819 | show_nfsv4_errors(__entry->error), |
| 820 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 821 | (unsigned long long)__entry->fileid, |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 822 | __entry->fhandle, |
| 823 | __entry->stateid_seq, __entry->stateid_hash |
Trond Myklebust | 08cb47f | 2013-08-20 21:59:40 -0400 | [diff] [blame] | 824 | ) |
| 825 | ); |
| 826 | |
| 827 | #define DEFINE_NFS4_TEST_STATEID_EVENT(name) \ |
| 828 | DEFINE_EVENT(nfs4_test_stateid_event, name, \ |
| 829 | TP_PROTO( \ |
| 830 | const struct nfs4_state *state, \ |
| 831 | const struct nfs4_lock_state *lsp, \ |
| 832 | int error \ |
| 833 | ), \ |
| 834 | TP_ARGS(state, lsp, error)) |
| 835 | DEFINE_NFS4_TEST_STATEID_EVENT(nfs4_test_delegation_stateid); |
| 836 | DEFINE_NFS4_TEST_STATEID_EVENT(nfs4_test_open_stateid); |
| 837 | DEFINE_NFS4_TEST_STATEID_EVENT(nfs4_test_lock_stateid); |
| 838 | #endif /* CONFIG_NFS_V4_1 */ |
| 839 | |
Trond Myklebust | 078ea3d | 2013-08-12 16:45:55 -0400 | [diff] [blame] | 840 | DECLARE_EVENT_CLASS(nfs4_lookup_event, |
| 841 | TP_PROTO( |
| 842 | const struct inode *dir, |
| 843 | const struct qstr *name, |
| 844 | int error |
| 845 | ), |
| 846 | |
| 847 | TP_ARGS(dir, name, error), |
| 848 | |
| 849 | TP_STRUCT__entry( |
| 850 | __field(dev_t, dev) |
| 851 | __field(int, error) |
| 852 | __field(u64, dir) |
| 853 | __string(name, name->name) |
| 854 | ), |
| 855 | |
| 856 | TP_fast_assign( |
| 857 | __entry->dev = dir->i_sb->s_dev; |
| 858 | __entry->dir = NFS_FILEID(dir); |
| 859 | __entry->error = error; |
| 860 | __assign_str(name, name->name); |
| 861 | ), |
| 862 | |
| 863 | TP_printk( |
| 864 | "error=%d (%s) name=%02x:%02x:%llu/%s", |
| 865 | __entry->error, |
| 866 | show_nfsv4_errors(__entry->error), |
| 867 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 868 | (unsigned long long)__entry->dir, |
| 869 | __get_str(name) |
| 870 | ) |
| 871 | ); |
| 872 | |
| 873 | #define DEFINE_NFS4_LOOKUP_EVENT(name) \ |
| 874 | DEFINE_EVENT(nfs4_lookup_event, name, \ |
| 875 | TP_PROTO( \ |
| 876 | const struct inode *dir, \ |
| 877 | const struct qstr *name, \ |
| 878 | int error \ |
| 879 | ), \ |
| 880 | TP_ARGS(dir, name, error)) |
| 881 | |
| 882 | DEFINE_NFS4_LOOKUP_EVENT(nfs4_lookup); |
| 883 | DEFINE_NFS4_LOOKUP_EVENT(nfs4_symlink); |
| 884 | DEFINE_NFS4_LOOKUP_EVENT(nfs4_mkdir); |
| 885 | DEFINE_NFS4_LOOKUP_EVENT(nfs4_mknod); |
| 886 | DEFINE_NFS4_LOOKUP_EVENT(nfs4_remove); |
| 887 | DEFINE_NFS4_LOOKUP_EVENT(nfs4_get_fs_locations); |
| 888 | DEFINE_NFS4_LOOKUP_EVENT(nfs4_secinfo); |
| 889 | |
Trond Myklebust | fbc6f7c | 2013-08-12 17:08:26 -0400 | [diff] [blame] | 890 | TRACE_EVENT(nfs4_rename, |
| 891 | TP_PROTO( |
| 892 | const struct inode *olddir, |
| 893 | const struct qstr *oldname, |
| 894 | const struct inode *newdir, |
| 895 | const struct qstr *newname, |
| 896 | int error |
| 897 | ), |
| 898 | |
| 899 | TP_ARGS(olddir, oldname, newdir, newname, error), |
| 900 | |
| 901 | TP_STRUCT__entry( |
| 902 | __field(dev_t, dev) |
| 903 | __field(int, error) |
| 904 | __field(u64, olddir) |
| 905 | __string(oldname, oldname->name) |
| 906 | __field(u64, newdir) |
| 907 | __string(newname, newname->name) |
| 908 | ), |
| 909 | |
| 910 | TP_fast_assign( |
| 911 | __entry->dev = olddir->i_sb->s_dev; |
| 912 | __entry->olddir = NFS_FILEID(olddir); |
| 913 | __entry->newdir = NFS_FILEID(newdir); |
| 914 | __entry->error = error; |
| 915 | __assign_str(oldname, oldname->name); |
| 916 | __assign_str(newname, newname->name); |
| 917 | ), |
| 918 | |
| 919 | TP_printk( |
| 920 | "error=%d (%s) oldname=%02x:%02x:%llu/%s " |
| 921 | "newname=%02x:%02x:%llu/%s", |
| 922 | __entry->error, |
| 923 | show_nfsv4_errors(__entry->error), |
| 924 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 925 | (unsigned long long)__entry->olddir, |
| 926 | __get_str(oldname), |
| 927 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 928 | (unsigned long long)__entry->newdir, |
| 929 | __get_str(newname) |
| 930 | ) |
| 931 | ); |
| 932 | |
Trond Myklebust | c1578b7 | 2013-08-12 16:58:42 -0400 | [diff] [blame] | 933 | DECLARE_EVENT_CLASS(nfs4_inode_event, |
| 934 | TP_PROTO( |
| 935 | const struct inode *inode, |
| 936 | int error |
| 937 | ), |
| 938 | |
| 939 | TP_ARGS(inode, error), |
| 940 | |
| 941 | TP_STRUCT__entry( |
| 942 | __field(dev_t, dev) |
| 943 | __field(u32, fhandle) |
| 944 | __field(u64, fileid) |
| 945 | __field(int, error) |
| 946 | ), |
| 947 | |
| 948 | TP_fast_assign( |
| 949 | __entry->dev = inode->i_sb->s_dev; |
| 950 | __entry->fileid = NFS_FILEID(inode); |
| 951 | __entry->fhandle = nfs_fhandle_hash(NFS_FH(inode)); |
| 952 | __entry->error = error; |
| 953 | ), |
| 954 | |
| 955 | TP_printk( |
| 956 | "error=%d (%s) fileid=%02x:%02x:%llu fhandle=0x%08x", |
| 957 | __entry->error, |
| 958 | show_nfsv4_errors(__entry->error), |
| 959 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 960 | (unsigned long long)__entry->fileid, |
| 961 | __entry->fhandle |
| 962 | ) |
| 963 | ); |
| 964 | |
| 965 | #define DEFINE_NFS4_INODE_EVENT(name) \ |
| 966 | DEFINE_EVENT(nfs4_inode_event, name, \ |
| 967 | TP_PROTO( \ |
| 968 | const struct inode *inode, \ |
| 969 | int error \ |
| 970 | ), \ |
| 971 | TP_ARGS(inode, error)) |
| 972 | |
Trond Myklebust | c1578b7 | 2013-08-12 16:58:42 -0400 | [diff] [blame] | 973 | DEFINE_NFS4_INODE_EVENT(nfs4_access); |
| 974 | DEFINE_NFS4_INODE_EVENT(nfs4_readlink); |
| 975 | DEFINE_NFS4_INODE_EVENT(nfs4_readdir); |
| 976 | DEFINE_NFS4_INODE_EVENT(nfs4_get_acl); |
| 977 | DEFINE_NFS4_INODE_EVENT(nfs4_set_acl); |
| 978 | #ifdef CONFIG_NFS_V4_SECURITY_LABEL |
| 979 | DEFINE_NFS4_INODE_EVENT(nfs4_get_security_label); |
| 980 | DEFINE_NFS4_INODE_EVENT(nfs4_set_security_label); |
| 981 | #endif /* CONFIG_NFS_V4_SECURITY_LABEL */ |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 982 | |
| 983 | DECLARE_EVENT_CLASS(nfs4_inode_stateid_event, |
| 984 | TP_PROTO( |
| 985 | const struct inode *inode, |
| 986 | const nfs4_stateid *stateid, |
| 987 | int error |
| 988 | ), |
| 989 | |
| 990 | TP_ARGS(inode, stateid, error), |
| 991 | |
| 992 | TP_STRUCT__entry( |
| 993 | __field(dev_t, dev) |
| 994 | __field(u32, fhandle) |
| 995 | __field(u64, fileid) |
| 996 | __field(int, error) |
| 997 | __field(int, stateid_seq) |
| 998 | __field(u32, stateid_hash) |
| 999 | ), |
| 1000 | |
| 1001 | TP_fast_assign( |
| 1002 | __entry->dev = inode->i_sb->s_dev; |
| 1003 | __entry->fileid = NFS_FILEID(inode); |
| 1004 | __entry->fhandle = nfs_fhandle_hash(NFS_FH(inode)); |
| 1005 | __entry->error = error; |
| 1006 | __entry->stateid_seq = |
| 1007 | be32_to_cpu(stateid->seqid); |
| 1008 | __entry->stateid_hash = |
| 1009 | nfs_stateid_hash(stateid); |
| 1010 | ), |
| 1011 | |
| 1012 | TP_printk( |
| 1013 | "error=%d (%s) fileid=%02x:%02x:%llu fhandle=0x%08x " |
| 1014 | "stateid=%d:0x%08x", |
| 1015 | __entry->error, |
| 1016 | show_nfsv4_errors(__entry->error), |
| 1017 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 1018 | (unsigned long long)__entry->fileid, |
| 1019 | __entry->fhandle, |
| 1020 | __entry->stateid_seq, __entry->stateid_hash |
| 1021 | ) |
| 1022 | ); |
| 1023 | |
| 1024 | #define DEFINE_NFS4_INODE_STATEID_EVENT(name) \ |
| 1025 | DEFINE_EVENT(nfs4_inode_stateid_event, name, \ |
| 1026 | TP_PROTO( \ |
| 1027 | const struct inode *inode, \ |
| 1028 | const nfs4_stateid *stateid, \ |
| 1029 | int error \ |
| 1030 | ), \ |
| 1031 | TP_ARGS(inode, stateid, error)) |
| 1032 | |
| 1033 | DEFINE_NFS4_INODE_STATEID_EVENT(nfs4_setattr); |
| 1034 | DEFINE_NFS4_INODE_STATEID_EVENT(nfs4_delegreturn); |
Trond Myklebust | c1578b7 | 2013-08-12 16:58:42 -0400 | [diff] [blame] | 1035 | |
Trond Myklebust | b5f875a | 2013-08-13 13:01:39 -0400 | [diff] [blame] | 1036 | DECLARE_EVENT_CLASS(nfs4_getattr_event, |
| 1037 | TP_PROTO( |
| 1038 | const struct nfs_server *server, |
| 1039 | const struct nfs_fh *fhandle, |
| 1040 | const struct nfs_fattr *fattr, |
| 1041 | int error |
| 1042 | ), |
| 1043 | |
| 1044 | TP_ARGS(server, fhandle, fattr, error), |
| 1045 | |
| 1046 | TP_STRUCT__entry( |
| 1047 | __field(dev_t, dev) |
| 1048 | __field(u32, fhandle) |
| 1049 | __field(u64, fileid) |
| 1050 | __field(unsigned int, valid) |
| 1051 | __field(int, error) |
| 1052 | ), |
| 1053 | |
| 1054 | TP_fast_assign( |
| 1055 | __entry->dev = server->s_dev; |
| 1056 | __entry->valid = fattr->valid; |
| 1057 | __entry->fhandle = nfs_fhandle_hash(fhandle); |
| 1058 | __entry->fileid = (fattr->valid & NFS_ATTR_FATTR_FILEID) ? fattr->fileid : 0; |
| 1059 | __entry->error = error; |
| 1060 | ), |
| 1061 | |
| 1062 | TP_printk( |
| 1063 | "error=%d (%s) fileid=%02x:%02x:%llu fhandle=0x%08x " |
| 1064 | "valid=%s", |
| 1065 | __entry->error, |
| 1066 | show_nfsv4_errors(__entry->error), |
| 1067 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 1068 | (unsigned long long)__entry->fileid, |
| 1069 | __entry->fhandle, |
| 1070 | show_nfs_fattr_flags(__entry->valid) |
| 1071 | ) |
| 1072 | ); |
| 1073 | |
| 1074 | #define DEFINE_NFS4_GETATTR_EVENT(name) \ |
| 1075 | DEFINE_EVENT(nfs4_getattr_event, name, \ |
| 1076 | TP_PROTO( \ |
| 1077 | const struct nfs_server *server, \ |
| 1078 | const struct nfs_fh *fhandle, \ |
| 1079 | const struct nfs_fattr *fattr, \ |
| 1080 | int error \ |
| 1081 | ), \ |
| 1082 | TP_ARGS(server, fhandle, fattr, error)) |
| 1083 | DEFINE_NFS4_GETATTR_EVENT(nfs4_getattr); |
| 1084 | DEFINE_NFS4_GETATTR_EVENT(nfs4_lookup_root); |
| 1085 | DEFINE_NFS4_GETATTR_EVENT(nfs4_fsinfo); |
| 1086 | |
Trond Myklebust | 7cd1486 | 2015-08-20 20:07:54 -0500 | [diff] [blame] | 1087 | DECLARE_EVENT_CLASS(nfs4_inode_callback_event, |
| 1088 | TP_PROTO( |
| 1089 | const struct nfs_client *clp, |
| 1090 | const struct nfs_fh *fhandle, |
| 1091 | const struct inode *inode, |
| 1092 | int error |
| 1093 | ), |
| 1094 | |
| 1095 | TP_ARGS(clp, fhandle, inode, error), |
| 1096 | |
| 1097 | TP_STRUCT__entry( |
| 1098 | __field(int, error) |
| 1099 | __field(dev_t, dev) |
| 1100 | __field(u32, fhandle) |
| 1101 | __field(u64, fileid) |
Anna Schumaker | 8fb42f7 | 2017-11-01 15:48:43 -0400 | [diff] [blame] | 1102 | __string(dstaddr, clp ? clp->cl_hostname : "unknown") |
Trond Myklebust | 7cd1486 | 2015-08-20 20:07:54 -0500 | [diff] [blame] | 1103 | ), |
| 1104 | |
| 1105 | TP_fast_assign( |
| 1106 | __entry->error = error; |
| 1107 | __entry->fhandle = nfs_fhandle_hash(fhandle); |
| 1108 | if (inode != NULL) { |
| 1109 | __entry->fileid = NFS_FILEID(inode); |
| 1110 | __entry->dev = inode->i_sb->s_dev; |
| 1111 | } else { |
| 1112 | __entry->fileid = 0; |
| 1113 | __entry->dev = 0; |
| 1114 | } |
Anna Schumaker | 8fb42f7 | 2017-11-01 15:48:43 -0400 | [diff] [blame] | 1115 | __assign_str(dstaddr, clp ? clp->cl_hostname : "unknown") |
Trond Myklebust | 7cd1486 | 2015-08-20 20:07:54 -0500 | [diff] [blame] | 1116 | ), |
| 1117 | |
| 1118 | TP_printk( |
| 1119 | "error=%d (%s) fileid=%02x:%02x:%llu fhandle=0x%08x " |
| 1120 | "dstaddr=%s", |
| 1121 | __entry->error, |
| 1122 | show_nfsv4_errors(__entry->error), |
| 1123 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 1124 | (unsigned long long)__entry->fileid, |
| 1125 | __entry->fhandle, |
| 1126 | __get_str(dstaddr) |
| 1127 | ) |
| 1128 | ); |
| 1129 | |
| 1130 | #define DEFINE_NFS4_INODE_CALLBACK_EVENT(name) \ |
| 1131 | DEFINE_EVENT(nfs4_inode_callback_event, name, \ |
| 1132 | TP_PROTO( \ |
| 1133 | const struct nfs_client *clp, \ |
| 1134 | const struct nfs_fh *fhandle, \ |
| 1135 | const struct inode *inode, \ |
| 1136 | int error \ |
| 1137 | ), \ |
| 1138 | TP_ARGS(clp, fhandle, inode, error)) |
| 1139 | DEFINE_NFS4_INODE_CALLBACK_EVENT(nfs4_cb_getattr); |
| 1140 | |
Trond Myklebust | e07db90 | 2015-12-28 14:07:23 -0500 | [diff] [blame] | 1141 | DECLARE_EVENT_CLASS(nfs4_inode_stateid_callback_event, |
| 1142 | TP_PROTO( |
| 1143 | const struct nfs_client *clp, |
| 1144 | const struct nfs_fh *fhandle, |
| 1145 | const struct inode *inode, |
| 1146 | const nfs4_stateid *stateid, |
| 1147 | int error |
| 1148 | ), |
| 1149 | |
| 1150 | TP_ARGS(clp, fhandle, inode, stateid, error), |
| 1151 | |
| 1152 | TP_STRUCT__entry( |
| 1153 | __field(int, error) |
| 1154 | __field(dev_t, dev) |
| 1155 | __field(u32, fhandle) |
| 1156 | __field(u64, fileid) |
Anna Schumaker | 8fb42f7 | 2017-11-01 15:48:43 -0400 | [diff] [blame] | 1157 | __string(dstaddr, clp ? clp->cl_hostname : "unknown") |
Trond Myklebust | e07db90 | 2015-12-28 14:07:23 -0500 | [diff] [blame] | 1158 | __field(int, stateid_seq) |
| 1159 | __field(u32, stateid_hash) |
| 1160 | ), |
| 1161 | |
| 1162 | TP_fast_assign( |
| 1163 | __entry->error = error; |
| 1164 | __entry->fhandle = nfs_fhandle_hash(fhandle); |
| 1165 | if (inode != NULL) { |
| 1166 | __entry->fileid = NFS_FILEID(inode); |
| 1167 | __entry->dev = inode->i_sb->s_dev; |
| 1168 | } else { |
| 1169 | __entry->fileid = 0; |
| 1170 | __entry->dev = 0; |
| 1171 | } |
Anna Schumaker | 8fb42f7 | 2017-11-01 15:48:43 -0400 | [diff] [blame] | 1172 | __assign_str(dstaddr, clp ? clp->cl_hostname : "unknown") |
Trond Myklebust | e07db90 | 2015-12-28 14:07:23 -0500 | [diff] [blame] | 1173 | __entry->stateid_seq = |
| 1174 | be32_to_cpu(stateid->seqid); |
| 1175 | __entry->stateid_hash = |
| 1176 | nfs_stateid_hash(stateid); |
| 1177 | ), |
| 1178 | |
| 1179 | TP_printk( |
| 1180 | "error=%d (%s) fileid=%02x:%02x:%llu fhandle=0x%08x " |
| 1181 | "stateid=%d:0x%08x dstaddr=%s", |
| 1182 | __entry->error, |
| 1183 | show_nfsv4_errors(__entry->error), |
| 1184 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 1185 | (unsigned long long)__entry->fileid, |
| 1186 | __entry->fhandle, |
| 1187 | __entry->stateid_seq, __entry->stateid_hash, |
| 1188 | __get_str(dstaddr) |
| 1189 | ) |
| 1190 | ); |
| 1191 | |
| 1192 | #define DEFINE_NFS4_INODE_STATEID_CALLBACK_EVENT(name) \ |
| 1193 | DEFINE_EVENT(nfs4_inode_stateid_callback_event, name, \ |
| 1194 | TP_PROTO( \ |
| 1195 | const struct nfs_client *clp, \ |
| 1196 | const struct nfs_fh *fhandle, \ |
| 1197 | const struct inode *inode, \ |
| 1198 | const nfs4_stateid *stateid, \ |
| 1199 | int error \ |
| 1200 | ), \ |
| 1201 | TP_ARGS(clp, fhandle, inode, stateid, error)) |
| 1202 | DEFINE_NFS4_INODE_STATEID_CALLBACK_EVENT(nfs4_cb_recall); |
| 1203 | DEFINE_NFS4_INODE_STATEID_CALLBACK_EVENT(nfs4_cb_layoutrecall_file); |
Trond Myklebust | 7cd1486 | 2015-08-20 20:07:54 -0500 | [diff] [blame] | 1204 | |
Trond Myklebust | 1f2d30b | 2013-08-13 11:34:01 -0400 | [diff] [blame] | 1205 | DECLARE_EVENT_CLASS(nfs4_idmap_event, |
| 1206 | TP_PROTO( |
| 1207 | const char *name, |
| 1208 | int len, |
| 1209 | u32 id, |
| 1210 | int error |
| 1211 | ), |
| 1212 | |
| 1213 | TP_ARGS(name, len, id, error), |
| 1214 | |
| 1215 | TP_STRUCT__entry( |
| 1216 | __field(int, error) |
| 1217 | __field(u32, id) |
| 1218 | __dynamic_array(char, name, len > 0 ? len + 1 : 1) |
| 1219 | ), |
| 1220 | |
| 1221 | TP_fast_assign( |
| 1222 | if (len < 0) |
| 1223 | len = 0; |
| 1224 | __entry->error = error < 0 ? error : 0; |
| 1225 | __entry->id = id; |
Daniel Bristot de Oliveira | 752d596 | 2016-07-01 20:44:36 -0300 | [diff] [blame] | 1226 | memcpy(__get_str(name), name, len); |
| 1227 | __get_str(name)[len] = 0; |
Trond Myklebust | 1f2d30b | 2013-08-13 11:34:01 -0400 | [diff] [blame] | 1228 | ), |
| 1229 | |
| 1230 | TP_printk( |
| 1231 | "error=%d id=%u name=%s", |
| 1232 | __entry->error, |
| 1233 | __entry->id, |
| 1234 | __get_str(name) |
| 1235 | ) |
| 1236 | ); |
| 1237 | #define DEFINE_NFS4_IDMAP_EVENT(name) \ |
| 1238 | DEFINE_EVENT(nfs4_idmap_event, name, \ |
| 1239 | TP_PROTO( \ |
| 1240 | const char *name, \ |
| 1241 | int len, \ |
| 1242 | u32 id, \ |
| 1243 | int error \ |
| 1244 | ), \ |
| 1245 | TP_ARGS(name, len, id, error)) |
| 1246 | DEFINE_NFS4_IDMAP_EVENT(nfs4_map_name_to_uid); |
| 1247 | DEFINE_NFS4_IDMAP_EVENT(nfs4_map_group_to_gid); |
| 1248 | DEFINE_NFS4_IDMAP_EVENT(nfs4_map_uid_to_name); |
| 1249 | DEFINE_NFS4_IDMAP_EVENT(nfs4_map_gid_to_group); |
| 1250 | |
Trond Myklebust | cc668ab | 2013-08-14 15:31:28 -0400 | [diff] [blame] | 1251 | DECLARE_EVENT_CLASS(nfs4_read_event, |
| 1252 | TP_PROTO( |
Weston Andros Adamson | d45f60c | 2014-06-09 11:48:35 -0400 | [diff] [blame] | 1253 | const struct nfs_pgio_header *hdr, |
Trond Myklebust | cc668ab | 2013-08-14 15:31:28 -0400 | [diff] [blame] | 1254 | int error |
| 1255 | ), |
| 1256 | |
Weston Andros Adamson | d45f60c | 2014-06-09 11:48:35 -0400 | [diff] [blame] | 1257 | TP_ARGS(hdr, error), |
Trond Myklebust | cc668ab | 2013-08-14 15:31:28 -0400 | [diff] [blame] | 1258 | |
| 1259 | TP_STRUCT__entry( |
| 1260 | __field(dev_t, dev) |
| 1261 | __field(u32, fhandle) |
| 1262 | __field(u64, fileid) |
| 1263 | __field(loff_t, offset) |
| 1264 | __field(size_t, count) |
| 1265 | __field(int, error) |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 1266 | __field(int, stateid_seq) |
| 1267 | __field(u32, stateid_hash) |
Trond Myklebust | cc668ab | 2013-08-14 15:31:28 -0400 | [diff] [blame] | 1268 | ), |
| 1269 | |
| 1270 | TP_fast_assign( |
Weston Andros Adamson | d45f60c | 2014-06-09 11:48:35 -0400 | [diff] [blame] | 1271 | const struct inode *inode = hdr->inode; |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 1272 | const struct nfs4_state *state = |
| 1273 | hdr->args.context->state; |
Trond Myklebust | cc668ab | 2013-08-14 15:31:28 -0400 | [diff] [blame] | 1274 | __entry->dev = inode->i_sb->s_dev; |
| 1275 | __entry->fileid = NFS_FILEID(inode); |
| 1276 | __entry->fhandle = nfs_fhandle_hash(NFS_FH(inode)); |
Weston Andros Adamson | d45f60c | 2014-06-09 11:48:35 -0400 | [diff] [blame] | 1277 | __entry->offset = hdr->args.offset; |
| 1278 | __entry->count = hdr->args.count; |
Trond Myklebust | cc668ab | 2013-08-14 15:31:28 -0400 | [diff] [blame] | 1279 | __entry->error = error; |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 1280 | __entry->stateid_seq = |
| 1281 | be32_to_cpu(state->stateid.seqid); |
| 1282 | __entry->stateid_hash = |
| 1283 | nfs_stateid_hash(&state->stateid); |
Trond Myklebust | cc668ab | 2013-08-14 15:31:28 -0400 | [diff] [blame] | 1284 | ), |
| 1285 | |
| 1286 | TP_printk( |
| 1287 | "error=%d (%s) fileid=%02x:%02x:%llu fhandle=0x%08x " |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 1288 | "offset=%lld count=%zu stateid=%d:0x%08x", |
Trond Myklebust | cc668ab | 2013-08-14 15:31:28 -0400 | [diff] [blame] | 1289 | __entry->error, |
| 1290 | show_nfsv4_errors(__entry->error), |
| 1291 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 1292 | (unsigned long long)__entry->fileid, |
| 1293 | __entry->fhandle, |
| 1294 | (long long)__entry->offset, |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 1295 | __entry->count, |
| 1296 | __entry->stateid_seq, __entry->stateid_hash |
Trond Myklebust | cc668ab | 2013-08-14 15:31:28 -0400 | [diff] [blame] | 1297 | ) |
| 1298 | ); |
| 1299 | #define DEFINE_NFS4_READ_EVENT(name) \ |
| 1300 | DEFINE_EVENT(nfs4_read_event, name, \ |
| 1301 | TP_PROTO( \ |
Weston Andros Adamson | d45f60c | 2014-06-09 11:48:35 -0400 | [diff] [blame] | 1302 | const struct nfs_pgio_header *hdr, \ |
Trond Myklebust | cc668ab | 2013-08-14 15:31:28 -0400 | [diff] [blame] | 1303 | int error \ |
| 1304 | ), \ |
Weston Andros Adamson | d45f60c | 2014-06-09 11:48:35 -0400 | [diff] [blame] | 1305 | TP_ARGS(hdr, error)) |
Trond Myklebust | cc668ab | 2013-08-14 15:31:28 -0400 | [diff] [blame] | 1306 | DEFINE_NFS4_READ_EVENT(nfs4_read); |
| 1307 | #ifdef CONFIG_NFS_V4_1 |
| 1308 | DEFINE_NFS4_READ_EVENT(nfs4_pnfs_read); |
| 1309 | #endif /* CONFIG_NFS_V4_1 */ |
| 1310 | |
| 1311 | DECLARE_EVENT_CLASS(nfs4_write_event, |
| 1312 | TP_PROTO( |
Weston Andros Adamson | d45f60c | 2014-06-09 11:48:35 -0400 | [diff] [blame] | 1313 | const struct nfs_pgio_header *hdr, |
Trond Myklebust | cc668ab | 2013-08-14 15:31:28 -0400 | [diff] [blame] | 1314 | int error |
| 1315 | ), |
| 1316 | |
Weston Andros Adamson | d45f60c | 2014-06-09 11:48:35 -0400 | [diff] [blame] | 1317 | TP_ARGS(hdr, error), |
Trond Myklebust | cc668ab | 2013-08-14 15:31:28 -0400 | [diff] [blame] | 1318 | |
| 1319 | TP_STRUCT__entry( |
| 1320 | __field(dev_t, dev) |
| 1321 | __field(u32, fhandle) |
| 1322 | __field(u64, fileid) |
| 1323 | __field(loff_t, offset) |
| 1324 | __field(size_t, count) |
| 1325 | __field(int, error) |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 1326 | __field(int, stateid_seq) |
| 1327 | __field(u32, stateid_hash) |
Trond Myklebust | cc668ab | 2013-08-14 15:31:28 -0400 | [diff] [blame] | 1328 | ), |
| 1329 | |
| 1330 | TP_fast_assign( |
Weston Andros Adamson | d45f60c | 2014-06-09 11:48:35 -0400 | [diff] [blame] | 1331 | const struct inode *inode = hdr->inode; |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 1332 | const struct nfs4_state *state = |
| 1333 | hdr->args.context->state; |
Trond Myklebust | cc668ab | 2013-08-14 15:31:28 -0400 | [diff] [blame] | 1334 | __entry->dev = inode->i_sb->s_dev; |
| 1335 | __entry->fileid = NFS_FILEID(inode); |
| 1336 | __entry->fhandle = nfs_fhandle_hash(NFS_FH(inode)); |
Weston Andros Adamson | d45f60c | 2014-06-09 11:48:35 -0400 | [diff] [blame] | 1337 | __entry->offset = hdr->args.offset; |
| 1338 | __entry->count = hdr->args.count; |
Trond Myklebust | cc668ab | 2013-08-14 15:31:28 -0400 | [diff] [blame] | 1339 | __entry->error = error; |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 1340 | __entry->stateid_seq = |
| 1341 | be32_to_cpu(state->stateid.seqid); |
| 1342 | __entry->stateid_hash = |
| 1343 | nfs_stateid_hash(&state->stateid); |
Trond Myklebust | cc668ab | 2013-08-14 15:31:28 -0400 | [diff] [blame] | 1344 | ), |
| 1345 | |
| 1346 | TP_printk( |
| 1347 | "error=%d (%s) fileid=%02x:%02x:%llu fhandle=0x%08x " |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 1348 | "offset=%lld count=%zu stateid=%d:0x%08x", |
Trond Myklebust | cc668ab | 2013-08-14 15:31:28 -0400 | [diff] [blame] | 1349 | __entry->error, |
| 1350 | show_nfsv4_errors(__entry->error), |
| 1351 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 1352 | (unsigned long long)__entry->fileid, |
| 1353 | __entry->fhandle, |
| 1354 | (long long)__entry->offset, |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 1355 | __entry->count, |
| 1356 | __entry->stateid_seq, __entry->stateid_hash |
Trond Myklebust | cc668ab | 2013-08-14 15:31:28 -0400 | [diff] [blame] | 1357 | ) |
| 1358 | ); |
| 1359 | |
| 1360 | #define DEFINE_NFS4_WRITE_EVENT(name) \ |
| 1361 | DEFINE_EVENT(nfs4_write_event, name, \ |
| 1362 | TP_PROTO( \ |
Weston Andros Adamson | d45f60c | 2014-06-09 11:48:35 -0400 | [diff] [blame] | 1363 | const struct nfs_pgio_header *hdr, \ |
Trond Myklebust | cc668ab | 2013-08-14 15:31:28 -0400 | [diff] [blame] | 1364 | int error \ |
| 1365 | ), \ |
Weston Andros Adamson | d45f60c | 2014-06-09 11:48:35 -0400 | [diff] [blame] | 1366 | TP_ARGS(hdr, error)) |
Trond Myklebust | cc668ab | 2013-08-14 15:31:28 -0400 | [diff] [blame] | 1367 | DEFINE_NFS4_WRITE_EVENT(nfs4_write); |
| 1368 | #ifdef CONFIG_NFS_V4_1 |
| 1369 | DEFINE_NFS4_WRITE_EVENT(nfs4_pnfs_write); |
| 1370 | #endif /* CONFIG_NFS_V4_1 */ |
| 1371 | |
| 1372 | DECLARE_EVENT_CLASS(nfs4_commit_event, |
| 1373 | TP_PROTO( |
| 1374 | const struct nfs_commit_data *data, |
| 1375 | int error |
| 1376 | ), |
| 1377 | |
| 1378 | TP_ARGS(data, error), |
| 1379 | |
| 1380 | TP_STRUCT__entry( |
| 1381 | __field(dev_t, dev) |
| 1382 | __field(u32, fhandle) |
| 1383 | __field(u64, fileid) |
| 1384 | __field(loff_t, offset) |
| 1385 | __field(size_t, count) |
| 1386 | __field(int, error) |
| 1387 | ), |
| 1388 | |
| 1389 | TP_fast_assign( |
| 1390 | const struct inode *inode = data->inode; |
| 1391 | __entry->dev = inode->i_sb->s_dev; |
| 1392 | __entry->fileid = NFS_FILEID(inode); |
| 1393 | __entry->fhandle = nfs_fhandle_hash(NFS_FH(inode)); |
| 1394 | __entry->offset = data->args.offset; |
| 1395 | __entry->count = data->args.count; |
| 1396 | __entry->error = error; |
| 1397 | ), |
| 1398 | |
| 1399 | TP_printk( |
| 1400 | "error=%d (%s) fileid=%02x:%02x:%llu fhandle=0x%08x " |
| 1401 | "offset=%lld count=%zu", |
| 1402 | __entry->error, |
| 1403 | show_nfsv4_errors(__entry->error), |
| 1404 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 1405 | (unsigned long long)__entry->fileid, |
| 1406 | __entry->fhandle, |
| 1407 | (long long)__entry->offset, |
| 1408 | __entry->count |
| 1409 | ) |
| 1410 | ); |
| 1411 | #define DEFINE_NFS4_COMMIT_EVENT(name) \ |
| 1412 | DEFINE_EVENT(nfs4_commit_event, name, \ |
| 1413 | TP_PROTO( \ |
| 1414 | const struct nfs_commit_data *data, \ |
| 1415 | int error \ |
| 1416 | ), \ |
| 1417 | TP_ARGS(data, error)) |
| 1418 | DEFINE_NFS4_COMMIT_EVENT(nfs4_commit); |
| 1419 | #ifdef CONFIG_NFS_V4_1 |
| 1420 | DEFINE_NFS4_COMMIT_EVENT(nfs4_pnfs_commit_ds); |
Trond Myklebust | 1037e6e | 2013-08-14 16:36:51 -0400 | [diff] [blame] | 1421 | |
| 1422 | #define show_pnfs_iomode(iomode) \ |
| 1423 | __print_symbolic(iomode, \ |
| 1424 | { IOMODE_READ, "READ" }, \ |
| 1425 | { IOMODE_RW, "RW" }, \ |
| 1426 | { IOMODE_ANY, "ANY" }) |
| 1427 | |
| 1428 | TRACE_EVENT(nfs4_layoutget, |
| 1429 | TP_PROTO( |
| 1430 | const struct nfs_open_context *ctx, |
| 1431 | const struct pnfs_layout_range *args, |
| 1432 | const struct pnfs_layout_range *res, |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 1433 | const nfs4_stateid *layout_stateid, |
Trond Myklebust | 1037e6e | 2013-08-14 16:36:51 -0400 | [diff] [blame] | 1434 | int error |
| 1435 | ), |
| 1436 | |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 1437 | TP_ARGS(ctx, args, res, layout_stateid, error), |
Trond Myklebust | 1037e6e | 2013-08-14 16:36:51 -0400 | [diff] [blame] | 1438 | |
| 1439 | TP_STRUCT__entry( |
| 1440 | __field(dev_t, dev) |
| 1441 | __field(u32, fhandle) |
| 1442 | __field(u64, fileid) |
| 1443 | __field(u32, iomode) |
| 1444 | __field(u64, offset) |
| 1445 | __field(u64, count) |
| 1446 | __field(int, error) |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 1447 | __field(int, stateid_seq) |
| 1448 | __field(u32, stateid_hash) |
| 1449 | __field(int, layoutstateid_seq) |
| 1450 | __field(u32, layoutstateid_hash) |
Trond Myklebust | 1037e6e | 2013-08-14 16:36:51 -0400 | [diff] [blame] | 1451 | ), |
| 1452 | |
| 1453 | TP_fast_assign( |
David Howells | 2b0143b | 2015-03-17 22:25:59 +0000 | [diff] [blame] | 1454 | const struct inode *inode = d_inode(ctx->dentry); |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 1455 | const struct nfs4_state *state = ctx->state; |
Trond Myklebust | 1037e6e | 2013-08-14 16:36:51 -0400 | [diff] [blame] | 1456 | __entry->dev = inode->i_sb->s_dev; |
| 1457 | __entry->fileid = NFS_FILEID(inode); |
| 1458 | __entry->fhandle = nfs_fhandle_hash(NFS_FH(inode)); |
| 1459 | __entry->iomode = args->iomode; |
| 1460 | __entry->offset = args->offset; |
| 1461 | __entry->count = args->length; |
| 1462 | __entry->error = error; |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 1463 | __entry->stateid_seq = |
| 1464 | be32_to_cpu(state->stateid.seqid); |
| 1465 | __entry->stateid_hash = |
| 1466 | nfs_stateid_hash(&state->stateid); |
| 1467 | if (!error) { |
| 1468 | __entry->layoutstateid_seq = |
| 1469 | be32_to_cpu(layout_stateid->seqid); |
| 1470 | __entry->layoutstateid_hash = |
| 1471 | nfs_stateid_hash(layout_stateid); |
| 1472 | } else { |
| 1473 | __entry->layoutstateid_seq = 0; |
| 1474 | __entry->layoutstateid_hash = 0; |
| 1475 | } |
Trond Myklebust | 1037e6e | 2013-08-14 16:36:51 -0400 | [diff] [blame] | 1476 | ), |
| 1477 | |
| 1478 | TP_printk( |
| 1479 | "error=%d (%s) fileid=%02x:%02x:%llu fhandle=0x%08x " |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 1480 | "iomode=%s offset=%llu count=%llu stateid=%d:0x%08x " |
| 1481 | "layoutstateid=%d:0x%08x", |
Trond Myklebust | 1037e6e | 2013-08-14 16:36:51 -0400 | [diff] [blame] | 1482 | __entry->error, |
| 1483 | show_nfsv4_errors(__entry->error), |
| 1484 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 1485 | (unsigned long long)__entry->fileid, |
| 1486 | __entry->fhandle, |
| 1487 | show_pnfs_iomode(__entry->iomode), |
| 1488 | (unsigned long long)__entry->offset, |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 1489 | (unsigned long long)__entry->count, |
| 1490 | __entry->stateid_seq, __entry->stateid_hash, |
| 1491 | __entry->layoutstateid_seq, __entry->layoutstateid_hash |
Trond Myklebust | 1037e6e | 2013-08-14 16:36:51 -0400 | [diff] [blame] | 1492 | ) |
| 1493 | ); |
| 1494 | |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 1495 | DEFINE_NFS4_INODE_STATEID_EVENT(nfs4_layoutcommit); |
| 1496 | DEFINE_NFS4_INODE_STATEID_EVENT(nfs4_layoutreturn); |
Trond Myklebust | 6a463beb | 2015-08-20 15:40:47 -0500 | [diff] [blame] | 1497 | DEFINE_NFS4_INODE_EVENT(nfs4_layoutreturn_on_close); |
Trond Myklebust | 1037e6e | 2013-08-14 16:36:51 -0400 | [diff] [blame] | 1498 | |
Jeff Layton | 9a4bf31 | 2015-12-10 10:41:58 -0500 | [diff] [blame] | 1499 | #define show_pnfs_update_layout_reason(reason) \ |
| 1500 | __print_symbolic(reason, \ |
| 1501 | { PNFS_UPDATE_LAYOUT_UNKNOWN, "unknown" }, \ |
| 1502 | { PNFS_UPDATE_LAYOUT_NO_PNFS, "no pnfs" }, \ |
| 1503 | { PNFS_UPDATE_LAYOUT_RD_ZEROLEN, "read+zerolen" }, \ |
| 1504 | { PNFS_UPDATE_LAYOUT_MDSTHRESH, "mdsthresh" }, \ |
| 1505 | { PNFS_UPDATE_LAYOUT_NOMEM, "nomem" }, \ |
| 1506 | { PNFS_UPDATE_LAYOUT_BULK_RECALL, "bulk recall" }, \ |
| 1507 | { PNFS_UPDATE_LAYOUT_IO_TEST_FAIL, "io test fail" }, \ |
| 1508 | { PNFS_UPDATE_LAYOUT_FOUND_CACHED, "found cached" }, \ |
| 1509 | { PNFS_UPDATE_LAYOUT_RETURN, "layoutreturn" }, \ |
| 1510 | { PNFS_UPDATE_LAYOUT_BLOCKED, "layouts blocked" }, \ |
Jeff Layton | 183d9e7 | 2016-05-17 12:28:47 -0400 | [diff] [blame] | 1511 | { PNFS_UPDATE_LAYOUT_INVALID_OPEN, "invalid open" }, \ |
| 1512 | { PNFS_UPDATE_LAYOUT_RETRY, "retrying" }, \ |
Jeff Layton | 9a4bf31 | 2015-12-10 10:41:58 -0500 | [diff] [blame] | 1513 | { PNFS_UPDATE_LAYOUT_SEND_LAYOUTGET, "sent layoutget" }) |
| 1514 | |
| 1515 | TRACE_EVENT(pnfs_update_layout, |
| 1516 | TP_PROTO(struct inode *inode, |
| 1517 | loff_t pos, |
| 1518 | u64 count, |
| 1519 | enum pnfs_iomode iomode, |
Trond Myklebust | f484830 | 2015-12-26 18:03:07 -0500 | [diff] [blame] | 1520 | struct pnfs_layout_hdr *lo, |
Jeff Layton | 183d9e7 | 2016-05-17 12:28:47 -0400 | [diff] [blame] | 1521 | struct pnfs_layout_segment *lseg, |
Jeff Layton | 9a4bf31 | 2015-12-10 10:41:58 -0500 | [diff] [blame] | 1522 | enum pnfs_update_layout_reason reason |
| 1523 | ), |
Jeff Layton | 183d9e7 | 2016-05-17 12:28:47 -0400 | [diff] [blame] | 1524 | TP_ARGS(inode, pos, count, iomode, lo, lseg, reason), |
Jeff Layton | 9a4bf31 | 2015-12-10 10:41:58 -0500 | [diff] [blame] | 1525 | TP_STRUCT__entry( |
| 1526 | __field(dev_t, dev) |
| 1527 | __field(u64, fileid) |
| 1528 | __field(u32, fhandle) |
| 1529 | __field(loff_t, pos) |
| 1530 | __field(u64, count) |
| 1531 | __field(enum pnfs_iomode, iomode) |
Trond Myklebust | f484830 | 2015-12-26 18:03:07 -0500 | [diff] [blame] | 1532 | __field(int, layoutstateid_seq) |
| 1533 | __field(u32, layoutstateid_hash) |
Jeff Layton | 183d9e7 | 2016-05-17 12:28:47 -0400 | [diff] [blame] | 1534 | __field(long, lseg) |
Jeff Layton | 9a4bf31 | 2015-12-10 10:41:58 -0500 | [diff] [blame] | 1535 | __field(enum pnfs_update_layout_reason, reason) |
| 1536 | ), |
| 1537 | TP_fast_assign( |
| 1538 | __entry->dev = inode->i_sb->s_dev; |
| 1539 | __entry->fileid = NFS_FILEID(inode); |
| 1540 | __entry->fhandle = nfs_fhandle_hash(NFS_FH(inode)); |
| 1541 | __entry->pos = pos; |
| 1542 | __entry->count = count; |
| 1543 | __entry->iomode = iomode; |
Jeff Layton | 9a4bf31 | 2015-12-10 10:41:58 -0500 | [diff] [blame] | 1544 | __entry->reason = reason; |
Trond Myklebust | f484830 | 2015-12-26 18:03:07 -0500 | [diff] [blame] | 1545 | if (lo != NULL) { |
| 1546 | __entry->layoutstateid_seq = |
| 1547 | be32_to_cpu(lo->plh_stateid.seqid); |
| 1548 | __entry->layoutstateid_hash = |
| 1549 | nfs_stateid_hash(&lo->plh_stateid); |
| 1550 | } else { |
| 1551 | __entry->layoutstateid_seq = 0; |
| 1552 | __entry->layoutstateid_hash = 0; |
| 1553 | } |
Jeff Layton | 183d9e7 | 2016-05-17 12:28:47 -0400 | [diff] [blame] | 1554 | __entry->lseg = (long)lseg; |
Jeff Layton | 9a4bf31 | 2015-12-10 10:41:58 -0500 | [diff] [blame] | 1555 | ), |
| 1556 | TP_printk( |
| 1557 | "fileid=%02x:%02x:%llu fhandle=0x%08x " |
Trond Myklebust | f484830 | 2015-12-26 18:03:07 -0500 | [diff] [blame] | 1558 | "iomode=%s pos=%llu count=%llu " |
Jeff Layton | 183d9e7 | 2016-05-17 12:28:47 -0400 | [diff] [blame] | 1559 | "layoutstateid=%d:0x%08x lseg=0x%lx (%s)", |
Jeff Layton | 9a4bf31 | 2015-12-10 10:41:58 -0500 | [diff] [blame] | 1560 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 1561 | (unsigned long long)__entry->fileid, |
| 1562 | __entry->fhandle, |
| 1563 | show_pnfs_iomode(__entry->iomode), |
| 1564 | (unsigned long long)__entry->pos, |
Trond Myklebust | f484830 | 2015-12-26 18:03:07 -0500 | [diff] [blame] | 1565 | (unsigned long long)__entry->count, |
| 1566 | __entry->layoutstateid_seq, __entry->layoutstateid_hash, |
Jeff Layton | 183d9e7 | 2016-05-17 12:28:47 -0400 | [diff] [blame] | 1567 | __entry->lseg, |
Jeff Layton | 9a4bf31 | 2015-12-10 10:41:58 -0500 | [diff] [blame] | 1568 | show_pnfs_update_layout_reason(__entry->reason) |
| 1569 | ) |
| 1570 | ); |
| 1571 | |
Trond Myklebust | cc668ab | 2013-08-14 15:31:28 -0400 | [diff] [blame] | 1572 | #endif /* CONFIG_NFS_V4_1 */ |
| 1573 | |
Trond Myklebust | c6d01c6 | 2013-08-09 11:51:26 -0400 | [diff] [blame] | 1574 | #endif /* _TRACE_NFS4_H */ |
| 1575 | |
| 1576 | #undef TRACE_INCLUDE_PATH |
| 1577 | #define TRACE_INCLUDE_PATH . |
| 1578 | #define TRACE_INCLUDE_FILE nfs4trace |
| 1579 | /* This part must be outside protection */ |
| 1580 | #include <trace/define_trace.h> |