1*8329232eSGordon Ross /* 2*8329232eSGordon Ross * CDDL HEADER START 3*8329232eSGordon Ross * 4*8329232eSGordon Ross * The contents of this file are subject to the terms of the 5*8329232eSGordon Ross * Common Development and Distribution License (the "License"). 6*8329232eSGordon Ross * You may not use this file except in compliance with the License. 7*8329232eSGordon Ross * 8*8329232eSGordon Ross * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9*8329232eSGordon Ross * or http://www.opensolaris.org/os/licensing. 10*8329232eSGordon Ross * See the License for the specific language governing permissions 11*8329232eSGordon Ross * and limitations under the License. 12*8329232eSGordon Ross * 13*8329232eSGordon Ross * When distributing Covered Code, include this CDDL HEADER in each 14*8329232eSGordon Ross * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15*8329232eSGordon Ross * If applicable, add the following below this CDDL HEADER, with the 16*8329232eSGordon Ross * fields enclosed by brackets "[]" replaced with your own identifying 17*8329232eSGordon Ross * information: Portions Copyright [yyyy] [name of copyright owner] 18*8329232eSGordon Ross * 19*8329232eSGordon Ross * CDDL HEADER END 20*8329232eSGordon Ross */ 21*8329232eSGordon Ross /* 22*8329232eSGordon Ross * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. 23*8329232eSGordon Ross * Copyright (c) 2013 by Delphix. All rights reserved. 24*8329232eSGordon Ross * Copyright 2017 Nexenta Systems, Inc. All rights reserved. 25*8329232eSGordon Ross */ 26*8329232eSGordon Ross 27*8329232eSGordon Ross #ifndef _SYS_SDT_H 28*8329232eSGordon Ross #define _SYS_SDT_H 29*8329232eSGordon Ross 30*8329232eSGordon Ross #include <sys/stdint.h> 31*8329232eSGordon Ross 32*8329232eSGordon Ross #ifdef __cplusplus 33*8329232eSGordon Ross extern "C" { 34*8329232eSGordon Ross #endif 35*8329232eSGordon Ross 36*8329232eSGordon Ross /* 37*8329232eSGordon Ross * DTrace SDT probes have different signatures in userland than they do in 38*8329232eSGordon Ross * kernel. If we're compiling for user mode (libfksmbsrv) define them as 39*8329232eSGordon Ross * either no-op (for the SMB dtrace provider) or libfksmbsrv functions for 40*8329232eSGordon Ross * the other SDT probe sites. 41*8329232eSGordon Ross */ 42*8329232eSGordon Ross #ifndef _KERNEL 43*8329232eSGordon Ross 44*8329232eSGordon Ross extern void smb_dtrace1(const char *, long); 45*8329232eSGordon Ross extern void smb_dtrace2(const char *, long, long); 46*8329232eSGordon Ross extern void smb_dtrace3(const char *, long, long, long); 47*8329232eSGordon Ross 48*8329232eSGordon Ross /* 49*8329232eSGordon Ross * These are for the few (specialized) dtrace SDT probes sprinkled 50*8329232eSGordon Ross * through the smbclnt code. In libfknsmb map these to functions. 51*8329232eSGordon Ross */ 52*8329232eSGordon Ross 53*8329232eSGordon Ross #undef DTRACE_PROBE1 54*8329232eSGordon Ross #define DTRACE_PROBE1(n, t1, a1) \ 55*8329232eSGordon Ross smb_dtrace1(#n, (long)a1) 56*8329232eSGordon Ross 57*8329232eSGordon Ross #undef DTRACE_PROBE2 58*8329232eSGordon Ross #define DTRACE_PROBE2(n, t1, a1, t2, a2) \ 59*8329232eSGordon Ross smb_dtrace2(#n, (long)a1, (long)a2) 60*8329232eSGordon Ross 61*8329232eSGordon Ross #undef DTRACE_PROBE3 62*8329232eSGordon Ross #define DTRACE_PROBE3(n, t1, a1, t2, a2, t3, a3) \ 63*8329232eSGordon Ross smb_dtrace3(#n, (long)a1, (long)a2, (long)a3) 64*8329232eSGordon Ross 65*8329232eSGordon Ross #endif /* _KERNEL */ 66*8329232eSGordon Ross 67*8329232eSGordon Ross #ifdef __cplusplus 68*8329232eSGordon Ross } 69*8329232eSGordon Ross #endif 70*8329232eSGordon Ross #endif /* _SYS_SDT_H */ 71