X-Git-Url: https://git.camperquake.de/gitweb.cgi?a=blobdiff_plain;f=include%2Fsys%2Fzil.h;h=c583887cd3af46daff07a8d1b4681323b173669f;hb=15a9e03368d8f186751a432740a5a281f45d712d;hp=45900c9816705d3fa90018e58926e25d8785d4a1;hpb=6283f55ea1b91e680386388c17d14b89e344fa8d;p=zfs.git diff --git a/include/sys/zil.h b/include/sys/zil.h index 45900c9..c583887 100644 --- a/include/sys/zil.h +++ b/include/sys/zil.h @@ -372,6 +372,65 @@ typedef struct itx { /* followed by type-specific part of lr_xx_t and its immediate data */ } itx_t; +/* + * Used for zil kstat. + */ +typedef struct zil_stats { + /* + * Number of times a ZIL commit (e.g. fsync) has been requested. + */ + kstat_named_t zil_commit_count; + + /* + * Number of times the ZIL has been flushed to stable storage. + * This is less than zil_commit_count when commits are "merged" + * (see the documentation above zil_commit()). + */ + kstat_named_t zil_commit_writer_count; + + /* + * Number of transactions (reads, writes, renames, etc.) + * that have been commited. + */ + kstat_named_t zil_itx_count; + + /* + * See the documentation for itx_wr_state_t above. + * Note that "bytes" accumulates the length of the transactions + * (i.e. data), not the actual log record sizes. + */ + kstat_named_t zil_itx_indirect_count; + kstat_named_t zil_itx_indirect_bytes; + kstat_named_t zil_itx_copied_count; + kstat_named_t zil_itx_copied_bytes; + kstat_named_t zil_itx_needcopy_count; + kstat_named_t zil_itx_needcopy_bytes; + + /* + * Transactions which have been allocated to the "normal" + * (i.e. not slog) storage pool. Note that "bytes" accumulate + * the actual log record sizes - which do not include the actual + * data in case of indirect writes. + */ + kstat_named_t zil_itx_metaslab_normal_count; + kstat_named_t zil_itx_metaslab_normal_bytes; + + /* + * Transactions which have been allocated to the "slog" storage pool. + * If there are no separate log devices, this is the same as the + * "normal" pool. + */ + kstat_named_t zil_itx_metaslab_slog_count; + kstat_named_t zil_itx_metaslab_slog_bytes; +} zil_stats_t; + +extern zil_stats_t zil_stats; + +#define ZIL_STAT_INCR(stat, val) \ + atomic_add_64(&zil_stats.stat.value.ui64, (val)); +#define ZIL_STAT_BUMP(stat) \ + ZIL_STAT_INCR(stat, 1); + typedef int zil_parse_blk_func_t(zilog_t *zilog, blkptr_t *bp, void *arg, uint64_t txg); typedef int zil_parse_lr_func_t(zilog_t *zilog, lr_t *lr, void *arg,