diff options
author | Jeff Layton <jlayton@primarydata.com> | 2014-10-28 14:24:14 -0400 |
---|---|---|
committer | Trond Myklebust <trond.myklebust@primarydata.com> | 2014-11-24 12:53:35 -0500 |
commit | 1a867a0898b2e366a1eb5b7fe21413a2b2b1629f (patch) | |
tree | 854b8e2516a0b2545414cd9cc00eeda7900dc052 /include/trace | |
parent | 3705ad64f123271b2b88dbff0c9891b7b90299d2 (diff) |
sunrpc: add tracepoints in xs_tcp_data_recv
Add tracepoints inside the main loop on xs_tcp_data_recv that allow
us to keep an eye on what's happening during each phase of it.
Signed-off-by: Jeff Layton <jlayton@primarydata.com>
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Diffstat (limited to 'include/trace')
-rw-r--r-- | include/trace/events/sunrpc.h | 44 |
1 files changed, 43 insertions, 1 deletions
diff --git a/include/trace/events/sunrpc.h b/include/trace/events/sunrpc.h index 5edb16bcd836..171ca4ff6d99 100644 --- a/include/trace/events/sunrpc.h +++ b/include/trace/events/sunrpc.h | |||
@@ -7,6 +7,7 @@ | |||
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 <linux/sunrpc/svc.h> | 9 | #include <linux/sunrpc/svc.h> |
10 | #include <linux/sunrpc/xprtsock.h> | ||
10 | #include <net/tcp_states.h> | 11 | #include <net/tcp_states.h> |
11 | #include <linux/net.h> | 12 | #include <linux/net.h> |
12 | #include <linux/tracepoint.h> | 13 | #include <linux/tracepoint.h> |
@@ -326,7 +327,7 @@ DECLARE_EVENT_CLASS(rpc_xprt_event, | |||
326 | __assign_str(port, xprt->address_strings[RPC_DISPLAY_PORT]); | 327 | __assign_str(port, xprt->address_strings[RPC_DISPLAY_PORT]); |
327 | ), | 328 | ), |
328 | 329 | ||
329 | TP_printk("peer=%s/%s xid=0x%x status=%d", __get_str(addr), | 330 | TP_printk("peer=[%s]:%s xid=0x%x status=%d", __get_str(addr), |
330 | __get_str(port), be32_to_cpu(__entry->xid), | 331 | __get_str(port), be32_to_cpu(__entry->xid), |
331 | __entry->status) | 332 | __entry->status) |
332 | ); | 333 | ); |
@@ -370,6 +371,47 @@ TRACE_EVENT(xs_tcp_data_ready, | |||
370 | __get_str(port), __entry->err, __entry->total) | 371 | __get_str(port), __entry->err, __entry->total) |
371 | ); | 372 | ); |
372 | 373 | ||
374 | #define rpc_show_sock_xprt_flags(flags) \ | ||
375 | __print_flags(flags, "|", \ | ||
376 | { TCP_RCV_LAST_FRAG, "TCP_RCV_LAST_FRAG" }, \ | ||
377 | { TCP_RCV_COPY_FRAGHDR, "TCP_RCV_COPY_FRAGHDR" }, \ | ||
378 | { TCP_RCV_COPY_XID, "TCP_RCV_COPY_XID" }, \ | ||
379 | { TCP_RCV_COPY_DATA, "TCP_RCV_COPY_DATA" }, \ | ||
380 | { TCP_RCV_READ_CALLDIR, "TCP_RCV_READ_CALLDIR" }, \ | ||
381 | { TCP_RCV_COPY_CALLDIR, "TCP_RCV_COPY_CALLDIR" }, \ | ||
382 | { TCP_RPC_REPLY, "TCP_RPC_REPLY" }) | ||
383 | |||
384 | TRACE_EVENT(xs_tcp_data_recv, | ||
385 | TP_PROTO(struct sock_xprt *xs), | ||
386 | |||
387 | TP_ARGS(xs), | ||
388 | |||
389 | TP_STRUCT__entry( | ||
390 | __string(addr, xs->xprt.address_strings[RPC_DISPLAY_ADDR]) | ||
391 | __string(port, xs->xprt.address_strings[RPC_DISPLAY_PORT]) | ||
392 | __field(__be32, xid) | ||
393 | __field(unsigned long, flags) | ||
394 | __field(unsigned long, copied) | ||
395 | __field(unsigned int, reclen) | ||
396 | __field(unsigned long, offset) | ||
397 | ), | ||
398 | |||
399 | TP_fast_assign( | ||
400 | __assign_str(addr, xs->xprt.address_strings[RPC_DISPLAY_ADDR]); | ||
401 | __assign_str(port, xs->xprt.address_strings[RPC_DISPLAY_PORT]); | ||
402 | __entry->xid = xs->tcp_xid; | ||
403 | __entry->flags = xs->tcp_flags; | ||
404 | __entry->copied = xs->tcp_copied; | ||
405 | __entry->reclen = xs->tcp_reclen; | ||
406 | __entry->offset = xs->tcp_offset; | ||
407 | ), | ||
408 | |||
409 | TP_printk("peer=[%s]:%s xid=0x%x flags=%s copied=%lu reclen=%u offset=%lu", | ||
410 | __get_str(addr), __get_str(port), be32_to_cpu(__entry->xid), | ||
411 | rpc_show_sock_xprt_flags(__entry->flags), | ||
412 | __entry->copied, __entry->reclen, __entry->offset) | ||
413 | ); | ||
414 | |||
373 | TRACE_EVENT(svc_recv, | 415 | TRACE_EVENT(svc_recv, |
374 | TP_PROTO(struct svc_rqst *rqst, int status), | 416 | TP_PROTO(struct svc_rqst *rqst, int status), |
375 | 417 | ||