Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Chuck Lever and committed by
J. Bruce Fields
41f306d0 7dbb53ba

+7 -8
+7 -7
include/trace/events/sunrpc.h
··· 485 485 { (1UL << RQ_BUSY), "RQ_BUSY"}) 486 486 487 487 TRACE_EVENT(svc_recv, 488 - TP_PROTO(struct svc_rqst *rqst, int status), 488 + TP_PROTO(struct svc_rqst *rqst, int len), 489 489 490 - TP_ARGS(rqst, status), 490 + TP_ARGS(rqst, len), 491 491 492 492 TP_STRUCT__entry( 493 493 __field(u32, xid) 494 - __field(int, status) 494 + __field(int, len) 495 495 __field(unsigned long, flags) 496 496 __dynamic_array(unsigned char, addr, rqst->rq_addrlen) 497 497 ), 498 498 499 499 TP_fast_assign( 500 - __entry->xid = status > 0 ? be32_to_cpu(rqst->rq_xid) : 0; 501 - __entry->status = status; 500 + __entry->xid = be32_to_cpu(rqst->rq_xid); 501 + __entry->len = len; 502 502 __entry->flags = rqst->rq_flags; 503 503 memcpy(__get_dynamic_array(addr), 504 504 &rqst->rq_addr, rqst->rq_addrlen); 505 505 ), 506 506 507 - TP_printk("addr=%pIScp xid=0x%08x status=%d flags=%s", 507 + TP_printk("addr=%pIScp xid=0x%08x len=%d flags=%s", 508 508 (struct sockaddr *)__get_dynamic_array(addr), 509 - __entry->xid, __entry->status, 509 + __entry->xid, __entry->len, 510 510 show_rqstp_flags(__entry->flags)) 511 511 ); 512 512
-1
net/sunrpc/svc_xprt.c
··· 848 848 rqstp->rq_res.len = 0; 849 849 svc_xprt_release(rqstp); 850 850 out: 851 - trace_svc_recv(rqstp, err); 852 851 return err; 853 852 } 854 853 EXPORT_SYMBOL_GPL(svc_recv);