]>
git.proxmox.com Git - mirror_zfs.git/blob - include/sys/trace_dmu.h
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
22 #if defined(_KERNEL) && defined(HAVE_DECLARE_EVENT_CLASS)
25 #define TRACE_SYSTEM zfs
27 #undef TRACE_SYSTEM_VAR
28 #define TRACE_SYSTEM_VAR zfs_dmu
30 #if !defined(_TRACE_DMU_H) || defined(TRACE_HEADER_MULTI_READ)
33 #include <linux/tracepoint.h>
34 #include <sys/types.h>
37 * Generic support for three argument tracepoints of the form:
45 DECLARE_EVENT_CLASS(zfs_delay_mintime_class
,
46 TP_PROTO(dmu_tx_t
*tx
, uint64_t dirty
, uint64_t min_tx_time
),
47 TP_ARGS(tx
, dirty
, min_tx_time
),
49 __field(uint64_t, tx_txg
)
50 __field(uint64_t, tx_lastsnap_txg
)
51 __field(uint64_t, tx_lasttried_txg
)
52 __field(boolean_t
, tx_anyobj
)
53 __field(boolean_t
, tx_waited
)
54 __field(hrtime_t
, tx_start
)
55 __field(boolean_t
, tx_wait_dirty
)
58 __field(uint64_t, tx_space_towrite
)
59 __field(uint64_t, tx_space_tofree
)
60 __field(uint64_t, tx_space_tooverwrite
)
61 __field(uint64_t, tx_space_tounref
)
62 __field(int64_t, tx_space_written
)
63 __field(int64_t, tx_space_freed
)
65 __field(uint64_t, min_tx_time
)
66 __field(uint64_t, dirty
)
69 __entry
->tx_txg
= tx
->tx_txg
;
70 __entry
->tx_lastsnap_txg
= tx
->tx_lastsnap_txg
;
71 __entry
->tx_lasttried_txg
= tx
->tx_lasttried_txg
;
72 __entry
->tx_anyobj
= tx
->tx_anyobj
;
73 __entry
->tx_waited
= tx
->tx_waited
;
74 __entry
->tx_start
= tx
->tx_start
;
75 __entry
->tx_wait_dirty
= tx
->tx_wait_dirty
;
76 __entry
->tx_err
= tx
->tx_err
;
78 __entry
->tx_space_towrite
= tx
->tx_space_towrite
;
79 __entry
->tx_space_tofree
= tx
->tx_space_tofree
;
80 __entry
->tx_space_tooverwrite
= tx
->tx_space_tooverwrite
;
81 __entry
->tx_space_tounref
= tx
->tx_space_tounref
;
82 __entry
->tx_space_written
= tx
->tx_space_written
.rc_count
;
83 __entry
->tx_space_freed
= tx
->tx_space_freed
.rc_count
;
85 __entry
->dirty
= dirty
;
86 __entry
->min_tx_time
= min_tx_time
;
88 TP_printk("tx { txg %llu lastsnap_txg %llu tx_lasttried_txg %llu "
89 "anyobj %d waited %d start %llu wait_dirty %d err %i "
91 "space_towrite %llu space_tofree %llu space_tooverwrite %llu "
92 "space_tounref %llu space_written %lli space_freed %lli "
94 "} dirty %llu min_tx_time %llu",
95 __entry
->tx_txg
, __entry
->tx_lastsnap_txg
,
96 __entry
->tx_lasttried_txg
, __entry
->tx_anyobj
, __entry
->tx_waited
,
97 __entry
->tx_start
, __entry
->tx_wait_dirty
, __entry
->tx_err
,
99 __entry
->tx_space_towrite
, __entry
->tx_space_tofree
,
100 __entry
->tx_space_tooverwrite
, __entry
->tx_space_tounref
,
101 __entry
->tx_space_written
, __entry
->tx_space_freed
,
103 __entry
->dirty
, __entry
->min_tx_time
)
106 #define DEFINE_DELAY_MINTIME_EVENT(name) \
107 DEFINE_EVENT(zfs_delay_mintime_class, name, \
108 TP_PROTO(dmu_tx_t *tx, uint64_t dirty, uint64_t min_tx_time), \
109 TP_ARGS(tx, dirty, min_tx_time))
110 DEFINE_DELAY_MINTIME_EVENT(zfs_delay__mintime
);
112 #endif /* _TRACE_DMU_H */
114 #undef TRACE_INCLUDE_PATH
115 #undef TRACE_INCLUDE_FILE
116 #define TRACE_INCLUDE_PATH sys
117 #define TRACE_INCLUDE_FILE trace_dmu
118 #include <trace/define_trace.h>
120 #endif /* _KERNEL && HAVE_DECLARE_EVENT_CLASS */