aboutsummaryrefslogtreecommitdiffstats
path: root/include/os/linux/zfs/sys/trace_dbuf.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/os/linux/zfs/sys/trace_dbuf.h')
-rw-r--r--include/os/linux/zfs/sys/trace_dbuf.h29
1 files changed, 11 insertions, 18 deletions
diff --git a/include/os/linux/zfs/sys/trace_dbuf.h b/include/os/linux/zfs/sys/trace_dbuf.h
index 0e9cbdd72..b61807744 100644
--- a/include/os/linux/zfs/sys/trace_dbuf.h
+++ b/include/os/linux/zfs/sys/trace_dbuf.h
@@ -45,9 +45,13 @@
* dmu_buf_impl_t *, ...,
* zio_t *, ...);
*/
+#define DBUF_TP_STRUCT_ENTRY_OS_SPA \
+ (db != NULL && \
+ POINTER_IS_VALID(DB_DNODE(db)->dn_objset)) \
+ ? spa_name(DB_DNODE(db)->dn_objset->os_spa) : "NULL"
#define DBUF_TP_STRUCT_ENTRY \
- __dynamic_array(char, os_spa, TRACE_DBUF_MSG_MAX) \
+ __string(os_spa, DBUF_TP_STRUCT_ENTRY_OS_SPA) \
__field(uint64_t, ds_object) \
__field(uint64_t, db_object) \
__field(uint64_t, db_level) \
@@ -55,18 +59,11 @@
__field(uint64_t, db_offset) \
__field(uint64_t, db_size) \
__field(uint64_t, db_state) \
- __field(int64_t, db_holds) \
- __dynamic_array(char, msg, TRACE_DBUF_MSG_MAX)
+ __field(int64_t, db_holds)
#define DBUF_TP_FAST_ASSIGN \
if (db != NULL) { \
- if (POINTER_IS_VALID(DB_DNODE(db)->dn_objset)) { \
- __assign_str(os_spa, \
- spa_name(DB_DNODE(db)->dn_objset->os_spa)); \
- } else { \
- __assign_str(os_spa, "NULL"); \
- } \
- \
+ __assign_str_impl(os_spa, DBUF_TP_STRUCT_ENTRY_OS_SPA); \
__entry->ds_object = db->db_objset->os_dsl_dataset ? \
db->db_objset->os_dsl_dataset->ds_object : 0; \
\
@@ -77,10 +74,8 @@
__entry->db_size = db->db.db_size; \
__entry->db_state = db->db_state; \
__entry->db_holds = zfs_refcount_count(&db->db_holds); \
- snprintf(__get_str(msg), TRACE_DBUF_MSG_MAX, \
- DBUF_TP_PRINTK_FMT, DBUF_TP_PRINTK_ARGS); \
} else { \
- __assign_str(os_spa, "NULL"); \
+ __assign_str_impl(os_spa, DBUF_TP_STRUCT_ENTRY_OS_SPA); \
__entry->ds_object = 0; \
__entry->db_object = 0; \
__entry->db_level = 0; \
@@ -89,8 +84,6 @@
__entry->db_size = 0; \
__entry->db_state = 0; \
__entry->db_holds = 0; \
- snprintf(__get_str(msg), TRACE_DBUF_MSG_MAX, \
- "dbuf { NULL }"); \
}
#define DBUF_TP_PRINTK_FMT \
@@ -109,7 +102,7 @@ DECLARE_EVENT_CLASS(zfs_dbuf_class,
TP_ARGS(db, zio),
TP_STRUCT__entry(DBUF_TP_STRUCT_ENTRY),
TP_fast_assign(DBUF_TP_FAST_ASSIGN),
- TP_printk("%s", __get_str(msg))
+ TP_printk(DBUF_TP_PRINTK_FMT, DBUF_TP_PRINTK_ARGS)
);
DECLARE_EVENT_CLASS(zfs_dbuf_state_class,
@@ -117,7 +110,7 @@ DECLARE_EVENT_CLASS(zfs_dbuf_state_class,
TP_ARGS(db, why),
TP_STRUCT__entry(DBUF_TP_STRUCT_ENTRY),
TP_fast_assign(DBUF_TP_FAST_ASSIGN),
- TP_printk("%s", __get_str(msg))
+ TP_printk(DBUF_TP_PRINTK_FMT, DBUF_TP_PRINTK_ARGS)
);
/* END CSTYLED */
@@ -139,7 +132,7 @@ DECLARE_EVENT_CLASS(zfs_dbuf_evict_one_class,
TP_ARGS(db, mls),
TP_STRUCT__entry(DBUF_TP_STRUCT_ENTRY),
TP_fast_assign(DBUF_TP_FAST_ASSIGN),
- TP_printk("%s", __get_str(msg))
+ TP_printk(DBUF_TP_PRINTK_FMT, DBUF_TP_PRINTK_ARGS)
);
/* END CSTYLED */