]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blame - zfs/include/sys/trace_dmu.h
UBUNTU: SAUCE: (noup) Update zfs to 0.7.5-1ubuntu16.5
[mirror_ubuntu-bionic-kernel.git] / zfs / include / sys / trace_dmu.h
CommitLineData
70e083d2
TG
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#undef TRACE_SYSTEM_VAR
28#define TRACE_SYSTEM_VAR zfs_dmu
29
30#if !defined(_TRACE_DMU_H) || defined(TRACE_HEADER_MULTI_READ)
31#define _TRACE_DMU_H
32
33#include <linux/tracepoint.h>
34#include <sys/types.h>
35
36/*
37 * Generic support for three argument tracepoints of the form:
38 *
39 * DTRACE_PROBE3(...,
40 * dmu_tx_t *, ...,
41 * uint64_t, ...,
42 * uint64_t, ...);
43 */
86e3c28a 44/* BEGIN CSTYLED */
70e083d2
TG
45DECLARE_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),
48 TP_STRUCT__entry(
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)
efc86325 53 __field(boolean_t, tx_waited)
70e083d2
TG
54 __field(hrtime_t, tx_start)
55 __field(boolean_t, tx_wait_dirty)
56 __field(int, tx_err)
70e083d2
TG
57 __field(uint64_t, min_tx_time)
58 __field(uint64_t, dirty)
59 ),
60 TP_fast_assign(
61 __entry->tx_txg = tx->tx_txg;
62 __entry->tx_lastsnap_txg = tx->tx_lastsnap_txg;
63 __entry->tx_lasttried_txg = tx->tx_lasttried_txg;
64 __entry->tx_anyobj = tx->tx_anyobj;
efc86325 65 __entry->tx_waited = tx->tx_waited;
70e083d2
TG
66 __entry->tx_start = tx->tx_start;
67 __entry->tx_wait_dirty = tx->tx_wait_dirty;
68 __entry->tx_err = tx->tx_err;
70e083d2
TG
69 __entry->dirty = dirty;
70 __entry->min_tx_time = min_tx_time;
71 ),
72 TP_printk("tx { txg %llu lastsnap_txg %llu tx_lasttried_txg %llu "
b49151d6 73 "anyobj %d dirty_delayed %d start %llu wait_dirty %d err %i "
70e083d2
TG
74 "} dirty %llu min_tx_time %llu",
75 __entry->tx_txg, __entry->tx_lastsnap_txg,
b49151d6 76 __entry->tx_lasttried_txg, __entry->tx_anyobj,
efc86325 77 __entry->tx_waited, __entry->tx_start,
b49151d6 78 __entry->tx_wait_dirty, __entry->tx_err,
70e083d2
TG
79 __entry->dirty, __entry->min_tx_time)
80);
86e3c28a 81/* END CSTYLED */
70e083d2 82
86e3c28a 83/* BEGIN CSTYLED */
70e083d2
TG
84#define DEFINE_DELAY_MINTIME_EVENT(name) \
85DEFINE_EVENT(zfs_delay_mintime_class, name, \
86 TP_PROTO(dmu_tx_t *tx, uint64_t dirty, uint64_t min_tx_time), \
87 TP_ARGS(tx, dirty, min_tx_time))
86e3c28a 88/* END CSTYLED */
70e083d2
TG
89DEFINE_DELAY_MINTIME_EVENT(zfs_delay__mintime);
90
86e3c28a
CIK
91/* BEGIN CSTYLED */
92DECLARE_EVENT_CLASS(zfs_free_long_range_class,
93 TP_PROTO(uint64_t long_free_dirty_all_txgs, uint64_t chunk_len, \
94 uint64_t txg),
95 TP_ARGS(long_free_dirty_all_txgs, chunk_len, txg),
96 TP_STRUCT__entry(
97 __field(uint64_t, long_free_dirty_all_txgs)
98 __field(uint64_t, chunk_len)
99 __field(uint64_t, txg)
100 ),
101 TP_fast_assign(
102 __entry->long_free_dirty_all_txgs = long_free_dirty_all_txgs;
103 __entry->chunk_len = chunk_len;
104 __entry->txg = txg;
105 ),
106 TP_printk("long_free_dirty_all_txgs %llu chunk_len %llu txg %llu",
107 __entry->long_free_dirty_all_txgs,
108 __entry->chunk_len, __entry->txg)
109);
110/* END CSTYLED */
111
112/* BEGIN CSTYLED */
113#define DEFINE_FREE_LONG_RANGE_EVENT(name) \
114DEFINE_EVENT(zfs_free_long_range_class, name, \
115 TP_PROTO(uint64_t long_free_dirty_all_txgs, \
116 uint64_t chunk_len, uint64_t txg), \
117 TP_ARGS(long_free_dirty_all_txgs, chunk_len, txg))
118/* END CSTYLED */
119DEFINE_FREE_LONG_RANGE_EVENT(zfs_free__long__range);
120
70e083d2
TG
121#endif /* _TRACE_DMU_H */
122
123#undef TRACE_INCLUDE_PATH
124#undef TRACE_INCLUDE_FILE
125#define TRACE_INCLUDE_PATH sys
126#define TRACE_INCLUDE_FILE trace_dmu
127#include <trace/define_trace.h>
128
129#endif /* _KERNEL && HAVE_DECLARE_EVENT_CLASS */