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]
23 #if defined(HAVE_DECLARE_EVENT_CLASS)
26 * If tracepoints are available define dtrace_probe events for vdev
27 * related probes. Definitions in usr/include/trace.h will map
28 * DTRACE_PROBE* calls to tracepoints.
32 #define TRACE_SYSTEM zfs
34 #undef TRACE_SYSTEM_VAR
35 #define TRACE_SYSTEM_VAR zfs_vdev
37 #if !defined(_TRACE_VDEV_H) || defined(TRACE_HEADER_MULTI_READ)
40 #include <linux/tracepoint.h>
41 #include <sys/types.h>
44 * Generic support for three argument tracepoints of the form:
52 DECLARE_EVENT_CLASS(zfs_removing_class_3,
53 TP_PROTO(spa_t *spa, uint64_t offset, uint64_t size),
54 TP_ARGS(spa, offset, size),
56 __field(spa_t *, vdev_spa)
57 __field(uint64_t, vdev_offset)
58 __field(uint64_t, vdev_size)
61 __entry->vdev_spa = spa;
62 __entry->vdev_offset = offset;
63 __entry->vdev_size = size;
65 TP_printk("spa %p offset %llu size %llu",
66 __entry->vdev_spa, __entry->vdev_offset,
72 #define DEFINE_REMOVE_FREE_EVENT(name) \
73 DEFINE_EVENT(zfs_removing_class_3, name, \
74 TP_PROTO(spa_t *spa, uint64_t offset, uint64_t size), \
75 TP_ARGS(spa, offset, size))
77 DEFINE_REMOVE_FREE_EVENT(zfs_remove__free__synced);
78 DEFINE_REMOVE_FREE_EVENT(zfs_remove__free__unvisited);
81 * Generic support for four argument tracepoints of the form:
90 DECLARE_EVENT_CLASS(zfs_removing_class_4,
91 TP_PROTO(spa_t *spa, uint64_t offset, uint64_t size, uint64_t txg),
92 TP_ARGS(spa, offset, size, txg),
94 __field(spa_t *, vdev_spa)
95 __field(uint64_t, vdev_offset)
96 __field(uint64_t, vdev_size)
97 __field(uint64_t, vdev_txg)
100 __entry->vdev_spa = spa;
101 __entry->vdev_offset = offset;
102 __entry->vdev_size = size;
103 __entry->vdev_txg = txg;
105 TP_printk("spa %p offset %llu size %llu txg %llu",
106 __entry->vdev_spa, __entry->vdev_offset,
107 __entry->vdev_size, __entry->vdev_txg)
111 #define DEFINE_REMOVE_FREE_EVENT_TXG(name) \
112 DEFINE_EVENT(zfs_removing_class_4, name, \
113 TP_PROTO(spa_t *spa, uint64_t offset, uint64_t size,uint64_t txg), \
114 TP_ARGS(spa, offset, size, txg))
116 DEFINE_REMOVE_FREE_EVENT_TXG(zfs_remove__free__inflight);
118 #endif /* _TRACE_VDEV_H */
120 #undef TRACE_INCLUDE_PATH
121 #undef TRACE_INCLUDE_FILE
122 #define TRACE_INCLUDE_PATH sys
123 #define TRACE_INCLUDE_FILE trace_vdev
124 #include <trace/define_trace.h>
129 * When tracepoints are not available, a DEFINE_DTRACE_PROBE* macro is
130 * needed for each DTRACE_PROBE. These will be used to generate stub
131 * tracing functions and protoypes for those functions. See
132 * include/sys/trace.h.
135 DEFINE_DTRACE_PROBE3(remove__free__synced);
136 DEFINE_DTRACE_PROBE3(remove__free__unvisited);
137 DEFINE_DTRACE_PROBE4(remove__free__inflight);
139 #endif /* HAVE_DECLARE_EVENT_CLASS */