Explorar el Código

sunrpc: Simplify trace_svc_recv

There doesn't seem to be a lot of value in calling trace_svc_recv
in the failing case.

1. There are two very common cases: one is the transport is not
ready, and the other is shutdown. Neither is terribly interesting.

2. The trace record for the failing case contains nothing but
the status code.

Therefore the trace point call site in the error exit is removed.
Since the trace point is now recording a length instead of a
status, rename the status field and remove the case that records a
zero XID.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Chuck Lever hace 7 años
padre
commit
41f306d0c2
Se han modificado 2 ficheros con 7 adiciones y 8 borrados
  1. 7 7
      include/trace/events/sunrpc.h
  2. 0 1
      net/sunrpc/svc_xprt.c

+ 7 - 7
include/trace/events/sunrpc.h

@@ -485,28 +485,28 @@ TRACE_EVENT(xs_tcp_data_recv,
 		{ (1UL << RQ_BUSY),		"RQ_BUSY"})
 		{ (1UL << RQ_BUSY),		"RQ_BUSY"})
 
 
 TRACE_EVENT(svc_recv,
 TRACE_EVENT(svc_recv,
-	TP_PROTO(struct svc_rqst *rqst, int status),
+	TP_PROTO(struct svc_rqst *rqst, int len),
 
 
-	TP_ARGS(rqst, status),
+	TP_ARGS(rqst, len),
 
 
 	TP_STRUCT__entry(
 	TP_STRUCT__entry(
 		__field(u32, xid)
 		__field(u32, xid)
-		__field(int, status)
+		__field(int, len)
 		__field(unsigned long, flags)
 		__field(unsigned long, flags)
 		__dynamic_array(unsigned char, addr, rqst->rq_addrlen)
 		__dynamic_array(unsigned char, addr, rqst->rq_addrlen)
 	),
 	),
 
 
 	TP_fast_assign(
 	TP_fast_assign(
-		__entry->xid = status > 0 ? be32_to_cpu(rqst->rq_xid) : 0;
-		__entry->status = status;
+		__entry->xid = be32_to_cpu(rqst->rq_xid);
+		__entry->len = len;
 		__entry->flags = rqst->rq_flags;
 		__entry->flags = rqst->rq_flags;
 		memcpy(__get_dynamic_array(addr),
 		memcpy(__get_dynamic_array(addr),
 			&rqst->rq_addr, rqst->rq_addrlen);
 			&rqst->rq_addr, rqst->rq_addrlen);
 	),
 	),
 
 
-	TP_printk("addr=%pIScp xid=0x%08x status=%d flags=%s",
+	TP_printk("addr=%pIScp xid=0x%08x len=%d flags=%s",
 			(struct sockaddr *)__get_dynamic_array(addr),
 			(struct sockaddr *)__get_dynamic_array(addr),
-			__entry->xid, __entry->status,
+			__entry->xid, __entry->len,
 			show_rqstp_flags(__entry->flags))
 			show_rqstp_flags(__entry->flags))
 );
 );
 
 

+ 0 - 1
net/sunrpc/svc_xprt.c

@@ -848,7 +848,6 @@ out_release:
 	rqstp->rq_res.len = 0;
 	rqstp->rq_res.len = 0;
 	svc_xprt_release(rqstp);
 	svc_xprt_release(rqstp);
 out:
 out:
-	trace_svc_recv(rqstp, err);
 	return err;
 	return err;
 }
 }
 EXPORT_SYMBOL_GPL(svc_recv);
 EXPORT_SYMBOL_GPL(svc_recv);