Factor out some dbuf subroutines and add state change tracing

Create dedicated dbuf_read_hole and dbuf_read_bonus.
Additionally, add a dtrace probe to allow state change tracing.

Reviewed-by: Matt Ahrens <matt@delphix.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Will Andrews <wca@FreeBSD.org>
Reviewed by: Brad Lewis <brad.lewis@delphix.com>
Authored-by: Will Andrews <wca@FreeBSD.org>
Signed-off-by: Matt Macy <mmacy@FreeBSD.org>
Closes #9923
This commit is contained in:
Matthew Macy
2020-02-18 11:21:37 -08:00
committed by GitHub
parent f244846462
commit 8b3547a481
2 changed files with 160 additions and 93 deletions
+17
View File
@@ -107,6 +107,14 @@ DECLARE_EVENT_CLASS(zfs_dbuf_class,
TP_fast_assign(DBUF_TP_FAST_ASSIGN),
TP_printk("%s", __get_str(msg))
);
DECLARE_EVENT_CLASS(zfs_dbuf_state_class,
TP_PROTO(dmu_buf_impl_t *db, const char *why),
TP_ARGS(db, why),
TP_STRUCT__entry(DBUF_TP_STRUCT_ENTRY),
TP_fast_assign(DBUF_TP_FAST_ASSIGN),
TP_printk("%s", __get_str(msg))
);
/* END CSTYLED */
/* BEGIN CSTYLED */
@@ -117,6 +125,14 @@ DEFINE_EVENT(zfs_dbuf_class, name, \
/* END CSTYLED */
DEFINE_DBUF_EVENT(zfs_blocked__read);
/* BEGIN CSTYLED */
#define DEFINE_DBUF_STATE_EVENT(name) \
DEFINE_EVENT(zfs_dbuf_state_class, name, \
TP_PROTO(dmu_buf_impl_t *db, const char *why), \
TP_ARGS(db, why))
/* END CSTYLED */
DEFINE_DBUF_STATE_EVENT(zfs_dbuf__state_change);
/* BEGIN CSTYLED */
DECLARE_EVENT_CLASS(zfs_dbuf_evict_one_class,
TP_PROTO(dmu_buf_impl_t *db, multilist_sublist_t *mls),
@@ -147,6 +163,7 @@ DEFINE_DBUF_EVICT_ONE_EVENT(zfs_dbuf__evict__one);
DEFINE_DTRACE_PROBE2(blocked__read);
DEFINE_DTRACE_PROBE2(dbuf__evict__one);
DEFINE_DTRACE_PROBE2(dbuf__state_change);
#endif /* HAVE_DECLARE_EVENT_CLASS */
#endif /* _KERNEL */