SUNRPC: Move the svc_xdr_recvfrom tracepoint again
authorChuck Lever <chuck.lever@oracle.com>
Sun, 3 Jan 2021 19:39:27 +0000 (14:39 -0500)
committerChuck Lever <chuck.lever@oracle.com>
Wed, 13 Jan 2021 14:13:20 +0000 (09:13 -0500)
commit5f39d2713bd80e8a3e6d9299930aec8844872c0e
tree80401db2f5441426d8e735c09bb75dafcdcce465
parent51b2ee7d006a736a9126e8111d1f24e4fd0afaa6
SUNRPC: Move the svc_xdr_recvfrom tracepoint again

Commit 156708adf2d9 ("SUNRPC: Move the svc_xdr_recvfrom()
tracepoint") tried to capture the correct XID in the trace record,
but this line in svc_recv:

rqstp->rq_xid = svc_getu32(&rqstp->rq_arg.head[0]);

alters the size of rq_arg.head[0].iov_len. The tracepoint records
the correct XID but an incorrect value for the length of the
xdr_buf's head.

To keep the trace callsites simple, I've created two trace classes.
One assumes the xdr_buf contains a full RPC message, and the XID
can be extracted from it. The other assumes the contents of the
xdr_buf are arbitrary, and the xid will be provided by the caller.

Currently there is only one user of each class, but I expect we will
need a few more tracepoints using each class as time goes on.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
include/trace/events/sunrpc.h
net/sunrpc/svc_xprt.c