smb3: dump in_send and num_waiters stats counters by default
authorSteve French <stfrench@microsoft.com>
Thu, 21 Nov 2019 23:26:35 +0000 (17:26 -0600)
committerSteve French <stfrench@microsoft.com>
Mon, 25 Nov 2019 07:17:12 +0000 (01:17 -0600)
Number of requests in_send and the number of waiters on sendRecv
are useful counters in various cases, move them from
CONFIG_CIFS_STATS2 to be on by default especially with multichannel

Signed-off-by: Steve French <stfrench@microsoft.com>
Acked-by: Ronnie Sahlberg <lsahlber@redhat.com>
fs/cifs/cifs_debug.c
fs/cifs/cifsglob.h

index efb2928ff6c893882fb388d98596537f58c91ce0..393c42cab7d33cf62598744ac558889dc4924dea 100644 (file)
@@ -365,11 +365,10 @@ skip_rdma:
                                   server->srv_count,
                                   server->sec_mode, in_flight(server));
 
-#ifdef CONFIG_CIFS_STATS2
                        seq_printf(m, " In Send: %d In MaxReq Wait: %d",
                                atomic_read(&server->in_send),
                                atomic_read(&server->num_waiters));
-#endif
+
                        /* dump session id helpful for use with network trace */
                        seq_printf(m, " SessionId: 0x%llx", ses->Suid);
                        if (ses->session_flags & SMB2_SESSION_FLAG_ENCRYPT_DATA)
index 2fc3d77463d361cf17c3e8c7ec83d38459f10a94..d34a4ed8c57d81c776234e51a6d99f5dcd9fb61c 100644 (file)
@@ -743,12 +743,12 @@ struct TCP_Server_Info {
        /* Total size of this PDU. Only valid from cifs_demultiplex_thread */
        unsigned int pdu_size;
        unsigned int total_read; /* total amount of data read in this pass */
+       atomic_t in_send; /* requests trying to send */
+       atomic_t num_waiters;   /* blocked waiting to get in sendrecv */
 #ifdef CONFIG_CIFS_FSCACHE
        struct fscache_cookie   *fscache; /* client index cache cookie */
 #endif
 #ifdef CONFIG_CIFS_STATS2
-       atomic_t in_send; /* requests trying to send */
-       atomic_t num_waiters;   /* blocked waiting to get in sendrecv */
        atomic_t num_cmds[NUMBER_OF_SMB2_COMMANDS]; /* total requests by cmd */
        atomic_t smb2slowcmd[NUMBER_OF_SMB2_COMMANDS]; /* count resps > 1 sec */
        __u64 time_per_cmd[NUMBER_OF_SMB2_COMMANDS]; /* total time per cmd */
@@ -1606,8 +1606,6 @@ struct close_cancelled_open {
 
 /*     Make code in transport.c a little cleaner by moving
        update of optional stats into function below */
-#ifdef CONFIG_CIFS_STATS2
-
 static inline void cifs_in_send_inc(struct TCP_Server_Info *server)
 {
        atomic_inc(&server->in_send);
@@ -1628,26 +1626,12 @@ static inline void cifs_num_waiters_dec(struct TCP_Server_Info *server)
        atomic_dec(&server->num_waiters);
 }
 
+#ifdef CONFIG_CIFS_STATS2
 static inline void cifs_save_when_sent(struct mid_q_entry *mid)
 {
        mid->when_sent = jiffies;
 }
 #else
-static inline void cifs_in_send_inc(struct TCP_Server_Info *server)
-{
-}
-static inline void cifs_in_send_dec(struct TCP_Server_Info *server)
-{
-}
-
-static inline void cifs_num_waiters_inc(struct TCP_Server_Info *server)
-{
-}
-
-static inline void cifs_num_waiters_dec(struct TCP_Server_Info *server)
-{
-}
-
 static inline void cifs_save_when_sent(struct mid_q_entry *mid)
 {
 }