]> git.proxmox.com Git - mirror_zfs-debian.git/blob - include/sys/trace_dmu.h
Imported Upstream version 0.6.4.2
[mirror_zfs-debian.git] / include / sys / trace_dmu.h
1 /*
2 * CDDL HEADER START
3 *
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.
7 *
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.
12 *
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]
18 *
19 * CDDL HEADER END
20 */
21
22 #if defined(_KERNEL) && defined(HAVE_DECLARE_EVENT_CLASS)
23
24 #undef TRACE_SYSTEM
25 #define TRACE_SYSTEM zfs
26
27 #if !defined(_TRACE_DMU_H) || defined(TRACE_HEADER_MULTI_READ)
28 #define _TRACE_DMU_H
29
30 #include <linux/tracepoint.h>
31 #include <sys/types.h>
32
33 /*
34 * Generic support for three argument tracepoints of the form:
35 *
36 * DTRACE_PROBE3(...,
37 * dmu_tx_t *, ...,
38 * uint64_t, ...,
39 * uint64_t, ...);
40 */
41
42 DECLARE_EVENT_CLASS(zfs_delay_mintime_class,
43 TP_PROTO(dmu_tx_t *tx, uint64_t dirty, uint64_t min_tx_time),
44 TP_ARGS(tx, dirty, min_tx_time),
45 TP_STRUCT__entry(
46 __field(uint64_t, tx_txg)
47 __field(uint64_t, tx_lastsnap_txg)
48 __field(uint64_t, tx_lasttried_txg)
49 __field(boolean_t, tx_anyobj)
50 __field(boolean_t, tx_waited)
51 __field(hrtime_t, tx_start)
52 __field(boolean_t, tx_wait_dirty)
53 __field(int, tx_err)
54 #ifdef DEBUG_DMU_TX
55 __field(uint64_t, tx_space_towrite)
56 __field(uint64_t, tx_space_tofree)
57 __field(uint64_t, tx_space_tooverwrite)
58 __field(uint64_t, tx_space_tounref)
59 __field(int64_t, tx_space_written)
60 __field(int64_t, tx_space_freed)
61 #endif
62 __field(uint64_t, min_tx_time)
63 __field(uint64_t, dirty)
64 ),
65 TP_fast_assign(
66 __entry->tx_txg = tx->tx_txg;
67 __entry->tx_lastsnap_txg = tx->tx_lastsnap_txg;
68 __entry->tx_lasttried_txg = tx->tx_lasttried_txg;
69 __entry->tx_anyobj = tx->tx_anyobj;
70 __entry->tx_waited = tx->tx_waited;
71 __entry->tx_start = tx->tx_start;
72 __entry->tx_wait_dirty = tx->tx_wait_dirty;
73 __entry->tx_err = tx->tx_err;
74 #ifdef DEBUG_DMU_TX
75 __entry->tx_space_towrite = tx->tx_space_towrite;
76 __entry->tx_space_tofree = tx->tx_space_tofree;
77 __entry->tx_space_tooverwrite = tx->tx_space_tooverwrite;
78 __entry->tx_space_tounref = tx->tx_space_tounref;
79 __entry->tx_space_written = tx->tx_space_written.rc_count;
80 __entry->tx_space_freed = tx->tx_space_freed.rc_count;
81 #endif
82 __entry->dirty = dirty;
83 __entry->min_tx_time = min_tx_time;
84 ),
85 TP_printk("tx { txg %llu lastsnap_txg %llu tx_lasttried_txg %llu "
86 "anyobj %d waited %d start %llu wait_dirty %d err %i "
87 #ifdef DEBUG_DMU_TX
88 "space_towrite %llu space_tofree %llu space_tooverwrite %llu "
89 "space_tounref %llu space_written %lli space_freed %lli "
90 #endif
91 "} dirty %llu min_tx_time %llu",
92 __entry->tx_txg, __entry->tx_lastsnap_txg,
93 __entry->tx_lasttried_txg, __entry->tx_anyobj, __entry->tx_waited,
94 __entry->tx_start, __entry->tx_wait_dirty, __entry->tx_err,
95 #ifdef DEBUG_DMU_TX
96 __entry->tx_space_towrite, __entry->tx_space_tofree,
97 __entry->tx_space_tooverwrite, __entry->tx_space_tounref,
98 __entry->tx_space_written, __entry->tx_space_freed,
99 #endif
100 __entry->dirty, __entry->min_tx_time)
101 );
102
103 #define DEFINE_DELAY_MINTIME_EVENT(name) \
104 DEFINE_EVENT(zfs_delay_mintime_class, name, \
105 TP_PROTO(dmu_tx_t *tx, uint64_t dirty, uint64_t min_tx_time), \
106 TP_ARGS(tx, dirty, min_tx_time))
107 DEFINE_DELAY_MINTIME_EVENT(zfs_delay__mintime);
108
109 #endif /* _TRACE_DMU_H */
110
111 #undef TRACE_INCLUDE_PATH
112 #undef TRACE_INCLUDE_FILE
113 #define TRACE_INCLUDE_PATH sys
114 #define TRACE_INCLUDE_FILE trace_dmu
115 #include <trace/define_trace.h>
116
117 #endif /* _KERNEL && HAVE_DECLARE_EVENT_CLASS */