diff mbox series

[SMB3,client] add dynamic trace points for smbdirect (RDMA) connect

Message ID CAH2r5mssSM9HhMXVu8570jX7Yx1CyERhjeg4S+Rp77HWrTHb6g@mail.gmail.com (mailing list archive)
State New, archived
Headers show
Series [SMB3,client] add dynamic trace points for smbdirect (RDMA) connect | expand

Commit Message

Steve French Sept. 19, 2023, 6:20 a.m. UTC
smb3_smbd_connect_done and smb3_smbd_connect_err

To improve debugging of RDMA issues add those two new tracepoints. We
already had dynamic tracepoints for the non-RDMA connect done and
error cases, but didn't for the smbdirect cases.

See attached patch

Comments

Tom Talpey Sept. 19, 2023, 2:34 p.m. UTC | #1
On 9/18/2023 11:20 PM, Steve French wrote:
>       smb3_smbd_connect_done and smb3_smbd_connect_err
> 
> To improve debugging of RDMA issues add those two new tracepoints. We
> already had dynamic tracepoints for the non-RDMA connect done and
> error cases, but didn't for the smbdirect cases.
> 
> See attached patch
> 


This looks fine but it's pretty basic. The entire smbdirect handling
in both client and server has its own idea of debug, with two (very)
different ways to enable various levels. It requires a silly combination
of /proc, ksmbd.control, "class" and "level" selections, and some weird
other thing I don't even try to remember. Combined with the ancient
cifs_dbg stuff, it is all just... unprintable.

Anyway
Acked-by: Tom Talpey <tom@talpey.com>

Tom.
diff mbox series

Patch

From fb2697a561f72b28023697968face1ec25da8575 Mon Sep 17 00:00:00 2001
From: Steve French <stfrench@microsoft.com>
Date: Tue, 19 Sep 2023 01:14:39 -0500
Subject: [PATCH] Add dynamic trace points for RDMA (smbdirect) reconnect

     smb3_smbd_connect_done and smb3_smbd_connect_err

To improve debugging of RDMA issues add those two. We already
had dynamic tracepoints for non-RDMA connect done and error cases.

Signed-off-by: Steve French <stfrench@microsoft.com>
---
 fs/smb/client/smbdirect.c | 5 ++++-
 fs/smb/client/trace.h     | 2 ++
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/fs/smb/client/smbdirect.c b/fs/smb/client/smbdirect.c
index 2a2aec8c6112..2a9f064ccc6a 100644
--- a/fs/smb/client/smbdirect.c
+++ b/fs/smb/client/smbdirect.c
@@ -1401,8 +1401,11 @@  int smbd_reconnect(struct TCP_Server_Info *server)
 	server->smbd_conn = smbd_get_connection(
 		server, (struct sockaddr *) &server->dstaddr);
 
-	if (server->smbd_conn)
+	if (server->smbd_conn) {
 		cifs_dbg(VFS, "RDMA transport re-established\n");
+		trace_smb3_smbd_connect_done(server->hostname, server->conn_id, &server->dstaddr);
+	} else
+		trace_smb3_smbd_connect_err(server->hostname, server->conn_id, &server->dstaddr);
 
 	return server->smbd_conn ? 0 : -ENOENT;
 }
diff --git a/fs/smb/client/trace.h b/fs/smb/client/trace.h
index a7e4755bed0f..de199ec9f726 100644
--- a/fs/smb/client/trace.h
+++ b/fs/smb/client/trace.h
@@ -935,6 +935,8 @@  DEFINE_EVENT(smb3_connect_class, smb3_##name,  \
 	TP_ARGS(hostname, conn_id, addr))
 
 DEFINE_SMB3_CONNECT_EVENT(connect_done);
+DEFINE_SMB3_CONNECT_EVENT(smbd_connect_done);
+DEFINE_SMB3_CONNECT_EVENT(smbd_connect_err);
 
 DECLARE_EVENT_CLASS(smb3_connect_err_class,
 	TP_PROTO(char *hostname, __u64 conn_id,
-- 
2.39.2