mirror of
https://github.com/tbsdtv/linux_media.git
synced 2025-07-23 04:33:26 +02:00
SUNRPC: Move the svc_xdr_recvfrom tracepoint again
Commit 156708adf2
("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>
This commit is contained in:
@@ -857,6 +857,7 @@ int svc_recv(struct svc_rqst *rqstp, long timeout)
|
||||
err = -EAGAIN;
|
||||
if (len <= 0)
|
||||
goto out_release;
|
||||
trace_svc_xdr_recvfrom(&rqstp->rq_arg);
|
||||
|
||||
clear_bit(XPT_OLD, &xprt->xpt_flags);
|
||||
|
||||
@@ -866,7 +867,6 @@ int svc_recv(struct svc_rqst *rqstp, long timeout)
|
||||
|
||||
if (serv->sv_stats)
|
||||
serv->sv_stats->netcnt++;
|
||||
trace_svc_xdr_recvfrom(rqstp, &rqstp->rq_arg);
|
||||
return len;
|
||||
out_release:
|
||||
rqstp->rq_res.len = 0;
|
||||
@@ -904,7 +904,7 @@ int svc_send(struct svc_rqst *rqstp)
|
||||
xb->len = xb->head[0].iov_len +
|
||||
xb->page_len +
|
||||
xb->tail[0].iov_len;
|
||||
trace_svc_xdr_sendto(rqstp, xb);
|
||||
trace_svc_xdr_sendto(rqstp->rq_xid, xb);
|
||||
trace_svc_stats_latency(rqstp);
|
||||
|
||||
len = xprt->xpt_ops->xpo_sendto(rqstp);
|
||||
|
Reference in New Issue
Block a user