xref: /illumos-gate/usr/src/lib/smbclnt/libfknsmb/common/sys/sdt.h (revision f17620a4f72a29025a22655ba8735ccd20ae174f)
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  * 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 /*
37  * DTrace SDT probes have different signatures in userland than they do in
38  * kernel.  If we're compiling for user mode (libfksmbsrv) define them as
39  * either no-op (for the SMB dtrace provider) or libfksmbsrv functions for
40  * the other SDT probe sites.
41  */
42 #ifndef	_KERNEL
43 
44 extern void smb_dtrace1(const char *, long);
45 extern void smb_dtrace2(const char *, long, long);
46 extern void smb_dtrace3(const char *, long, long, long);
47 
48 /*
49  * These are for the few (specialized) dtrace SDT probes sprinkled
50  * through the smbclnt code.  In libfknsmb map these to functions.
51  */
52 
53 #undef	DTRACE_PROBE1
54 #define	DTRACE_PROBE1(n, t1, a1) \
55 	smb_dtrace1(#n, (long)a1)
56 
57 #undef	DTRACE_PROBE2
58 #define	DTRACE_PROBE2(n, t1, a1, t2, a2) \
59 	smb_dtrace2(#n, (long)a1, (long)a2)
60 
61 #undef	DTRACE_PROBE3
62 #define	DTRACE_PROBE3(n, t1, a1, t2, a2, t3, a3) \
63 	smb_dtrace3(#n, (long)a1, (long)a2, (long)a3)
64 
65 #endif	/* _KERNEL */
66 
67 #ifdef	__cplusplus
68 }
69 #endif
70 #endif	/* _SYS_SDT_H */
71