Sync usage with man page.
[netbsd-mini2440.git] / external / cddl / osnet / dist / uts / common / sys / sdt.h
blobff048021965339cb0939a9167dc9d886670f9c28
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 http://www.opensolaris.org/os/licensing.
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 * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
23 * Use is subject to license terms.
26 #ifndef _SYS_SDT_H
27 #define _SYS_SDT_H
29 #pragma ident "%Z%%M% %I% %E% SMI"
31 #ifdef __cplusplus
32 extern "C" {
33 #endif
35 #ifndef _KERNEL
37 #define DTRACE_PROBE(provider, name) { \
38 extern void __dtrace_##provider##___##name(void); \
39 __dtrace_##provider##___##name(); \
42 #define DTRACE_PROBE1(provider, name, arg1) { \
43 extern void __dtrace_##provider##___##name(unsigned long); \
44 __dtrace_##provider##___##name((unsigned long)arg1); \
47 #define DTRACE_PROBE2(provider, name, arg1, arg2) { \
48 extern void __dtrace_##provider##___##name(unsigned long, \
49 unsigned long); \
50 __dtrace_##provider##___##name((unsigned long)arg1, \
51 (unsigned long)arg2); \
54 #define DTRACE_PROBE3(provider, name, arg1, arg2, arg3) { \
55 extern void __dtrace_##provider##___##name(unsigned long, \
56 unsigned long, unsigned long); \
57 __dtrace_##provider##___##name((unsigned long)arg1, \
58 (unsigned long)arg2, (unsigned long)arg3); \
61 #define DTRACE_PROBE4(provider, name, arg1, arg2, arg3, arg4) { \
62 extern void __dtrace_##provider##___##name(unsigned long, \
63 unsigned long, unsigned long, unsigned long); \
64 __dtrace_##provider##___##name((unsigned long)arg1, \
65 (unsigned long)arg2, (unsigned long)arg3, \
66 (unsigned long)arg4); \
69 #define DTRACE_PROBE5(provider, name, arg1, arg2, arg3, arg4, arg5) { \
70 extern void __dtrace_##provider##___##name(unsigned long, \
71 unsigned long, unsigned long, unsigned long, unsigned long);\
72 __dtrace_##provider##___##name((unsigned long)arg1, \
73 (unsigned long)arg2, (unsigned long)arg3, \
74 (unsigned long)arg4, (unsigned long)arg5); \
77 #else /* _KERNEL */
79 #define DTRACE_PROBE(name) { \
80 extern void __dtrace_probe_##name(void); \
81 __dtrace_probe_##name(); \
84 #define DTRACE_PROBE1(name, type1, arg1) { \
85 extern void __dtrace_probe_##name(uintptr_t); \
86 __dtrace_probe_##name((uintptr_t)(arg1)); \
89 #define DTRACE_PROBE2(name, type1, arg1, type2, arg2) { \
90 extern void __dtrace_probe_##name(uintptr_t, uintptr_t); \
91 __dtrace_probe_##name((uintptr_t)(arg1), (uintptr_t)(arg2)); \
94 #define DTRACE_PROBE3(name, type1, arg1, type2, arg2, type3, arg3) { \
95 extern void __dtrace_probe_##name(uintptr_t, uintptr_t, uintptr_t); \
96 __dtrace_probe_##name((uintptr_t)(arg1), (uintptr_t)(arg2), \
97 (uintptr_t)(arg3)); \
100 #define DTRACE_PROBE4(name, type1, arg1, type2, arg2, \
101 type3, arg3, type4, arg4) { \
102 extern void __dtrace_probe_##name(uintptr_t, uintptr_t, \
103 uintptr_t, uintptr_t); \
104 __dtrace_probe_##name((uintptr_t)(arg1), (uintptr_t)(arg2), \
105 (uintptr_t)(arg3), (uintptr_t)(arg4)); \
108 #define DTRACE_PROBE5(name, type1, arg1, type2, arg2, \
109 type3, arg3, type4, arg4, type5, arg5) { \
110 extern void __dtrace_probe_##name(uintptr_t, uintptr_t, \
111 uintptr_t, uintptr_t, uintptr_t); \
112 __dtrace_probe_##name((uintptr_t)(arg1), (uintptr_t)(arg2), \
113 (uintptr_t)(arg3), (uintptr_t)(arg4), (uintptr_t)(arg5)); \
116 #define DTRACE_PROBE6(name, type1, arg1, type2, arg2, \
117 type3, arg3, type4, arg4, type5, arg5, type6, arg6) { \
118 extern void __dtrace_probe_##name(uintptr_t, uintptr_t, \
119 uintptr_t, uintptr_t, uintptr_t, uintptr_t); \
120 __dtrace_probe_##name((uintptr_t)(arg1), (uintptr_t)(arg2), \
121 (uintptr_t)(arg3), (uintptr_t)(arg4), (uintptr_t)(arg5), \
122 (uintptr_t)(arg6)); \
125 #define DTRACE_PROBE7(name, type1, arg1, type2, arg2, type3, arg3, \
126 type4, arg4, type5, arg5, type6, arg6, type7, arg7) { \
127 extern void __dtrace_probe_##name(uintptr_t, uintptr_t, \
128 uintptr_t, uintptr_t, uintptr_t, uintptr_t, uintptr_t); \
129 __dtrace_probe_##name((uintptr_t)(arg1), (uintptr_t)(arg2), \
130 (uintptr_t)(arg3), (uintptr_t)(arg4), (uintptr_t)(arg5), \
131 (uintptr_t)(arg6), (uintptr_t)(arg7)); \
134 #define DTRACE_SCHED(name) \
135 DTRACE_PROBE(__sched_##name);
137 #define DTRACE_SCHED1(name, type1, arg1) \
138 DTRACE_PROBE1(__sched_##name, type1, arg1);
140 #define DTRACE_SCHED2(name, type1, arg1, type2, arg2) \
141 DTRACE_PROBE2(__sched_##name, type1, arg1, type2, arg2);
143 #define DTRACE_SCHED3(name, type1, arg1, type2, arg2, type3, arg3) \
144 DTRACE_PROBE3(__sched_##name, type1, arg1, type2, arg2, type3, arg3);
146 #define DTRACE_SCHED4(name, type1, arg1, type2, arg2, \
147 type3, arg3, type4, arg4) \
148 DTRACE_PROBE4(__sched_##name, type1, arg1, type2, arg2, \
149 type3, arg3, type4, arg4);
151 #define DTRACE_PROC(name) \
152 DTRACE_PROBE(__proc_##name);
154 #define DTRACE_PROC1(name, type1, arg1) \
155 DTRACE_PROBE1(__proc_##name, type1, arg1);
157 #define DTRACE_PROC2(name, type1, arg1, type2, arg2) \
158 DTRACE_PROBE2(__proc_##name, type1, arg1, type2, arg2);
160 #define DTRACE_PROC3(name, type1, arg1, type2, arg2, type3, arg3) \
161 DTRACE_PROBE3(__proc_##name, type1, arg1, type2, arg2, type3, arg3);
163 #define DTRACE_PROC4(name, type1, arg1, type2, arg2, \
164 type3, arg3, type4, arg4) \
165 DTRACE_PROBE4(__proc_##name, type1, arg1, type2, arg2, \
166 type3, arg3, type4, arg4);
168 #define DTRACE_IO(name) \
169 DTRACE_PROBE(__io_##name);
171 #define DTRACE_IO1(name, type1, arg1) \
172 DTRACE_PROBE1(__io_##name, type1, arg1);
174 #define DTRACE_IO2(name, type1, arg1, type2, arg2) \
175 DTRACE_PROBE2(__io_##name, type1, arg1, type2, arg2);
177 #define DTRACE_IO3(name, type1, arg1, type2, arg2, type3, arg3) \
178 DTRACE_PROBE3(__io_##name, type1, arg1, type2, arg2, type3, arg3);
180 #define DTRACE_IO4(name, type1, arg1, type2, arg2, \
181 type3, arg3, type4, arg4) \
182 DTRACE_PROBE4(__io_##name, type1, arg1, type2, arg2, \
183 type3, arg3, type4, arg4);
185 #define DTRACE_NFSV3_3(name, type1, arg1, type2, arg2, \
186 type3, arg3) \
187 DTRACE_PROBE3(__nfsv3_##name, type1, arg1, type2, arg2, \
188 type3, arg3);
189 #define DTRACE_NFSV3_4(name, type1, arg1, type2, arg2, \
190 type3, arg3, type4, arg4) \
191 DTRACE_PROBE4(__nfsv3_##name, type1, arg1, type2, arg2, \
192 type3, arg3, type4, arg4);
194 #define DTRACE_NFSV4_1(name, type1, arg1) \
195 DTRACE_PROBE1(__nfsv4_##name, type1, arg1);
197 #define DTRACE_NFSV4_2(name, type1, arg1, type2, arg2) \
198 DTRACE_PROBE2(__nfsv4_##name, type1, arg1, type2, arg2);
200 #define DTRACE_NFSV4_3(name, type1, arg1, type2, arg2, type3, arg3) \
201 DTRACE_PROBE3(__nfsv4_##name, type1, arg1, type2, arg2, type3, arg3);
203 #define DTRACE_SMB_1(name, type1, arg1) \
204 DTRACE_PROBE1(__smb_##name, type1, arg1);
206 #define DTRACE_SMB_2(name, type1, arg1, type2, arg2) \
207 DTRACE_PROBE2(__smb_##name, type1, arg1, type2, arg2);
209 #define DTRACE_IP(name) \
210 DTRACE_PROBE(__ip_##name);
212 #define DTRACE_IP1(name, type1, arg1) \
213 DTRACE_PROBE1(__ip_##name, type1, arg1);
215 #define DTRACE_IP2(name, type1, arg1, type2, arg2) \
216 DTRACE_PROBE2(__ip_##name, type1, arg1, type2, arg2);
218 #define DTRACE_IP3(name, type1, arg1, type2, arg2, type3, arg3) \
219 DTRACE_PROBE3(__ip_##name, type1, arg1, type2, arg2, type3, arg3);
221 #define DTRACE_IP4(name, type1, arg1, type2, arg2, \
222 type3, arg3, type4, arg4) \
223 DTRACE_PROBE4(__ip_##name, type1, arg1, type2, arg2, \
224 type3, arg3, type4, arg4);
226 #define DTRACE_IP5(name, type1, arg1, type2, arg2, \
227 type3, arg3, type4, arg4, type5, arg5) \
228 DTRACE_PROBE5(__ip_##name, type1, arg1, type2, arg2, \
229 type3, arg3, type4, arg4, type5, arg5);
231 #define DTRACE_IP6(name, type1, arg1, type2, arg2, \
232 type3, arg3, type4, arg4, type5, arg5, type6, arg6) \
233 DTRACE_PROBE6(__ip_##name, type1, arg1, type2, arg2, \
234 type3, arg3, type4, arg4, type5, arg5, type6, arg6);
236 #define DTRACE_IP7(name, type1, arg1, type2, arg2, type3, arg3, \
237 type4, arg4, type5, arg5, type6, arg6, type7, arg7) \
238 DTRACE_PROBE7(__ip_##name, type1, arg1, type2, arg2, \
239 type3, arg3, type4, arg4, type5, arg5, type6, arg6, \
240 type7, arg7);
242 #define DTRACE_SYSEVENT2(name, type1, arg1, type2, arg2) \
243 DTRACE_PROBE2(__sysevent_##name, type1, arg1, type2, arg2);
245 #define DTRACE_XPV(name) \
246 DTRACE_PROBE(__xpv_##name);
248 #define DTRACE_XPV1(name, type1, arg1) \
249 DTRACE_PROBE1(__xpv_##name, type1, arg1);
251 #define DTRACE_XPV2(name, type1, arg1, type2, arg2) \
252 DTRACE_PROBE2(__xpv_##name, type1, arg1, type2, arg2);
254 #define DTRACE_XPV3(name, type1, arg1, type2, arg2, type3, arg3) \
255 DTRACE_PROBE3(__xpv_##name, type1, arg1, type2, arg2, type3, arg3);
257 #define DTRACE_XPV4(name, type1, arg1, type2, arg2, type3, arg3, \
258 type4, arg4) \
259 DTRACE_PROBE4(__xpv_##name, type1, arg1, type2, arg2, \
260 type3, arg3, type4, arg4);
262 #endif /* _KERNEL */
264 extern const char *sdt_prefix;
266 typedef struct sdt_probedesc {
267 char *sdpd_name; /* name of this probe */
268 unsigned long sdpd_offset; /* offset of call in text */
269 struct sdt_probedesc *sdpd_next; /* next static probe */
270 } sdt_probedesc_t;
272 #ifdef __cplusplus
274 #endif
276 #endif /* _SYS_SDT_H */