]>
Commit | Line | Data |
---|---|---|
49ee64e5 NB |
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 | ||
c1718e95 FV |
27 | #undef TRACE_SYSTEM_VAR |
28 | #define TRACE_SYSTEM_VAR zfs_acl | |
29 | ||
49ee64e5 NB |
30 | #if !defined(_TRACE_ACL_H) || defined(TRACE_HEADER_MULTI_READ) |
31 | #define _TRACE_ACL_H | |
32 | ||
33 | #include <linux/tracepoint.h> | |
2c6abf15 | 34 | #include <linux/vfs_compat.h> |
49ee64e5 NB |
35 | #include <sys/types.h> |
36 | ||
37 | /* | |
38 | * Generic support for three argument tracepoints of the form: | |
39 | * | |
40 | * DTRACE_PROBE3(..., | |
41 | * znode_t *, ..., | |
42 | * zfs_ace_hdr_t *, ..., | |
43 | * uint32_t, ...); | |
44 | */ | |
02730c33 | 45 | /* BEGIN CSTYLED */ |
49ee64e5 NB |
46 | DECLARE_EVENT_CLASS(zfs_ace_class, |
47 | TP_PROTO(znode_t *zn, zfs_ace_hdr_t *ace, uint32_t mask_matched), | |
48 | TP_ARGS(zn, ace, mask_matched), | |
49 | TP_STRUCT__entry( | |
50 | __field(uint64_t, z_id) | |
51 | __field(uint8_t, z_unlinked) | |
52 | __field(uint8_t, z_atime_dirty) | |
53 | __field(uint8_t, z_zn_prefetch) | |
54 | __field(uint8_t, z_moved) | |
55 | __field(uint_t, z_blksz) | |
56 | __field(uint_t, z_seq) | |
57 | __field(uint64_t, z_mapcnt) | |
49ee64e5 | 58 | __field(uint64_t, z_size) |
49ee64e5 | 59 | __field(uint64_t, z_pflags) |
49ee64e5 NB |
60 | __field(uint32_t, z_sync_cnt) |
61 | __field(mode_t, z_mode) | |
62 | __field(boolean_t, z_is_sa) | |
49ee64e5 NB |
63 | __field(boolean_t, z_is_mapped) |
64 | __field(boolean_t, z_is_ctldir) | |
65 | __field(boolean_t, z_is_stale) | |
66 | ||
2c6abf15 NB |
67 | __field(uint32_t, i_uid) |
68 | __field(uint32_t, i_gid) | |
49ee64e5 NB |
69 | __field(unsigned long, i_ino) |
70 | __field(unsigned int, i_nlink) | |
71 | __field(u64, i_version) | |
72 | __field(loff_t, i_size) | |
73 | __field(unsigned int, i_blkbits) | |
74 | __field(unsigned short, i_bytes) | |
75 | __field(umode_t, i_mode) | |
76 | __field(__u32, i_generation) | |
77 | ||
78 | __field(uint16_t, z_type) | |
79 | __field(uint16_t, z_flags) | |
80 | __field(uint32_t, z_access_mask) | |
81 | ||
82 | __field(uint32_t, mask_matched) | |
83 | ), | |
84 | TP_fast_assign( | |
85 | __entry->z_id = zn->z_id; | |
86 | __entry->z_unlinked = zn->z_unlinked; | |
87 | __entry->z_atime_dirty = zn->z_atime_dirty; | |
88 | __entry->z_zn_prefetch = zn->z_zn_prefetch; | |
89 | __entry->z_moved = zn->z_moved; | |
90 | __entry->z_blksz = zn->z_blksz; | |
91 | __entry->z_seq = zn->z_seq; | |
92 | __entry->z_mapcnt = zn->z_mapcnt; | |
49ee64e5 | 93 | __entry->z_size = zn->z_size; |
49ee64e5 | 94 | __entry->z_pflags = zn->z_pflags; |
49ee64e5 NB |
95 | __entry->z_sync_cnt = zn->z_sync_cnt; |
96 | __entry->z_mode = zn->z_mode; | |
97 | __entry->z_is_sa = zn->z_is_sa; | |
49ee64e5 NB |
98 | __entry->z_is_mapped = zn->z_is_mapped; |
99 | __entry->z_is_ctldir = zn->z_is_ctldir; | |
100 | __entry->z_is_stale = zn->z_is_stale; | |
101 | ||
64aefee1 NB |
102 | __entry->i_uid = KUID_TO_SUID(ZTOI(zn)->i_uid); |
103 | __entry->i_gid = KGID_TO_SGID(ZTOI(zn)->i_gid); | |
49ee64e5 NB |
104 | __entry->i_ino = zn->z_inode.i_ino; |
105 | __entry->i_nlink = zn->z_inode.i_nlink; | |
106 | __entry->i_version = zn->z_inode.i_version; | |
107 | __entry->i_size = zn->z_inode.i_size; | |
108 | __entry->i_blkbits = zn->z_inode.i_blkbits; | |
109 | __entry->i_bytes = zn->z_inode.i_bytes; | |
110 | __entry->i_mode = zn->z_inode.i_mode; | |
111 | __entry->i_generation = zn->z_inode.i_generation; | |
112 | ||
113 | __entry->z_type = ace->z_type; | |
114 | __entry->z_flags = ace->z_flags; | |
115 | __entry->z_access_mask = ace->z_access_mask; | |
116 | ||
117 | __entry->mask_matched = mask_matched; | |
118 | ), | |
119 | TP_printk("zn { id %llu unlinked %u atime_dirty %u " | |
120 | "zn_prefetch %u moved %u blksz %u seq %u " | |
dfbc8630 | 121 | "mapcnt %llu size %llu pflags %llu " |
2c6abf15 | 122 | "sync_cnt %u mode 0x%x is_sa %d " |
c1570649 | 123 | "is_mapped %d is_ctldir %d is_stale %d inode { " |
2c6abf15 NB |
124 | "uid %u gid %u ino %lu nlink %u version %llu size %lli " |
125 | "blkbits %u bytes %u mode 0x%x generation %x } } " | |
126 | "ace { type %u flags %u access_mask %u } mask_matched %u", | |
49ee64e5 NB |
127 | __entry->z_id, __entry->z_unlinked, __entry->z_atime_dirty, |
128 | __entry->z_zn_prefetch, __entry->z_moved, __entry->z_blksz, | |
278f2236 | 129 | __entry->z_seq, __entry->z_mapcnt, __entry->z_size, |
2c6abf15 | 130 | __entry->z_pflags, __entry->z_sync_cnt, __entry->z_mode, |
d88895a0 | 131 | __entry->z_is_sa, __entry->z_is_mapped, |
2c6abf15 NB |
132 | __entry->z_is_ctldir, __entry->z_is_stale, __entry->i_uid, |
133 | __entry->i_gid, __entry->i_ino, __entry->i_nlink, | |
134 | __entry->i_version, __entry->i_size, __entry->i_blkbits, | |
135 | __entry->i_bytes, __entry->i_mode, __entry->i_generation, | |
136 | __entry->z_type, __entry->z_flags, __entry->z_access_mask, | |
137 | __entry->mask_matched) | |
49ee64e5 | 138 | ); |
02730c33 | 139 | /* END CSTYLED */ |
49ee64e5 | 140 | |
4ea3f864 | 141 | /* BEGIN CSTYLED */ |
e82dbae1 | 142 | #define DEFINE_ACE_EVENT(name) \ |
49ee64e5 NB |
143 | DEFINE_EVENT(zfs_ace_class, name, \ |
144 | TP_PROTO(znode_t *zn, zfs_ace_hdr_t *ace, uint32_t mask_matched), \ | |
145 | TP_ARGS(zn, ace, mask_matched)) | |
4ea3f864 | 146 | /* END CSTYLED */ |
49ee64e5 NB |
147 | DEFINE_ACE_EVENT(zfs_zfs__ace__denies); |
148 | DEFINE_ACE_EVENT(zfs_zfs__ace__allows); | |
149 | ||
150 | #endif /* _TRACE_ACL_H */ | |
151 | ||
152 | #undef TRACE_INCLUDE_PATH | |
153 | #undef TRACE_INCLUDE_FILE | |
154 | #define TRACE_INCLUDE_PATH sys | |
155 | #define TRACE_INCLUDE_FILE trace_acl | |
156 | #include <trace/define_trace.h> | |
157 | ||
158 | #endif /* _KERNEL && HAVE_DECLARE_EVENT_CLASS */ |