From: Jeff Layton <jlayton@kernel.org>
To: Chuck Lever <chuck.lever@oracle.com>, linux-nfs@vger.kernel.org
Cc: trondmy@hammerspace.com
Subject: Re: [PATCH v2 06/15] SUNRPC: Trace the rpc_create_args
Date: Wed, 06 Jul 2022 14:57:21 -0400 [thread overview]
Message-ID: <732a3dd097707a57d4208f0bdb807abcd29ba224.camel@kernel.org> (raw)
In-Reply-To: <165452706752.1496.657240546600966342.stgit@oracle-102.nfsv4.dev>
On Mon, 2022-06-06 at 10:51 -0400, Chuck Lever wrote:
> Pass the upper layer's rpc_create_args to the rpc_clnt_new()
> tracepoint so additional parts of the upper layer's request can be
> recorded.
>
> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
> ---
> include/trace/events/sunrpc.h | 53 +++++++++++++++++++++++++++++++++--------
> net/sunrpc/clnt.c | 2 +-
> 2 files changed, 44 insertions(+), 11 deletions(-)
>
> diff --git a/include/trace/events/sunrpc.h b/include/trace/events/sunrpc.h
> index a66aa1f59ed8..986e135e314f 100644
> --- a/include/trace/events/sunrpc.h
> +++ b/include/trace/events/sunrpc.h
> @@ -139,36 +139,69 @@ DEFINE_RPC_CLNT_EVENT(release);
> DEFINE_RPC_CLNT_EVENT(replace_xprt);
> DEFINE_RPC_CLNT_EVENT(replace_xprt_err);
>
> +TRACE_DEFINE_ENUM(RPC_XPRTSEC_NONE);
> +TRACE_DEFINE_ENUM(RPC_XPRTSEC_TLS_X509);
> +TRACE_DEFINE_ENUM(RPC_XPRTSEC_TLS_PSK);
> +
> +#define rpc_show_xprtsec_policy(policy) \
> + __print_symbolic(policy, \
> + { RPC_XPRTSEC_NONE, "none" }, \
> + { RPC_XPRTSEC_TLS_X509, "tls-x509" }, \
> + { RPC_XPRTSEC_TLS_PSK, "tls-psk" })
> +
> +#define rpc_show_create_flags(flags) \
> + __print_flags(flags, "|", \
> + { RPC_CLNT_CREATE_HARDRTRY, "HARDRTRY" }, \
> + { RPC_CLNT_CREATE_AUTOBIND, "AUTOBIND" }, \
> + { RPC_CLNT_CREATE_NONPRIVPORT, "NONPRIVPORT" }, \
> + { RPC_CLNT_CREATE_NOPING, "NOPING" }, \
> + { RPC_CLNT_CREATE_DISCRTRY, "DISCRTRY" }, \
> + { RPC_CLNT_CREATE_QUIET, "QUIET" }, \
> + { RPC_CLNT_CREATE_INFINITE_SLOTS, \
> + "INFINITE_SLOTS" }, \
> + { RPC_CLNT_CREATE_NO_IDLE_TIMEOUT, \
> + "NO_IDLE_TIMEOUT" }, \
> + { RPC_CLNT_CREATE_NO_RETRANS_TIMEOUT, \
> + "NO_RETRANS_TIMEOUT" }, \
> + { RPC_CLNT_CREATE_SOFTERR, "SOFTERR" }, \
> + { RPC_CLNT_CREATE_REUSEPORT, "REUSEPORT" })
> +
> TRACE_EVENT(rpc_clnt_new,
> TP_PROTO(
> const struct rpc_clnt *clnt,
> const struct rpc_xprt *xprt,
> - const char *program,
> - const char *server
> + const struct rpc_create_args *args
> ),
>
> - TP_ARGS(clnt, xprt, program, server),
> + TP_ARGS(clnt, xprt, args),
>
> TP_STRUCT__entry(
> __field(unsigned int, client_id)
> + __field(unsigned long, xprtsec)
> + __field(unsigned long, flags)
> + __string(program, clnt->cl_program->name)
> + __string(server, xprt->servername)
> __string(addr, xprt->address_strings[RPC_DISPLAY_ADDR])
> __string(port, xprt->address_strings[RPC_DISPLAY_PORT])
> - __string(program, program)
> - __string(server, server)
> ),
>
> TP_fast_assign(
> __entry->client_id = clnt->cl_clid;
> + __entry->xprtsec = args->xprtsec;
> + __entry->flags = args->flags;
> + __assign_str(program, clnt->cl_program->name);
> + __assign_str(server, xprt->servername);
> __assign_str(addr, xprt->address_strings[RPC_DISPLAY_ADDR]);
> __assign_str(port, xprt->address_strings[RPC_DISPLAY_PORT]);
> - __assign_str(program, program);
> - __assign_str(server, server);
> ),
>
> - TP_printk("client=" SUNRPC_TRACE_CLID_SPECIFIER
> - " peer=[%s]:%s program=%s server=%s",
> + TP_printk("client=" SUNRPC_TRACE_CLID_SPECIFIER " peer=[%s]:%s"
> + " program=%s server=%s xprtsec=%s flags=%s",
> __entry->client_id, __get_str(addr), __get_str(port),
> - __get_str(program), __get_str(server))
> + __get_str(program), __get_str(server),
> + rpc_show_xprtsec_policy(__entry->xprtsec),
> + rpc_show_create_flags(__entry->flags)
> + )
> );
>
> TRACE_EVENT(rpc_clnt_new_err,
> diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c
> index 6dcc88d45f5d..0ca86c92968f 100644
> --- a/net/sunrpc/clnt.c
> +++ b/net/sunrpc/clnt.c
> @@ -435,7 +435,7 @@ static struct rpc_clnt * rpc_new_client(const struct rpc_create_args *args,
> if (parent)
> refcount_inc(&parent->cl_count);
>
> - trace_rpc_clnt_new(clnt, xprt, program->name, args->servername);
> + trace_rpc_clnt_new(clnt, xprt, args);
> return clnt;
>
> out_no_path:
>
>
All of these tracing patches seem like a reasonable thing to add on
their own, IMO. It might be good to move them and some of the bugfixes
to a separate series and get those merged ahead of the parts that add
TLS support (which are more controversial).
Reviewed-by: Jeff Layton <jlayton@kernel.org>
next prev parent reply other threads:[~2022-07-06 18:57 UTC|newest]
Thread overview: 39+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-06 14:50 [PATCH v2 00/15] RPC-with-TLS client side Chuck Lever
2022-06-06 14:50 ` [PATCH v2 01/15] SUNRPC: Fail faster on bad verifier Chuck Lever
2022-07-06 17:12 ` Jeff Layton
2022-06-06 14:50 ` [PATCH v2 02/15] SUNRPC: Widen rpc_task::tk_flags Chuck Lever
2022-07-06 17:14 ` Jeff Layton
2022-06-06 14:50 ` [PATCH v2 03/15] SUNRPC: Replace dprintk() call site in xs_data_ready Chuck Lever
2022-07-06 17:19 ` Jeff Layton
2022-07-06 18:10 ` Chuck Lever III
2022-06-06 14:50 ` [PATCH v2 04/15] NFS: Replace fs_context-related dprintk() call sites with tracepoints Chuck Lever
2022-07-06 18:44 ` Jeff Layton
2022-06-06 14:51 ` [PATCH v2 05/15] SUNRPC: Plumb an API for setting transport layer security Chuck Lever
2022-07-18 19:46 ` Jeff Layton
2022-06-06 14:51 ` [PATCH v2 06/15] SUNRPC: Trace the rpc_create_args Chuck Lever
2022-07-06 18:57 ` Jeff Layton [this message]
2022-07-06 19:04 ` Chuck Lever III
2022-06-06 14:51 ` [PATCH v2 07/15] SUNRPC: Refactor rpc_call_null_helper() Chuck Lever
2022-07-18 19:44 ` Jeff Layton
2022-06-06 14:51 ` [PATCH v2 08/15] SUNRPC: Add RPC client support for the RPC_AUTH_TLS auth flavor Chuck Lever
2022-06-06 14:51 ` [PATCH v2 09/15] SUNRPC: Ignore data_ready callbacks during TLS handshakes Chuck Lever
2022-06-06 14:51 ` [PATCH v2 10/15] SUNRPC: Capture cmsg metadata on client-side receive Chuck Lever
2022-07-18 19:53 ` Jeff Layton
2022-07-19 21:43 ` Chuck Lever III
2022-06-06 14:51 ` [PATCH v2 11/15] SUNRPC: Add a connect worker function for TLS Chuck Lever
2022-06-06 14:51 ` [PATCH v2 12/15] SUNRPC: Add RPC-with-TLS support to xprtsock.c Chuck Lever
2022-07-12 17:00 ` Benjamin Coddington
2022-07-18 20:10 ` Jeff Layton
2022-07-19 21:31 ` Chuck Lever III
2022-06-06 14:51 ` [PATCH v2 13/15] SUNRPC: Add RPC-with-TLS tracepoints Chuck Lever
2022-06-06 14:51 ` [PATCH v2 14/15] NFS: Have struct nfs_client carry a TLS policy field Chuck Lever
2022-06-06 14:52 ` [PATCH v2 15/15] NFS: Add an "xprtsec=" NFS mount option Chuck Lever
2022-07-18 20:24 ` Jeff Layton
2022-07-18 20:35 ` Chuck Lever III
2022-07-12 12:36 ` [PATCH v2 00/15] RPC-with-TLS client side Jeff Layton
2022-07-12 13:48 ` Chuck Lever III
2022-07-13 0:51 ` Rick Macklem
2022-07-13 13:22 ` Benjamin Coddington
2022-07-13 13:32 ` Chuck Lever III
2022-07-14 16:24 ` Benjamin Coddington
2022-07-18 20:25 ` Jeff Layton
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=732a3dd097707a57d4208f0bdb807abcd29ba224.camel@kernel.org \
--to=jlayton@kernel.org \
--cc=chuck.lever@oracle.com \
--cc=linux-nfs@vger.kernel.org \
--cc=trondmy@hammerspace.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox