From c5cd7cf176c933cb7122906d5725d9f9598e2ee3 Mon Sep 17 00:00:00 2001
From: Steve French <stfrench@microsoft.com>
Date: Mon, 25 Feb 2019 00:11:43 -0600
Subject: [PATCH] smb3: add tracepoints for query dir
Adds two tracepoints - one for query_dir done (no err) and one for query_dir_err (no more files, or error on query dir)
Sanple output:
To start the trace in one window:
trace-cmd record -e smb3_query_dir*
Then in another window after doing an
ls /mnt
View the trace output by:
trace-cmd show
Sample output (note that the "error" in no more files, so is rc=0)
ls-27625 [006] .... 74313.708032: smb3_query_dir_done: xid=20 sid=0xaf0a6274 tid=0x9f398492 fid=0x7a50dd5a offset=0x0 len=0x13
ls-27625 [006] .... 74313.708713: smb3_query_dir_err: xid=21 sid=0xaf0a6274 tid=0x9f398492 fid=0x7a50dd5a offset=0x0 len=0x0 rc=0
Signed-off-by: Steve French <stfrench@microsoft.com>
---
fs/cifs/smb2pdu.c | 4 ++++
fs/cifs/trace.h | 2 ++
2 files changed, 6 insertions(+)
@@ -3896,9 +3896,13 @@ SMB2_query_directory(const unsigned int xid, struct cifs_tcon *tcon,
else
cifs_dbg(VFS, "illegal search buffer type\n");
+ trace_smb3_query_dir_done(xid, persistent_fid, tcon->tid,
+ tcon->ses->Suid, index, srch_inf->entries_in_buffer);
return rc;
qdir_exit:
+ trace_smb3_query_dir_err(xid, persistent_fid, tcon->tid,
+ tcon->ses->Suid, index, 0, rc);
free_rsp_buf(resp_buftype, rsp);
return rc;
}
@@ -58,6 +58,7 @@ DEFINE_EVENT(smb3_rw_err_class, smb3_##name, \
DEFINE_SMB3_RW_ERR_EVENT(write_err);
DEFINE_SMB3_RW_ERR_EVENT(read_err);
+DEFINE_SMB3_RW_ERR_EVENT(query_dir_err);
/* For logging successful read or write */
@@ -102,6 +103,7 @@ DEFINE_EVENT(smb3_rw_done_class, smb3_##name, \
DEFINE_SMB3_RW_DONE_EVENT(write_done);
DEFINE_SMB3_RW_DONE_EVENT(read_done);
+DEFINE_SMB3_RW_DONE_EVENT(query_dir_done);
/*
* For handle based calls other than read and write, and get/set info
--
2.17.1