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 * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
23 * Copyright (c) 2013 by Delphix. All rights reserved.
24 * Copyright 2017 Nexenta Systems, Inc. All rights reserved.
25 */
26
27 #ifndef _SYS_SDT_H
28 #define _SYS_SDT_H
29
30 #include <sys/stdint.h>
31
32 #ifdef __cplusplus
33 extern "C" {
34 #endif
35
36 #ifndef _KERNEL
37
38 #define DTRACE_PROBE(provider, name) { \
39 extern void __dtrace_##provider##___##name(void); \
40 __dtrace_##provider##___##name(); \
41 }
42
43 #define DTRACE_PROBE1(provider, name, arg1) { \
44 extern void __dtrace_##provider##___##name(unsigned long); \
214 DTRACE_PROBE6(__iscsi_##name, type1, arg1, type2, arg2, \
215 type3, arg3, type4, arg4, type5, arg5, type6, arg6);
216
217 #define DTRACE_ISCSI_7(name, type1, arg1, type2, arg2, \
218 type3, arg3, type4, arg4, type5, arg5, type6, arg6, type7, arg7) \
219 DTRACE_PROBE7(__iscsi_##name, type1, arg1, type2, arg2, \
220 type3, arg3, type4, arg4, type5, arg5, type6, arg6, \
221 type7, arg7);
222
223 #define DTRACE_ISCSI_8(name, type1, arg1, type2, arg2, \
224 type3, arg3, type4, arg4, type5, arg5, type6, arg6, \
225 type7, arg7, type8, arg8) \
226 DTRACE_PROBE8(__iscsi_##name, type1, arg1, type2, arg2, \
227 type3, arg3, type4, arg4, type5, arg5, type6, arg6, \
228 type7, arg7, type8, arg8);
229
230 #define DTRACE_NFSV3_3(name, type1, arg1, type2, arg2, \
231 type3, arg3) \
232 DTRACE_PROBE3(__nfsv3_##name, type1, arg1, type2, arg2, \
233 type3, arg3);
234 #define DTRACE_NFSV3_4(name, type1, arg1, type2, arg2, \
235 type3, arg3, type4, arg4) \
236 DTRACE_PROBE4(__nfsv3_##name, type1, arg1, type2, arg2, \
237 type3, arg3, type4, arg4);
238
239 #define DTRACE_NFSV4_1(name, type1, arg1) \
240 DTRACE_PROBE1(__nfsv4_##name, type1, arg1);
241
242 #define DTRACE_NFSV4_2(name, type1, arg1, type2, arg2) \
243 DTRACE_PROBE2(__nfsv4_##name, type1, arg1, type2, arg2);
244
245 #define DTRACE_NFSV4_3(name, type1, arg1, type2, arg2, type3, arg3) \
246 DTRACE_PROBE3(__nfsv4_##name, type1, arg1, type2, arg2, type3, arg3);
247
248 /*
249 * The SMB probes are done a little differently from the other probes
250 * in this file for the benefit of the libfksmbsrv USDT provider.
251 * See: lib/smbsrv/libfksmbsrv/common/sys/sdt.h
252 */
253 #define DTRACE_SMB_START(name, type1, arg1) \
254 DTRACE_PROBE1(__smb_##name##__start, type1, arg1);
255 #define DTRACE_SMB_DONE(name, type1, arg1) \
256 DTRACE_PROBE1(__smb_##name##__done, type1, arg1);
257
258 #define DTRACE_SMB2_START(name, type1, arg1) \
|
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 * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
23 * Copyright (c) 2013 by Delphix. All rights reserved.
24 * Copyright 2018 Nexenta Systems, Inc. All rights reserved.
25 */
26
27 #ifndef _SYS_SDT_H
28 #define _SYS_SDT_H
29
30 #include <sys/stdint.h>
31
32 #ifdef __cplusplus
33 extern "C" {
34 #endif
35
36 #ifndef _KERNEL
37
38 #define DTRACE_PROBE(provider, name) { \
39 extern void __dtrace_##provider##___##name(void); \
40 __dtrace_##provider##___##name(); \
41 }
42
43 #define DTRACE_PROBE1(provider, name, arg1) { \
44 extern void __dtrace_##provider##___##name(unsigned long); \
214 DTRACE_PROBE6(__iscsi_##name, type1, arg1, type2, arg2, \
215 type3, arg3, type4, arg4, type5, arg5, type6, arg6);
216
217 #define DTRACE_ISCSI_7(name, type1, arg1, type2, arg2, \
218 type3, arg3, type4, arg4, type5, arg5, type6, arg6, type7, arg7) \
219 DTRACE_PROBE7(__iscsi_##name, type1, arg1, type2, arg2, \
220 type3, arg3, type4, arg4, type5, arg5, type6, arg6, \
221 type7, arg7);
222
223 #define DTRACE_ISCSI_8(name, type1, arg1, type2, arg2, \
224 type3, arg3, type4, arg4, type5, arg5, type6, arg6, \
225 type7, arg7, type8, arg8) \
226 DTRACE_PROBE8(__iscsi_##name, type1, arg1, type2, arg2, \
227 type3, arg3, type4, arg4, type5, arg5, type6, arg6, \
228 type7, arg7, type8, arg8);
229
230 #define DTRACE_NFSV3_3(name, type1, arg1, type2, arg2, \
231 type3, arg3) \
232 DTRACE_PROBE3(__nfsv3_##name, type1, arg1, type2, arg2, \
233 type3, arg3);
234
235 #define DTRACE_NFSV3_4(name, type1, arg1, type2, arg2, \
236 type3, arg3, type4, arg4) \
237 DTRACE_PROBE4(__nfsv3_##name, type1, arg1, type2, arg2, \
238 type3, arg3, type4, arg4);
239
240 #define DTRACE_NFSV3_5(name, type1, arg1, type2, arg2, \
241 type3, arg3, type4, arg4, type5, arg5) \
242 DTRACE_PROBE5(__nfsv3_##name, type1, arg1, type2, arg2, \
243 type3, arg3, type4, arg4, type5, arg5);
244
245 #define DTRACE_NFSV4_1(name, type1, arg1) \
246 DTRACE_PROBE1(__nfsv4_##name, type1, arg1);
247
248 #define DTRACE_NFSV4_2(name, type1, arg1, type2, arg2) \
249 DTRACE_PROBE2(__nfsv4_##name, type1, arg1, type2, arg2);
250
251 #define DTRACE_NFSV4_3(name, type1, arg1, type2, arg2, type3, arg3) \
252 DTRACE_PROBE3(__nfsv4_##name, type1, arg1, type2, arg2, type3, arg3);
253
254 /*
255 * The SMB probes are done a little differently from the other probes
256 * in this file for the benefit of the libfksmbsrv USDT provider.
257 * See: lib/smbsrv/libfksmbsrv/common/sys/sdt.h
258 */
259 #define DTRACE_SMB_START(name, type1, arg1) \
260 DTRACE_PROBE1(__smb_##name##__start, type1, arg1);
261 #define DTRACE_SMB_DONE(name, type1, arg1) \
262 DTRACE_PROBE1(__smb_##name##__done, type1, arg1);
263
264 #define DTRACE_SMB2_START(name, type1, arg1) \
|