Update RELEASES.md LTS release to 2.2
[zfs.git] / include / os / linux / zfs / sys / trace_vdev.h
blob6a3f6c202527b74151ef9295c46b206595cda55d
1 /*
2 * CDDL HEADER START
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 https://opensource.org/licenses/CDDL-1.0.
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]
19 * CDDL HEADER END
22 #if defined(_KERNEL)
23 #if defined(HAVE_DECLARE_EVENT_CLASS)
26 * If tracepoints are available define dtrace_probe events for vdev
27 * related probes. Definitions in include/os/linux/spl/sys/trace.h
28 * will map DTRACE_PROBE* calls to tracepoints.
31 #undef TRACE_SYSTEM
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)
38 #define _TRACE_VDEV_H
40 #include <linux/tracepoint.h>
41 #include <sys/types.h>
44 * Generic support for three argument tracepoints of the form:
46 * DTRACE_PROBE3(...,
47 * spa_t *, ...,
48 * uint64_t, ...,
49 * uint64_t, ...);
51 /* BEGIN CSTYLED */
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),
55 TP_STRUCT__entry(
56 __field(spa_t *, vdev_spa)
57 __field(uint64_t, vdev_offset)
58 __field(uint64_t, vdev_size)
60 TP_fast_assign(
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,
67 __entry->vdev_size)
69 /* END CSTYLED */
71 #define DEFINE_REMOVE_FREE_EVENT(name) \
72 DEFINE_EVENT(zfs_removing_class_3, name, \
73 TP_PROTO(spa_t *spa, uint64_t offset, uint64_t size), \
74 TP_ARGS(spa, offset, size))
75 DEFINE_REMOVE_FREE_EVENT(zfs_remove__free__synced);
76 DEFINE_REMOVE_FREE_EVENT(zfs_remove__free__unvisited);
79 * Generic support for four argument tracepoints of the form:
81 * DTRACE_PROBE4(...,
82 * spa_t *, ...,
83 * uint64_t, ...,
84 * uint64_t, ...,
85 * uint64_t, ...);
87 /* BEGIN CSTYLED */
88 DECLARE_EVENT_CLASS(zfs_removing_class_4,
89 TP_PROTO(spa_t *spa, uint64_t offset, uint64_t size, uint64_t txg),
90 TP_ARGS(spa, offset, size, txg),
91 TP_STRUCT__entry(
92 __field(spa_t *, vdev_spa)
93 __field(uint64_t, vdev_offset)
94 __field(uint64_t, vdev_size)
95 __field(uint64_t, vdev_txg)
97 TP_fast_assign(
98 __entry->vdev_spa = spa;
99 __entry->vdev_offset = offset;
100 __entry->vdev_size = size;
101 __entry->vdev_txg = txg;
103 TP_printk("spa %p offset %llu size %llu txg %llu",
104 __entry->vdev_spa, __entry->vdev_offset,
105 __entry->vdev_size, __entry->vdev_txg)
108 #define DEFINE_REMOVE_FREE_EVENT_TXG(name) \
109 DEFINE_EVENT(zfs_removing_class_4, name, \
110 TP_PROTO(spa_t *spa, uint64_t offset, uint64_t size,uint64_t txg), \
111 TP_ARGS(spa, offset, size, txg))
112 DEFINE_REMOVE_FREE_EVENT_TXG(zfs_remove__free__inflight);
114 #endif /* _TRACE_VDEV_H */
116 #undef TRACE_INCLUDE_PATH
117 #undef TRACE_INCLUDE_FILE
118 #define TRACE_INCLUDE_PATH sys
119 #define TRACE_INCLUDE_FILE trace_vdev
120 #include <trace/define_trace.h>
122 #else
125 * When tracepoints are not available, a DEFINE_DTRACE_PROBE* macro is
126 * needed for each DTRACE_PROBE. These will be used to generate stub
127 * tracing functions and prototypes for those functions. See
128 * include/os/linux/spl/sys/trace.h.
131 DEFINE_DTRACE_PROBE3(remove__free__synced);
132 DEFINE_DTRACE_PROBE3(remove__free__unvisited);
133 DEFINE_DTRACE_PROBE4(remove__free__inflight);
135 #endif /* HAVE_DECLARE_EVENT_CLASS */
136 #endif /* _KERNEL */