]> git.saurik.com Git - apple/xnu.git/blame - osfmk/mach/machine/sdt.h
xnu-2782.20.48.tar.gz
[apple/xnu.git] / osfmk / mach / machine / sdt.h
CommitLineData
2d21ac55
A
1/*
2 * Copyright (c) 2007 Apple Inc. All rights reserved.
3 */
4/*
5 * CDDL HEADER START
6 *
7 * The contents of this file are subject to the terms of the
8 * Common Development and Distribution License, Version 1.0 only
9 * (the "License"). You may not use this file except in compliance
10 * with the License.
11 *
12 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
13 * or http://www.opensolaris.org/os/licensing.
14 * See the License for the specific language governing permissions
15 * and limitations under the License.
16 *
17 * When distributing Covered Code, include this CDDL HEADER in each
18 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
19 * If applicable, add the following below this CDDL HEADER, with the
20 * fields enclosed by brackets "[]" replaced with your own identifying
21 * information: Portions Copyright [yyyy] [name of copyright owner]
22 *
23 * CDDL HEADER END
24 */
25/*
26 * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
27 * Use is subject to license terms.
28 */
29
30#ifndef _MACH_MACHINE_SYS_SDT_H
31#define _MACH_MACHINE_SYS_SDT_H
32
33#include <mach/machine/sdt_isa.h>
34
b0d623f7
A
35#ifdef KERNEL
36
37#if CONFIG_DTRACE
38
2d21ac55
A
39/*
40 * The following macros are used to create static probes. The argument types
41 * should be no greater than uintptr_t in size each. The behavior of larger
42 * types is undefined.
43 */
44
45#define DTRACE_PROBE(provider, name) { \
46 DTRACE_CALL0ARGS(provider, name) \
47}
48
49#define DTRACE_PROBE1(provider, name, arg0) { \
50 uintptr_t __dtrace_args[ARG1_EXTENT] __attribute__ ((aligned (16))); \
51 __dtrace_args[0] = (uintptr_t)arg0; \
52 DTRACE_CALL1ARG(provider, name) \
53}
54
55#define DTRACE_PROBE2(provider, name, arg0, arg1) { \
56 uintptr_t __dtrace_args[ARGS2_EXTENT] __attribute__ ((aligned (16))); \
57 __dtrace_args[0] = (uintptr_t)arg0; \
58 __dtrace_args[1] = (uintptr_t)arg1; \
59 DTRACE_CALL2ARGS(provider, name) \
60}
61
62#define DTRACE_PROBE3(provider, name, arg0, arg1, arg2) { \
63 uintptr_t __dtrace_args[ARGS3_EXTENT] __attribute__ ((aligned (16))); \
64 __dtrace_args[0] = (uintptr_t)arg0; \
65 __dtrace_args[1] = (uintptr_t)arg1; \
66 __dtrace_args[2] = (uintptr_t)arg2; \
67 DTRACE_CALL3ARGS(provider, name) \
68}
69
70#define DTRACE_PROBE4(provider, name, arg0, arg1, arg2, arg3) { \
71 uintptr_t __dtrace_args[ARGS4_EXTENT] __attribute__ ((aligned (16))); \
72 __dtrace_args[0] = (uintptr_t)arg0; \
73 __dtrace_args[1] = (uintptr_t)arg1; \
74 __dtrace_args[2] = (uintptr_t)arg2; \
75 __dtrace_args[3] = (uintptr_t)arg3; \
76 DTRACE_CALL4ARGS(provider, name) \
77}
78
79#define DTRACE_PROBE5(provider, name, arg0, arg1, arg2, arg3, arg4) { \
80 uintptr_t __dtrace_args[ARGS5_EXTENT] __attribute__ ((aligned (16))); \
81 __dtrace_args[0] = (uintptr_t)arg0; \
82 __dtrace_args[1] = (uintptr_t)arg1; \
83 __dtrace_args[2] = (uintptr_t)arg2; \
84 __dtrace_args[3] = (uintptr_t)arg3; \
85 __dtrace_args[4] = (uintptr_t)arg4; \
86 DTRACE_CALL5ARGS(provider, name) \
87}
88
89#define DTRACE_PROBE6(provider, name, arg0, arg1, arg2, arg3, arg4, arg5) { \
90 uintptr_t __dtrace_args[ARGS6_EXTENT] __attribute__ ((aligned (16))); \
91 __dtrace_args[0] = (uintptr_t)arg0; \
92 __dtrace_args[1] = (uintptr_t)arg1; \
93 __dtrace_args[2] = (uintptr_t)arg2; \
94 __dtrace_args[3] = (uintptr_t)arg3; \
95 __dtrace_args[4] = (uintptr_t)arg4; \
96 __dtrace_args[5] = (uintptr_t)arg5; \
97 DTRACE_CALL6ARGS(provider, name) \
98}
99
100#define DTRACE_PROBE7(provider, name, arg0, arg1, arg2, arg3, arg4, arg5, arg6) { \
101 uintptr_t __dtrace_args[ARGS7_EXTENT] __attribute__ ((aligned (16))); \
102 __dtrace_args[0] = (uintptr_t)arg0; \
103 __dtrace_args[1] = (uintptr_t)arg1; \
104 __dtrace_args[2] = (uintptr_t)arg2; \
105 __dtrace_args[3] = (uintptr_t)arg3; \
106 __dtrace_args[4] = (uintptr_t)arg4; \
107 __dtrace_args[5] = (uintptr_t)arg5; \
108 __dtrace_args[6] = (uintptr_t)arg6; \
109 DTRACE_CALL7ARGS(provider, name) \
110}
111
112#define DTRACE_PROBE8(provider, name, arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7) { \
113 uintptr_t __dtrace_args[ARGS8_EXTENT] __attribute__ ((aligned (16))); \
114 __dtrace_args[0] = (uintptr_t)arg0; \
115 __dtrace_args[1] = (uintptr_t)arg1; \
116 __dtrace_args[2] = (uintptr_t)arg2; \
117 __dtrace_args[3] = (uintptr_t)arg3; \
118 __dtrace_args[4] = (uintptr_t)arg4; \
119 __dtrace_args[5] = (uintptr_t)arg5; \
120 __dtrace_args[6] = (uintptr_t)arg6; \
121 __dtrace_args[7] = (uintptr_t)arg7; \
122 DTRACE_CALL8ARGS(provider, name) \
123}
124
125#define DTRACE_PROBE9(provider, name, arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8) { \
126 uintptr_t __dtrace_args[ARGS9_EXTENT] __attribute__ ((aligned (16))); \
127 __dtrace_args[0] = (uintptr_t)arg0; \
128 __dtrace_args[1] = (uintptr_t)arg1; \
129 __dtrace_args[2] = (uintptr_t)arg2; \
130 __dtrace_args[3] = (uintptr_t)arg3; \
131 __dtrace_args[4] = (uintptr_t)arg4; \
132 __dtrace_args[5] = (uintptr_t)arg5; \
133 __dtrace_args[6] = (uintptr_t)arg6; \
134 __dtrace_args[7] = (uintptr_t)arg7; \
135 __dtrace_args[8] = (uintptr_t)arg8; \
136 DTRACE_CALL9ARGS(provider, name) \
137}
138
139#define DTRACE_PROBE10(provider, name, arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9) { \
140 uintptr_t __dtrace_args[ARGS10_EXTENT] __attribute__ ((aligned (16))); \
141 __dtrace_args[0] = (uintptr_t)arg0; \
142 __dtrace_args[1] = (uintptr_t)arg1; \
143 __dtrace_args[2] = (uintptr_t)arg2; \
144 __dtrace_args[3] = (uintptr_t)arg3; \
145 __dtrace_args[4] = (uintptr_t)arg4; \
146 __dtrace_args[5] = (uintptr_t)arg5; \
147 __dtrace_args[6] = (uintptr_t)arg6; \
148 __dtrace_args[7] = (uintptr_t)arg7; \
149 __dtrace_args[8] = (uintptr_t)arg8; \
150 __dtrace_args[9] = (uintptr_t)arg9; \
151 DTRACE_CALL10ARGS(provider, name) \
152}
153
154
2d21ac55
A
155
156#define DTRACE_SCHED(name) \
157 DTRACE_PROBE(__sched_, name);
158
159#define DTRACE_SCHED1(name, type1, arg1) \
160 DTRACE_PROBE1(__sched_, name, arg1);
161
162#define DTRACE_SCHED2(name, type1, arg1, type2, arg2) \
163 DTRACE_PROBE2(__sched_, name, arg1, arg2);
164
165#define DTRACE_SCHED3(name, type1, arg1, type2, arg2, type3, arg3) \
166 DTRACE_PROBE3(__sched_, name, arg1, arg2, arg3);
167
168#define DTRACE_SCHED4(name, type1, arg1, type2, arg2, \
169 type3, arg3, type4, arg4) \
170 DTRACE_PROBE4(__sched_, name, arg1, arg2, arg3, arg4);
171
172#define DTRACE_PROC(name) \
173 DTRACE_PROBE(__proc_, name);
174
175#define DTRACE_PROC1(name, type1, arg1) \
176 DTRACE_PROBE1(__proc_, name, arg1);
177
178#define DTRACE_PROC2(name, type1, arg1, type2, arg2) \
179 DTRACE_PROBE2(__proc_, name, arg1, arg2);
180
181#define DTRACE_PROC3(name, type1, arg1, type2, arg2, type3, arg3) \
182 DTRACE_PROBE3(__proc_, name, arg1, arg2, arg3);
183
184#define DTRACE_PROC4(name, type1, arg1, type2, arg2, \
185 type3, arg3, type4, arg4) \
186 DTRACE_PROBE4(__proc_, name, arg1, arg2, arg3, arg4);
187
188#define DTRACE_IO(name) \
189 DTRACE_PROBE(__io_, name);
190
191#define DTRACE_IO1(name, type1, arg1) \
192 DTRACE_PROBE1(__io_, name, arg1);
193
194#define DTRACE_IO2(name, type1, arg1, type2, arg2) \
39236c6e 195 DTRACE_PROBE2(__io_, name, arg1, arg2);
2d21ac55
A
196
197#define DTRACE_IO3(name, type1, arg1, type2, arg2, type3, arg3) \
198 DTRACE_PROBE3(__io_, name, arg1, arg2, arg3);
199
200#define DTRACE_IO4(name, type1, arg1, type2, arg2, \
201 type3, arg3, type4, arg4) \
202 DTRACE_PROBE4(__io_, name, arg1, arg2, arg3, arg4);
203
204#define DTRACE_INT5(name, type1, arg1, type2, arg2, \
205 type3, arg3, type4, arg4, type5, arg5) \
206 DTRACE_PROBE5(__sdt_, name, arg1, arg2, arg3, arg4, arg5);
207
208#define DTRACE_TMR3(name, type1, arg1, type2, arg2, type3, arg3) \
209 DTRACE_PROBE3(__sdt_, name, arg1, arg2, arg3);
210
4b17d6b6
A
211#define DTRACE_TMR4(name, type1, arg1, arg2, arg3, arg4) \
212 DTRACE_PROBE4(__sdt_, name, arg1, arg2, arg3, arg4);
213
214#define DTRACE_TMR5(name, type1, arg1, type2, arg2, type3, arg3, arg4, arg5) \
215 DTRACE_PROBE5(__sdt_, name, arg1, arg2, arg3, arg4, arg5);
216
217#define DTRACE_TMR6(name, type1, arg1, type2, arg2, type3, arg3, arg4, arg5, arg6) \
218 DTRACE_PROBE6(__sdt_, name, arg1, arg2, arg3, arg4, arg5, arg6);
219
39236c6e
A
220#define DTRACE_TMR7(name, type1, arg1, type2, arg2, type3, arg3, arg4, arg5, arg6, arg7) \
221 DTRACE_PROBE7(__sdt_, name, arg1, arg2, arg3, arg4, arg5, arg6, arg7);
222
2d21ac55
A
223#define DTRACE_VM(name) \
224 DTRACE_PROBE(__vminfo_, name)
225
226#define DTRACE_VM1(name, type1, arg1) \
227 DTRACE_PROBE1(__vminfo_, name, arg1)
228
229#define DTRACE_VM2(name, type1, arg1, type2, arg2) \
230 DTRACE_PROBE2(__vminfo_, name, arg1, arg2)
231
232#define DTRACE_VM3(name, type1, arg1, type2, arg2, type3, arg3) \
233 DTRACE_PROBE3(__vminfo_, name, arg1, arg2, arg3)
234
235#define DTRACE_VM4(name, type1, arg1, type2, arg2, \
236 type3, arg3, type4, arg4) \
237 DTRACE_PROBE4(__vminfo_, name, arg1, arg2, arg3, arg4)
238
6d2010ae
A
239#define DTRACE_IP(name) \
240 DTRACE_PROBE(__ip_, name)
241
242#define DTRACE_IP1(name, type1, arg1) \
243 DTRACE_PROBE1(__ip_, name, arg1)
244
245#define DTRACE_IP2(name, type1, arg1, type2, arg2) \
246 DTRACE_PROBE2(__ip_, name, arg1, arg2)
247
248#define DTRACE_IP3(name, type1, arg1, type2, arg2, type3, arg3) \
249 DTRACE_PROBE3(__ip_, name, arg1, arg2, arg3)
250
251#define DTRACE_IP4(name, type1, arg1, type2, arg2, \
252 type3, arg3, type4, arg4) \
253 DTRACE_PROBE4(__ip_, name, arg1, arg2, arg3, arg4)
254
255#define DTRACE_IP5(name, typ1, arg1, type2, arg2, type3, arg3, \
256 type4, arg4, type5, arg5) \
257 DTRACE_PROBE5(__ip_, name, arg1, arg2, arg3, arg4, arg5)
258
259#define DTRACE_IP6(name, type1, arg1, type2, arg2, type3, arg3, \
260 type4,arg4, type5, arg5, type6, arg6) \
261 DTRACE_PROBE6(__ip_, name, arg1, arg2, arg3, arg4, arg5, arg6)
262
263#define DTRACE_IP7(name, type1, arg1, type2, arg2, type3, arg3, \
264 type4, arg4, type5, arg5, type6, arg6, type7, arg7) \
265 DTRACE_PROBE7(__ip_, name, arg1, arg2, arg3, arg4, arg5, arg6, arg7)
266
267#define DTRACE_TCP(name) \
268 DTRACE_PROBE(__tcp_, name)
269
270#define DTRACE_TCP1(name, type1, arg1) \
271 DTRACE_PROBE1(__tcp_, name, arg1)
272
273#define DTRACE_TCP2(name, type1, arg1, type2, arg2) \
274 DTRACE_PROBE2(__tcp_, name, arg1, arg2)
275
276#define DTRACE_TCP3(name, type1, arg1, type2, arg2, type3, arg3) \
277 DTRACE_PROBE3(__tcp_, name, arg1, arg2, arg3)
278
279#define DTRACE_TCP4(name, type1, arg1, type2, arg2, \
280 type3, arg3, type4, arg4) \
281 DTRACE_PROBE4(__tcp_, name, arg1, arg2, arg3, arg4)
282
283#define DTRACE_TCP5(name, typ1, arg1, type2, arg2, type3, arg3, \
284 type4, arg4, type5, arg5) \
285 DTRACE_PROBE5(__tcp_, name, arg1, arg2, arg3, arg4, arg5)
286
39236c6e
A
287#define DTRACE_MPTCP(name) \
288 DTRACE_PROBE(__mptcp_, name)
289
290#define DTRACE_MPTCP1(name, type1, arg1) \
291 DTRACE_PROBE1(__mptcp_, name, arg1)
292
293#define DTRACE_MPTCP2(name, type1, arg1, type2, arg2) \
294 DTRACE_PROBE2(__mptcp_, name, arg1, arg2)
295
296#define DTRACE_MPTCP3(name, type1, arg1, type2, arg2, type3, arg3) \
297 DTRACE_PROBE3(__mptcp_, name, arg1, arg2, arg3)
298
299#define DTRACE_MPTCP4(name, type1, arg1, type2, arg2, \
300 type3, arg3, type4, arg4) \
301 DTRACE_PROBE4(__mptcp_, name, arg1, arg2, arg3, arg4)
302
303#define DTRACE_MPTCP5(name, typ1, arg1, type2, arg2, type3, arg3, \
304 type4, arg4, type5, arg5) \
305 DTRACE_PROBE5(__mptcp_, name, arg1, arg2, arg3, arg4, arg5)
306
307#define DTRACE_MPTCP6(name, typ1, arg1, type2, arg2, type3, arg3, \
308 type4, arg4, type5, arg5, type6, arg6) \
309 DTRACE_PROBE6(__mptcp_, name, arg1, arg2, arg3, arg4, arg5, arg6)
310
311#define DTRACE_MPTCP7(name, typ1, arg1, type2, arg2, type3, arg3, \
312 type4, arg4, type5, arg5, type6, arg6, \
313 type7, arg7) \
314 DTRACE_PROBE7(__mptcp_, name, arg1, arg2, arg3, arg4, arg5, \
315 arg6, arg7)
316
317#define DTRACE_FSINFO(name, type, vp) \
318 DTRACE_PROBE1(__fsinfo_, name, vp)
319
320#define DTRACE_FSINFO_IO(name, type1, vp, type2, size) \
321 DTRACE_PROBE2(__fsinfo_, name, vp, size)
322
323#define DTRACE_BOOST(name) \
324 DTRACE_PROBE(__boost_, name);
325
326#define DTRACE_BOOST1(name, type1, arg1) \
327 DTRACE_PROBE1(__boost_, name, arg1);
328
329#define DTRACE_BOOST2(name, type1, arg1, type2, arg2) \
330 DTRACE_PROBE2(__boost_, name, arg1, arg2);
331
332#define DTRACE_BOOST3(name, type1, arg1, type2, arg2, type3, arg3) \
333 DTRACE_PROBE3(__boost_, name, arg1, arg2, arg3);
334
335#define DTRACE_BOOST4(name, type1, arg1, type2, arg2, \
336 type3, arg3, type4, arg4) \
337 DTRACE_PROBE4(__boost_, name, arg1, arg2, arg3, arg4);
338
339#define DTRACE_BOOST5(name, type1, arg1, type2, arg2, \
340 type3, arg3, type4, arg4, type5, arg5) \
341 DTRACE_PROBE5(__boost_, name, arg1, arg2, arg3, arg4, arg5);
342
343#define DTRACE_BOOST6(name, type1, arg1, type2, arg2, \
344 type3, arg3, type4, arg4, type5, arg5, type6, arg6) \
345 DTRACE_PROBE6(__boost_, name, arg1, arg2, arg3, arg4, arg5, arg6);
346
2d21ac55
A
347#else /* CONFIG_DTRACE */
348
349#define DTRACE_SCHED(name) do {} while (0)
350#define DTRACE_SCHED1(name, type1, arg1) do {} while (0)
351#define DTRACE_SCHED2(name, type1, arg1, type2, arg2) do {} while (0)
352#define DTRACE_SCHED3(name, type1, arg1, type2, arg2, type3, arg3) do {} while (0)
353#define DTRACE_SCHED4(name, type1, arg1, type2, arg2, type3, arg3, type4, arg4) do {} while (0)
354
355#define DTRACE_PROC(name) do {} while(0)
356#define DTRACE_PROC1(name, type1, arg1) do {} while(0)
357#define DTRACE_PROC2(name, type1, arg1, type2, arg2) do {} while (0)
358#define DTRACE_PROC3(name, type1, arg1, type2, arg2, type3, arg3) do {} while (0)
359#define DTRACE_PROC4(name, type1, arg1, type2, arg2, type3, arg3, type4, arg4) do {} while(0)
360#define DTRACE_IO(name) do {} while(0)
361#define DTRACE_IO1(name, type1, arg1) do {} while(0)
362#define DTRACE_IO2(name, type1, arg1, type2, arg2) do {} while(0)
363#define DTRACE_IO3(name, type1, arg1, type2, arg2, type3, arg3) do {} while(0)
364#define DTRACE_IO4(name, type1, arg1, type2, arg2, type3, arg3, type4, arg4) do {} while(0)
365#define DTRACE_INT5(name, type1, arg1, type2, arg2, type3, arg3, type4, arg4, type5, arg5) do {} while(0)
366#define DTRACE_TMR3(name, type1, arg1, type2, arg2, type3, arg3) do {} while(0)
367
368#define DTRACE_VM(name) do {} while(0)
369#define DTRACE_VM1(name, type1, arg1) do {} while(0)
370#define DTRACE_VM2(name, type1, arg1, type2, arg2) do {} while(0)
371#define DTRACE_VM3(name, type1, arg1, type2, arg2, type3, arg3) do {} while(0)
372#define DTRACE_VM4(name, type1, arg1, type2, arg2, type3, arg3, type4, arg4) do {} while(0)
6d2010ae
A
373#define DTRACE_IP(name) do {} while(0)
374#define DTRACE_IP1(name, type1, arg1) do {} while(0)
375#define DTRACE_IP2(name, type1, arg1, type2, arg2) do {} while(0)
376#define DTRACE_IP3(name, type1, arg1, type2, arg2, type3, arg3) do {} while(0)
377#define DTRACE_IP4(name, type1, arg1, type2, arg2, type3, arg3, type4, arg4) do {} while(0)
378#define DTRACE_IP5(name, type1, arg1, type2, arg2, type3, arg3, type4, arg4, type5, arg5) do {} while(0)
379#define DTRACE_IP6(name, type1, arg1, type2, arg2, type3, arg3, type4, arg4, type5, arg5, type6, arg6) do {} while(0)
380#define DTRACE_IP7(name, type1, arg1, type2, arg2, type3, arg3, type4, arg4, type5, arg5, \
381 type6, arg6, type7, arg7) do {} while(0)
382
383#define DTRACE_TCP(name) do {} while(0)
384#define DTRACE_TCP1(name, type1, arg1) do {} while(0)
385#define DTRACE_TCP2(name, type1, arg1, type2, arg2) do {} while(0)
386#define DTRACE_TCP3(name, type1, arg1, type2, arg2, type3, arg3) do {} while(0)
387#define DTRACE_TCP4(name, type1, arg1, type2, arg2, type3, arg3, type4, arg4) do {} while(0)
388#define DTRACE_TCP5(name, type1, arg1, type2, arg2, type3, arg3, type4, arg4, type5, arg5) do {} while(0)
2d21ac55 389
39236c6e
A
390#define DTRACE_MPTCP(name) do {} while(0)
391#define DTRACE_MPTCP1(name, type1, arg1) do {} while(0)
392#define DTRACE_MPTCP2(name, type1, arg1, type2, arg2) do {} while(0)
393#define DTRACE_MPTCP3(name, type1, arg1, type2, arg2, type3, arg3) do {} while(0)
394#define DTRACE_MPTCP4(name, type1, arg1, type2, arg2, type3, arg3, type4, arg4) do {} while(0)
395#define DTRACE_MPTCP5(name, type1, arg1, type2, arg2, type3, arg3, type4, arg4, type5, arg5) do {} while(0)
396#define DTRACE_MPTCP6(name, type1, arg1, type2, arg2, type3, arg3, type4, arg4, type5, arg5, type6, arg6) do {} while(0)
397#define DTRACE_MPTCP7(name, type1, arg1, type2, arg2, type3, arg3, type4, arg4, type5, arg5, type6, arg6, type7, arg7) do {} while(0)
398
399#define DTRACE_FSINFO(name, type, vp) do {} while(0)
400#define DTRACE_FSINFO_IO(name, type1, vp, type2, size) do {} while (0)
401
402#define DTRACE_BOOST(name) do {} while(0)
403#define DTRACE_BOOST1(name, type1, arg1) do {} while(0)
404#define DTRACE_BOOST2(name, type1, arg1, type2, arg2) do {} while(0)
405#define DTRACE_BOOST3(name, type1, arg1, type2, arg2, type3, arg3) do {} while(0)
406#define DTRACE_BOOST4(name, type1, arg1, type2, arg2, type3, arg3, type4, arg4) do {} while(0)
407#define DTRACE_BOOST5(name, type1, arg1, type2, arg2, type3, arg3, type4, arg4, type5, arg5) do {} while(0)
408#define DTRACE_BOOST6(name, type1, arg1, type2, arg2, type3, arg3, type4, arg4, type5, arg5, type6, arg6) do {} while(0)
409
2d21ac55
A
410#endif /* CONFIG_DTRACE */
411
412#endif /* KERNEL */
413
414#endif /* _MACH_MACHINE_SYS_SDT_H */