diff options
author | Chuck Lever <chuck.lever@oracle.com> | 2018-03-27 10:51:00 -0400 |
---|---|---|
committer | J. Bruce Fields <bfields@redhat.com> | 2018-04-03 15:08:11 -0400 |
commit | ece200ddd54b9ce840cfee554fb812560c545c7d (patch) | |
tree | b87a51d113f432e730f79847080fc9987a10a4b1 /net/sunrpc/svc_xprt.c | |
parent | 41f306d0c287e0cc04054135f9f4ceb003ad6795 (diff) |
sunrpc: Save remote presentation address in svc_xprt for trace events
TP_printk defines a format string that is passed to user space for
converting raw trace event records to something human-readable.
My user space's printf (Oracle Linux 7), however, does not have a
%pI format specifier. The result is that what is supposed to be an
IP address in the output of "trace-cmd report" is just a string that
says the field couldn't be displayed.
To fix this, adopt the same approach as the client: maintain a pre-
formated presentation address for occasions when %pI is not
available.
The location of the trace_svc_send trace point is adjusted so that
rqst->rq_xprt is not NULL when the trace event is recorded.
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'net/sunrpc/svc_xprt.c')
-rw-r--r-- | net/sunrpc/svc_xprt.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/net/sunrpc/svc_xprt.c b/net/sunrpc/svc_xprt.c index 47384d0b1673..f745754a55ea 100644 --- a/net/sunrpc/svc_xprt.c +++ b/net/sunrpc/svc_xprt.c | |||
@@ -173,6 +173,7 @@ void svc_xprt_init(struct net *net, struct svc_xprt_class *xcl, | |||
173 | set_bit(XPT_BUSY, &xprt->xpt_flags); | 173 | set_bit(XPT_BUSY, &xprt->xpt_flags); |
174 | rpc_init_wait_queue(&xprt->xpt_bc_pending, "xpt_bc_pending"); | 174 | rpc_init_wait_queue(&xprt->xpt_bc_pending, "xpt_bc_pending"); |
175 | xprt->xpt_net = get_net(net); | 175 | xprt->xpt_net = get_net(net); |
176 | strcpy(xprt->xpt_remotebuf, "uninitialized"); | ||
176 | } | 177 | } |
177 | EXPORT_SYMBOL_GPL(svc_xprt_init); | 178 | EXPORT_SYMBOL_GPL(svc_xprt_init); |
178 | 179 | ||
@@ -894,12 +895,12 @@ int svc_send(struct svc_rqst *rqstp) | |||
894 | len = xprt->xpt_ops->xpo_sendto(rqstp); | 895 | len = xprt->xpt_ops->xpo_sendto(rqstp); |
895 | mutex_unlock(&xprt->xpt_mutex); | 896 | mutex_unlock(&xprt->xpt_mutex); |
896 | rpc_wake_up(&xprt->xpt_bc_pending); | 897 | rpc_wake_up(&xprt->xpt_bc_pending); |
898 | trace_svc_send(rqstp, len); | ||
897 | svc_xprt_release(rqstp); | 899 | svc_xprt_release(rqstp); |
898 | 900 | ||
899 | if (len == -ECONNREFUSED || len == -ENOTCONN || len == -EAGAIN) | 901 | if (len == -ECONNREFUSED || len == -ENOTCONN || len == -EAGAIN) |
900 | len = 0; | 902 | len = 0; |
901 | out: | 903 | out: |
902 | trace_svc_send(rqstp, len); | ||
903 | return len; | 904 | return len; |
904 | } | 905 | } |
905 | 906 | ||