Commit 7e5ae43b authored by Olga Kornievskaia's avatar Olga Kornievskaia Committed by Trond Myklebust

NFSv4.1: add tracepoint to trunked nfs4_exchange_id calls

Add a tracepoint to track when the client sends EXCHANGE_ID to test
a new transport for session trunking.

nfs4_detect_session_trunking() tests for trunking and returns
EINVAL if trunking can't be done, add EINVAL mapping to
show_nfs4_status() in tracepoints.
Signed-off-by: default avatarOlga Kornievskaia <kolga@netapp.com>
Reviewed-by: default avatarBenjamin Coddington <bcodding@redhat.com>
Signed-off-by: default avatarTrond Myklebust <trond.myklebust@hammerspace.com>
parent fd5860ab
......@@ -8970,10 +8970,12 @@ void nfs4_test_session_trunk(struct rpc_clnt *clnt, struct rpc_xprt *xprt,
return;
status = task->tk_status;
if (status == 0)
if (status == 0) {
status = nfs4_detect_session_trunking(adata->clp,
task->tk_msg.rpc_resp, xprt);
trace_nfs4_trunked_exchange_id(adata->clp,
xprt->address_strings[RPC_DISPLAY_ADDR], status);
}
if (status == 0)
rpc_clnt_xprt_switch_add_xprt(clnt, xprt);
else if (status != -NFS4ERR_DELAY && rpc_clnt_xprt_switch_has_addr(clnt,
......
......@@ -77,6 +77,36 @@ DEFINE_NFS4_CLIENTID_EVENT(nfs4_bind_conn_to_session);
DEFINE_NFS4_CLIENTID_EVENT(nfs4_sequence);
DEFINE_NFS4_CLIENTID_EVENT(nfs4_reclaim_complete);
TRACE_EVENT(nfs4_trunked_exchange_id,
TP_PROTO(
const struct nfs_client *clp,
const char *addr,
int error
),
TP_ARGS(clp, addr, error),
TP_STRUCT__entry(
__string(main_addr, clp->cl_hostname)
__string(trunk_addr, addr)
__field(unsigned long, error)
),
TP_fast_assign(
__entry->error = error < 0 ? -error : 0;
__assign_str(main_addr, clp->cl_hostname);
__assign_str(trunk_addr, addr);
),
TP_printk(
"error=%ld (%s) main_addr=%s trunk_addr=%s",
-__entry->error,
show_nfs4_status(__entry->error),
__get_str(main_addr),
__get_str(trunk_addr)
)
);
TRACE_EVENT(nfs4_sequence_done,
TP_PROTO(
const struct nfs4_session *session,
......
......@@ -239,6 +239,7 @@ TRACE_DEFINE_ENUM(NFS4ERR_RESET_TO_PNFS);
{ EHOSTDOWN, "EHOSTDOWN" }, \
{ EPIPE, "EPIPE" }, \
{ EPFNOSUPPORT, "EPFNOSUPPORT" }, \
{ EINVAL, "EINVAL" }, \
{ EPROTONOSUPPORT, "EPROTONOSUPPORT" }, \
{ NFS4ERR_ACCESS, "ACCESS" }, \
{ NFS4ERR_ATTRNOTSUPP, "ATTRNOTSUPP" }, \
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment