summaryrefslogtreecommitdiff
path: root/fs/nfsd/stats.h
diff options
context:
space:
mode:
authorAmir Goldstein <amir73il@gmail.com>2021-01-06 09:52:36 +0200
committerChuck Lever <chuck.lever@oracle.com>2021-01-25 09:36:28 -0500
commit20ad856e47323e208ae8d6a9ecfe5bf0be6f505e (patch)
tree111fc9aa63cab904835739e51da4b1fdd9aba160 /fs/nfsd/stats.h
parente567b98ce9a4b35b63c364d24828a9e5cd7a8179 (diff)
downloadlinux-20ad856e47323e208ae8d6a9ecfe5bf0be6f505e.tar.gz
nfsd: report per-export stats
Collect some nfsd stats per export in addition to the global stats. A new nfsdfs export_stats file is created. It uses the same ops as the exports file to iterate the export entries and we use the file's name to determine the reported info per export. For example: $ cat /proc/fs/nfsd/export_stats # Version 1.1 # Path Client Start-time # Stats /test localhost 92 fh_stale: 0 io_read: 9 io_write: 1 Every export entry reports the start time when stats collection started, so stats collecting scripts can know if stats where reset between samples. Signed-off-by: Amir Goldstein <amir73il@gmail.com> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Diffstat (limited to 'fs/nfsd/stats.h')
-rw-r--r--fs/nfsd/stats.h12
1 files changed, 9 insertions, 3 deletions
diff --git a/fs/nfsd/stats.h b/fs/nfsd/stats.h
index 87c3150c200f..51ecda852e23 100644
--- a/fs/nfsd/stats.h
+++ b/fs/nfsd/stats.h
@@ -59,19 +59,25 @@ static inline void nfsd_stats_rc_nocache_inc(void)
percpu_counter_inc(&nfsdstats.counter[NFSD_STATS_RC_NOCACHE]);
}
-static inline void nfsd_stats_fh_stale_inc(void)
+static inline void nfsd_stats_fh_stale_inc(struct svc_export *exp)
{
percpu_counter_inc(&nfsdstats.counter[NFSD_STATS_FH_STALE]);
+ if (exp)
+ percpu_counter_inc(&exp->ex_stats.counter[EXP_STATS_FH_STALE]);
}
-static inline void nfsd_stats_io_read_add(s64 amount)
+static inline void nfsd_stats_io_read_add(struct svc_export *exp, s64 amount)
{
percpu_counter_add(&nfsdstats.counter[NFSD_STATS_IO_READ], amount);
+ if (exp)
+ percpu_counter_add(&exp->ex_stats.counter[EXP_STATS_IO_READ], amount);
}
-static inline void nfsd_stats_io_write_add(s64 amount)
+static inline void nfsd_stats_io_write_add(struct svc_export *exp, s64 amount)
{
percpu_counter_add(&nfsdstats.counter[NFSD_STATS_IO_WRITE], amount);
+ if (exp)
+ percpu_counter_add(&exp->ex_stats.counter[EXP_STATS_IO_WRITE], amount);
}
static inline void nfsd_stats_payload_misses_inc(struct nfsd_net *nn)