xprtrdma: Refine trace_xprtrdma_fixup
authorChuck Lever <chuck.lever@oracle.com>
Wed, 23 Oct 2019 14:02:03 +0000 (10:02 -0400)
committerAnna Schumaker <Anna.Schumaker@Netapp.com>
Thu, 24 Oct 2019 14:30:40 +0000 (10:30 -0400)
Slightly reduce overhead and display more useful information.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
include/trace/events/rpcrdma.h
net/sunrpc/xprtrdma/rpc_rdma.c

index 99e3c61609b2441c96c5392ce313cc3ebedc7dbb..542177c5896fb652abdefc54f202676a676fc6d2 100644 (file)
@@ -1084,66 +1084,32 @@ DEFINE_REPLY_EVENT(xprtrdma_reply_hdr);
 TRACE_EVENT(xprtrdma_fixup,
        TP_PROTO(
                const struct rpc_rqst *rqst,
-               int len,
-               int hdrlen
+               unsigned long fixup
        ),
 
-       TP_ARGS(rqst, len, hdrlen),
+       TP_ARGS(rqst, fixup),
 
        TP_STRUCT__entry(
                __field(unsigned int, task_id)
                __field(unsigned int, client_id)
-               __field(const void *, base)
-               __field(int, len)
-               __field(int, hdrlen)
-       ),
-
-       TP_fast_assign(
-               __entry->task_id = rqst->rq_task->tk_pid;
-               __entry->client_id = rqst->rq_task->tk_client->cl_clid;
-               __entry->base = rqst->rq_rcv_buf.head[0].iov_base;
-               __entry->len = len;
-               __entry->hdrlen = hdrlen;
-       ),
-
-       TP_printk("task:%u@%u base=%p len=%d hdrlen=%d",
-               __entry->task_id, __entry->client_id,
-               __entry->base, __entry->len, __entry->hdrlen
-       )
-);
-
-TRACE_EVENT(xprtrdma_fixup_pg,
-       TP_PROTO(
-               const struct rpc_rqst *rqst,
-               int pageno,
-               const void *pos,
-               int len,
-               int curlen
-       ),
-
-       TP_ARGS(rqst, pageno, pos, len, curlen),
-
-       TP_STRUCT__entry(
-               __field(unsigned int, task_id)
-               __field(unsigned int, client_id)
-               __field(const void *, pos)
-               __field(int, pageno)
-               __field(int, len)
-               __field(int, curlen)
+               __field(unsigned long, fixup)
+               __field(size_t, headlen)
+               __field(unsigned int, pagelen)
+               __field(size_t, taillen)
        ),
 
        TP_fast_assign(
                __entry->task_id = rqst->rq_task->tk_pid;
                __entry->client_id = rqst->rq_task->tk_client->cl_clid;
-               __entry->pos = pos;
-               __entry->pageno = pageno;
-               __entry->len = len;
-               __entry->curlen = curlen;
+               __entry->fixup = fixup;
+               __entry->headlen = rqst->rq_rcv_buf.head[0].iov_len;
+               __entry->pagelen = rqst->rq_rcv_buf.page_len;
+               __entry->taillen = rqst->rq_rcv_buf.tail[0].iov_len;
        ),
 
-       TP_printk("task:%u@%u pageno=%d pos=%p len=%d curlen=%d",
-               __entry->task_id, __entry->client_id,
-               __entry->pageno, __entry->pos, __entry->len, __entry->curlen
+       TP_printk("task:%u@%u fixup=%lu xdr=%zu/%u/%zu",
+               __entry->task_id, __entry->client_id, __entry->fixup,
+               __entry->headlen, __entry->pagelen, __entry->taillen
        )
 );
 
index 4ad88893e9641a5fed986add6aaa35716eeb5194..26d334c83b3861a637916874973aab5cf0a12df8 100644 (file)
@@ -1086,7 +1086,6 @@ rpcrdma_inline_fixup(struct rpc_rqst *rqst, char *srcp, int copy_len, int pad)
        curlen = rqst->rq_rcv_buf.head[0].iov_len;
        if (curlen > copy_len)
                curlen = copy_len;
-       trace_xprtrdma_fixup(rqst, copy_len, curlen);
        srcp += curlen;
        copy_len -= curlen;
 
@@ -1106,8 +1105,6 @@ rpcrdma_inline_fixup(struct rpc_rqst *rqst, char *srcp, int copy_len, int pad)
                        if (curlen > pagelist_len)
                                curlen = pagelist_len;
 
-                       trace_xprtrdma_fixup_pg(rqst, i, srcp,
-                                               copy_len, curlen);
                        destp = kmap_atomic(ppages[i]);
                        memcpy(destp + page_base, srcp, curlen);
                        flush_dcache_page(ppages[i]);
@@ -1139,6 +1136,8 @@ rpcrdma_inline_fixup(struct rpc_rqst *rqst, char *srcp, int copy_len, int pad)
                rqst->rq_private_buf.tail[0].iov_base = srcp;
        }
 
+       if (fixup_copy_count)
+               trace_xprtrdma_fixup(rqst, fixup_copy_count);
        return fixup_copy_count;
 }