xref: /openbmc/linux/fs/nfs/nfs4trace.h (revision ca8acf8d)
1c6d01c6fSTrond Myklebust /*
2c6d01c6fSTrond Myklebust  * Copyright (c) 2013 Trond Myklebust <Trond.Myklebust@netapp.com>
3c6d01c6fSTrond Myklebust  */
4c6d01c6fSTrond Myklebust #undef TRACE_SYSTEM
5c6d01c6fSTrond Myklebust #define TRACE_SYSTEM nfs4
6c6d01c6fSTrond Myklebust 
7c6d01c6fSTrond Myklebust #if !defined(_TRACE_NFS4_H) || defined(TRACE_HEADER_MULTI_READ)
8c6d01c6fSTrond Myklebust #define _TRACE_NFS4_H
9c6d01c6fSTrond Myklebust 
10c6d01c6fSTrond Myklebust #include <linux/tracepoint.h>
11c6d01c6fSTrond Myklebust 
12c6d01c6fSTrond Myklebust #define show_nfsv4_errors(error) \
13c6d01c6fSTrond Myklebust 	__print_symbolic(error, \
14c6d01c6fSTrond Myklebust 		{ NFS4_OK, "OK" }, \
15c6d01c6fSTrond Myklebust 		/* Mapped by nfs4_stat_to_errno() */ \
16c6d01c6fSTrond Myklebust 		{ -EPERM, "EPERM" }, \
17c6d01c6fSTrond Myklebust 		{ -ENOENT, "ENOENT" }, \
18c6d01c6fSTrond Myklebust 		{ -EIO, "EIO" }, \
19c6d01c6fSTrond Myklebust 		{ -ENXIO, "ENXIO" }, \
20c6d01c6fSTrond Myklebust 		{ -EACCES, "EACCES" }, \
21c6d01c6fSTrond Myklebust 		{ -EEXIST, "EEXIST" }, \
22c6d01c6fSTrond Myklebust 		{ -EXDEV, "EXDEV" }, \
23c6d01c6fSTrond Myklebust 		{ -ENOTDIR, "ENOTDIR" }, \
24c6d01c6fSTrond Myklebust 		{ -EISDIR, "EISDIR" }, \
25c6d01c6fSTrond Myklebust 		{ -EFBIG, "EFBIG" }, \
26c6d01c6fSTrond Myklebust 		{ -ENOSPC, "ENOSPC" }, \
27c6d01c6fSTrond Myklebust 		{ -EROFS, "EROFS" }, \
28c6d01c6fSTrond Myklebust 		{ -EMLINK, "EMLINK" }, \
29c6d01c6fSTrond Myklebust 		{ -ENAMETOOLONG, "ENAMETOOLONG" }, \
30c6d01c6fSTrond Myklebust 		{ -ENOTEMPTY, "ENOTEMPTY" }, \
31c6d01c6fSTrond Myklebust 		{ -EDQUOT, "EDQUOT" }, \
32c6d01c6fSTrond Myklebust 		{ -ESTALE, "ESTALE" }, \
33c6d01c6fSTrond Myklebust 		{ -EBADHANDLE, "EBADHANDLE" }, \
34c6d01c6fSTrond Myklebust 		{ -EBADCOOKIE, "EBADCOOKIE" }, \
35c6d01c6fSTrond Myklebust 		{ -ENOTSUPP, "ENOTSUPP" }, \
36c6d01c6fSTrond Myklebust 		{ -ETOOSMALL, "ETOOSMALL" }, \
37c6d01c6fSTrond Myklebust 		{ -EREMOTEIO, "EREMOTEIO" }, \
38c6d01c6fSTrond Myklebust 		{ -EBADTYPE, "EBADTYPE" }, \
39c6d01c6fSTrond Myklebust 		{ -EAGAIN, "EAGAIN" }, \
40c6d01c6fSTrond Myklebust 		{ -ELOOP, "ELOOP" }, \
41c6d01c6fSTrond Myklebust 		{ -EOPNOTSUPP, "EOPNOTSUPP" }, \
42c6d01c6fSTrond Myklebust 		{ -EDEADLK, "EDEADLK" }, \
43c6d01c6fSTrond Myklebust 		/* RPC errors */ \
44c6d01c6fSTrond Myklebust 		{ -ENOMEM, "ENOMEM" }, \
45c6d01c6fSTrond Myklebust 		{ -EKEYEXPIRED, "EKEYEXPIRED" }, \
46c6d01c6fSTrond Myklebust 		{ -ETIMEDOUT, "ETIMEDOUT" }, \
47c6d01c6fSTrond Myklebust 		{ -ERESTARTSYS, "ERESTARTSYS" }, \
48c6d01c6fSTrond Myklebust 		{ -ECONNREFUSED, "ECONNREFUSED" }, \
49c6d01c6fSTrond Myklebust 		{ -ECONNRESET, "ECONNRESET" }, \
50c6d01c6fSTrond Myklebust 		{ -ENETUNREACH, "ENETUNREACH" }, \
51c6d01c6fSTrond Myklebust 		{ -EHOSTUNREACH, "EHOSTUNREACH" }, \
52c6d01c6fSTrond Myklebust 		{ -EHOSTDOWN, "EHOSTDOWN" }, \
53c6d01c6fSTrond Myklebust 		{ -EPIPE, "EPIPE" }, \
54c6d01c6fSTrond Myklebust 		{ -EPFNOSUPPORT, "EPFNOSUPPORT" }, \
55c6d01c6fSTrond Myklebust 		{ -EPROTONOSUPPORT, "EPROTONOSUPPORT" }, \
56c6d01c6fSTrond Myklebust 		/* NFSv4 native errors */ \
57c6d01c6fSTrond Myklebust 		{ -NFS4ERR_ACCESS, "ACCESS" }, \
58c6d01c6fSTrond Myklebust 		{ -NFS4ERR_ATTRNOTSUPP, "ATTRNOTSUPP" }, \
59c6d01c6fSTrond Myklebust 		{ -NFS4ERR_ADMIN_REVOKED, "ADMIN_REVOKED" }, \
60c6d01c6fSTrond Myklebust 		{ -NFS4ERR_BACK_CHAN_BUSY, "BACK_CHAN_BUSY" }, \
61c6d01c6fSTrond Myklebust 		{ -NFS4ERR_BADCHAR, "BADCHAR" }, \
62c6d01c6fSTrond Myklebust 		{ -NFS4ERR_BADHANDLE, "BADHANDLE" }, \
63c6d01c6fSTrond Myklebust 		{ -NFS4ERR_BADIOMODE, "BADIOMODE" }, \
64c6d01c6fSTrond Myklebust 		{ -NFS4ERR_BADLAYOUT, "BADLAYOUT" }, \
65c6d01c6fSTrond Myklebust 		{ -NFS4ERR_BADLABEL, "BADLABEL" }, \
66c6d01c6fSTrond Myklebust 		{ -NFS4ERR_BADNAME, "BADNAME" }, \
67c6d01c6fSTrond Myklebust 		{ -NFS4ERR_BADOWNER, "BADOWNER" }, \
68c6d01c6fSTrond Myklebust 		{ -NFS4ERR_BADSESSION, "BADSESSION" }, \
69c6d01c6fSTrond Myklebust 		{ -NFS4ERR_BADSLOT, "BADSLOT" }, \
70c6d01c6fSTrond Myklebust 		{ -NFS4ERR_BADTYPE, "BADTYPE" }, \
71c6d01c6fSTrond Myklebust 		{ -NFS4ERR_BADXDR, "BADXDR" }, \
72c6d01c6fSTrond Myklebust 		{ -NFS4ERR_BAD_COOKIE, "BAD_COOKIE" }, \
73c6d01c6fSTrond Myklebust 		{ -NFS4ERR_BAD_HIGH_SLOT, "BAD_HIGH_SLOT" }, \
74c6d01c6fSTrond Myklebust 		{ -NFS4ERR_BAD_RANGE, "BAD_RANGE" }, \
75c6d01c6fSTrond Myklebust 		{ -NFS4ERR_BAD_SEQID, "BAD_SEQID" }, \
76c6d01c6fSTrond Myklebust 		{ -NFS4ERR_BAD_SESSION_DIGEST, "BAD_SESSION_DIGEST" }, \
77c6d01c6fSTrond Myklebust 		{ -NFS4ERR_BAD_STATEID, "BAD_STATEID" }, \
78c6d01c6fSTrond Myklebust 		{ -NFS4ERR_CB_PATH_DOWN, "CB_PATH_DOWN" }, \
79c6d01c6fSTrond Myklebust 		{ -NFS4ERR_CLID_INUSE, "CLID_INUSE" }, \
80c6d01c6fSTrond Myklebust 		{ -NFS4ERR_CLIENTID_BUSY, "CLIENTID_BUSY" }, \
81c6d01c6fSTrond Myklebust 		{ -NFS4ERR_COMPLETE_ALREADY, "COMPLETE_ALREADY" }, \
82c6d01c6fSTrond Myklebust 		{ -NFS4ERR_CONN_NOT_BOUND_TO_SESSION, \
83c6d01c6fSTrond Myklebust 			"CONN_NOT_BOUND_TO_SESSION" }, \
84c6d01c6fSTrond Myklebust 		{ -NFS4ERR_DEADLOCK, "DEADLOCK" }, \
85c6d01c6fSTrond Myklebust 		{ -NFS4ERR_DEADSESSION, "DEAD_SESSION" }, \
86c6d01c6fSTrond Myklebust 		{ -NFS4ERR_DELAY, "DELAY" }, \
87c6d01c6fSTrond Myklebust 		{ -NFS4ERR_DELEG_ALREADY_WANTED, \
88c6d01c6fSTrond Myklebust 			"DELEG_ALREADY_WANTED" }, \
89c6d01c6fSTrond Myklebust 		{ -NFS4ERR_DELEG_REVOKED, "DELEG_REVOKED" }, \
90c6d01c6fSTrond Myklebust 		{ -NFS4ERR_DENIED, "DENIED" }, \
91c6d01c6fSTrond Myklebust 		{ -NFS4ERR_DIRDELEG_UNAVAIL, "DIRDELEG_UNAVAIL" }, \
92c6d01c6fSTrond Myklebust 		{ -NFS4ERR_DQUOT, "DQUOT" }, \
93c6d01c6fSTrond Myklebust 		{ -NFS4ERR_ENCR_ALG_UNSUPP, "ENCR_ALG_UNSUPP" }, \
94c6d01c6fSTrond Myklebust 		{ -NFS4ERR_EXIST, "EXIST" }, \
95c6d01c6fSTrond Myklebust 		{ -NFS4ERR_EXPIRED, "EXPIRED" }, \
96c6d01c6fSTrond Myklebust 		{ -NFS4ERR_FBIG, "FBIG" }, \
97c6d01c6fSTrond Myklebust 		{ -NFS4ERR_FHEXPIRED, "FHEXPIRED" }, \
98c6d01c6fSTrond Myklebust 		{ -NFS4ERR_FILE_OPEN, "FILE_OPEN" }, \
99c6d01c6fSTrond Myklebust 		{ -NFS4ERR_GRACE, "GRACE" }, \
100c6d01c6fSTrond Myklebust 		{ -NFS4ERR_HASH_ALG_UNSUPP, "HASH_ALG_UNSUPP" }, \
101c6d01c6fSTrond Myklebust 		{ -NFS4ERR_INVAL, "INVAL" }, \
102c6d01c6fSTrond Myklebust 		{ -NFS4ERR_IO, "IO" }, \
103c6d01c6fSTrond Myklebust 		{ -NFS4ERR_ISDIR, "ISDIR" }, \
104c6d01c6fSTrond Myklebust 		{ -NFS4ERR_LAYOUTTRYLATER, "LAYOUTTRYLATER" }, \
105c6d01c6fSTrond Myklebust 		{ -NFS4ERR_LAYOUTUNAVAILABLE, "LAYOUTUNAVAILABLE" }, \
106c6d01c6fSTrond Myklebust 		{ -NFS4ERR_LEASE_MOVED, "LEASE_MOVED" }, \
107c6d01c6fSTrond Myklebust 		{ -NFS4ERR_LOCKED, "LOCKED" }, \
108c6d01c6fSTrond Myklebust 		{ -NFS4ERR_LOCKS_HELD, "LOCKS_HELD" }, \
109c6d01c6fSTrond Myklebust 		{ -NFS4ERR_LOCK_RANGE, "LOCK_RANGE" }, \
110c6d01c6fSTrond Myklebust 		{ -NFS4ERR_MINOR_VERS_MISMATCH, "MINOR_VERS_MISMATCH" }, \
111c6d01c6fSTrond Myklebust 		{ -NFS4ERR_MLINK, "MLINK" }, \
112c6d01c6fSTrond Myklebust 		{ -NFS4ERR_MOVED, "MOVED" }, \
113c6d01c6fSTrond Myklebust 		{ -NFS4ERR_NAMETOOLONG, "NAMETOOLONG" }, \
114c6d01c6fSTrond Myklebust 		{ -NFS4ERR_NOENT, "NOENT" }, \
115c6d01c6fSTrond Myklebust 		{ -NFS4ERR_NOFILEHANDLE, "NOFILEHANDLE" }, \
116c6d01c6fSTrond Myklebust 		{ -NFS4ERR_NOMATCHING_LAYOUT, "NOMATCHING_LAYOUT" }, \
117c6d01c6fSTrond Myklebust 		{ -NFS4ERR_NOSPC, "NOSPC" }, \
118c6d01c6fSTrond Myklebust 		{ -NFS4ERR_NOTDIR, "NOTDIR" }, \
119c6d01c6fSTrond Myklebust 		{ -NFS4ERR_NOTEMPTY, "NOTEMPTY" }, \
120c6d01c6fSTrond Myklebust 		{ -NFS4ERR_NOTSUPP, "NOTSUPP" }, \
121c6d01c6fSTrond Myklebust 		{ -NFS4ERR_NOT_ONLY_OP, "NOT_ONLY_OP" }, \
122c6d01c6fSTrond Myklebust 		{ -NFS4ERR_NOT_SAME, "NOT_SAME" }, \
123c6d01c6fSTrond Myklebust 		{ -NFS4ERR_NO_GRACE, "NO_GRACE" }, \
124c6d01c6fSTrond Myklebust 		{ -NFS4ERR_NXIO, "NXIO" }, \
125c6d01c6fSTrond Myklebust 		{ -NFS4ERR_OLD_STATEID, "OLD_STATEID" }, \
126c6d01c6fSTrond Myklebust 		{ -NFS4ERR_OPENMODE, "OPENMODE" }, \
127c6d01c6fSTrond Myklebust 		{ -NFS4ERR_OP_ILLEGAL, "OP_ILLEGAL" }, \
128c6d01c6fSTrond Myklebust 		{ -NFS4ERR_OP_NOT_IN_SESSION, "OP_NOT_IN_SESSION" }, \
129c6d01c6fSTrond Myklebust 		{ -NFS4ERR_PERM, "PERM" }, \
130c6d01c6fSTrond Myklebust 		{ -NFS4ERR_PNFS_IO_HOLE, "PNFS_IO_HOLE" }, \
131c6d01c6fSTrond Myklebust 		{ -NFS4ERR_PNFS_NO_LAYOUT, "PNFS_NO_LAYOUT" }, \
132c6d01c6fSTrond Myklebust 		{ -NFS4ERR_RECALLCONFLICT, "RECALLCONFLICT" }, \
133c6d01c6fSTrond Myklebust 		{ -NFS4ERR_RECLAIM_BAD, "RECLAIM_BAD" }, \
134c6d01c6fSTrond Myklebust 		{ -NFS4ERR_RECLAIM_CONFLICT, "RECLAIM_CONFLICT" }, \
135c6d01c6fSTrond Myklebust 		{ -NFS4ERR_REJECT_DELEG, "REJECT_DELEG" }, \
136c6d01c6fSTrond Myklebust 		{ -NFS4ERR_REP_TOO_BIG, "REP_TOO_BIG" }, \
137c6d01c6fSTrond Myklebust 		{ -NFS4ERR_REP_TOO_BIG_TO_CACHE, \
138c6d01c6fSTrond Myklebust 			"REP_TOO_BIG_TO_CACHE" }, \
139c6d01c6fSTrond Myklebust 		{ -NFS4ERR_REQ_TOO_BIG, "REQ_TOO_BIG" }, \
140c6d01c6fSTrond Myklebust 		{ -NFS4ERR_RESOURCE, "RESOURCE" }, \
141c6d01c6fSTrond Myklebust 		{ -NFS4ERR_RESTOREFH, "RESTOREFH" }, \
142c6d01c6fSTrond Myklebust 		{ -NFS4ERR_RETRY_UNCACHED_REP, "RETRY_UNCACHED_REP" }, \
143c6d01c6fSTrond Myklebust 		{ -NFS4ERR_RETURNCONFLICT, "RETURNCONFLICT" }, \
144c6d01c6fSTrond Myklebust 		{ -NFS4ERR_ROFS, "ROFS" }, \
145c6d01c6fSTrond Myklebust 		{ -NFS4ERR_SAME, "SAME" }, \
146c6d01c6fSTrond Myklebust 		{ -NFS4ERR_SHARE_DENIED, "SHARE_DENIED" }, \
147c6d01c6fSTrond Myklebust 		{ -NFS4ERR_SEQUENCE_POS, "SEQUENCE_POS" }, \
148c6d01c6fSTrond Myklebust 		{ -NFS4ERR_SEQ_FALSE_RETRY, "SEQ_FALSE_RETRY" }, \
149c6d01c6fSTrond Myklebust 		{ -NFS4ERR_SEQ_MISORDERED, "SEQ_MISORDERED" }, \
150c6d01c6fSTrond Myklebust 		{ -NFS4ERR_SERVERFAULT, "SERVERFAULT" }, \
151c6d01c6fSTrond Myklebust 		{ -NFS4ERR_STALE, "STALE" }, \
152c6d01c6fSTrond Myklebust 		{ -NFS4ERR_STALE_CLIENTID, "STALE_CLIENTID" }, \
153c6d01c6fSTrond Myklebust 		{ -NFS4ERR_STALE_STATEID, "STALE_STATEID" }, \
154c6d01c6fSTrond Myklebust 		{ -NFS4ERR_SYMLINK, "SYMLINK" }, \
155c6d01c6fSTrond Myklebust 		{ -NFS4ERR_TOOSMALL, "TOOSMALL" }, \
156c6d01c6fSTrond Myklebust 		{ -NFS4ERR_TOO_MANY_OPS, "TOO_MANY_OPS" }, \
157c6d01c6fSTrond Myklebust 		{ -NFS4ERR_UNKNOWN_LAYOUTTYPE, "UNKNOWN_LAYOUTTYPE" }, \
158c6d01c6fSTrond Myklebust 		{ -NFS4ERR_UNSAFE_COMPOUND, "UNSAFE_COMPOUND" }, \
159c6d01c6fSTrond Myklebust 		{ -NFS4ERR_WRONGSEC, "WRONGSEC" }, \
160c6d01c6fSTrond Myklebust 		{ -NFS4ERR_WRONG_CRED, "WRONG_CRED" }, \
161c6d01c6fSTrond Myklebust 		{ -NFS4ERR_WRONG_TYPE, "WRONG_TYPE" }, \
162c6d01c6fSTrond Myklebust 		{ -NFS4ERR_XDEV, "XDEV" })
163c6d01c6fSTrond Myklebust 
16442113a75STrond Myklebust #define show_open_flags(flags) \
16542113a75STrond Myklebust 	__print_flags(flags, "|", \
16642113a75STrond Myklebust 		{ O_CREAT, "O_CREAT" }, \
16742113a75STrond Myklebust 		{ O_EXCL, "O_EXCL" }, \
16842113a75STrond Myklebust 		{ O_TRUNC, "O_TRUNC" }, \
16942113a75STrond Myklebust 		{ O_DIRECT, "O_DIRECT" })
17042113a75STrond Myklebust 
17142113a75STrond Myklebust #define show_fmode_flags(mode) \
17242113a75STrond Myklebust 	__print_flags(mode, "|", \
17342113a75STrond Myklebust 		{ ((__force unsigned long)FMODE_READ), "READ" }, \
17442113a75STrond Myklebust 		{ ((__force unsigned long)FMODE_WRITE), "WRITE" }, \
17542113a75STrond Myklebust 		{ ((__force unsigned long)FMODE_EXEC), "EXEC" })
17642113a75STrond Myklebust 
177c6d01c6fSTrond Myklebust DECLARE_EVENT_CLASS(nfs4_clientid_event,
178c6d01c6fSTrond Myklebust 		TP_PROTO(
179c6d01c6fSTrond Myklebust 			const struct nfs_client *clp,
180c6d01c6fSTrond Myklebust 			int error
181c6d01c6fSTrond Myklebust 		),
182c6d01c6fSTrond Myklebust 
183c6d01c6fSTrond Myklebust 		TP_ARGS(clp, error),
184c6d01c6fSTrond Myklebust 
185c6d01c6fSTrond Myklebust 		TP_STRUCT__entry(
186c6d01c6fSTrond Myklebust 			__string(dstaddr,
187c6d01c6fSTrond Myklebust 				rpc_peeraddr2str(clp->cl_rpcclient,
188c6d01c6fSTrond Myklebust 					RPC_DISPLAY_ADDR))
189c6d01c6fSTrond Myklebust 			__field(int, error)
190c6d01c6fSTrond Myklebust 		),
191c6d01c6fSTrond Myklebust 
192c6d01c6fSTrond Myklebust 		TP_fast_assign(
193c6d01c6fSTrond Myklebust 			__entry->error = error;
194c6d01c6fSTrond Myklebust 			__assign_str(dstaddr,
195c6d01c6fSTrond Myklebust 				rpc_peeraddr2str(clp->cl_rpcclient,
196c6d01c6fSTrond Myklebust 						RPC_DISPLAY_ADDR));
197c6d01c6fSTrond Myklebust 		),
198c6d01c6fSTrond Myklebust 
199c6d01c6fSTrond Myklebust 		TP_printk(
200c6d01c6fSTrond Myklebust 			"error=%d (%s) dstaddr=%s",
201c6d01c6fSTrond Myklebust 			__entry->error,
202c6d01c6fSTrond Myklebust 			show_nfsv4_errors(__entry->error),
203c6d01c6fSTrond Myklebust 			__get_str(dstaddr)
204c6d01c6fSTrond Myklebust 		)
205c6d01c6fSTrond Myklebust );
206c6d01c6fSTrond Myklebust #define DEFINE_NFS4_CLIENTID_EVENT(name) \
207c6d01c6fSTrond Myklebust 	DEFINE_EVENT(nfs4_clientid_event, name,	 \
208c6d01c6fSTrond Myklebust 			TP_PROTO( \
209c6d01c6fSTrond Myklebust 				const struct nfs_client *clp, \
210c6d01c6fSTrond Myklebust 				int error \
211c6d01c6fSTrond Myklebust 			), \
212c6d01c6fSTrond Myklebust 			TP_ARGS(clp, error))
213c6d01c6fSTrond Myklebust DEFINE_NFS4_CLIENTID_EVENT(nfs4_setclientid);
214c6d01c6fSTrond Myklebust DEFINE_NFS4_CLIENTID_EVENT(nfs4_setclientid_confirm);
215c6d01c6fSTrond Myklebust DEFINE_NFS4_CLIENTID_EVENT(nfs4_renew);
216c6d01c6fSTrond Myklebust DEFINE_NFS4_CLIENTID_EVENT(nfs4_renew_async);
217c6d01c6fSTrond Myklebust #ifdef CONFIG_NFS_V4_1
218c6d01c6fSTrond Myklebust DEFINE_NFS4_CLIENTID_EVENT(nfs4_exchange_id);
219c6d01c6fSTrond Myklebust DEFINE_NFS4_CLIENTID_EVENT(nfs4_create_session);
220c6d01c6fSTrond Myklebust DEFINE_NFS4_CLIENTID_EVENT(nfs4_destroy_session);
221c6d01c6fSTrond Myklebust DEFINE_NFS4_CLIENTID_EVENT(nfs4_destroy_clientid);
222c6d01c6fSTrond Myklebust DEFINE_NFS4_CLIENTID_EVENT(nfs4_bind_conn_to_session);
223c6d01c6fSTrond Myklebust DEFINE_NFS4_CLIENTID_EVENT(nfs4_sequence);
224c6d01c6fSTrond Myklebust DEFINE_NFS4_CLIENTID_EVENT(nfs4_reclaim_complete);
225c6d01c6fSTrond Myklebust #endif /* CONFIG_NFS_V4_1 */
226c6d01c6fSTrond Myklebust 
22742113a75STrond Myklebust DECLARE_EVENT_CLASS(nfs4_open_event,
22842113a75STrond Myklebust 		TP_PROTO(
22942113a75STrond Myklebust 			const struct nfs_open_context *ctx,
23042113a75STrond Myklebust 			int flags,
23142113a75STrond Myklebust 			int error
23242113a75STrond Myklebust 		),
23342113a75STrond Myklebust 
23442113a75STrond Myklebust 		TP_ARGS(ctx, flags, error),
23542113a75STrond Myklebust 
23642113a75STrond Myklebust 		TP_STRUCT__entry(
23742113a75STrond Myklebust 			__field(int, error)
23842113a75STrond Myklebust 			__field(unsigned int, flags)
23942113a75STrond Myklebust 			__field(unsigned int, fmode)
24042113a75STrond Myklebust 			__field(dev_t, dev)
24142113a75STrond Myklebust 			__field(u32, fhandle)
24242113a75STrond Myklebust 			__field(u64, fileid)
24342113a75STrond Myklebust 			__field(u64, dir)
24442113a75STrond Myklebust 			__string(name, ctx->dentry->d_name.name)
24542113a75STrond Myklebust 		),
24642113a75STrond Myklebust 
24742113a75STrond Myklebust 		TP_fast_assign(
24842113a75STrond Myklebust 			const struct nfs4_state *state = ctx->state;
24942113a75STrond Myklebust 			const struct inode *inode = NULL;
25042113a75STrond Myklebust 
25142113a75STrond Myklebust 			__entry->error = error;
25242113a75STrond Myklebust 			__entry->flags = flags;
25342113a75STrond Myklebust 			__entry->fmode = (__force unsigned int)ctx->mode;
25442113a75STrond Myklebust 			__entry->dev = ctx->dentry->d_sb->s_dev;
25542113a75STrond Myklebust 			if (!IS_ERR(state))
25642113a75STrond Myklebust 				inode = state->inode;
25742113a75STrond Myklebust 			if (inode != NULL) {
25842113a75STrond Myklebust 				__entry->fileid = NFS_FILEID(inode);
25942113a75STrond Myklebust 				__entry->fhandle = nfs_fhandle_hash(NFS_FH(inode));
26042113a75STrond Myklebust 			} else {
26142113a75STrond Myklebust 				__entry->fileid = 0;
26242113a75STrond Myklebust 				__entry->fhandle = 0;
26342113a75STrond Myklebust 			}
26442113a75STrond Myklebust 			__entry->dir = NFS_FILEID(ctx->dentry->d_parent->d_inode);
26542113a75STrond Myklebust 			__assign_str(name, ctx->dentry->d_name.name);
26642113a75STrond Myklebust 		),
26742113a75STrond Myklebust 
26842113a75STrond Myklebust 		TP_printk(
26942113a75STrond Myklebust 			"error=%d (%s) flags=%d (%s) fmode=%s "
27042113a75STrond Myklebust 			"fileid=%02x:%02x:%llu fhandle=0x%08x "
27142113a75STrond Myklebust 			"name=%02x:%02x:%llu/%s",
27242113a75STrond Myklebust 			 __entry->error,
27342113a75STrond Myklebust 			 show_nfsv4_errors(__entry->error),
27442113a75STrond Myklebust 			 __entry->flags,
27542113a75STrond Myklebust 			 show_open_flags(__entry->flags),
27642113a75STrond Myklebust 			 show_fmode_flags(__entry->fmode),
27742113a75STrond Myklebust 			 MAJOR(__entry->dev), MINOR(__entry->dev),
27842113a75STrond Myklebust 			 (unsigned long long)__entry->fileid,
27942113a75STrond Myklebust 			 __entry->fhandle,
28042113a75STrond Myklebust 			 MAJOR(__entry->dev), MINOR(__entry->dev),
28142113a75STrond Myklebust 			 (unsigned long long)__entry->dir,
28242113a75STrond Myklebust 			 __get_str(name)
28342113a75STrond Myklebust 		)
28442113a75STrond Myklebust );
28542113a75STrond Myklebust 
28642113a75STrond Myklebust #define DEFINE_NFS4_OPEN_EVENT(name) \
28742113a75STrond Myklebust 	DEFINE_EVENT(nfs4_open_event, name, \
28842113a75STrond Myklebust 			TP_PROTO( \
28942113a75STrond Myklebust 				const struct nfs_open_context *ctx, \
29042113a75STrond Myklebust 				int flags, \
29142113a75STrond Myklebust 				int error \
29242113a75STrond Myklebust 			), \
29342113a75STrond Myklebust 			TP_ARGS(ctx, flags, error))
29442113a75STrond Myklebust DEFINE_NFS4_OPEN_EVENT(nfs4_open_reclaim);
29542113a75STrond Myklebust DEFINE_NFS4_OPEN_EVENT(nfs4_open_expired);
29642113a75STrond Myklebust DEFINE_NFS4_OPEN_EVENT(nfs4_open_file);
29742113a75STrond Myklebust 
29842113a75STrond Myklebust TRACE_EVENT(nfs4_close,
29942113a75STrond Myklebust 		TP_PROTO(
30042113a75STrond Myklebust 			const struct nfs4_state *state,
30142113a75STrond Myklebust 			const struct nfs_closeargs *args,
30242113a75STrond Myklebust 			const struct nfs_closeres *res,
30342113a75STrond Myklebust 			int error
30442113a75STrond Myklebust 		),
30542113a75STrond Myklebust 
30642113a75STrond Myklebust 		TP_ARGS(state, args, res, error),
30742113a75STrond Myklebust 
30842113a75STrond Myklebust 		TP_STRUCT__entry(
30942113a75STrond Myklebust 			__field(dev_t, dev)
31042113a75STrond Myklebust 			__field(u32, fhandle)
31142113a75STrond Myklebust 			__field(u64, fileid)
31242113a75STrond Myklebust 			__field(unsigned int, fmode)
31342113a75STrond Myklebust 			__field(int, error)
31442113a75STrond Myklebust 		),
31542113a75STrond Myklebust 
31642113a75STrond Myklebust 		TP_fast_assign(
31742113a75STrond Myklebust 			const struct inode *inode = state->inode;
31842113a75STrond Myklebust 
31942113a75STrond Myklebust 			__entry->dev = inode->i_sb->s_dev;
32042113a75STrond Myklebust 			__entry->fileid = NFS_FILEID(inode);
32142113a75STrond Myklebust 			__entry->fhandle = nfs_fhandle_hash(NFS_FH(inode));
32242113a75STrond Myklebust 			__entry->fmode = (__force unsigned int)state->state;
32342113a75STrond Myklebust 			__entry->error = error;
32442113a75STrond Myklebust 		),
32542113a75STrond Myklebust 
32642113a75STrond Myklebust 		TP_printk(
32742113a75STrond Myklebust 			"error=%d (%s) fmode=%s fileid=%02x:%02x:%llu "
32842113a75STrond Myklebust 			"fhandle=0x%08x",
32942113a75STrond Myklebust 			__entry->error,
33042113a75STrond Myklebust 			show_nfsv4_errors(__entry->error),
33142113a75STrond Myklebust 			__entry->fmode ?  show_fmode_flags(__entry->fmode) :
33242113a75STrond Myklebust 					  "closed",
33342113a75STrond Myklebust 			MAJOR(__entry->dev), MINOR(__entry->dev),
33442113a75STrond Myklebust 			(unsigned long long)__entry->fileid,
33542113a75STrond Myklebust 			__entry->fhandle
33642113a75STrond Myklebust 		)
33742113a75STrond Myklebust );
33842113a75STrond Myklebust 
339d1b748a5STrond Myklebust #define show_lock_cmd(type) \
340d1b748a5STrond Myklebust 	__print_symbolic((int)type, \
341d1b748a5STrond Myklebust 		{ F_GETLK, "GETLK" }, \
342d1b748a5STrond Myklebust 		{ F_SETLK, "SETLK" }, \
343d1b748a5STrond Myklebust 		{ F_SETLKW, "SETLKW" })
344d1b748a5STrond Myklebust #define show_lock_type(type) \
345d1b748a5STrond Myklebust 	__print_symbolic((int)type, \
346d1b748a5STrond Myklebust 		{ F_RDLCK, "RDLCK" }, \
347d1b748a5STrond Myklebust 		{ F_WRLCK, "WRLCK" }, \
348d1b748a5STrond Myklebust 		{ F_UNLCK, "UNLCK" })
349d1b748a5STrond Myklebust 
350d1b748a5STrond Myklebust DECLARE_EVENT_CLASS(nfs4_lock_event,
351d1b748a5STrond Myklebust 		TP_PROTO(
352d1b748a5STrond Myklebust 			const struct file_lock *request,
353d1b748a5STrond Myklebust 			const struct nfs4_state *state,
354d1b748a5STrond Myklebust 			int cmd,
355d1b748a5STrond Myklebust 			int error
356d1b748a5STrond Myklebust 		),
357d1b748a5STrond Myklebust 
358d1b748a5STrond Myklebust 		TP_ARGS(request, state, cmd, error),
359d1b748a5STrond Myklebust 
360d1b748a5STrond Myklebust 		TP_STRUCT__entry(
361d1b748a5STrond Myklebust 			__field(int, error)
362d1b748a5STrond Myklebust 			__field(int, cmd)
363d1b748a5STrond Myklebust 			__field(char, type)
364d1b748a5STrond Myklebust 			__field(loff_t, start)
365d1b748a5STrond Myklebust 			__field(loff_t, end)
366d1b748a5STrond Myklebust 			__field(dev_t, dev)
367d1b748a5STrond Myklebust 			__field(u32, fhandle)
368d1b748a5STrond Myklebust 			__field(u64, fileid)
369d1b748a5STrond Myklebust 		),
370d1b748a5STrond Myklebust 
371d1b748a5STrond Myklebust 		TP_fast_assign(
372d1b748a5STrond Myklebust 			const struct inode *inode = state->inode;
373d1b748a5STrond Myklebust 
374d1b748a5STrond Myklebust 			__entry->error = error;
375d1b748a5STrond Myklebust 			__entry->cmd = cmd;
376d1b748a5STrond Myklebust 			__entry->type = request->fl_type;
377d1b748a5STrond Myklebust 			__entry->start = request->fl_start;
378d1b748a5STrond Myklebust 			__entry->end = request->fl_end;
379d1b748a5STrond Myklebust 			__entry->dev = inode->i_sb->s_dev;
380d1b748a5STrond Myklebust 			__entry->fileid = NFS_FILEID(inode);
381d1b748a5STrond Myklebust 			__entry->fhandle = nfs_fhandle_hash(NFS_FH(inode));
382d1b748a5STrond Myklebust 		),
383d1b748a5STrond Myklebust 
384d1b748a5STrond Myklebust 		TP_printk(
385d1b748a5STrond Myklebust 			"error=%d (%s) cmd=%s:%s range=%lld:%lld "
386d1b748a5STrond Myklebust 			"fileid=%02x:%02x:%llu fhandle=0x%08x",
387d1b748a5STrond Myklebust 			__entry->error,
388d1b748a5STrond Myklebust 			show_nfsv4_errors(__entry->error),
389d1b748a5STrond Myklebust 			show_lock_cmd(__entry->cmd),
390d1b748a5STrond Myklebust 			show_lock_type(__entry->type),
391d1b748a5STrond Myklebust 			(long long)__entry->start,
392d1b748a5STrond Myklebust 			(long long)__entry->end,
393d1b748a5STrond Myklebust 			MAJOR(__entry->dev), MINOR(__entry->dev),
394d1b748a5STrond Myklebust 			(unsigned long long)__entry->fileid,
395d1b748a5STrond Myklebust 			__entry->fhandle
396d1b748a5STrond Myklebust 		)
397d1b748a5STrond Myklebust );
398d1b748a5STrond Myklebust 
399d1b748a5STrond Myklebust #define DEFINE_NFS4_LOCK_EVENT(name) \
400d1b748a5STrond Myklebust 	DEFINE_EVENT(nfs4_lock_event, name, \
401d1b748a5STrond Myklebust 			TP_PROTO( \
402d1b748a5STrond Myklebust 				const struct file_lock *request, \
403d1b748a5STrond Myklebust 				const struct nfs4_state *state, \
404d1b748a5STrond Myklebust 				int cmd, \
405d1b748a5STrond Myklebust 				int error \
406d1b748a5STrond Myklebust 			), \
407d1b748a5STrond Myklebust 			TP_ARGS(request, state, cmd, error))
408d1b748a5STrond Myklebust DEFINE_NFS4_LOCK_EVENT(nfs4_get_lock);
409d1b748a5STrond Myklebust DEFINE_NFS4_LOCK_EVENT(nfs4_set_lock);
410d1b748a5STrond Myklebust DEFINE_NFS4_LOCK_EVENT(nfs4_lock_reclaim);
411d1b748a5STrond Myklebust DEFINE_NFS4_LOCK_EVENT(nfs4_lock_expired);
412d1b748a5STrond Myklebust DEFINE_NFS4_LOCK_EVENT(nfs4_unlock);
413d1b748a5STrond Myklebust 
414ca8acf8dSTrond Myklebust DECLARE_EVENT_CLASS(nfs4_set_delegation_event,
415ca8acf8dSTrond Myklebust 		TP_PROTO(
416ca8acf8dSTrond Myklebust 			const struct inode *inode,
417ca8acf8dSTrond Myklebust 			fmode_t fmode
418ca8acf8dSTrond Myklebust 		),
419ca8acf8dSTrond Myklebust 
420ca8acf8dSTrond Myklebust 		TP_ARGS(inode, fmode),
421ca8acf8dSTrond Myklebust 
422ca8acf8dSTrond Myklebust 		TP_STRUCT__entry(
423ca8acf8dSTrond Myklebust 			__field(dev_t, dev)
424ca8acf8dSTrond Myklebust 			__field(u32, fhandle)
425ca8acf8dSTrond Myklebust 			__field(u64, fileid)
426ca8acf8dSTrond Myklebust 			__field(unsigned int, fmode)
427ca8acf8dSTrond Myklebust 		),
428ca8acf8dSTrond Myklebust 
429ca8acf8dSTrond Myklebust 		TP_fast_assign(
430ca8acf8dSTrond Myklebust 			__entry->dev = inode->i_sb->s_dev;
431ca8acf8dSTrond Myklebust 			__entry->fileid = NFS_FILEID(inode);
432ca8acf8dSTrond Myklebust 			__entry->fhandle = nfs_fhandle_hash(NFS_FH(inode));
433ca8acf8dSTrond Myklebust 			__entry->fmode = (__force unsigned int)fmode;
434ca8acf8dSTrond Myklebust 		),
435ca8acf8dSTrond Myklebust 
436ca8acf8dSTrond Myklebust 		TP_printk(
437ca8acf8dSTrond Myklebust 			"fmode=%s fileid=%02x:%02x:%llu fhandle=0x%08x",
438ca8acf8dSTrond Myklebust 			show_fmode_flags(__entry->fmode),
439ca8acf8dSTrond Myklebust 			MAJOR(__entry->dev), MINOR(__entry->dev),
440ca8acf8dSTrond Myklebust 			(unsigned long long)__entry->fileid,
441ca8acf8dSTrond Myklebust 			__entry->fhandle
442ca8acf8dSTrond Myklebust 		)
443ca8acf8dSTrond Myklebust );
444ca8acf8dSTrond Myklebust #define DEFINE_NFS4_SET_DELEGATION_EVENT(name) \
445ca8acf8dSTrond Myklebust 	DEFINE_EVENT(nfs4_set_delegation_event, name, \
446ca8acf8dSTrond Myklebust 			TP_PROTO( \
447ca8acf8dSTrond Myklebust 				const struct inode *inode, \
448ca8acf8dSTrond Myklebust 				fmode_t fmode \
449ca8acf8dSTrond Myklebust 			), \
450ca8acf8dSTrond Myklebust 			TP_ARGS(inode, fmode))
451ca8acf8dSTrond Myklebust DEFINE_NFS4_SET_DELEGATION_EVENT(nfs4_set_delegation);
452ca8acf8dSTrond Myklebust DEFINE_NFS4_SET_DELEGATION_EVENT(nfs4_reclaim_delegation);
453ca8acf8dSTrond Myklebust 
454ca8acf8dSTrond Myklebust TRACE_EVENT(nfs4_delegreturn_exit,
455ca8acf8dSTrond Myklebust 		TP_PROTO(
456ca8acf8dSTrond Myklebust 			const struct nfs4_delegreturnargs *args,
457ca8acf8dSTrond Myklebust 			const struct nfs4_delegreturnres *res,
458ca8acf8dSTrond Myklebust 			int error
459ca8acf8dSTrond Myklebust 		),
460ca8acf8dSTrond Myklebust 
461ca8acf8dSTrond Myklebust 		TP_ARGS(args, res, error),
462ca8acf8dSTrond Myklebust 
463ca8acf8dSTrond Myklebust 		TP_STRUCT__entry(
464ca8acf8dSTrond Myklebust 			__field(dev_t, dev)
465ca8acf8dSTrond Myklebust 			__field(u32, fhandle)
466ca8acf8dSTrond Myklebust 			__field(int, error)
467ca8acf8dSTrond Myklebust 		),
468ca8acf8dSTrond Myklebust 
469ca8acf8dSTrond Myklebust 		TP_fast_assign(
470ca8acf8dSTrond Myklebust 			__entry->dev = res->server->s_dev;
471ca8acf8dSTrond Myklebust 			__entry->fhandle = nfs_fhandle_hash(args->fhandle);
472ca8acf8dSTrond Myklebust 			__entry->error = error;
473ca8acf8dSTrond Myklebust 		),
474ca8acf8dSTrond Myklebust 
475ca8acf8dSTrond Myklebust 		TP_printk(
476ca8acf8dSTrond Myklebust 			"error=%d (%s) dev=%02x:%02x fhandle=0x%08x",
477ca8acf8dSTrond Myklebust 			__entry->error,
478ca8acf8dSTrond Myklebust 			show_nfsv4_errors(__entry->error),
479ca8acf8dSTrond Myklebust 			MAJOR(__entry->dev), MINOR(__entry->dev),
480ca8acf8dSTrond Myklebust 			__entry->fhandle
481ca8acf8dSTrond Myklebust 		)
482ca8acf8dSTrond Myklebust );
483ca8acf8dSTrond Myklebust 
484078ea3dfSTrond Myklebust DECLARE_EVENT_CLASS(nfs4_lookup_event,
485078ea3dfSTrond Myklebust 		TP_PROTO(
486078ea3dfSTrond Myklebust 			const struct inode *dir,
487078ea3dfSTrond Myklebust 			const struct qstr *name,
488078ea3dfSTrond Myklebust 			int error
489078ea3dfSTrond Myklebust 		),
490078ea3dfSTrond Myklebust 
491078ea3dfSTrond Myklebust 		TP_ARGS(dir, name, error),
492078ea3dfSTrond Myklebust 
493078ea3dfSTrond Myklebust 		TP_STRUCT__entry(
494078ea3dfSTrond Myklebust 			__field(dev_t, dev)
495078ea3dfSTrond Myklebust 			__field(int, error)
496078ea3dfSTrond Myklebust 			__field(u64, dir)
497078ea3dfSTrond Myklebust 			__string(name, name->name)
498078ea3dfSTrond Myklebust 		),
499078ea3dfSTrond Myklebust 
500078ea3dfSTrond Myklebust 		TP_fast_assign(
501078ea3dfSTrond Myklebust 			__entry->dev = dir->i_sb->s_dev;
502078ea3dfSTrond Myklebust 			__entry->dir = NFS_FILEID(dir);
503078ea3dfSTrond Myklebust 			__entry->error = error;
504078ea3dfSTrond Myklebust 			__assign_str(name, name->name);
505078ea3dfSTrond Myklebust 		),
506078ea3dfSTrond Myklebust 
507078ea3dfSTrond Myklebust 		TP_printk(
508078ea3dfSTrond Myklebust 			"error=%d (%s) name=%02x:%02x:%llu/%s",
509078ea3dfSTrond Myklebust 			__entry->error,
510078ea3dfSTrond Myklebust 			show_nfsv4_errors(__entry->error),
511078ea3dfSTrond Myklebust 			MAJOR(__entry->dev), MINOR(__entry->dev),
512078ea3dfSTrond Myklebust 			(unsigned long long)__entry->dir,
513078ea3dfSTrond Myklebust 			__get_str(name)
514078ea3dfSTrond Myklebust 		)
515078ea3dfSTrond Myklebust );
516078ea3dfSTrond Myklebust 
517078ea3dfSTrond Myklebust #define DEFINE_NFS4_LOOKUP_EVENT(name) \
518078ea3dfSTrond Myklebust 	DEFINE_EVENT(nfs4_lookup_event, name, \
519078ea3dfSTrond Myklebust 			TP_PROTO( \
520078ea3dfSTrond Myklebust 				const struct inode *dir, \
521078ea3dfSTrond Myklebust 				const struct qstr *name, \
522078ea3dfSTrond Myklebust 				int error \
523078ea3dfSTrond Myklebust 			), \
524078ea3dfSTrond Myklebust 			TP_ARGS(dir, name, error))
525078ea3dfSTrond Myklebust 
526078ea3dfSTrond Myklebust DEFINE_NFS4_LOOKUP_EVENT(nfs4_lookup);
527078ea3dfSTrond Myklebust DEFINE_NFS4_LOOKUP_EVENT(nfs4_symlink);
528078ea3dfSTrond Myklebust DEFINE_NFS4_LOOKUP_EVENT(nfs4_mkdir);
529078ea3dfSTrond Myklebust DEFINE_NFS4_LOOKUP_EVENT(nfs4_mknod);
530078ea3dfSTrond Myklebust DEFINE_NFS4_LOOKUP_EVENT(nfs4_remove);
531078ea3dfSTrond Myklebust DEFINE_NFS4_LOOKUP_EVENT(nfs4_get_fs_locations);
532078ea3dfSTrond Myklebust DEFINE_NFS4_LOOKUP_EVENT(nfs4_secinfo);
533078ea3dfSTrond Myklebust 
534fbc6f7c2STrond Myklebust TRACE_EVENT(nfs4_rename,
535fbc6f7c2STrond Myklebust 		TP_PROTO(
536fbc6f7c2STrond Myklebust 			const struct inode *olddir,
537fbc6f7c2STrond Myklebust 			const struct qstr *oldname,
538fbc6f7c2STrond Myklebust 			const struct inode *newdir,
539fbc6f7c2STrond Myklebust 			const struct qstr *newname,
540fbc6f7c2STrond Myklebust 			int error
541fbc6f7c2STrond Myklebust 		),
542fbc6f7c2STrond Myklebust 
543fbc6f7c2STrond Myklebust 		TP_ARGS(olddir, oldname, newdir, newname, error),
544fbc6f7c2STrond Myklebust 
545fbc6f7c2STrond Myklebust 		TP_STRUCT__entry(
546fbc6f7c2STrond Myklebust 			__field(dev_t, dev)
547fbc6f7c2STrond Myklebust 			__field(int, error)
548fbc6f7c2STrond Myklebust 			__field(u64, olddir)
549fbc6f7c2STrond Myklebust 			__string(oldname, oldname->name)
550fbc6f7c2STrond Myklebust 			__field(u64, newdir)
551fbc6f7c2STrond Myklebust 			__string(newname, newname->name)
552fbc6f7c2STrond Myklebust 		),
553fbc6f7c2STrond Myklebust 
554fbc6f7c2STrond Myklebust 		TP_fast_assign(
555fbc6f7c2STrond Myklebust 			__entry->dev = olddir->i_sb->s_dev;
556fbc6f7c2STrond Myklebust 			__entry->olddir = NFS_FILEID(olddir);
557fbc6f7c2STrond Myklebust 			__entry->newdir = NFS_FILEID(newdir);
558fbc6f7c2STrond Myklebust 			__entry->error = error;
559fbc6f7c2STrond Myklebust 			__assign_str(oldname, oldname->name);
560fbc6f7c2STrond Myklebust 			__assign_str(newname, newname->name);
561fbc6f7c2STrond Myklebust 		),
562fbc6f7c2STrond Myklebust 
563fbc6f7c2STrond Myklebust 		TP_printk(
564fbc6f7c2STrond Myklebust 			"error=%d (%s) oldname=%02x:%02x:%llu/%s "
565fbc6f7c2STrond Myklebust 			"newname=%02x:%02x:%llu/%s",
566fbc6f7c2STrond Myklebust 			__entry->error,
567fbc6f7c2STrond Myklebust 			show_nfsv4_errors(__entry->error),
568fbc6f7c2STrond Myklebust 			MAJOR(__entry->dev), MINOR(__entry->dev),
569fbc6f7c2STrond Myklebust 			(unsigned long long)__entry->olddir,
570fbc6f7c2STrond Myklebust 			__get_str(oldname),
571fbc6f7c2STrond Myklebust 			MAJOR(__entry->dev), MINOR(__entry->dev),
572fbc6f7c2STrond Myklebust 			(unsigned long long)__entry->newdir,
573fbc6f7c2STrond Myklebust 			__get_str(newname)
574fbc6f7c2STrond Myklebust 		)
575fbc6f7c2STrond Myklebust );
576fbc6f7c2STrond Myklebust 
577c1578b76STrond Myklebust DECLARE_EVENT_CLASS(nfs4_inode_event,
578c1578b76STrond Myklebust 		TP_PROTO(
579c1578b76STrond Myklebust 			const struct inode *inode,
580c1578b76STrond Myklebust 			int error
581c1578b76STrond Myklebust 		),
582c1578b76STrond Myklebust 
583c1578b76STrond Myklebust 		TP_ARGS(inode, error),
584c1578b76STrond Myklebust 
585c1578b76STrond Myklebust 		TP_STRUCT__entry(
586c1578b76STrond Myklebust 			__field(dev_t, dev)
587c1578b76STrond Myklebust 			__field(u32, fhandle)
588c1578b76STrond Myklebust 			__field(u64, fileid)
589c1578b76STrond Myklebust 			__field(int, error)
590c1578b76STrond Myklebust 		),
591c1578b76STrond Myklebust 
592c1578b76STrond Myklebust 		TP_fast_assign(
593c1578b76STrond Myklebust 			__entry->dev = inode->i_sb->s_dev;
594c1578b76STrond Myklebust 			__entry->fileid = NFS_FILEID(inode);
595c1578b76STrond Myklebust 			__entry->fhandle = nfs_fhandle_hash(NFS_FH(inode));
596c1578b76STrond Myklebust 			__entry->error = error;
597c1578b76STrond Myklebust 		),
598c1578b76STrond Myklebust 
599c1578b76STrond Myklebust 		TP_printk(
600c1578b76STrond Myklebust 			"error=%d (%s) fileid=%02x:%02x:%llu fhandle=0x%08x",
601c1578b76STrond Myklebust 			__entry->error,
602c1578b76STrond Myklebust 			show_nfsv4_errors(__entry->error),
603c1578b76STrond Myklebust 			MAJOR(__entry->dev), MINOR(__entry->dev),
604c1578b76STrond Myklebust 			(unsigned long long)__entry->fileid,
605c1578b76STrond Myklebust 			__entry->fhandle
606c1578b76STrond Myklebust 		)
607c1578b76STrond Myklebust );
608c1578b76STrond Myklebust 
609c1578b76STrond Myklebust #define DEFINE_NFS4_INODE_EVENT(name) \
610c1578b76STrond Myklebust 	DEFINE_EVENT(nfs4_inode_event, name, \
611c1578b76STrond Myklebust 			TP_PROTO( \
612c1578b76STrond Myklebust 				const struct inode *inode, \
613c1578b76STrond Myklebust 				int error \
614c1578b76STrond Myklebust 			), \
615c1578b76STrond Myklebust 			TP_ARGS(inode, error))
616c1578b76STrond Myklebust 
617c1578b76STrond Myklebust DEFINE_NFS4_INODE_EVENT(nfs4_setattr);
618c1578b76STrond Myklebust DEFINE_NFS4_INODE_EVENT(nfs4_access);
619c1578b76STrond Myklebust DEFINE_NFS4_INODE_EVENT(nfs4_readlink);
620c1578b76STrond Myklebust DEFINE_NFS4_INODE_EVENT(nfs4_readdir);
621c1578b76STrond Myklebust DEFINE_NFS4_INODE_EVENT(nfs4_get_acl);
622c1578b76STrond Myklebust DEFINE_NFS4_INODE_EVENT(nfs4_set_acl);
623c1578b76STrond Myklebust #ifdef CONFIG_NFS_V4_SECURITY_LABEL
624c1578b76STrond Myklebust DEFINE_NFS4_INODE_EVENT(nfs4_get_security_label);
625c1578b76STrond Myklebust DEFINE_NFS4_INODE_EVENT(nfs4_set_security_label);
626c1578b76STrond Myklebust #endif /* CONFIG_NFS_V4_SECURITY_LABEL */
627ca8acf8dSTrond Myklebust DEFINE_NFS4_INODE_EVENT(nfs4_recall_delegation);
628ca8acf8dSTrond Myklebust DEFINE_NFS4_INODE_EVENT(nfs4_delegreturn);
629c1578b76STrond Myklebust 
630c6d01c6fSTrond Myklebust #endif /* _TRACE_NFS4_H */
631c6d01c6fSTrond Myklebust 
632c6d01c6fSTrond Myklebust #undef TRACE_INCLUDE_PATH
633c6d01c6fSTrond Myklebust #define TRACE_INCLUDE_PATH .
634c6d01c6fSTrond Myklebust #define TRACE_INCLUDE_FILE nfs4trace
635c6d01c6fSTrond Myklebust /* This part must be outside protection */
636c6d01c6fSTrond Myklebust #include <trace/define_trace.h>
637