]> granicus.if.org Git - zfs/blob - include/sys/trace_dnode.h
Fix build failure with Linux 4.1 and FTRACE
[zfs] / include / sys / trace_dnode.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_dnode
29
30 #if !defined(_TRACE_DNODE_H) || defined(TRACE_HEADER_MULTI_READ)
31 #define _TRACE_DNODE_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  *     dnode_t *, ...,
41  *     int64_t, ...,
42  *     uint32_t, ...);
43  */
44
45 DECLARE_EVENT_CLASS(zfs_dnode_move_class,
46         TP_PROTO(dnode_t *dn, int64_t refcount, uint32_t dbufs),
47         TP_ARGS(dn, refcount, dbufs),
48         TP_STRUCT__entry(
49             __field(uint64_t,           dn_object)
50             __field(dmu_object_type_t,  dn_type)
51             __field(uint16_t,           dn_bonuslen)
52             __field(uint8_t,            dn_bonustype)
53             __field(uint8_t,            dn_nblkptr)
54             __field(uint8_t,            dn_checksum)
55             __field(uint8_t,            dn_compress)
56             __field(uint8_t,            dn_nlevels)
57             __field(uint8_t,            dn_indblkshift)
58             __field(uint8_t,            dn_datablkshift)
59             __field(uint8_t,            dn_moved)
60             __field(uint16_t,           dn_datablkszsec)
61             __field(uint32_t,           dn_datablksz)
62             __field(uint64_t,           dn_maxblkid)
63             __field(int64_t,            dn_tx_holds)
64             __field(int64_t,            dn_holds)
65             __field(boolean_t,          dn_have_spill)
66
67             __field(int64_t,            refcount)
68             __field(uint32_t,           dbufs)
69         ),
70         TP_fast_assign(
71             __entry->dn_object          = dn->dn_object;
72             __entry->dn_type            = dn->dn_type;
73             __entry->dn_bonuslen        = dn->dn_bonuslen;
74             __entry->dn_bonustype       = dn->dn_bonustype;
75             __entry->dn_nblkptr         = dn->dn_nblkptr;
76             __entry->dn_checksum        = dn->dn_checksum;
77             __entry->dn_compress        = dn->dn_compress;
78             __entry->dn_nlevels         = dn->dn_nlevels;
79             __entry->dn_indblkshift     = dn->dn_indblkshift;
80             __entry->dn_datablkshift    = dn->dn_datablkshift;
81             __entry->dn_moved           = dn->dn_moved;
82             __entry->dn_datablkszsec    = dn->dn_datablkszsec;
83             __entry->dn_datablksz       = dn->dn_datablksz;
84             __entry->dn_maxblkid        = dn->dn_maxblkid;
85             __entry->dn_tx_holds        = dn->dn_tx_holds.rc_count;
86             __entry->dn_holds           = dn->dn_holds.rc_count;
87             __entry->dn_have_spill      = dn->dn_have_spill;
88
89             __entry->refcount           = refcount;
90             __entry->dbufs              = dbufs;
91         ),
92         TP_printk("dn { object %llu type %d bonuslen %u bonustype %u "
93             "nblkptr %u checksum %u compress %u nlevels %u indblkshift %u "
94             "datablkshift %u moved %u datablkszsec %u datablksz %u "
95             "maxblkid %llu tx_holds %lli holds %lli have_spill %d } "
96             "refcount %lli dbufs %u",
97             __entry->dn_object, __entry->dn_type, __entry->dn_bonuslen,
98             __entry->dn_bonustype, __entry->dn_nblkptr, __entry->dn_checksum,
99             __entry->dn_compress, __entry->dn_nlevels, __entry->dn_indblkshift,
100             __entry->dn_datablkshift, __entry->dn_moved,
101             __entry->dn_datablkszsec, __entry->dn_datablksz,
102             __entry->dn_maxblkid, __entry->dn_tx_holds, __entry->dn_holds,
103             __entry->dn_have_spill, __entry->refcount, __entry->dbufs)
104 );
105
106 #define DEFINE_DNODE_MOVE_EVENT(name) \
107 DEFINE_EVENT(zfs_dnode_move_class, name, \
108         TP_PROTO(dnode_t *dn, int64_t refcount, uint32_t dbufs), \
109         TP_ARGS(dn, refcount, dbufs))
110 DEFINE_DNODE_MOVE_EVENT(zfs_dnode__move);
111
112 #endif /* _TRACE_DNODE_H */
113
114 #undef TRACE_INCLUDE_PATH
115 #undef TRACE_INCLUDE_FILE
116 #define TRACE_INCLUDE_PATH sys
117 #define TRACE_INCLUDE_FILE trace_dnode
118 #include <trace/define_trace.h>
119
120 #endif /* _KERNEL && HAVE_DECLARE_EVENT_CLASS */