]> git.proxmox.com Git - mirror_zfs-debian.git/blame - include/sys/trace_acl.h
Imported Upstream version 0.6.5.7
[mirror_zfs-debian.git] / include / sys / trace_acl.h
CommitLineData
ea04106b
AX
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
e10b0808
AX
27#undef TRACE_SYSTEM_VAR
28#define TRACE_SYSTEM_VAR zfs_acl
29
ea04106b
AX
30#if !defined(_TRACE_ACL_H) || defined(TRACE_HEADER_MULTI_READ)
31#define _TRACE_ACL_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 * znode_t *, ...,
41 * zfs_ace_hdr_t *, ...,
42 * uint32_t, ...);
43 */
44
45DECLARE_EVENT_CLASS(zfs_ace_class,
46 TP_PROTO(znode_t *zn, zfs_ace_hdr_t *ace, uint32_t mask_matched),
47 TP_ARGS(zn, ace, mask_matched),
48 TP_STRUCT__entry(
49 __field(uint64_t, z_id)
50 __field(uint8_t, z_unlinked)
51 __field(uint8_t, z_atime_dirty)
52 __field(uint8_t, z_zn_prefetch)
53 __field(uint8_t, z_moved)
54 __field(uint_t, z_blksz)
55 __field(uint_t, z_seq)
56 __field(uint64_t, z_mapcnt)
57 __field(uint64_t, z_gen)
58 __field(uint64_t, z_size)
59 __array(uint64_t, z_atime, 2)
60 __field(uint64_t, z_links)
61 __field(uint64_t, z_pflags)
62 __field(uint64_t, z_uid)
63 __field(uint64_t, z_gid)
64 __field(uint32_t, z_sync_cnt)
65 __field(mode_t, z_mode)
66 __field(boolean_t, z_is_sa)
67 __field(boolean_t, z_is_zvol)
68 __field(boolean_t, z_is_mapped)
69 __field(boolean_t, z_is_ctldir)
70 __field(boolean_t, z_is_stale)
71
72 __field(unsigned long, i_ino)
73 __field(unsigned int, i_nlink)
74 __field(u64, i_version)
75 __field(loff_t, i_size)
76 __field(unsigned int, i_blkbits)
77 __field(unsigned short, i_bytes)
78 __field(umode_t, i_mode)
79 __field(__u32, i_generation)
80
81 __field(uint16_t, z_type)
82 __field(uint16_t, z_flags)
83 __field(uint32_t, z_access_mask)
84
85 __field(uint32_t, mask_matched)
86 ),
87 TP_fast_assign(
88 __entry->z_id = zn->z_id;
89 __entry->z_unlinked = zn->z_unlinked;
90 __entry->z_atime_dirty = zn->z_atime_dirty;
91 __entry->z_zn_prefetch = zn->z_zn_prefetch;
92 __entry->z_moved = zn->z_moved;
93 __entry->z_blksz = zn->z_blksz;
94 __entry->z_seq = zn->z_seq;
95 __entry->z_mapcnt = zn->z_mapcnt;
96 __entry->z_gen = zn->z_gen;
97 __entry->z_size = zn->z_size;
98 __entry->z_atime[0] = zn->z_atime[0];
99 __entry->z_atime[1] = zn->z_atime[1];
100 __entry->z_links = zn->z_links;
101 __entry->z_pflags = zn->z_pflags;
102 __entry->z_uid = zn->z_uid;
103 __entry->z_gid = zn->z_gid;
104 __entry->z_sync_cnt = zn->z_sync_cnt;
105 __entry->z_mode = zn->z_mode;
106 __entry->z_is_sa = zn->z_is_sa;
107 __entry->z_is_zvol = zn->z_is_zvol;
108 __entry->z_is_mapped = zn->z_is_mapped;
109 __entry->z_is_ctldir = zn->z_is_ctldir;
110 __entry->z_is_stale = zn->z_is_stale;
111
112 __entry->i_ino = zn->z_inode.i_ino;
113 __entry->i_nlink = zn->z_inode.i_nlink;
114 __entry->i_version = zn->z_inode.i_version;
115 __entry->i_size = zn->z_inode.i_size;
116 __entry->i_blkbits = zn->z_inode.i_blkbits;
117 __entry->i_bytes = zn->z_inode.i_bytes;
118 __entry->i_mode = zn->z_inode.i_mode;
119 __entry->i_generation = zn->z_inode.i_generation;
120
121 __entry->z_type = ace->z_type;
122 __entry->z_flags = ace->z_flags;
123 __entry->z_access_mask = ace->z_access_mask;
124
125 __entry->mask_matched = mask_matched;
126 ),
127 TP_printk("zn { id %llu unlinked %u atime_dirty %u "
128 "zn_prefetch %u moved %u blksz %u seq %u "
129 "mapcnt %llu gen %llu size %llu atime 0x%llx:0x%llx "
130 "links %llu pflags %llu uid %llu gid %llu "
131 "sync_cnt %u mode 0x%x is_sa %d is_zvol %d "
132 "is_mapped %d is_ctldir %d is_stale %d inode { "
133 "ino %lu nlink %u version %llu size %lli blkbits %u "
134 "bytes %u mode 0x%x generation %x } } ace { type %u "
135 "flags %u access_mask %u } mask_matched %u",
136 __entry->z_id, __entry->z_unlinked, __entry->z_atime_dirty,
137 __entry->z_zn_prefetch, __entry->z_moved, __entry->z_blksz,
138 __entry->z_seq, __entry->z_mapcnt, __entry->z_gen,
139 __entry->z_size, __entry->z_atime[0], __entry->z_atime[1],
140 __entry->z_links, __entry->z_pflags, __entry->z_uid,
141 __entry->z_gid, __entry->z_sync_cnt, __entry->z_mode,
142 __entry->z_is_sa, __entry->z_is_zvol, __entry->z_is_mapped,
143 __entry->z_is_ctldir, __entry->z_is_stale, __entry->i_ino,
144 __entry->i_nlink, __entry->i_version, __entry->i_size,
145 __entry->i_blkbits, __entry->i_bytes, __entry->i_mode,
146 __entry->i_generation, __entry->z_type, __entry->z_flags,
147 __entry->z_access_mask, __entry->mask_matched)
148);
149
150#define DEFINE_ACE_EVENT(name) \
151DEFINE_EVENT(zfs_ace_class, name, \
152 TP_PROTO(znode_t *zn, zfs_ace_hdr_t *ace, uint32_t mask_matched), \
153 TP_ARGS(zn, ace, mask_matched))
154DEFINE_ACE_EVENT(zfs_zfs__ace__denies);
155DEFINE_ACE_EVENT(zfs_zfs__ace__allows);
156
157#endif /* _TRACE_ACL_H */
158
159#undef TRACE_INCLUDE_PATH
160#undef TRACE_INCLUDE_FILE
161#define TRACE_INCLUDE_PATH sys
162#define TRACE_INCLUDE_FILE trace_acl
163#include <trace/define_trace.h>
164
165#endif /* _KERNEL && HAVE_DECLARE_EVENT_CLASS */