aboutsummaryrefslogtreecommitdiffstats
path: root/include/trace
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2013-09-09 12:19:15 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2013-09-09 12:19:15 -0400
commitbf97293eb878df3792d9de7213bd7b82135aea77 (patch)
tree16cb367bd78095b9eb8a54c800fcddfcccb618c7 /include/trace
parent16d70e15295953b19ecf59e943723a181782b856 (diff)
parentb1b3e136948a2bf4915326acb0d825d7d180753f (diff)
Merge tag 'nfs-for-3.12-1' of git://git.linux-nfs.org/projects/trondmy/linux-nfs
Pull NFS client updates from Trond Myklebust: "Highlights include: - Fix NFSv4 recovery so that it doesn't recover lost locks in cases such as lease loss due to a network partition, where doing so may result in data corruption. Add a kernel parameter to control choice of legacy behaviour or not. - Performance improvements when 2 processes are writing to the same file. - Flush data to disk when an RPCSEC_GSS session timeout is imminent. - Implement NFSv4.1 SP4_MACH_CRED state protection to prevent other NFS clients from being able to manipulate our lease and file locking state. - Allow sharing of RPCSEC_GSS caches between different rpc clients. - Fix the broken NFSv4 security auto-negotiation between client and server. - Fix rmdir() to wait for outstanding sillyrename unlinks to complete - Add a tracepoint framework for debugging NFSv4 state recovery issues. - Add tracing to the generic NFS layer. - Add tracing for the SUNRPC socket connection state. - Clean up the rpc_pipefs mount/umount event management. - Merge more patches from Chuck in preparation for NFSv4 migration support" * tag 'nfs-for-3.12-1' of git://git.linux-nfs.org/projects/trondmy/linux-nfs: (107 commits) NFSv4: use mach cred for SECINFO_NO_NAME w/ integrity NFS: nfs_compare_super shouldn't check the auth flavour unless 'sec=' was set NFSv4: Allow security autonegotiation for submounts NFSv4: Disallow security negotiation for lookups when 'sec=' is specified NFSv4: Fix security auto-negotiation NFS: Clean up nfs_parse_security_flavors() NFS: Clean up the auth flavour array mess NFSv4.1 Use MDS auth flavor for data server connection NFS: Don't check lock owner compatability unless file is locked (part 2) NFS: Don't check lock owner compatibility in writes unless file is locked nfs4: Map NFS4ERR_WRONG_CRED to EPERM nfs4.1: Add SP4_MACH_CRED write and commit support nfs4.1: Add SP4_MACH_CRED stateid support nfs4.1: Add SP4_MACH_CRED secinfo support nfs4.1: Add SP4_MACH_CRED cleanup support nfs4.1: Add state protection handler nfs4.1: Minimal SP4_MACH_CRED implementation SUNRPC: Replace pointer values with task->tk_pid and rpc_clnt->cl_clid SUNRPC: Add an identifier for struct rpc_clnt SUNRPC: Ensure rpc_task->tk_pid is available for tracepoints ...
Diffstat (limited to 'include/trace')
-rw-r--r--include/trace/events/sunrpc.h181
1 files changed, 157 insertions, 24 deletions
diff --git a/include/trace/events/sunrpc.h b/include/trace/events/sunrpc.h
index 43be87d5dd58..d51d16c7afd8 100644
--- a/include/trace/events/sunrpc.h
+++ b/include/trace/events/sunrpc.h
@@ -6,6 +6,8 @@
6 6
7#include <linux/sunrpc/sched.h> 7#include <linux/sunrpc/sched.h>
8#include <linux/sunrpc/clnt.h> 8#include <linux/sunrpc/clnt.h>
9#include <net/tcp_states.h>
10#include <linux/net.h>
9#include <linux/tracepoint.h> 11#include <linux/tracepoint.h>
10 12
11DECLARE_EVENT_CLASS(rpc_task_status, 13DECLARE_EVENT_CLASS(rpc_task_status,
@@ -15,18 +17,20 @@ DECLARE_EVENT_CLASS(rpc_task_status,
15 TP_ARGS(task), 17 TP_ARGS(task),
16 18
17 TP_STRUCT__entry( 19 TP_STRUCT__entry(
18 __field(const struct rpc_task *, task) 20 __field(unsigned int, task_id)
19 __field(const struct rpc_clnt *, clnt) 21 __field(unsigned int, client_id)
20 __field(int, status) 22 __field(int, status)
21 ), 23 ),
22 24
23 TP_fast_assign( 25 TP_fast_assign(
24 __entry->task = task; 26 __entry->task_id = task->tk_pid;
25 __entry->clnt = task->tk_client; 27 __entry->client_id = task->tk_client->cl_clid;
26 __entry->status = task->tk_status; 28 __entry->status = task->tk_status;
27 ), 29 ),
28 30
29 TP_printk("task:%p@%p, status %d",__entry->task, __entry->clnt, __entry->status) 31 TP_printk("task:%u@%u, status %d",
32 __entry->task_id, __entry->client_id,
33 __entry->status)
30); 34);
31 35
32DEFINE_EVENT(rpc_task_status, rpc_call_status, 36DEFINE_EVENT(rpc_task_status, rpc_call_status,
@@ -47,18 +51,20 @@ TRACE_EVENT(rpc_connect_status,
47 TP_ARGS(task, status), 51 TP_ARGS(task, status),
48 52
49 TP_STRUCT__entry( 53 TP_STRUCT__entry(
50 __field(const struct rpc_task *, task) 54 __field(unsigned int, task_id)
51 __field(const struct rpc_clnt *, clnt) 55 __field(unsigned int, client_id)
52 __field(int, status) 56 __field(int, status)
53 ), 57 ),
54 58
55 TP_fast_assign( 59 TP_fast_assign(
56 __entry->task = task; 60 __entry->task_id = task->tk_pid;
57 __entry->clnt = task->tk_client; 61 __entry->client_id = task->tk_client->cl_clid;
58 __entry->status = status; 62 __entry->status = status;
59 ), 63 ),
60 64
61 TP_printk("task:%p@%p, status %d",__entry->task, __entry->clnt, __entry->status) 65 TP_printk("task:%u@%u, status %d",
66 __entry->task_id, __entry->client_id,
67 __entry->status)
62); 68);
63 69
64DECLARE_EVENT_CLASS(rpc_task_running, 70DECLARE_EVENT_CLASS(rpc_task_running,
@@ -68,8 +74,8 @@ DECLARE_EVENT_CLASS(rpc_task_running,
68 TP_ARGS(clnt, task, action), 74 TP_ARGS(clnt, task, action),
69 75
70 TP_STRUCT__entry( 76 TP_STRUCT__entry(
71 __field(const struct rpc_clnt *, clnt) 77 __field(unsigned int, task_id)
72 __field(const struct rpc_task *, task) 78 __field(unsigned int, client_id)
73 __field(const void *, action) 79 __field(const void *, action)
74 __field(unsigned long, runstate) 80 __field(unsigned long, runstate)
75 __field(int, status) 81 __field(int, status)
@@ -77,17 +83,16 @@ DECLARE_EVENT_CLASS(rpc_task_running,
77 ), 83 ),
78 84
79 TP_fast_assign( 85 TP_fast_assign(
80 __entry->clnt = clnt; 86 __entry->client_id = clnt->cl_clid;
81 __entry->task = task; 87 __entry->task_id = task->tk_pid;
82 __entry->action = action; 88 __entry->action = action;
83 __entry->runstate = task->tk_runstate; 89 __entry->runstate = task->tk_runstate;
84 __entry->status = task->tk_status; 90 __entry->status = task->tk_status;
85 __entry->flags = task->tk_flags; 91 __entry->flags = task->tk_flags;
86 ), 92 ),
87 93
88 TP_printk("task:%p@%p flags=%4.4x state=%4.4lx status=%d action=%pf", 94 TP_printk("task:%u@%u flags=%4.4x state=%4.4lx status=%d action=%pf",
89 __entry->task, 95 __entry->task_id, __entry->client_id,
90 __entry->clnt,
91 __entry->flags, 96 __entry->flags,
92 __entry->runstate, 97 __entry->runstate,
93 __entry->status, 98 __entry->status,
@@ -126,8 +131,8 @@ DECLARE_EVENT_CLASS(rpc_task_queued,
126 TP_ARGS(clnt, task, q), 131 TP_ARGS(clnt, task, q),
127 132
128 TP_STRUCT__entry( 133 TP_STRUCT__entry(
129 __field(const struct rpc_clnt *, clnt) 134 __field(unsigned int, task_id)
130 __field(const struct rpc_task *, task) 135 __field(unsigned int, client_id)
131 __field(unsigned long, timeout) 136 __field(unsigned long, timeout)
132 __field(unsigned long, runstate) 137 __field(unsigned long, runstate)
133 __field(int, status) 138 __field(int, status)
@@ -136,8 +141,8 @@ DECLARE_EVENT_CLASS(rpc_task_queued,
136 ), 141 ),
137 142
138 TP_fast_assign( 143 TP_fast_assign(
139 __entry->clnt = clnt; 144 __entry->client_id = clnt->cl_clid;
140 __entry->task = task; 145 __entry->task_id = task->tk_pid;
141 __entry->timeout = task->tk_timeout; 146 __entry->timeout = task->tk_timeout;
142 __entry->runstate = task->tk_runstate; 147 __entry->runstate = task->tk_runstate;
143 __entry->status = task->tk_status; 148 __entry->status = task->tk_status;
@@ -145,9 +150,8 @@ DECLARE_EVENT_CLASS(rpc_task_queued,
145 __assign_str(q_name, rpc_qname(q)); 150 __assign_str(q_name, rpc_qname(q));
146 ), 151 ),
147 152
148 TP_printk("task:%p@%p flags=%4.4x state=%4.4lx status=%d timeout=%lu queue=%s", 153 TP_printk("task:%u@%u flags=%4.4x state=%4.4lx status=%d timeout=%lu queue=%s",
149 __entry->task, 154 __entry->task_id, __entry->client_id,
150 __entry->clnt,
151 __entry->flags, 155 __entry->flags,
152 __entry->runstate, 156 __entry->runstate,
153 __entry->status, 157 __entry->status,
@@ -172,6 +176,135 @@ DEFINE_EVENT(rpc_task_queued, rpc_task_wakeup,
172 176
173); 177);
174 178
179#define rpc_show_socket_state(state) \
180 __print_symbolic(state, \
181 { SS_FREE, "FREE" }, \
182 { SS_UNCONNECTED, "UNCONNECTED" }, \
183 { SS_CONNECTING, "CONNECTING," }, \
184 { SS_CONNECTED, "CONNECTED," }, \
185 { SS_DISCONNECTING, "DISCONNECTING" })
186
187#define rpc_show_sock_state(state) \
188 __print_symbolic(state, \
189 { TCP_ESTABLISHED, "ESTABLISHED" }, \
190 { TCP_SYN_SENT, "SYN_SENT" }, \
191 { TCP_SYN_RECV, "SYN_RECV" }, \
192 { TCP_FIN_WAIT1, "FIN_WAIT1" }, \
193 { TCP_FIN_WAIT2, "FIN_WAIT2" }, \
194 { TCP_TIME_WAIT, "TIME_WAIT" }, \
195 { TCP_CLOSE, "CLOSE" }, \
196 { TCP_CLOSE_WAIT, "CLOSE_WAIT" }, \
197 { TCP_LAST_ACK, "LAST_ACK" }, \
198 { TCP_LISTEN, "LISTEN" }, \
199 { TCP_CLOSING, "CLOSING" })
200
201DECLARE_EVENT_CLASS(xs_socket_event,
202
203 TP_PROTO(
204 struct rpc_xprt *xprt,
205 struct socket *socket
206 ),
207
208 TP_ARGS(xprt, socket),
209
210 TP_STRUCT__entry(
211 __field(unsigned int, socket_state)
212 __field(unsigned int, sock_state)
213 __field(unsigned long long, ino)
214 __string(dstaddr,
215 xprt->address_strings[RPC_DISPLAY_ADDR])
216 __string(dstport,
217 xprt->address_strings[RPC_DISPLAY_PORT])
218 ),
219
220 TP_fast_assign(
221 struct inode *inode = SOCK_INODE(socket);
222 __entry->socket_state = socket->state;
223 __entry->sock_state = socket->sk->sk_state;
224 __entry->ino = (unsigned long long)inode->i_ino;
225 __assign_str(dstaddr,
226 xprt->address_strings[RPC_DISPLAY_ADDR]);
227 __assign_str(dstport,
228 xprt->address_strings[RPC_DISPLAY_PORT]);
229 ),
230
231 TP_printk(
232 "socket:[%llu] dstaddr=%s/%s "
233 "state=%u (%s) sk_state=%u (%s)",
234 __entry->ino, __get_str(dstaddr), __get_str(dstport),
235 __entry->socket_state,
236 rpc_show_socket_state(__entry->socket_state),
237 __entry->sock_state,
238 rpc_show_sock_state(__entry->sock_state)
239 )
240);
241#define DEFINE_RPC_SOCKET_EVENT(name) \
242 DEFINE_EVENT(xs_socket_event, name, \
243 TP_PROTO( \
244 struct rpc_xprt *xprt, \
245 struct socket *socket \
246 ), \
247 TP_ARGS(xprt, socket))
248
249DECLARE_EVENT_CLASS(xs_socket_event_done,
250
251 TP_PROTO(
252 struct rpc_xprt *xprt,
253 struct socket *socket,
254 int error
255 ),
256
257 TP_ARGS(xprt, socket, error),
258
259 TP_STRUCT__entry(
260 __field(int, error)
261 __field(unsigned int, socket_state)
262 __field(unsigned int, sock_state)
263 __field(unsigned long long, ino)
264 __string(dstaddr,
265 xprt->address_strings[RPC_DISPLAY_ADDR])
266 __string(dstport,
267 xprt->address_strings[RPC_DISPLAY_PORT])
268 ),
269
270 TP_fast_assign(
271 struct inode *inode = SOCK_INODE(socket);
272 __entry->socket_state = socket->state;
273 __entry->sock_state = socket->sk->sk_state;
274 __entry->ino = (unsigned long long)inode->i_ino;
275 __entry->error = error;
276 __assign_str(dstaddr,
277 xprt->address_strings[RPC_DISPLAY_ADDR]);
278 __assign_str(dstport,
279 xprt->address_strings[RPC_DISPLAY_PORT]);
280 ),
281
282 TP_printk(
283 "error=%d socket:[%llu] dstaddr=%s/%s "
284 "state=%u (%s) sk_state=%u (%s)",
285 __entry->error,
286 __entry->ino, __get_str(dstaddr), __get_str(dstport),
287 __entry->socket_state,
288 rpc_show_socket_state(__entry->socket_state),
289 __entry->sock_state,
290 rpc_show_sock_state(__entry->sock_state)
291 )
292);
293#define DEFINE_RPC_SOCKET_EVENT_DONE(name) \
294 DEFINE_EVENT(xs_socket_event_done, name, \
295 TP_PROTO( \
296 struct rpc_xprt *xprt, \
297 struct socket *socket, \
298 int error \
299 ), \
300 TP_ARGS(xprt, socket, error))
301
302DEFINE_RPC_SOCKET_EVENT(rpc_socket_state_change);
303DEFINE_RPC_SOCKET_EVENT_DONE(rpc_socket_connect);
304DEFINE_RPC_SOCKET_EVENT_DONE(rpc_socket_reset_connection);
305DEFINE_RPC_SOCKET_EVENT(rpc_socket_close);
306DEFINE_RPC_SOCKET_EVENT(rpc_socket_shutdown);
307
175#endif /* _TRACE_SUNRPC_H */ 308#endif /* _TRACE_SUNRPC_H */
176 309
177#include <trace/define_trace.h> 310#include <trace/define_trace.h>