From 76a5cb6fc1e22a2a316fb690fc4cdd5121d1c0ff Mon Sep 17 00:00:00 2001 From: David Howells Date: Fri, 6 Apr 2018 14:17:26 +0100 Subject: afs: Add stats for data transfer operations Add statistics to /proc/fs/afs/stats for data transfer RPC operations. New lines are added that look like: file-rd : n=55794 nb=10252282150 file-wr : n=9789 nb=3247763645 where n= indicates the number of ops completed and nb= indicates the number of bytes successfully transferred. file-rd is the counts for read/fetch operations and file-wr the counts for write/store operations. Note that directory and symlink downloading are included in the file-rd stats at the moment. Signed-off-by: David Howells --- fs/afs/proc.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'fs/afs/proc.c') diff --git a/fs/afs/proc.c b/fs/afs/proc.c index 3212bce0d4fb..839a22280606 100644 --- a/fs/afs/proc.c +++ b/fs/afs/proc.c @@ -922,6 +922,13 @@ static int afs_proc_stats_show(struct seq_file *m, void *v) seq_printf(m, "dir-edit: cr=%u rm=%u\n", atomic_read(&net->n_dir_cr), atomic_read(&net->n_dir_rm)); + + seq_printf(m, "file-rd : n=%u nb=%lu\n", + atomic_read(&net->n_fetches), + atomic_long_read(&net->n_fetch_bytes)); + seq_printf(m, "file-wr : n=%u nb=%lu\n", + atomic_read(&net->n_stores), + atomic_long_read(&net->n_store_bytes)); return 0; } -- cgit v1.2.3-58-ga151