]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
cifs: Add a couple of missing smb3_rw_credits tracepoints
authorDavid Howells <dhowells@redhat.com>
Mon, 20 Oct 2025 09:33:06 +0000 (10:33 +0100)
committerSteve French <stfrench@microsoft.com>
Mon, 20 Oct 2025 21:48:05 +0000 (16:48 -0500)
Add missing smb3_rw_credits tracepoints to cifs_readv_callback() (for SMB1)
to match those of SMB2/3.

Signed-off-by: David Howells <dhowells@redhat.com>
cc: Steve French <sfrench@samba.org>
cc: Paulo Alcantara <pc@manguebit.org>
cc: Shyam Prasad N <sprasad@microsoft.com>
cc: Tom Talpey <tom@talpey.com>
cc: linux-cifs@vger.kernel.org
cc: linux-fsdevel@vger.kernel.org
Signed-off-by: Steve French <stfrench@microsoft.com>
fs/smb/client/cifssmb.c

index 2881efcbe09a30ca77d39c84c7b7facaa0ccff02..7da194f29fefc8ce08dd23f2b5243a40e360cfea 100644 (file)
@@ -1311,6 +1311,8 @@ cifs_readv_callback(struct mid_q_entry *mid)
                .rreq_debug_id = rdata->rreq->debug_id,
                .rreq_debug_index = rdata->subreq.debug_index,
        };
+       unsigned int rreq_debug_id = rdata->rreq->debug_id;
+       unsigned int subreq_debug_index = rdata->subreq.debug_index;
 
        cifs_dbg(FYI, "%s: mid=%llu state=%d result=%d bytes=%zu\n",
                 __func__, mid->mid, mid->mid_state, rdata->result,
@@ -1374,6 +1376,9 @@ do_retry:
                        __set_bit(NETFS_SREQ_MADE_PROGRESS, &rdata->subreq.flags);
        }
 
+       trace_smb3_rw_credits(rreq_debug_id, subreq_debug_index, rdata->credits.value,
+                             server->credits, server->in_flight,
+                             0, cifs_trace_rw_credits_read_response_clear);
        rdata->credits.value = 0;
        rdata->subreq.error = rdata->result;
        rdata->subreq.transferred += rdata->got_bytes;
@@ -1381,6 +1386,9 @@ do_retry:
        netfs_read_subreq_terminated(&rdata->subreq);
        release_mid(mid);
        add_credits(server, &credits, 0);
+       trace_smb3_rw_credits(rreq_debug_id, subreq_debug_index, 0,
+                             server->credits, server->in_flight,
+                             credits.value, cifs_trace_rw_credits_read_response_add);
 }
 
 /* cifs_async_readv - send an async write, and set up mid to handle result */