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 | c6d01c6 | 2013-08-09 11:51:26 -0400 | [diff] [blame] | 177 | DECLARE_EVENT_CLASS(nfs4_clientid_event, |
| 178 | TP_PROTO( |
| 179 | const struct nfs_client *clp, |
| 180 | int error |
| 181 | ), |
| 182 | |
| 183 | TP_ARGS(clp, error), |
| 184 | |
| 185 | TP_STRUCT__entry( |
| 186 | __string(dstaddr, |
| 187 | rpc_peeraddr2str(clp->cl_rpcclient, |
| 188 | RPC_DISPLAY_ADDR)) |
| 189 | __field(int, error) |
| 190 | ), |
| 191 | |
| 192 | TP_fast_assign( |
| 193 | __entry->error = error; |
| 194 | __assign_str(dstaddr, |
| 195 | rpc_peeraddr2str(clp->cl_rpcclient, |
| 196 | RPC_DISPLAY_ADDR)); |
| 197 | ), |
| 198 | |
| 199 | TP_printk( |
| 200 | "error=%d (%s) dstaddr=%s", |
| 201 | __entry->error, |
| 202 | show_nfsv4_errors(__entry->error), |
| 203 | __get_str(dstaddr) |
| 204 | ) |
| 205 | ); |
| 206 | #define DEFINE_NFS4_CLIENTID_EVENT(name) \ |
| 207 | DEFINE_EVENT(nfs4_clientid_event, name, \ |
| 208 | TP_PROTO( \ |
| 209 | const struct nfs_client *clp, \ |
| 210 | int error \ |
| 211 | ), \ |
| 212 | TP_ARGS(clp, error)) |
| 213 | DEFINE_NFS4_CLIENTID_EVENT(nfs4_setclientid); |
| 214 | DEFINE_NFS4_CLIENTID_EVENT(nfs4_setclientid_confirm); |
| 215 | DEFINE_NFS4_CLIENTID_EVENT(nfs4_renew); |
| 216 | DEFINE_NFS4_CLIENTID_EVENT(nfs4_renew_async); |
| 217 | #ifdef CONFIG_NFS_V4_1 |
| 218 | DEFINE_NFS4_CLIENTID_EVENT(nfs4_exchange_id); |
| 219 | DEFINE_NFS4_CLIENTID_EVENT(nfs4_create_session); |
| 220 | DEFINE_NFS4_CLIENTID_EVENT(nfs4_destroy_session); |
| 221 | DEFINE_NFS4_CLIENTID_EVENT(nfs4_destroy_clientid); |
| 222 | DEFINE_NFS4_CLIENTID_EVENT(nfs4_bind_conn_to_session); |
| 223 | DEFINE_NFS4_CLIENTID_EVENT(nfs4_sequence); |
| 224 | DEFINE_NFS4_CLIENTID_EVENT(nfs4_reclaim_complete); |
| 225 | #endif /* CONFIG_NFS_V4_1 */ |
| 226 | |
Trond Myklebust | 42113a7 | 2013-08-12 16:19:27 -0400 | [diff] [blame] | 227 | DECLARE_EVENT_CLASS(nfs4_open_event, |
| 228 | TP_PROTO( |
| 229 | const struct nfs_open_context *ctx, |
| 230 | int flags, |
| 231 | int error |
| 232 | ), |
| 233 | |
| 234 | TP_ARGS(ctx, flags, error), |
| 235 | |
| 236 | TP_STRUCT__entry( |
| 237 | __field(int, error) |
| 238 | __field(unsigned int, flags) |
| 239 | __field(unsigned int, fmode) |
| 240 | __field(dev_t, dev) |
| 241 | __field(u32, fhandle) |
| 242 | __field(u64, fileid) |
| 243 | __field(u64, dir) |
| 244 | __string(name, ctx->dentry->d_name.name) |
| 245 | ), |
| 246 | |
| 247 | TP_fast_assign( |
| 248 | const struct nfs4_state *state = ctx->state; |
| 249 | const struct inode *inode = NULL; |
| 250 | |
| 251 | __entry->error = error; |
| 252 | __entry->flags = flags; |
| 253 | __entry->fmode = (__force unsigned int)ctx->mode; |
| 254 | __entry->dev = ctx->dentry->d_sb->s_dev; |
| 255 | if (!IS_ERR(state)) |
| 256 | inode = state->inode; |
| 257 | if (inode != NULL) { |
| 258 | __entry->fileid = NFS_FILEID(inode); |
| 259 | __entry->fhandle = nfs_fhandle_hash(NFS_FH(inode)); |
| 260 | } else { |
| 261 | __entry->fileid = 0; |
| 262 | __entry->fhandle = 0; |
| 263 | } |
| 264 | __entry->dir = NFS_FILEID(ctx->dentry->d_parent->d_inode); |
| 265 | __assign_str(name, ctx->dentry->d_name.name); |
| 266 | ), |
| 267 | |
| 268 | TP_printk( |
| 269 | "error=%d (%s) flags=%d (%s) fmode=%s " |
| 270 | "fileid=%02x:%02x:%llu fhandle=0x%08x " |
| 271 | "name=%02x:%02x:%llu/%s", |
| 272 | __entry->error, |
| 273 | show_nfsv4_errors(__entry->error), |
| 274 | __entry->flags, |
| 275 | show_open_flags(__entry->flags), |
| 276 | show_fmode_flags(__entry->fmode), |
| 277 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 278 | (unsigned long long)__entry->fileid, |
| 279 | __entry->fhandle, |
| 280 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 281 | (unsigned long long)__entry->dir, |
| 282 | __get_str(name) |
| 283 | ) |
| 284 | ); |
| 285 | |
| 286 | #define DEFINE_NFS4_OPEN_EVENT(name) \ |
| 287 | DEFINE_EVENT(nfs4_open_event, name, \ |
| 288 | TP_PROTO( \ |
| 289 | const struct nfs_open_context *ctx, \ |
| 290 | int flags, \ |
| 291 | int error \ |
| 292 | ), \ |
| 293 | TP_ARGS(ctx, flags, error)) |
| 294 | DEFINE_NFS4_OPEN_EVENT(nfs4_open_reclaim); |
| 295 | DEFINE_NFS4_OPEN_EVENT(nfs4_open_expired); |
| 296 | DEFINE_NFS4_OPEN_EVENT(nfs4_open_file); |
| 297 | |
| 298 | TRACE_EVENT(nfs4_close, |
| 299 | TP_PROTO( |
| 300 | const struct nfs4_state *state, |
| 301 | const struct nfs_closeargs *args, |
| 302 | const struct nfs_closeres *res, |
| 303 | int error |
| 304 | ), |
| 305 | |
| 306 | TP_ARGS(state, args, res, error), |
| 307 | |
| 308 | TP_STRUCT__entry( |
| 309 | __field(dev_t, dev) |
| 310 | __field(u32, fhandle) |
| 311 | __field(u64, fileid) |
| 312 | __field(unsigned int, fmode) |
| 313 | __field(int, error) |
| 314 | ), |
| 315 | |
| 316 | TP_fast_assign( |
| 317 | const struct inode *inode = state->inode; |
| 318 | |
| 319 | __entry->dev = inode->i_sb->s_dev; |
| 320 | __entry->fileid = NFS_FILEID(inode); |
| 321 | __entry->fhandle = nfs_fhandle_hash(NFS_FH(inode)); |
| 322 | __entry->fmode = (__force unsigned int)state->state; |
| 323 | __entry->error = error; |
| 324 | ), |
| 325 | |
| 326 | TP_printk( |
| 327 | "error=%d (%s) fmode=%s fileid=%02x:%02x:%llu " |
| 328 | "fhandle=0x%08x", |
| 329 | __entry->error, |
| 330 | show_nfsv4_errors(__entry->error), |
| 331 | __entry->fmode ? show_fmode_flags(__entry->fmode) : |
| 332 | "closed", |
| 333 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 334 | (unsigned long long)__entry->fileid, |
| 335 | __entry->fhandle |
| 336 | ) |
| 337 | ); |
| 338 | |
Trond Myklebust | d1b748a | 2013-08-12 16:35:20 -0400 | [diff] [blame] | 339 | #define show_lock_cmd(type) \ |
| 340 | __print_symbolic((int)type, \ |
| 341 | { F_GETLK, "GETLK" }, \ |
| 342 | { F_SETLK, "SETLK" }, \ |
| 343 | { F_SETLKW, "SETLKW" }) |
| 344 | #define show_lock_type(type) \ |
| 345 | __print_symbolic((int)type, \ |
| 346 | { F_RDLCK, "RDLCK" }, \ |
| 347 | { F_WRLCK, "WRLCK" }, \ |
| 348 | { F_UNLCK, "UNLCK" }) |
| 349 | |
| 350 | DECLARE_EVENT_CLASS(nfs4_lock_event, |
| 351 | TP_PROTO( |
| 352 | const struct file_lock *request, |
| 353 | const struct nfs4_state *state, |
| 354 | int cmd, |
| 355 | int error |
| 356 | ), |
| 357 | |
| 358 | TP_ARGS(request, state, cmd, error), |
| 359 | |
| 360 | TP_STRUCT__entry( |
| 361 | __field(int, error) |
| 362 | __field(int, cmd) |
| 363 | __field(char, type) |
| 364 | __field(loff_t, start) |
| 365 | __field(loff_t, end) |
| 366 | __field(dev_t, dev) |
| 367 | __field(u32, fhandle) |
| 368 | __field(u64, fileid) |
| 369 | ), |
| 370 | |
| 371 | TP_fast_assign( |
| 372 | const struct inode *inode = state->inode; |
| 373 | |
| 374 | __entry->error = error; |
| 375 | __entry->cmd = cmd; |
| 376 | __entry->type = request->fl_type; |
| 377 | __entry->start = request->fl_start; |
| 378 | __entry->end = request->fl_end; |
| 379 | __entry->dev = inode->i_sb->s_dev; |
| 380 | __entry->fileid = NFS_FILEID(inode); |
| 381 | __entry->fhandle = nfs_fhandle_hash(NFS_FH(inode)); |
| 382 | ), |
| 383 | |
| 384 | TP_printk( |
| 385 | "error=%d (%s) cmd=%s:%s range=%lld:%lld " |
| 386 | "fileid=%02x:%02x:%llu fhandle=0x%08x", |
| 387 | __entry->error, |
| 388 | show_nfsv4_errors(__entry->error), |
| 389 | show_lock_cmd(__entry->cmd), |
| 390 | show_lock_type(__entry->type), |
| 391 | (long long)__entry->start, |
| 392 | (long long)__entry->end, |
| 393 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 394 | (unsigned long long)__entry->fileid, |
| 395 | __entry->fhandle |
| 396 | ) |
| 397 | ); |
| 398 | |
| 399 | #define DEFINE_NFS4_LOCK_EVENT(name) \ |
| 400 | DEFINE_EVENT(nfs4_lock_event, name, \ |
| 401 | TP_PROTO( \ |
| 402 | const struct file_lock *request, \ |
| 403 | const struct nfs4_state *state, \ |
| 404 | int cmd, \ |
| 405 | int error \ |
| 406 | ), \ |
| 407 | TP_ARGS(request, state, cmd, error)) |
| 408 | DEFINE_NFS4_LOCK_EVENT(nfs4_get_lock); |
| 409 | DEFINE_NFS4_LOCK_EVENT(nfs4_set_lock); |
| 410 | DEFINE_NFS4_LOCK_EVENT(nfs4_lock_reclaim); |
| 411 | DEFINE_NFS4_LOCK_EVENT(nfs4_lock_expired); |
| 412 | DEFINE_NFS4_LOCK_EVENT(nfs4_unlock); |
| 413 | |
Trond Myklebust | 078ea3d | 2013-08-12 16:45:55 -0400 | [diff] [blame] | 414 | DECLARE_EVENT_CLASS(nfs4_lookup_event, |
| 415 | TP_PROTO( |
| 416 | const struct inode *dir, |
| 417 | const struct qstr *name, |
| 418 | int error |
| 419 | ), |
| 420 | |
| 421 | TP_ARGS(dir, name, error), |
| 422 | |
| 423 | TP_STRUCT__entry( |
| 424 | __field(dev_t, dev) |
| 425 | __field(int, error) |
| 426 | __field(u64, dir) |
| 427 | __string(name, name->name) |
| 428 | ), |
| 429 | |
| 430 | TP_fast_assign( |
| 431 | __entry->dev = dir->i_sb->s_dev; |
| 432 | __entry->dir = NFS_FILEID(dir); |
| 433 | __entry->error = error; |
| 434 | __assign_str(name, name->name); |
| 435 | ), |
| 436 | |
| 437 | TP_printk( |
| 438 | "error=%d (%s) name=%02x:%02x:%llu/%s", |
| 439 | __entry->error, |
| 440 | show_nfsv4_errors(__entry->error), |
| 441 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 442 | (unsigned long long)__entry->dir, |
| 443 | __get_str(name) |
| 444 | ) |
| 445 | ); |
| 446 | |
| 447 | #define DEFINE_NFS4_LOOKUP_EVENT(name) \ |
| 448 | DEFINE_EVENT(nfs4_lookup_event, name, \ |
| 449 | TP_PROTO( \ |
| 450 | const struct inode *dir, \ |
| 451 | const struct qstr *name, \ |
| 452 | int error \ |
| 453 | ), \ |
| 454 | TP_ARGS(dir, name, error)) |
| 455 | |
| 456 | DEFINE_NFS4_LOOKUP_EVENT(nfs4_lookup); |
| 457 | DEFINE_NFS4_LOOKUP_EVENT(nfs4_symlink); |
| 458 | DEFINE_NFS4_LOOKUP_EVENT(nfs4_mkdir); |
| 459 | DEFINE_NFS4_LOOKUP_EVENT(nfs4_mknod); |
| 460 | DEFINE_NFS4_LOOKUP_EVENT(nfs4_remove); |
| 461 | DEFINE_NFS4_LOOKUP_EVENT(nfs4_get_fs_locations); |
| 462 | DEFINE_NFS4_LOOKUP_EVENT(nfs4_secinfo); |
| 463 | |
Trond Myklebust | c1578b7 | 2013-08-12 16:58:42 -0400 | [diff] [blame^] | 464 | DECLARE_EVENT_CLASS(nfs4_inode_event, |
| 465 | TP_PROTO( |
| 466 | const struct inode *inode, |
| 467 | int error |
| 468 | ), |
| 469 | |
| 470 | TP_ARGS(inode, error), |
| 471 | |
| 472 | TP_STRUCT__entry( |
| 473 | __field(dev_t, dev) |
| 474 | __field(u32, fhandle) |
| 475 | __field(u64, fileid) |
| 476 | __field(int, error) |
| 477 | ), |
| 478 | |
| 479 | TP_fast_assign( |
| 480 | __entry->dev = inode->i_sb->s_dev; |
| 481 | __entry->fileid = NFS_FILEID(inode); |
| 482 | __entry->fhandle = nfs_fhandle_hash(NFS_FH(inode)); |
| 483 | __entry->error = error; |
| 484 | ), |
| 485 | |
| 486 | TP_printk( |
| 487 | "error=%d (%s) fileid=%02x:%02x:%llu fhandle=0x%08x", |
| 488 | __entry->error, |
| 489 | show_nfsv4_errors(__entry->error), |
| 490 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 491 | (unsigned long long)__entry->fileid, |
| 492 | __entry->fhandle |
| 493 | ) |
| 494 | ); |
| 495 | |
| 496 | #define DEFINE_NFS4_INODE_EVENT(name) \ |
| 497 | DEFINE_EVENT(nfs4_inode_event, name, \ |
| 498 | TP_PROTO( \ |
| 499 | const struct inode *inode, \ |
| 500 | int error \ |
| 501 | ), \ |
| 502 | TP_ARGS(inode, error)) |
| 503 | |
| 504 | DEFINE_NFS4_INODE_EVENT(nfs4_setattr); |
| 505 | DEFINE_NFS4_INODE_EVENT(nfs4_access); |
| 506 | DEFINE_NFS4_INODE_EVENT(nfs4_readlink); |
| 507 | DEFINE_NFS4_INODE_EVENT(nfs4_readdir); |
| 508 | DEFINE_NFS4_INODE_EVENT(nfs4_get_acl); |
| 509 | DEFINE_NFS4_INODE_EVENT(nfs4_set_acl); |
| 510 | #ifdef CONFIG_NFS_V4_SECURITY_LABEL |
| 511 | DEFINE_NFS4_INODE_EVENT(nfs4_get_security_label); |
| 512 | DEFINE_NFS4_INODE_EVENT(nfs4_set_security_label); |
| 513 | #endif /* CONFIG_NFS_V4_SECURITY_LABEL */ |
| 514 | |
Trond Myklebust | c6d01c6 | 2013-08-09 11:51:26 -0400 | [diff] [blame] | 515 | #endif /* _TRACE_NFS4_H */ |
| 516 | |
| 517 | #undef TRACE_INCLUDE_PATH |
| 518 | #define TRACE_INCLUDE_PATH . |
| 519 | #define TRACE_INCLUDE_FILE nfs4trace |
| 520 | /* This part must be outside protection */ |
| 521 | #include <trace/define_trace.h> |