]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - include/os/linux/zfs/sys/trace_txg.h
Add prototypes
[FreeBSD/FreeBSD.git] / include / os / linux / zfs / sys / trace_txg.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)
23 #if defined(HAVE_DECLARE_EVENT_CLASS)
24
25 #undef TRACE_SYSTEM
26 #define TRACE_SYSTEM zfs
27
28 #undef TRACE_SYSTEM_VAR
29 #define TRACE_SYSTEM_VAR zfs_txg
30
31 #if !defined(_TRACE_TXG_H) || defined(TRACE_HEADER_MULTI_READ)
32 #define _TRACE_TXG_H
33
34 #include <linux/tracepoint.h>
35 #include <sys/types.h>
36
37 /*
38  * Generic support for two argument tracepoints of the form:
39  *
40  * DTRACE_PROBE2(...,
41  *     dsl_pool_t *, ...,
42  *     uint64_t, ...);
43  */
44 /* BEGIN CSTYLED */
45 DECLARE_EVENT_CLASS(zfs_txg_class,
46         TP_PROTO(dsl_pool_t *dp, uint64_t txg),
47         TP_ARGS(dp, txg),
48         TP_STRUCT__entry(
49             __field(uint64_t, txg)
50         ),
51         TP_fast_assign(
52             __entry->txg = txg;
53         ),
54         TP_printk("txg %llu", __entry->txg)
55 );
56 /* END CSTYLED */
57
58 /* BEGIN CSTYLED */
59 #define DEFINE_TXG_EVENT(name) \
60 DEFINE_EVENT(zfs_txg_class, name, \
61         TP_PROTO(dsl_pool_t *dp, uint64_t txg), \
62         TP_ARGS(dp, txg))
63 /* END CSTYLED */
64 DEFINE_TXG_EVENT(zfs_dsl_pool_sync__done);
65 DEFINE_TXG_EVENT(zfs_txg__quiescing);
66 DEFINE_TXG_EVENT(zfs_txg__opened);
67 DEFINE_TXG_EVENT(zfs_txg__syncing);
68 DEFINE_TXG_EVENT(zfs_txg__synced);
69 DEFINE_TXG_EVENT(zfs_txg__quiesced);
70
71 #endif /* _TRACE_TXG_H */
72
73 #undef TRACE_INCLUDE_PATH
74 #undef TRACE_INCLUDE_FILE
75 #define TRACE_INCLUDE_PATH sys
76 #define TRACE_INCLUDE_FILE trace_txg
77 #include <trace/define_trace.h>
78
79 #else
80
81 DEFINE_DTRACE_PROBE2(dsl_pool_sync__done);
82 DEFINE_DTRACE_PROBE2(txg__quiescing);
83 DEFINE_DTRACE_PROBE2(txg__opened);
84 DEFINE_DTRACE_PROBE2(txg__syncing);
85 DEFINE_DTRACE_PROBE2(txg__synced);
86 DEFINE_DTRACE_PROBE2(txg__quiesced);
87
88 #endif /* HAVE_DECLARE_EVENT_CLASS */
89 #endif /* _KERNEL */