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 2007 Sun Microsystems, Inc.  All rights reserved.
23*8329232eSGordon Ross  * Use is subject to license terms.
24*8329232eSGordon Ross  *
25*8329232eSGordon Ross  * Copyright 2017 Nexenta Systems, Inc.  All rights reserved.
26*8329232eSGordon Ross  */
27*8329232eSGordon Ross 
28*8329232eSGordon Ross #ifndef	_SYS_FTRACE_H
29*8329232eSGordon Ross #define	_SYS_FTRACE_H
30*8329232eSGordon Ross 
31*8329232eSGordon Ross #ifdef	__cplusplus
32*8329232eSGordon Ross extern "C" {
33*8329232eSGordon Ross #endif
34*8329232eSGordon Ross 
35*8329232eSGordon Ross /*
36*8329232eSGordon Ross  * Constants used by both asm and non-asm code.
37*8329232eSGordon Ross  */
38*8329232eSGordon Ross 
39*8329232eSGordon Ross /*
40*8329232eSGordon Ross  * Flags determining the state of tracing -
41*8329232eSGordon Ross  *   both for the "ftrace_state" variable, and for the per-CPU variable
42*8329232eSGordon Ross  *   "cpu[N]->cpu_ftrace_state".
43*8329232eSGordon Ross  */
44*8329232eSGordon Ross #define	FTRACE_READY	0x00000001
45*8329232eSGordon Ross #define	FTRACE_ENABLED	0x00000002
46*8329232eSGordon Ross 
47*8329232eSGordon Ross #include <sys/types.h>
48*8329232eSGordon Ross #include <sys/sdt.h>
49*8329232eSGordon Ross 
50*8329232eSGordon Ross /*
51*8329232eSGordon Ross  * The record of a single event.
52*8329232eSGordon Ross  * ftrace_record_t;
53*8329232eSGordon Ross  */
54*8329232eSGordon Ross 
55*8329232eSGordon Ross #define	FTRACE_0(fmt)						\
56*8329232eSGordon Ross 	DTRACE_PROBE1(ftrace0, char *, fmt)
57*8329232eSGordon Ross #define	FTRACE_1(fmt, d1)					\
58*8329232eSGordon Ross 	DTRACE_PROBE2(ftrace1, char *, fmt, uintptr_t, d1)
59*8329232eSGordon Ross 
60*8329232eSGordon Ross // #define	FTRACE_START()	ftrace_start()
61*8329232eSGordon Ross // #define	FTRACE_STOP()	ftrace_stop()
62*8329232eSGordon Ross 
63*8329232eSGordon Ross #ifdef	__cplusplus
64*8329232eSGordon Ross }
65*8329232eSGordon Ross #endif
66*8329232eSGordon Ross 
67*8329232eSGordon Ross #endif	/* _SYS_FTRACE_H */
68