Skip to content

Commit d5227c8

Browse files
dhowellssmfrench
authored andcommitted
cifs: Add the smb3_read_* tracepoints to SMB1
Add the smb3_read_* tracepoints to SMB1's cifs_async_readv() and cifs_readv_callback(). Signed-off-by: David Howells <[email protected]> cc: Steve French <[email protected]> cc: Paulo Alcantara <[email protected]> cc: [email protected] cc: [email protected] Signed-off-by: Steve French <[email protected]>
1 parent 7e4d912 commit d5227c8

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

fs/smb/client/cifssmb.c

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1363,6 +1363,14 @@ cifs_readv_callback(struct mid_q_entry *mid)
13631363
if (rdata->result == -ENODATA) {
13641364
rdata->result = 0;
13651365
__set_bit(NETFS_SREQ_HIT_EOF, &rdata->subreq.flags);
1366+
trace_smb3_read_err(rdata->rreq->debug_id,
1367+
rdata->subreq.debug_index,
1368+
rdata->xid,
1369+
rdata->req->cfile->fid.persistent_fid,
1370+
tcon->tid, tcon->ses->Suid,
1371+
rdata->subreq.start + rdata->subreq.transferred,
1372+
rdata->subreq.len - rdata->subreq.transferred,
1373+
rdata->result);
13661374
} else {
13671375
size_t trans = rdata->subreq.transferred + rdata->got_bytes;
13681376
if (trans < rdata->subreq.len &&
@@ -1374,6 +1382,13 @@ cifs_readv_callback(struct mid_q_entry *mid)
13741382
}
13751383
if (rdata->got_bytes)
13761384
__set_bit(NETFS_SREQ_MADE_PROGRESS, &rdata->subreq.flags);
1385+
trace_smb3_read_done(rdata->rreq->debug_id,
1386+
rdata->subreq.debug_index,
1387+
rdata->xid,
1388+
rdata->req->cfile->fid.persistent_fid,
1389+
tcon->tid, tcon->ses->Suid,
1390+
rdata->subreq.start + rdata->subreq.transferred,
1391+
rdata->got_bytes);
13771392
}
13781393

13791394
trace_smb3_rw_credits(rreq_debug_id, subreq_debug_index, rdata->credits.value,
@@ -1445,6 +1460,13 @@ cifs_async_readv(struct cifs_io_subrequest *rdata)
14451460
rdata->iov[1].iov_base = (char *)smb + 4;
14461461
rdata->iov[1].iov_len = get_rfc1002_length(smb);
14471462

1463+
trace_smb3_read_enter(rdata->rreq->debug_id,
1464+
rdata->subreq.debug_index,
1465+
rdata->xid,
1466+
rdata->req->cfile->fid.netfid,
1467+
tcon->tid, tcon->ses->Suid,
1468+
rdata->subreq.start, rdata->subreq.len);
1469+
14481470
rc = cifs_call_async(tcon->ses->server, &rqst, cifs_readv_receive,
14491471
cifs_readv_callback, NULL, rdata, 0, NULL);
14501472

0 commit comments

Comments
 (0)