Update RELEASES.md LTS release to 2.2
[zfs.git] / include / os / linux / zfs / sys / trace_multilist.h
blob33b9aeac9213b725207dc5dc97a775ebce0a71b7
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)
25 #undef TRACE_SYSTEM
26 #define TRACE_SYSTEM zfs
28 #undef TRACE_SYSTEM_VAR
29 #define TRACE_SYSTEM_VAR zfs_multilist
31 #if !defined(_TRACE_MULTILIST_H) || defined(TRACE_HEADER_MULTI_READ)
32 #define _TRACE_MULTILIST_H
34 #include <linux/tracepoint.h>
35 #include <sys/types.h>
38 * Generic support for three argument tracepoints of the form:
40 * DTRACE_PROBE3(...,
41 * multilist_t *, ...,
42 * unsigned int, ...,
43 * void *, ...);
45 /* BEGIN CSTYLED */
46 DECLARE_EVENT_CLASS(zfs_multilist_insert_remove_class,
47 TP_PROTO(multilist_t *ml, unsigned sublist_idx, void *obj),
48 TP_ARGS(ml, sublist_idx, obj),
49 TP_STRUCT__entry(
50 __field(size_t, ml_offset)
51 __field(uint64_t, ml_num_sublists)
53 __field(unsigned int, sublist_idx)
55 TP_fast_assign(
56 __entry->ml_offset = ml->ml_offset;
57 __entry->ml_num_sublists = ml->ml_num_sublists;
59 __entry->sublist_idx = sublist_idx;
61 TP_printk("ml { offset %ld numsublists %llu sublistidx %u } ",
62 __entry->ml_offset, __entry->ml_num_sublists, __entry->sublist_idx)
64 /* END CSTYLED */
66 #define DEFINE_MULTILIST_INSERT_REMOVE_EVENT(name) \
67 DEFINE_EVENT(zfs_multilist_insert_remove_class, name, \
68 TP_PROTO(multilist_t *ml, unsigned int sublist_idx, void *obj), \
69 TP_ARGS(ml, sublist_idx, obj))
70 DEFINE_MULTILIST_INSERT_REMOVE_EVENT(zfs_multilist__insert);
71 DEFINE_MULTILIST_INSERT_REMOVE_EVENT(zfs_multilist__remove);
73 #endif /* _TRACE_MULTILIST_H */
75 #undef TRACE_INCLUDE_PATH
76 #undef TRACE_INCLUDE_FILE
77 #define TRACE_INCLUDE_PATH sys
78 #define TRACE_INCLUDE_FILE trace_multilist
79 #include <trace/define_trace.h>
81 #else
83 DEFINE_DTRACE_PROBE3(multilist__insert);
84 DEFINE_DTRACE_PROBE3(multilist__remove);
86 #endif /* HAVE_DECLARE_EVENT_CLASS */
87 #endif /* _KERNEL */