Re: [PATCH 3/4] SUNRPC: Replace dprintk() call site in xs_data_ready

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, 2022-07-22 at 13:25 -0400, Chuck Lever wrote:
> Signed-off-by: Chuck Lever <chuck.lever@xxxxxxxxxx>
> ---
>  include/trace/events/sunrpc.h |   18 ++++++++++++++++++
>  net/sunrpc/xprtsock.c         |    6 ++++--
>  2 files changed, 22 insertions(+), 2 deletions(-)
> 
> diff --git a/include/trace/events/sunrpc.h
> b/include/trace/events/sunrpc.h
> index b61d9c90fa26..04b6903b6c0c 100644
> --- a/include/trace/events/sunrpc.h
> +++ b/include/trace/events/sunrpc.h
> @@ -1266,6 +1266,24 @@ TRACE_EVENT(xprt_reserve,
>         )
>  );
>  
> +TRACE_EVENT(xs_data_ready,
> +       TP_PROTO(
> +               const struct rpc_xprt *xprt
> +       ),
> +
> +       TP_ARGS(xprt),
> +
> +       TP_STRUCT__entry(
> +               __sockaddr(addr, xprt->addrlen)
> +       ),
> +
> +       TP_fast_assign(
> +               __assign_sockaddr(addr, &xprt->addr, xprt->addrlen);
> +       ),
> +
> +       TP_printk("peer=%pISpc", __get_sockaddr(addr))

NACK. Please resolve and store the string up front instead of storing
the sockaddr. Most versions of perf can't resolve those kernel-specific
%p printks and just end up barfing on them.

> +);
> +
>  TRACE_EVENT(xs_stream_read_data,
>         TP_PROTO(struct rpc_xprt *xprt, ssize_t err, size_t total),
>  
> diff --git a/net/sunrpc/xprtsock.c b/net/sunrpc/xprtsock.c
> index fcdd0fca408e..eba1be9984f8 100644
> --- a/net/sunrpc/xprtsock.c
> +++ b/net/sunrpc/xprtsock.c
> @@ -1378,7 +1378,7 @@ static void xs_udp_data_receive_workfn(struct
> work_struct *work)
>  }
>  
>  /**
> - * xs_data_ready - "data ready" callback for UDP sockets
> + * xs_data_ready - "data ready" callback for sockets
>   * @sk: socket with data to read
>   *
>   */
> @@ -1386,11 +1386,13 @@ static void xs_data_ready(struct sock *sk)
>  {
>         struct rpc_xprt *xprt;
>  
> -       dprintk("RPC:       xs_data_ready...\n");
>         xprt = xprt_from_sock(sk);
>         if (xprt != NULL) {
>                 struct sock_xprt *transport = container_of(xprt,
>                                 struct sock_xprt, xprt);
> +
> +               trace_xs_data_ready(xprt);
> +
>                 transport->old_data_ready(sk);
>                 /* Any data means we had a useful conversation, so
>                  * then we don't need to delay the next reconnect
> 
> 

-- 
Trond Myklebust
Linux NFS client maintainer, Hammerspace
trond.myklebust@xxxxxxxxxxxxxxx






[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux