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 /*
23 * Copyright 2010 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
25 */
26
27 /*
28 * Copyright (c) 2013, Joyent, Inc. All rights reserved.
29 * Copyright (c) 2012 by Delphix. All rights reserved.
30 */
31
32 #ifndef _DT_IMPL_H
33 #define _DT_IMPL_H
34
35 #include <sys/param.h>
36 #include <sys/objfs.h>
37 #include <setjmp.h>
38 #include <libctf.h>
39 #include <dtrace.h>
40 #include <gelf.h>
41 #include <synch.h>
42
43 #ifdef __cplusplus
44 extern "C" {
45 #endif
46
47 #include <dt_parser.h>
48 #include <dt_regset.h>
49 #include <dt_inttab.h>
303 hrtime_t dt_laststatus; /* last status */
304 hrtime_t dt_lastswitch; /* last switch of buffer data */
305 hrtime_t dt_lastagg; /* last snapshot of aggregation data */
306 char *dt_sprintf_buf; /* buffer for dtrace_sprintf() */
307 int dt_sprintf_buflen; /* length of dtrace_sprintf() buffer */
308 const char *dt_filetag; /* default filetag for dt_set_errmsg() */
309 char *dt_buffered_buf; /* buffer for buffered output */
310 size_t dt_buffered_offs; /* current offset into buffered buffer */
311 size_t dt_buffered_size; /* size of buffered buffer */
312 dtrace_handle_buffered_f *dt_bufhdlr; /* buffered handler, if any */
313 void *dt_bufarg; /* buffered handler argument */
314 dt_dof_t dt_dof; /* DOF generation buffers (see dt_dof.c) */
315 struct utsname dt_uts; /* uname(2) information for system */
316 dt_list_t dt_lib_dep; /* scratch linked-list of lib dependencies */
317 dt_list_t dt_lib_dep_sorted; /* dependency sorted library list */
318 dtrace_flowkind_t dt_flow; /* flow kind */
319 const char *dt_prefix; /* recommended flow prefix */
320 int dt_indent; /* recommended flow indent */
321 dtrace_epid_t dt_last_epid; /* most recently consumed EPID */
322 uint64_t dt_last_timestamp; /* most recently consumed timestamp */
323 };
324
325 /*
326 * Values for the user arg of the ECB.
327 */
328 #define DT_ECB_DEFAULT 0
329 #define DT_ECB_ERROR 1
330
331 /*
332 * Values for the dt_linkmode property, which is used by the assembler when
333 * processing external symbol references. User can set using -xlink=<mode>.
334 */
335 #define DT_LINK_KERNEL 0 /* kernel syms static, user syms dynamic */
336 #define DT_LINK_PRIMARY 1 /* primary kernel syms static, others dynamic */
337 #define DT_LINK_DYNAMIC 2 /* all symbols dynamic */
338 #define DT_LINK_STATIC 3 /* all symbols static */
339
340 /*
341 * Values for the dt_linktype property, which is used by dtrace_program_link()
342 * to determine the type of output file that is desired by the client.
|
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 /*
23 * Copyright 2010 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
25 */
26
27 /*
28 * Copyright (c) 2013, Joyent, Inc. All rights reserved.
29 * Copyright (c) 2011, 2014 by Delphix. All rights reserved.
30 */
31
32 #ifndef _DT_IMPL_H
33 #define _DT_IMPL_H
34
35 #include <sys/param.h>
36 #include <sys/objfs.h>
37 #include <setjmp.h>
38 #include <libctf.h>
39 #include <dtrace.h>
40 #include <gelf.h>
41 #include <synch.h>
42
43 #ifdef __cplusplus
44 extern "C" {
45 #endif
46
47 #include <dt_parser.h>
48 #include <dt_regset.h>
49 #include <dt_inttab.h>
303 hrtime_t dt_laststatus; /* last status */
304 hrtime_t dt_lastswitch; /* last switch of buffer data */
305 hrtime_t dt_lastagg; /* last snapshot of aggregation data */
306 char *dt_sprintf_buf; /* buffer for dtrace_sprintf() */
307 int dt_sprintf_buflen; /* length of dtrace_sprintf() buffer */
308 const char *dt_filetag; /* default filetag for dt_set_errmsg() */
309 char *dt_buffered_buf; /* buffer for buffered output */
310 size_t dt_buffered_offs; /* current offset into buffered buffer */
311 size_t dt_buffered_size; /* size of buffered buffer */
312 dtrace_handle_buffered_f *dt_bufhdlr; /* buffered handler, if any */
313 void *dt_bufarg; /* buffered handler argument */
314 dt_dof_t dt_dof; /* DOF generation buffers (see dt_dof.c) */
315 struct utsname dt_uts; /* uname(2) information for system */
316 dt_list_t dt_lib_dep; /* scratch linked-list of lib dependencies */
317 dt_list_t dt_lib_dep_sorted; /* dependency sorted library list */
318 dtrace_flowkind_t dt_flow; /* flow kind */
319 const char *dt_prefix; /* recommended flow prefix */
320 int dt_indent; /* recommended flow indent */
321 dtrace_epid_t dt_last_epid; /* most recently consumed EPID */
322 uint64_t dt_last_timestamp; /* most recently consumed timestamp */
323 boolean_t dt_has_sugar; /* syntactic sugar used? */
324 };
325
326 /*
327 * Values for the user arg of the ECB.
328 */
329 #define DT_ECB_DEFAULT 0
330 #define DT_ECB_ERROR 1
331
332 /*
333 * Values for the dt_linkmode property, which is used by the assembler when
334 * processing external symbol references. User can set using -xlink=<mode>.
335 */
336 #define DT_LINK_KERNEL 0 /* kernel syms static, user syms dynamic */
337 #define DT_LINK_PRIMARY 1 /* primary kernel syms static, others dynamic */
338 #define DT_LINK_DYNAMIC 2 /* all symbols dynamic */
339 #define DT_LINK_STATIC 3 /* all symbols static */
340
341 /*
342 * Values for the dt_linktype property, which is used by dtrace_program_link()
343 * to determine the type of output file that is desired by the client.
|