diff options
author | Brian Behlendorf <[email protected]> | 2010-08-26 10:26:05 -0700 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2010-08-31 08:38:45 -0700 |
commit | 59e6e7ca85e984433fc9c929dd0d474579bb88a5 (patch) | |
tree | 0e11639e0e64e2c5d917703a37c93cdfd3f406cb /module/zfs/dmu.c | |
parent | 754c6663a36b9801b391a9659319416ecd79d9d2 (diff) |
Fix kstat xuio
Move xiou stat structures from a header to the dmu.c source as is
done with all the other kstat interfaces. This information is local
to dmu.c registered the xuio kstat and should stay that way.
Signed-off-by: Brian Behlendorf <[email protected]>
Diffstat (limited to 'module/zfs/dmu.c')
-rw-r--r-- | module/zfs/dmu.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/module/zfs/dmu.c b/module/zfs/dmu.c index 732742f33..7f17c736f 100644 --- a/module/zfs/dmu.c +++ b/module/zfs/dmu.c @@ -831,6 +831,31 @@ dmu_prealloc(objset_t *os, uint64_t object, uint64_t offset, uint64_t size, */ kstat_t *xuio_ksp = NULL; +typedef struct xuio_stats { + /* loaned yet not returned arc_buf */ + kstat_named_t xuiostat_onloan_rbuf; + kstat_named_t xuiostat_onloan_wbuf; + /* whether a copy is made when loaning out a read buffer */ + kstat_named_t xuiostat_rbuf_copied; + kstat_named_t xuiostat_rbuf_nocopy; + /* whether a copy is made when assigning a write buffer */ + kstat_named_t xuiostat_wbuf_copied; + kstat_named_t xuiostat_wbuf_nocopy; +} xuio_stats_t; + +static xuio_stats_t xuio_stats = { + { "onloan_read_buf", KSTAT_DATA_UINT64 }, + { "onloan_write_buf", KSTAT_DATA_UINT64 }, + { "read_buf_copied", KSTAT_DATA_UINT64 }, + { "read_buf_nocopy", KSTAT_DATA_UINT64 }, + { "write_buf_copied", KSTAT_DATA_UINT64 }, + { "write_buf_nocopy", KSTAT_DATA_UINT64 } +}; + +#define XUIOSTAT_INCR(stat, val) \ + atomic_add_64(&xuio_stats.stat.value.ui64, (val)) +#define XUIOSTAT_BUMP(stat) XUIOSTAT_INCR(stat, 1) + int dmu_xuio_init(xuio_t *xuio, int nblk) { |