diff options
author | Steve French <stfrench@microsoft.com> | 2024-01-17 16:15:18 -0600 |
---|---|---|
committer | Steve French <stfrench@microsoft.com> | 2024-01-18 12:07:51 -0600 |
commit | d8392c203e84ec7daa2afecdb8f4db69bc32416a (patch) | |
tree | 897c872d5d640817b2ba59922e8e5e7c8f77b46c /fs/smb/client/misc.c | |
parent | 8ca5d2641be217a78a891d4dbe2a46232d1d8eb9 (diff) | |
download | linux-stable-d8392c203e84ec7daa2afecdb8f4db69bc32416a.tar.gz linux-stable-d8392c203e84ec7daa2afecdb8f4db69bc32416a.tar.bz2 linux-stable-d8392c203e84ec7daa2afecdb8f4db69bc32416a.zip |
smb3: show beginning time for per share stats
In analyzing problems, one missing piece of debug data is when the
mount occurred. A related problem is when collecting stats we don't
know the period of time the stats covered, ie when this set of stats
for the tcon started to be collected. To make debugging easier track
the stats begin time. Set it when the mount occurred at mount time,
and reset it to current time whenever stats are reset. For example,
...
1) \\localhost\test
SMBs: 14 since 2024-01-17 22:17:30 UTC
Bytes read: 0 Bytes written: 0
Open files: 0 total (local), 0 open on server
TreeConnects: 1 total 0 failed
TreeDisconnects: 0 total 0 failed
...
2) \\localhost\scratch
SMBs: 24 since 2024-01-17 22:16:04 UTC
Bytes read: 0 Bytes written: 0
Open files: 0 total (local), 0 open on server
TreeConnects: 1 total 0 failed
TreeDisconnects: 0 total 0 failed
...
Note the time "since ... UTC" is now displayed in /proc/fs/cifs/Stats
for each share that is mounted.
Suggested-by: Shyam Prasad N <sprasad@microsoft.com>
Reviewed-by: Bharath SM <bharathsm@microsoft.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
Diffstat (limited to 'fs/smb/client/misc.c')
-rw-r--r-- | fs/smb/client/misc.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/smb/client/misc.c b/fs/smb/client/misc.c index c2137ea3c253..0748d7b757b9 100644 --- a/fs/smb/client/misc.c +++ b/fs/smb/client/misc.c @@ -140,6 +140,7 @@ tcon_info_alloc(bool dir_leases_enabled) spin_lock_init(&ret_buf->stat_lock); atomic_set(&ret_buf->num_local_opens, 0); atomic_set(&ret_buf->num_remote_opens, 0); + ret_buf->stats_from_time = ktime_get_real_seconds(); #ifdef CONFIG_CIFS_DFS_UPCALL INIT_LIST_HEAD(&ret_buf->dfs_ses_list); #endif |