aboutsummaryrefslogtreecommitdiffstats
path: root/include/os
diff options
context:
space:
mode:
authorAlexander Motin <[email protected]>2023-05-25 16:51:53 -0400
committerGitHub <[email protected]>2023-05-25 13:51:53 -0700
commitb6fbe61fa6a75747d9b65082ad4dbec05305d496 (patch)
tree8ac0969a3cd6e72ac63095d44e6350ebccca32c9 /include/os
parentf63811f07213361d49878648bd597af88d06859c (diff)
zil: Add some more statistics.
In addition to a number of actual log bytes written, account also a total written bytes including padding and total allocated bytes (bytes <= write <= alloc). It should allow to monitor zil traffic and space efficiency. Add dtrace probe for zil block size selection. Make zilstat report more information and fit it into less width. Reviewed-by: Ameer Hamza <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Alexander Motin <[email protected]> Sponsored by: iXsystems, Inc. Closes #14863
Diffstat (limited to 'include/os')
-rw-r--r--include/os/linux/zfs/sys/trace_zil.h34
1 files changed, 34 insertions, 0 deletions
diff --git a/include/os/linux/zfs/sys/trace_zil.h b/include/os/linux/zfs/sys/trace_zil.h
index 7bddd9d1f..afa1a274e 100644
--- a/include/os/linux/zfs/sys/trace_zil.h
+++ b/include/os/linux/zfs/sys/trace_zil.h
@@ -215,6 +215,39 @@ DEFINE_EVENT(zfs_zil_commit_io_error_class, name, \
TP_ARGS(zilog, zcw))
DEFINE_ZIL_COMMIT_IO_ERROR_EVENT(zfs_zil__commit__io__error);
+/*
+ * Generic support for three argument tracepoints of the form:
+ *
+ * DTRACE_PROBE3(...,
+ * zilog_t *, ...,
+ * uint64_t, ...,
+ * uint64_t, ...);
+ */
+/* BEGIN CSTYLED */
+DECLARE_EVENT_CLASS(zfs_zil_block_size_class,
+ TP_PROTO(zilog_t *zilog, uint64_t res, uint64_t s1),
+ TP_ARGS(zilog, res, s1),
+ TP_STRUCT__entry(
+ ZILOG_TP_STRUCT_ENTRY
+ __field(uint64_t, res)
+ __field(uint64_t, s1)
+ ),
+ TP_fast_assign(
+ ZILOG_TP_FAST_ASSIGN
+ __entry->res = res;
+ __entry->s1 = s1;
+ ),
+ TP_printk(
+ ZILOG_TP_PRINTK_FMT " res %llu s1 %llu",
+ ZILOG_TP_PRINTK_ARGS, __entry->res, __entry->s1)
+);
+
+#define DEFINE_ZIL_BLOCK_SIZE_EVENT(name) \
+DEFINE_EVENT(zfs_zil_block_size_class, name, \
+ TP_PROTO(zilog_t *zilog, uint64_t res, uint64_t s1), \
+ TP_ARGS(zilog, res, s1))
+DEFINE_ZIL_BLOCK_SIZE_EVENT(zfs_zil__block__size);
+
#endif /* _TRACE_ZIL_H */
#undef TRACE_INCLUDE_PATH
@@ -228,6 +261,7 @@ DEFINE_ZIL_COMMIT_IO_ERROR_EVENT(zfs_zil__commit__io__error);
DEFINE_DTRACE_PROBE2(zil__process__commit__itx);
DEFINE_DTRACE_PROBE2(zil__process__normal__itx);
DEFINE_DTRACE_PROBE2(zil__commit__io__error);
+DEFINE_DTRACE_PROBE3(zil__block__size);
#endif /* HAVE_DECLARE_EVENT_CLASS */
#endif /* _KERNEL */