codebase style improvements for OpenZFS 6459 port
[freebsd.git] / include / sys / trace_multilist.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) && 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_multilist
29
30 #if !defined(_TRACE_MULTILIST_H) || defined(TRACE_HEADER_MULTI_READ)
31 #define _TRACE_MULTILIST_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  *     multilist_t *, ...,
41  *     unsigned int, ...,
42  *     void *, ...);
43  */
44 /* BEGIN CSTYLED */
45 DECLARE_EVENT_CLASS(zfs_multilist_insert_remove_class,
46         TP_PROTO(multilist_t *ml, unsigned sublist_idx, void *obj),
47         TP_ARGS(ml, sublist_idx, obj),
48         TP_STRUCT__entry(
49             __field(size_t,             ml_offset)
50             __field(uint64_t,           ml_num_sublists)
51
52             __field(unsigned int,       sublist_idx)
53         ),
54         TP_fast_assign(
55             __entry->ml_offset          = ml->ml_offset;
56             __entry->ml_num_sublists    = ml->ml_num_sublists;
57
58             __entry->sublist_idx        = sublist_idx;
59         ),
60         TP_printk("ml { offset %ld numsublists %llu sublistidx %u } ",
61             __entry->ml_offset, __entry->ml_num_sublists, __entry->sublist_idx)
62 );
63 /* END CSTYLED */
64
65 #define DEFINE_MULTILIST_INSERT_REMOVE_EVENT(name) \
66 /* BEGIN CSTYLED */
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 /* END CSTYLED */
71 DEFINE_MULTILIST_INSERT_REMOVE_EVENT(zfs_multilist__insert);
72 DEFINE_MULTILIST_INSERT_REMOVE_EVENT(zfs_multilist__remove);
73
74 #endif /* _TRACE_MULTILIST_H */
75
76 #undef TRACE_INCLUDE_PATH
77 #undef TRACE_INCLUDE_FILE
78 #define TRACE_INCLUDE_PATH sys
79 #define TRACE_INCLUDE_FILE trace_multilist
80 #include <trace/define_trace.h>
81
82 #endif /* _KERNEL && HAVE_DECLARE_EVENT_CLASS */