17c478bdstevel@tonic-gate/*
27c478bdstevel@tonic-gate * CDDL HEADER START
37c478bdstevel@tonic-gate *
47c478bdstevel@tonic-gate * The contents of this file are subject to the terms of the
5c9d6cd7jhaslam * Common Development and Distribution License (the "License").
6c9d6cd7jhaslam * You may not use this file except in compliance with the License.
77c478bdstevel@tonic-gate *
87c478bdstevel@tonic-gate * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
97c478bdstevel@tonic-gate * or http://www.opensolaris.org/os/licensing.
107c478bdstevel@tonic-gate * See the License for the specific language governing permissions
117c478bdstevel@tonic-gate * and limitations under the License.
127c478bdstevel@tonic-gate *
137c478bdstevel@tonic-gate * When distributing Covered Code, include this CDDL HEADER in each
147c478bdstevel@tonic-gate * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
157c478bdstevel@tonic-gate * If applicable, add the following below this CDDL HEADER, with the
167c478bdstevel@tonic-gate * fields enclosed by brackets "[]" replaced with your own identifying
177c478bdstevel@tonic-gate * information: Portions Copyright [yyyy] [name of copyright owner]
187c478bdstevel@tonic-gate *
197c478bdstevel@tonic-gate * CDDL HEADER END
207c478bdstevel@tonic-gate */
21900524fahl
227c478bdstevel@tonic-gate/*
23c9d6cd7jhaslam * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
247c478bdstevel@tonic-gate * Use is subject to license terms.
257c478bdstevel@tonic-gate */
267c478bdstevel@tonic-gate
272b6389eBryan Cantrill/*
28c3bd3abMatthew Ahrens * Copyright (c) 2014, 2016 by Delphix. All rights reserved.
29a386cc1Robert Mustacchi * Copyright (c) 2013, Joyent, Inc. All rights reserved.
302b6389eBryan Cantrill */
312b6389eBryan Cantrill
327c478bdstevel@tonic-gate#ifndef	_DTRACE_H
337c478bdstevel@tonic-gate#define	_DTRACE_H
347c478bdstevel@tonic-gate
357c478bdstevel@tonic-gate#include <sys/dtrace.h>
367c478bdstevel@tonic-gate#include <stdarg.h>
377c478bdstevel@tonic-gate#include <stdio.h>
387c478bdstevel@tonic-gate#include <gelf.h>
397c478bdstevel@tonic-gate
407c478bdstevel@tonic-gate#ifdef	__cplusplus
417c478bdstevel@tonic-gateextern "C" {
427c478bdstevel@tonic-gate#endif
437c478bdstevel@tonic-gate
447c478bdstevel@tonic-gate/*
457c478bdstevel@tonic-gate * DTrace Dynamic Tracing Software: Library Interfaces
467c478bdstevel@tonic-gate *
477c478bdstevel@tonic-gate * Note: The contents of this file are private to the implementation of the
487c478bdstevel@tonic-gate * Solaris system and DTrace subsystem and are subject to change at any time
497c478bdstevel@tonic-gate * without notice.  Applications and drivers using these interfaces will fail
507c478bdstevel@tonic-gate * to run on future releases.  These interfaces should not be used for any
517c478bdstevel@tonic-gate * purpose except those expressly outlined in dtrace(7D) and libdtrace(3LIB).
527c478bdstevel@tonic-gate * Please refer to the "Solaris Dynamic Tracing Guide" for more information.
537c478bdstevel@tonic-gate */
547c478bdstevel@tonic-gate
55900524fahl#define	DTRACE_VERSION	3		/* library ABI interface version */
567c478bdstevel@tonic-gate
577c478bdstevel@tonic-gatestruct ps_prochandle;
58c3bd3abMatthew Ahrensstruct dt_node;
597c478bdstevel@tonic-gatetypedef struct dtrace_hdl dtrace_hdl_t;
607c478bdstevel@tonic-gatetypedef struct dtrace_prog dtrace_prog_t;
617c478bdstevel@tonic-gatetypedef struct dtrace_vector dtrace_vector_t;
627c478bdstevel@tonic-gatetypedef struct dtrace_aggdata dtrace_aggdata_t;
637c478bdstevel@tonic-gate
647c478bdstevel@tonic-gate#define	DTRACE_O_NODEV		0x01	/* do not open dtrace(7D) device */
657c478bdstevel@tonic-gate#define	DTRACE_O_NOSYS		0x02	/* do not load /system/object modules */
667c478bdstevel@tonic-gate#define	DTRACE_O_LP64		0x04	/* force D compiler to be LP64 */
677c478bdstevel@tonic-gate#define	DTRACE_O_ILP32		0x08	/* force D compiler to be ILP32 */
687c478bdstevel@tonic-gate#define	DTRACE_O_MASK		0x0f	/* mask of valid flags to dtrace_open */
697c478bdstevel@tonic-gate
707c478bdstevel@tonic-gateextern dtrace_hdl_t *dtrace_open(int, int, int *);
717c478bdstevel@tonic-gateextern dtrace_hdl_t *dtrace_vopen(int, int, int *,
727c478bdstevel@tonic-gate    const dtrace_vector_t *, void *);
737c478bdstevel@tonic-gate
747c478bdstevel@tonic-gateextern int dtrace_go(dtrace_hdl_t *);
757c478bdstevel@tonic-gateextern int dtrace_stop(dtrace_hdl_t *);
767c478bdstevel@tonic-gateextern void dtrace_sleep(dtrace_hdl_t *);
777c478bdstevel@tonic-gateextern void dtrace_close(dtrace_hdl_t *);
787c478bdstevel@tonic-gate
797c478bdstevel@tonic-gateextern int dtrace_errno(dtrace_hdl_t *);
807c478bdstevel@tonic-gateextern const char *dtrace_errmsg(dtrace_hdl_t *, int);
817c478bdstevel@tonic-gateextern const char *dtrace_faultstr(dtrace_hdl_t *, int);
821a7c1b7mwsextern const char *dtrace_subrstr(dtrace_hdl_t *, int);
837c478bdstevel@tonic-gate
847c478bdstevel@tonic-gateextern int dtrace_setopt(dtrace_hdl_t *, const char *, const char *);
857c478bdstevel@tonic-gateextern int dtrace_getopt(dtrace_hdl_t *, const char *, dtrace_optval_t *);
867c478bdstevel@tonic-gate
877c478bdstevel@tonic-gateextern void dtrace_update(dtrace_hdl_t *);
887c478bdstevel@tonic-gateextern int dtrace_ctlfd(dtrace_hdl_t *);
897c478bdstevel@tonic-gate
907c478bdstevel@tonic-gate/*
917c478bdstevel@tonic-gate * DTrace Program Interface
927c478bdstevel@tonic-gate *
937c478bdstevel@tonic-gate * DTrace programs can be created by compiling ASCII text files containing
941a7c1b7mws * D programs or by compiling in-memory C strings that specify a D program.
957c478bdstevel@tonic-gate * Once created, callers can examine the list of program statements and
967c478bdstevel@tonic-gate * enable the probes and actions described by these statements.
977c478bdstevel@tonic-gate */
987c478bdstevel@tonic-gate
997c478bdstevel@tonic-gatetypedef struct dtrace_proginfo {
1007c478bdstevel@tonic-gate	dtrace_attribute_t dpi_descattr; /* minimum probedesc attributes */
1017c478bdstevel@tonic-gate	dtrace_attribute_t dpi_stmtattr; /* minimum statement attributes */
1027c478bdstevel@tonic-gate	uint_t dpi_aggregates;	/* number of aggregates specified in program */
1037c478bdstevel@tonic-gate	uint_t dpi_recgens;	/* number of record generating probes in prog */
1047c478bdstevel@tonic-gate	uint_t dpi_matches;	/* number of probes matched by program */
1057c478bdstevel@tonic-gate	uint_t dpi_speculations; /* number of speculations specified in prog */
1067c478bdstevel@tonic-gate} dtrace_proginfo_t;
1077c478bdstevel@tonic-gate
1087c478bdstevel@tonic-gate#define	DTRACE_C_DIFV	0x0001	/* DIF verbose mode: show each compiled DIFO */
1097c478bdstevel@tonic-gate#define	DTRACE_C_EMPTY	0x0002	/* Permit compilation of empty D source files */
1107c478bdstevel@tonic-gate#define	DTRACE_C_ZDEFS	0x0004	/* Permit probe defs that match zero probes */
1117c478bdstevel@tonic-gate#define	DTRACE_C_EATTR	0x0008	/* Error if program attributes less than min */
1127c478bdstevel@tonic-gate#define	DTRACE_C_CPP	0x0010	/* Preprocess input file with cpp(1) utility */
1137c478bdstevel@tonic-gate#define	DTRACE_C_KNODEF	0x0020	/* Permit unresolved kernel symbols in DIFO */
1147c478bdstevel@tonic-gate#define	DTRACE_C_UNODEF	0x0040	/* Permit unresolved user symbols in DIFO */
115c3bd3abMatthew Ahrens#define	DTRACE_C_PSPEC	0x0080	/* Interpret ambiguous specifiers as probes */
1167c478bdstevel@tonic-gate#define	DTRACE_C_ETAGS	0x0100	/* Prefix error messages with error tags */
1177c478bdstevel@tonic-gate#define	DTRACE_C_ARGREF	0x0200	/* Do not require all macro args to be used */
1187c478bdstevel@tonic-gate#define	DTRACE_C_DEFARG	0x0800	/* Use 0/"" as value for unspecified args */
1197c478bdstevel@tonic-gate#define	DTRACE_C_NOLIBS	0x1000	/* Do not process D system libraries */
120c9d6cd7jhaslam#define	DTRACE_C_CTL	0x2000	/* Only process control directives */
121c9d6cd7jhaslam#define	DTRACE_C_MASK	0x3bff	/* mask of all valid flags to dtrace_*compile */
1227c478bdstevel@tonic-gate
1237c478bdstevel@tonic-gateextern dtrace_prog_t *dtrace_program_strcompile(dtrace_hdl_t *,
1247c478bdstevel@tonic-gate    const char *, dtrace_probespec_t, uint_t, int, char *const []);
1257c478bdstevel@tonic-gate
1267c478bdstevel@tonic-gateextern dtrace_prog_t *dtrace_program_fcompile(dtrace_hdl_t *,
1277c478bdstevel@tonic-gate    FILE *, uint_t, int, char *const []);
1287c478bdstevel@tonic-gate
1297c478bdstevel@tonic-gateextern int dtrace_program_exec(dtrace_hdl_t *, dtrace_prog_t *,
1307c478bdstevel@tonic-gate    dtrace_proginfo_t *);
1317c478bdstevel@tonic-gateextern void dtrace_program_info(dtrace_hdl_t *, dtrace_prog_t *,
1327c478bdstevel@tonic-gate    dtrace_proginfo_t *);
1337c478bdstevel@tonic-gate
1347c478bdstevel@tonic-gate#define	DTRACE_D_STRIP	0x01	/* strip non-loadable sections from program */
1357c478bdstevel@tonic-gate#define	DTRACE_D_PROBES	0x02	/* include provider and probe definitions */
1367c478bdstevel@tonic-gate#define	DTRACE_D_MASK	0x03	/* mask of valid flags to dtrace_dof_create */
1377c478bdstevel@tonic-gate
1387c478bdstevel@tonic-gateextern int dtrace_program_link(dtrace_hdl_t *, dtrace_prog_t *,
1397c478bdstevel@tonic-gate    uint_t, const char *, int, char *const []);
1407c478bdstevel@tonic-gate
141900524fahlextern int dtrace_program_header(dtrace_hdl_t *, FILE *, const char *);
142900524fahl
1437c478bdstevel@tonic-gateextern void *dtrace_dof_create(dtrace_hdl_t *, dtrace_prog_t *, uint_t);
1447c478bdstevel@tonic-gateextern void dtrace_dof_destroy(dtrace_hdl_t *, void *);
1457c478bdstevel@tonic-gate
1467c478bdstevel@tonic-gateextern void *dtrace_getopt_dof(dtrace_hdl_t *);
1477c478bdstevel@tonic-gateextern void *dtrace_geterr_dof(dtrace_hdl_t *);
1487c478bdstevel@tonic-gate
1497c478bdstevel@tonic-gatetypedef struct dtrace_stmtdesc {
1507c478bdstevel@tonic-gate	dtrace_ecbdesc_t *dtsd_ecbdesc;		/* ECB description */
1517c478bdstevel@tonic-gate	dtrace_actdesc_t *dtsd_action;		/* action list */
1527c478bdstevel@tonic-gate	dtrace_actdesc_t *dtsd_action_last;	/* last action in action list */
1537c478bdstevel@tonic-gate	void *dtsd_aggdata;			/* aggregation data */
1547c478bdstevel@tonic-gate	void *dtsd_fmtdata;			/* type-specific output data */
155deef35fEric Schrock	void *dtsd_strdata;			/* type-specific string data */
1567c478bdstevel@tonic-gate	void (*dtsd_callback)();		/* callback function for EPID */
1577c478bdstevel@tonic-gate	void *dtsd_data;			/* callback data pointer */
1587c478bdstevel@tonic-gate	dtrace_attribute_t dtsd_descattr;	/* probedesc attributes */
1597c478bdstevel@tonic-gate	dtrace_attribute_t dtsd_stmtattr;	/* statement attributes */
1607c478bdstevel@tonic-gate} dtrace_stmtdesc_t;
1617c478bdstevel@tonic-gate
1627c478bdstevel@tonic-gatetypedef int dtrace_stmt_f(dtrace_hdl_t *, dtrace_prog_t *,
1637c478bdstevel@tonic-gate    dtrace_stmtdesc_t *, void *);
1647c478bdstevel@tonic-gate
1657c478bdstevel@tonic-gateextern dtrace_stmtdesc_t *dtrace_stmt_create(dtrace_hdl_t *,
1667c478bdstevel@tonic-gate    dtrace_ecbdesc_t *);
1677c478bdstevel@tonic-gateextern dtrace_actdesc_t *dtrace_stmt_action(dtrace_hdl_t *,
1687c478bdstevel@tonic-gate    dtrace_stmtdesc_t *);
1697c478bdstevel@tonic-gateextern int dtrace_stmt_add(dtrace_hdl_t *, dtrace_prog_t *,
1707c478bdstevel@tonic-gate    dtrace_stmtdesc_t *);
1717c478bdstevel@tonic-gateextern int dtrace_stmt_iter(dtrace_hdl_t *, dtrace_prog_t *,
1727c478bdstevel@tonic-gate    dtrace_stmt_f *, void *);
1731a7c1b7mwsextern void dtrace_stmt_destroy(dtrace_hdl_t *, dtrace_stmtdesc_t *);
1747c478bdstevel@tonic-gate
1757c478bdstevel@tonic-gate/*
1767c478bdstevel@tonic-gate * DTrace Data Consumption Interface
1777c478bdstevel@tonic-gate */
1787c478bdstevel@tonic-gatetypedef enum {
1797c478bdstevel@tonic-gate	DTRACEFLOW_ENTRY,
1807c478bdstevel@tonic-gate	DTRACEFLOW_RETURN,
1817c478bdstevel@tonic-gate	DTRACEFLOW_NONE
1827c478bdstevel@tonic-gate} dtrace_flowkind_t;
1837c478bdstevel@tonic-gate
1847c478bdstevel@tonic-gate#define	DTRACE_CONSUME_ERROR		-1	/* error while processing */
1857c478bdstevel@tonic-gate#define	DTRACE_CONSUME_THIS		0	/* consume this probe/record */
1867c478bdstevel@tonic-gate#define	DTRACE_CONSUME_NEXT		1	/* advance to next probe/rec */
1877c478bdstevel@tonic-gate#define	DTRACE_CONSUME_ABORT		2	/* abort consumption */
1887c478bdstevel@tonic-gate
1897c478bdstevel@tonic-gatetypedef struct dtrace_probedata {
1907c478bdstevel@tonic-gate	dtrace_hdl_t *dtpda_handle;		/* handle to DTrace library */
1917c478bdstevel@tonic-gate	dtrace_eprobedesc_t *dtpda_edesc;	/* enabled probe description */
1927c478bdstevel@tonic-gate	dtrace_probedesc_t *dtpda_pdesc;	/* probe description */
1937c478bdstevel@tonic-gate	processorid_t dtpda_cpu;		/* CPU for data */
1947c478bdstevel@tonic-gate	caddr_t dtpda_data;			/* pointer to raw data */
1957c478bdstevel@tonic-gate	dtrace_flowkind_t dtpda_flow;		/* flow kind */
1967c478bdstevel@tonic-gate	const char *dtpda_prefix;		/* recommended flow prefix */
1977c478bdstevel@tonic-gate	int dtpda_indent;			/* recommended flow indent */
1987c478bdstevel@tonic-gate} dtrace_probedata_t;
1997c478bdstevel@tonic-gate
2007c478bdstevel@tonic-gatetypedef int dtrace_consume_probe_f(const dtrace_probedata_t *, void *);
2017c478bdstevel@tonic-gatetypedef int dtrace_consume_rec_f(const dtrace_probedata_t *,
2027c478bdstevel@tonic-gate    const dtrace_recdesc_t *, void *);
2037c478bdstevel@tonic-gate
2047c478bdstevel@tonic-gateextern int dtrace_consume(dtrace_hdl_t *, FILE *,
2057c478bdstevel@tonic-gate    dtrace_consume_probe_f *, dtrace_consume_rec_f *, void *);
2067c478bdstevel@tonic-gate
2077c478bdstevel@tonic-gate#define	DTRACE_STATUS_NONE	0	/* no status; not yet time */
2087c478bdstevel@tonic-gate#define	DTRACE_STATUS_OKAY	1	/* status okay */
2097c478bdstevel@tonic-gate#define	DTRACE_STATUS_EXITED	2	/* exit() was called; tracing stopped */
2107c478bdstevel@tonic-gate#define	DTRACE_STATUS_FILLED	3	/* fill buffer filled; tracing stoped */
2117c478bdstevel@tonic-gate#define	DTRACE_STATUS_STOPPED	4	/* tracing already stopped */
2127c478bdstevel@tonic-gate
2137c478bdstevel@tonic-gateextern int dtrace_status(dtrace_hdl_t *);
2147c478bdstevel@tonic-gate
2157c478bdstevel@tonic-gate/*
2167c478bdstevel@tonic-gate * DTrace Formatted Output Interfaces
2177c478bdstevel@tonic-gate *
2187c478bdstevel@tonic-gate * To format output associated with a given dtrace_stmtdesc, the caller can
2197c478bdstevel@tonic-gate * invoke one of the following functions, passing the opaque dtsd_fmtdata and a
2207c478bdstevel@tonic-gate * list of record descriptions.  These functions return either -1 to indicate
2217c478bdstevel@tonic-gate * an error, or a positive integer indicating the number of records consumed.
2227c478bdstevel@tonic-gate * For anonymous enablings, the consumer can use the dtrd_format member of
2237c478bdstevel@tonic-gate * the record description to obtain a format description.  The dtfd_string
2247c478bdstevel@tonic-gate * member of the format description may be passed to dtrace_print{fa}_create()
2257c478bdstevel@tonic-gate * to create the opaque format data.
2267c478bdstevel@tonic-gate */
2277c478bdstevel@tonic-gateextern void *dtrace_printf_create(dtrace_hdl_t *, const char *);
2287c478bdstevel@tonic-gateextern void *dtrace_printa_create(dtrace_hdl_t *, const char *);
2297c478bdstevel@tonic-gateextern size_t dtrace_printf_format(dtrace_hdl_t *, void *, char *, size_t);
2307c478bdstevel@tonic-gate
2317c478bdstevel@tonic-gateextern int dtrace_fprintf(dtrace_hdl_t *, FILE *, void *,
2327c478bdstevel@tonic-gate    const dtrace_probedata_t *, const dtrace_recdesc_t *, uint_t,
2337c478bdstevel@tonic-gate    const void *, size_t);
2347c478bdstevel@tonic-gate
2357c478bdstevel@tonic-gateextern int dtrace_fprinta(dtrace_hdl_t *, FILE *, void *,
2367c478bdstevel@tonic-gate    const dtrace_probedata_t *, const dtrace_recdesc_t *, uint_t,
2377c478bdstevel@tonic-gate    const void *, size_t);
2387c478bdstevel@tonic-gate
2397c478bdstevel@tonic-gateextern int dtrace_system(dtrace_hdl_t *, FILE *, void *,
2407c478bdstevel@tonic-gate    const dtrace_probedata_t *, const dtrace_recdesc_t *, uint_t,
2417c478bdstevel@tonic-gate    const void *, size_t);
2427c478bdstevel@tonic-gate
2437c478bdstevel@tonic-gateextern int dtrace_freopen(dtrace_hdl_t *, FILE *, void *,
2447c478bdstevel@tonic-gate    const dtrace_probedata_t *, const dtrace_recdesc_t *, uint_t,
2457c478bdstevel@tonic-gate    const void *, size_t);
2467c478bdstevel@tonic-gate
2477c478bdstevel@tonic-gate/*
248deef35fEric Schrock * Type-specific output printing
249deef35fEric Schrock *
250deef35fEric Schrock * The print() action will associate a string data record that is actually the
251deef35fEric Schrock * fully-qualified type name of the data traced by the DIFEXPR action.  This is
252deef35fEric Schrock * stored in the same 'format' record from the kernel, but we know by virtue of
253deef35fEric Schrock * the fact that the action is still DIFEXPR that it is actually a reference to
254deef35fEric Schrock * plain string data.
255deef35fEric Schrock */
256deef35fEric Schrockextern int dtrace_print(dtrace_hdl_t *, FILE *, const char *,
257deef35fEric Schrock    caddr_t, size_t);
258deef35fEric Schrock
259deef35fEric Schrock/*
2607c478bdstevel@tonic-gate * DTrace Work Interface
2617c478bdstevel@tonic-gate */
2627c478bdstevel@tonic-gatetypedef enum {
2637c478bdstevel@tonic-gate	DTRACE_WORKSTATUS_ERROR = -1,
2647c478bdstevel@tonic-gate	DTRACE_WORKSTATUS_OKAY,
2657c478bdstevel@tonic-gate	DTRACE_WORKSTATUS_DONE
2667c478bdstevel@tonic-gate} dtrace_workstatus_t;
2677c478bdstevel@tonic-gate
2687c478bdstevel@tonic-gateextern dtrace_workstatus_t dtrace_work(dtrace_hdl_t *, FILE *,
2697c478bdstevel@tonic-gate    dtrace_consume_probe_f *, dtrace_consume_rec_f *, void *);
2707c478bdstevel@tonic-gate
2717c478bdstevel@tonic-gate/*
2727c478bdstevel@tonic-gate * DTrace Handler Interface
2737c478bdstevel@tonic-gate */
2747c478bdstevel@tonic-gate#define	DTRACE_HANDLE_ABORT		-1	/* abort current operation */
2757c478bdstevel@tonic-gate#define	DTRACE_HANDLE_OK		0	/* handled okay; continue */
2767c478bdstevel@tonic-gate
2777c478bdstevel@tonic-gatetypedef struct dtrace_errdata {
2787c478bdstevel@tonic-gate	dtrace_hdl_t *dteda_handle;		/* handle to DTrace library */
2797c478bdstevel@tonic-gate	dtrace_eprobedesc_t *dteda_edesc;	/* enabled probe inducing err */
2807c478bdstevel@tonic-gate	dtrace_probedesc_t *dteda_pdesc;	/* probe inducing error */
2817c478bdstevel@tonic-gate	processorid_t dteda_cpu;		/* CPU of error */
2827c478bdstevel@tonic-gate	int dteda_action;			/* action inducing error */
2837c478bdstevel@tonic-gate	int dteda_offset;			/* offset in DIFO of error */
2847c478bdstevel@tonic-gate	int dteda_fault;			/* specific fault */
2857c478bdstevel@tonic-gate	uint64_t dteda_addr;			/* address of fault, if any */
2867c478bdstevel@tonic-gate	const char *dteda_msg;			/* preconstructed message */
2877c478bdstevel@tonic-gate} dtrace_errdata_t;
2887c478bdstevel@tonic-gate
289a1b5e53bmctypedef int dtrace_handle_err_f(const dtrace_errdata_t *, void *);
2907c478bdstevel@tonic-gateextern int dtrace_handle_err(dtrace_hdl_t *, dtrace_handle_err_f *, void *);
2917c478bdstevel@tonic-gate
2927c478bdstevel@tonic-gatetypedef enum {
2937c478bdstevel@tonic-gate	DTRACEDROP_PRINCIPAL,			/* drop to principal buffer */
2947c478bdstevel@tonic-gate	DTRACEDROP_AGGREGATION,			/* drop to aggregation buffer */
2957c478bdstevel@tonic-gate	DTRACEDROP_DYNAMIC,			/* dynamic drop */
2967c478bdstevel@tonic-gate	DTRACEDROP_DYNRINSE,			/* dyn drop due to rinsing */
2977c478bdstevel@tonic-gate	DTRACEDROP_DYNDIRTY,			/* dyn drop due to dirty */
2987c478bdstevel@tonic-gate	DTRACEDROP_SPEC,			/* speculative drop */
2997c478bdstevel@tonic-gate	DTRACEDROP_SPECBUSY,			/* spec drop due to busy */
300a1b5e53bmc	DTRACEDROP_SPECUNAVAIL,			/* spec drop due to unavail */
301a1b5e53bmc	DTRACEDROP_STKSTROVERFLOW,		/* stack string tab overflow */
302a1b5e53bmc	DTRACEDROP_DBLERROR			/* error in ERROR probe */
3037c478bdstevel@tonic-gate} dtrace_dropkind_t;
3047c478bdstevel@tonic-gate
3057c478bdstevel@tonic-gatetypedef struct dtrace_dropdata {
3067c478bdstevel@tonic-gate	dtrace_hdl_t *dtdda_handle;		/* handle to DTrace library */
3077c478bdstevel@tonic-gate	processorid_t dtdda_cpu;		/* CPU, if any */
3087c478bdstevel@tonic-gate	dtrace_dropkind_t dtdda_kind;		/* kind of drop */
3097c478bdstevel@tonic-gate	uint64_t dtdda_drops;			/* number of drops */
3107c478bdstevel@tonic-gate	uint64_t dtdda_total;			/* total drops */
3117c478bdstevel@tonic-gate	const char *dtdda_msg;			/* preconstructed message */
3127c478bdstevel@tonic-gate} dtrace_dropdata_t;
3137c478bdstevel@tonic-gate
314a1b5e53bmctypedef int dtrace_handle_drop_f(const dtrace_dropdata_t *, void *);
3157c478bdstevel@tonic-gateextern int dtrace_handle_drop(dtrace_hdl_t *, dtrace_handle_drop_f *, void *);
3167c478bdstevel@tonic-gate
317900524fahltypedef void dtrace_handle_proc_f(struct ps_prochandle *, const char *, void *);
3187c478bdstevel@tonic-gateextern int dtrace_handle_proc(dtrace_hdl_t *, dtrace_handle_proc_f *, void *);
3197c478bdstevel@tonic-gate
32030ef842bmc#define	DTRACE_BUFDATA_AGGKEY		0x0001	/* aggregation key */
32130ef842bmc#define	DTRACE_BUFDATA_AGGVAL		0x0002	/* aggregation value */
32230ef842bmc#define	DTRACE_BUFDATA_AGGFORMAT	0x0004	/* aggregation format data */
32330ef842bmc#define	DTRACE_BUFDATA_AGGLAST		0x0008	/* last for this key/val */
32430ef842bmc
3257c478bdstevel@tonic-gatetypedef struct dtrace_bufdata {
3267c478bdstevel@tonic-gate	dtrace_hdl_t *dtbda_handle;		/* handle to DTrace library */
3277c478bdstevel@tonic-gate	const char *dtbda_buffered;		/* buffered output */
3287c478bdstevel@tonic-gate	dtrace_probedata_t *dtbda_probe;	/* probe data */
329a1b5e53bmc	const dtrace_recdesc_t *dtbda_recdesc;	/* record description */
330a1b5e53bmc	const dtrace_aggdata_t *dtbda_aggdata;	/* aggregation data, if agg. */
33130ef842bmc	uint32_t dtbda_flags;			/* flags; see above */
3327c478bdstevel@tonic-gate} dtrace_bufdata_t;
3337c478bdstevel@tonic-gate
334a1b5e53bmctypedef int dtrace_handle_buffered_f(const dtrace_bufdata_t *, void *);
3357c478bdstevel@tonic-gateextern int dtrace_handle_buffered(dtrace_hdl_t *,
3367c478bdstevel@tonic-gate    dtrace_handle_buffered_f *, void *);
3377c478bdstevel@tonic-gate
338a1b5e53bmctypedef struct dtrace_setoptdata {
339a1b5e53bmc	dtrace_hdl_t *dtsda_handle;		/* handle to DTrace library */
340a1b5e53bmc	const dtrace_probedata_t *dtsda_probe;	/* probe data */
341a1b5e53bmc	const char *dtsda_option;		/* option that was set */
342a1b5e53bmc	dtrace_optval_t dtsda_oldval;		/* old value */
343a1b5e53bmc	dtrace_optval_t dtsda_newval;		/* new value */
344a1b5e53bmc} dtrace_setoptdata_t;
345a1b5e53bmc
346a1b5e53bmctypedef int dtrace_handle_setopt_f(const dtrace_setoptdata_t *, void *);
347a1b5e53bmcextern int dtrace_handle_setopt(dtrace_hdl_t *,
348a1b5e53bmc    dtrace_handle_setopt_f *, void *);
349a1b5e53bmc
3507c478bdstevel@tonic-gate/*
3517c478bdstevel@tonic-gate * DTrace Aggregate Interface
3527c478bdstevel@tonic-gate */
3537c478bdstevel@tonic-gate
3547c478bdstevel@tonic-gate#define	DTRACE_A_PERCPU		0x0001
3557c478bdstevel@tonic-gate#define	DTRACE_A_KEEPDELTA	0x0002
3567c478bdstevel@tonic-gate#define	DTRACE_A_ANONYMOUS	0x0004
35733093f5Bryan Cantrill#define	DTRACE_A_TOTAL		0x0008
35833093f5Bryan Cantrill#define	DTRACE_A_MINMAXBIN	0x0010
35933093f5Bryan Cantrill#define	DTRACE_A_HASNEGATIVES	0x0020
36033093f5Bryan Cantrill#define	DTRACE_A_HASPOSITIVES	0x0040
36133093f5Bryan Cantrill
36233093f5Bryan Cantrill#define	DTRACE_AGGZOOM_MAX		0.95	/* height of max bar */
3637c478bdstevel@tonic-gate
3647c478bdstevel@tonic-gate#define	DTRACE_AGGWALK_ERROR		-1	/* error while processing */
3657c478bdstevel@tonic-gate#define	DTRACE_AGGWALK_NEXT		0	/* proceed to next element */
3667c478bdstevel@tonic-gate#define	DTRACE_AGGWALK_ABORT		1	/* abort aggregation walk */
3677c478bdstevel@tonic-gate#define	DTRACE_AGGWALK_CLEAR		2	/* clear this element */
3687c478bdstevel@tonic-gate#define	DTRACE_AGGWALK_NORMALIZE	3	/* normalize this element */
3697c478bdstevel@tonic-gate#define	DTRACE_AGGWALK_DENORMALIZE	4	/* denormalize this element */
3707c478bdstevel@tonic-gate#define	DTRACE_AGGWALK_REMOVE		5	/* remove this element */
3717c478bdstevel@tonic-gate
3727c478bdstevel@tonic-gatestruct dtrace_aggdata {
3737c478bdstevel@tonic-gate	dtrace_hdl_t *dtada_handle;		/* handle to DTrace library */
3747c478bdstevel@tonic-gate	dtrace_aggdesc_t *dtada_desc;		/* aggregation description */
3757c478bdstevel@tonic-gate	dtrace_eprobedesc_t *dtada_edesc;	/* enabled probe description */
3767c478bdstevel@tonic-gate	dtrace_probedesc_t *dtada_pdesc;	/* probe description */
3777c478bdstevel@tonic-gate	caddr_t dtada_data;			/* pointer to raw data */
3787c478bdstevel@tonic-gate	uint64_t dtada_normal;			/* the normal -- 1 for denorm */
3797c478bdstevel@tonic-gate	size_t dtada_size;			/* total size of the data */
3807c478bdstevel@tonic-gate	caddr_t dtada_delta;			/* delta data, if available */
3817c478bdstevel@tonic-gate	caddr_t *dtada_percpu;			/* per CPU data, if avail */
3827c478bdstevel@tonic-gate	caddr_t *dtada_percpu_delta;		/* per CPU delta, if avail */
38333093f5Bryan Cantrill	int64_t dtada_total;			/* per agg total, if avail */
38433093f5Bryan Cantrill	uint16_t dtada_minbin;			/* minimum bin, if avail */
38533093f5Bryan Cantrill	uint16_t dtada_maxbin;			/* maximum bin, if avail */
38633093f5Bryan Cantrill	uint32_t dtada_flags;			/* flags */
3877c478bdstevel@tonic-gate};
3887c478bdstevel@tonic-gate
389a1b5e53bmctypedef int dtrace_aggregate_f(const dtrace_aggdata_t *, void *);
3907c478bdstevel@tonic-gatetypedef int dtrace_aggregate_walk_f(dtrace_hdl_t *,
3917c478bdstevel@tonic-gate    dtrace_aggregate_f *, void *);
39230ef842bmctypedef int dtrace_aggregate_walk_joined_f(const dtrace_aggdata_t **,
39330ef842bmc    const int, void *);
3947c478bdstevel@tonic-gate
3957c478bdstevel@tonic-gateextern void dtrace_aggregate_clear(dtrace_hdl_t *);
3967c478bdstevel@tonic-gateextern int dtrace_aggregate_snap(dtrace_hdl_t *);
3977c478bdstevel@tonic-gateextern int dtrace_aggregate_print(dtrace_hdl_t *, FILE *,
3987c478bdstevel@tonic-gate    dtrace_aggregate_walk_f *);
3997c478bdstevel@tonic-gate
4007c478bdstevel@tonic-gateextern int dtrace_aggregate_walk(dtrace_hdl_t *, dtrace_aggregate_f *, void *);
4017c478bdstevel@tonic-gate
40230ef842bmcextern int dtrace_aggregate_walk_joined(dtrace_hdl_t *,
40330ef842bmc    dtrace_aggvarid_t *, int, dtrace_aggregate_walk_joined_f *, void *);
40430ef842bmc
40530ef842bmcextern int dtrace_aggregate_walk_sorted(dtrace_hdl_t *,
40630ef842bmc    dtrace_aggregate_f *, void *);
40730ef842bmc
4087c478bdstevel@tonic-gateextern int dtrace_aggregate_walk_keysorted(dtrace_hdl_t *,
4097c478bdstevel@tonic-gate    dtrace_aggregate_f *, void *);
4107c478bdstevel@tonic-gate
4117c478bdstevel@tonic-gateextern int dtrace_aggregate_walk_valsorted(dtrace_hdl_t *,
4127c478bdstevel@tonic-gate    dtrace_aggregate_f *, void *);
4137c478bdstevel@tonic-gate
4147c478bdstevel@tonic-gateextern int dtrace_aggregate_walk_keyvarsorted(dtrace_hdl_t *,
4157c478bdstevel@tonic-gate    dtrace_aggregate_f *, void *);
4167c478bdstevel@tonic-gate
4177c478bdstevel@tonic-gateextern int dtrace_aggregate_walk_valvarsorted(dtrace_hdl_t *,
4187c478bdstevel@tonic-gate    dtrace_aggregate_f *, void *);
4197c478bdstevel@tonic-gate
4207c478bdstevel@tonic-gateextern int dtrace_aggregate_walk_keyrevsorted(dtrace_hdl_t *,
4217c478bdstevel@tonic-gate    dtrace_aggregate_f *, void *);
4227c478bdstevel@tonic-gate
4237c478bdstevel@tonic-gateextern int dtrace_aggregate_walk_valrevsorted(dtrace_hdl_t *,
4247c478bdstevel@tonic-gate    dtrace_aggregate_f *, void *);
4257c478bdstevel@tonic-gate
4267c478bdstevel@tonic-gateextern int dtrace_aggregate_walk_keyvarrevsorted(dtrace_hdl_t *,
4277c478bdstevel@tonic-gate    dtrace_aggregate_f *, void *);
4287c478bdstevel@tonic-gate
4297c478bdstevel@tonic-gateextern int dtrace_aggregate_walk_valvarrevsorted(dtrace_hdl_t *,
4307c478bdstevel@tonic-gate    dtrace_aggregate_f *, void *);
4317c478bdstevel@tonic-gate
4327c478bdstevel@tonic-gate#define	DTRACE_AGD_PRINTED	0x1	/* aggregation printed in program */
4337c478bdstevel@tonic-gate
4347c478bdstevel@tonic-gate/*
4357c478bdstevel@tonic-gate * DTrace Process Control Interface
4367c478bdstevel@tonic-gate *
4377c478bdstevel@tonic-gate * Library clients who wish to have libdtrace create or grab processes for
4387c478bdstevel@tonic-gate * monitoring of their symbol table changes may use these interfaces to
4397c478bdstevel@tonic-gate * request that libdtrace obtain control of the process using libproc.
4407c478bdstevel@tonic-gate */
4417c478bdstevel@tonic-gate
4427c478bdstevel@tonic-gateextern struct ps_prochandle *dtrace_proc_create(dtrace_hdl_t *,
4437c478bdstevel@tonic-gate    const char *, char *const *);
4447c478bdstevel@tonic-gate
4457c478bdstevel@tonic-gateextern struct ps_prochandle *dtrace_proc_grab(dtrace_hdl_t *, pid_t, int);
4467c478bdstevel@tonic-gateextern void dtrace_proc_release(dtrace_hdl_t *, struct ps_prochandle *);
4477c478bdstevel@tonic-gateextern void dtrace_proc_continue(dtrace_hdl_t *, struct ps_prochandle *);
4487c478bdstevel@tonic-gate
4497c478bdstevel@tonic-gate/*
4507c478bdstevel@tonic-gate * DTrace Object, Symbol, and Type Interfaces
4517c478bdstevel@tonic-gate *
4527c478bdstevel@tonic-gate * Library clients can use libdtrace to perform symbol and C type information
4537c478bdstevel@tonic-gate * lookups by symbol name, symbol address, or C type name, or to lookup meta-
4547c478bdstevel@tonic-gate * information cached for each of the program objects in use by DTrace.  The
4557c478bdstevel@tonic-gate * resulting struct contain pointers to arbitrary-length strings, including
4567c478bdstevel@tonic-gate * object, symbol, and type names, that are persistent until the next call to
4577c478bdstevel@tonic-gate * dtrace_update().  Once dtrace_update() is called, any cached values must
4587c478bdstevel@tonic-gate * be flushed and not used subsequently by the client program.
4597c478bdstevel@tonic-gate */
4607c478bdstevel@tonic-gate
4617c478bdstevel@tonic-gate#define	DTRACE_OBJ_EXEC	 ((const char *)0L)	/* primary executable file */
4627c478bdstevel@tonic-gate#define	DTRACE_OBJ_RTLD	 ((const char *)1L)	/* run-time link-editor */
4637c478bdstevel@tonic-gate#define	DTRACE_OBJ_CDEFS ((const char *)2L)	/* C include definitions */
4647c478bdstevel@tonic-gate#define	DTRACE_OBJ_DDEFS ((const char *)3L)	/* D program definitions */
4657c478bdstevel@tonic-gate#define	DTRACE_OBJ_EVERY ((const char *)-1L)	/* all known objects */
4667c478bdstevel@tonic-gate#define	DTRACE_OBJ_KMODS ((const char *)-2L)	/* all kernel objects */
4677c478bdstevel@tonic-gate#define	DTRACE_OBJ_UMODS ((const char *)-3L)	/* all user objects */
4687c478bdstevel@tonic-gate
4697c478bdstevel@tonic-gatetypedef struct dtrace_objinfo {
4707c478bdstevel@tonic-gate	const char *dto_name;			/* object file scope name */
4717c478bdstevel@tonic-gate	const char *dto_file;			/* object file path (if any) */
4727c478bdstevel@tonic-gate	int dto_id;				/* object file id (if any) */
4737c478bdstevel@tonic-gate	uint_t dto_flags;			/* object flags (see below) */
4747c478bdstevel@tonic-gate	GElf_Addr dto_text_va;			/* address of text section */
4757c478bdstevel@tonic-gate	GElf_Xword dto_text_size;		/* size of text section */
4767c478bdstevel@tonic-gate	GElf_Addr dto_data_va;			/* address of data section */
4777c478bdstevel@tonic-gate	GElf_Xword dto_data_size;		/* size of data section */
4787c478bdstevel@tonic-gate	GElf_Addr dto_bss_va;			/* address of BSS */
4797c478bdstevel@tonic-gate	GElf_Xword dto_bss_size;		/* size of BSS */
4807c478bdstevel@tonic-gate} dtrace_objinfo_t;
4817c478bdstevel@tonic-gate
4827c478bdstevel@tonic-gate#define	DTRACE_OBJ_F_KERNEL	0x1		/* object is a kernel module */
4837c478bdstevel@tonic-gate#define	DTRACE_OBJ_F_PRIMARY	0x2		/* object is a primary module */
4847c478bdstevel@tonic-gate
4857c478bdstevel@tonic-gatetypedef int dtrace_obj_f(dtrace_hdl_t *, const dtrace_objinfo_t *, void *);
4867c478bdstevel@tonic-gate
4877c478bdstevel@tonic-gateextern int dtrace_object_iter(dtrace_hdl_t *, dtrace_obj_f *, void *);
4887c478bdstevel@tonic-gateextern int dtrace_object_info(dtrace_hdl_t *, const char *, dtrace_objinfo_t *);
4897c478bdstevel@tonic-gate
4907c478bdstevel@tonic-gatetypedef struct dtrace_syminfo {
4917c478bdstevel@tonic-gate	const char *dts_object;			/* object name */
4927c478bdstevel@tonic-gate	const char *dts_name;			/* symbol name */
4937c478bdstevel@tonic-gate	ulong_t dts_id;				/* symbol id */
4947c478bdstevel@tonic-gate} dtrace_syminfo_t;
4957c478bdstevel@tonic-gate
4967c478bdstevel@tonic-gateextern int dtrace_lookup_by_name(dtrace_hdl_t *, const char *, const char *,
4977c478bdstevel@tonic-gate    GElf_Sym *, dtrace_syminfo_t *);
4987c478bdstevel@tonic-gate
4997c478bdstevel@tonic-gateextern int dtrace_lookup_by_addr(dtrace_hdl_t *, GElf_Addr addr,
5007c478bdstevel@tonic-gate    GElf_Sym *, dtrace_syminfo_t *);
5017c478bdstevel@tonic-gate
5027c478bdstevel@tonic-gatetypedef struct dtrace_typeinfo {
5037c478bdstevel@tonic-gate	const char *dtt_object;			/* object containing type */
5047c478bdstevel@tonic-gate	ctf_file_t *dtt_ctfp;			/* CTF container handle */
5057c478bdstevel@tonic-gate	ctf_id_t dtt_type;			/* CTF type identifier */
506a386cc1Robert Mustacchi	uint_t dtt_flags;			/* Misc. flags */
5077c478bdstevel@tonic-gate} dtrace_typeinfo_t;
5087c478bdstevel@tonic-gate
509a386cc1Robert Mustacchi#define	DTT_FL_USER	0x1			/* user type */
510a386cc1Robert Mustacchi
5117c478bdstevel@tonic-gateextern int dtrace_lookup_by_type(dtrace_hdl_t *, const char *, const char *,
5127c478bdstevel@tonic-gate    dtrace_typeinfo_t *);
5137c478bdstevel@tonic-gate
5147c478bdstevel@tonic-gateextern int dtrace_symbol_type(dtrace_hdl_t *, const GElf_Sym *,
5157c478bdstevel@tonic-gate    const dtrace_syminfo_t *, dtrace_typeinfo_t *);
5167c478bdstevel@tonic-gate
5177c478bdstevel@tonic-gateextern int dtrace_type_strcompile(dtrace_hdl_t *,
5187c478bdstevel@tonic-gate    const char *, dtrace_typeinfo_t *);
5197c478bdstevel@tonic-gate
5207c478bdstevel@tonic-gateextern int dtrace_type_fcompile(dtrace_hdl_t *,
5217c478bdstevel@tonic-gate    FILE *, dtrace_typeinfo_t *);
5227c478bdstevel@tonic-gate
523c3bd3abMatthew Ahrensextern struct dt_node *dt_compile_sugar(dtrace_hdl_t *,
524c3bd3abMatthew Ahrens    struct dt_node *);
525c3bd3abMatthew Ahrens
526c3bd3abMatthew Ahrens
5277c478bdstevel@tonic-gate/*
5287c478bdstevel@tonic-gate * DTrace Probe Interface
5297c478bdstevel@tonic-gate *
5307c478bdstevel@tonic-gate * Library clients can use these functions to iterate over the set of available
5317c478bdstevel@tonic-gate * probe definitions and inquire as to their attributes.  The probe iteration
5327c478bdstevel@tonic-gate * interfaces report probes that are declared as well as those from dtrace(7D).
5337c478bdstevel@tonic-gate */
5347c478bdstevel@tonic-gatetypedef struct dtrace_probeinfo {
5357c478bdstevel@tonic-gate	dtrace_attribute_t dtp_attr;		/* name attributes */
5367c478bdstevel@tonic-gate	dtrace_attribute_t dtp_arga;		/* arg attributes */
5377c478bdstevel@tonic-gate	const dtrace_typeinfo_t *dtp_argv;	/* arg types */
5387c478bdstevel@tonic-gate	int dtp_argc;				/* arg count */
5397c478bdstevel@tonic-gate} dtrace_probeinfo_t;
5407c478bdstevel@tonic-gate
5417c478bdstevel@tonic-gatetypedef int dtrace_probe_f(dtrace_hdl_t *, const dtrace_probedesc_t *, void *);
5427c478bdstevel@tonic-gate
5437c478bdstevel@tonic-gateextern int dtrace_probe_iter(dtrace_hdl_t *,
5447c478bdstevel@tonic-gate    const dtrace_probedesc_t *pdp, dtrace_probe_f *, void *);
5457c478bdstevel@tonic-gate
5467c478bdstevel@tonic-gateextern int dtrace_probe_info(dtrace_hdl_t *,
5477c478bdstevel@tonic-gate    const dtrace_probedesc_t *, dtrace_probeinfo_t *);
5487c478bdstevel@tonic-gate
5497c478bdstevel@tonic-gate/*
5507c478bdstevel@tonic-gate * DTrace Vector Interface
5517c478bdstevel@tonic-gate *
5527c478bdstevel@tonic-gate * The DTrace library normally speaks directly to dtrace(7D).  However,
5537c478bdstevel@tonic-gate * this communication may be vectored elsewhere.  Consumers who wish to
5547c478bdstevel@tonic-gate * perform a vectored open must fill in the vector, and use the dtrace_vopen()
5557c478bdstevel@tonic-gate * entry point to obtain a library handle.
5567c478bdstevel@tonic-gate */
5577c478bdstevel@tonic-gatestruct dtrace_vector {
5587c478bdstevel@tonic-gate	int (*dtv_ioctl)(void *, int, void *);
5597c478bdstevel@tonic-gate	int (*dtv_lookup_by_addr)(void *, GElf_Addr, GElf_Sym *,
5607c478bdstevel@tonic-gate	    dtrace_syminfo_t *);
5617c478bdstevel@tonic-gate	int (*dtv_status)(void *, processorid_t);
5627c478bdstevel@tonic-gate	long (*dtv_sysconf)(void *, int);
5637c478bdstevel@tonic-gate};
5647c478bdstevel@tonic-gate
5657c478bdstevel@tonic-gate/*
5667c478bdstevel@tonic-gate * DTrace Utility Functions
5677c478bdstevel@tonic-gate *
568a1b5e53bmc * Library clients can use these functions to convert addresses strings, to
569a1b5e53bmc * convert between string and integer probe descriptions and the
570a1b5e53bmc * dtrace_probedesc_t representation, and to perform similar conversions on
571a1b5e53bmc * stability attributes.
5727c478bdstevel@tonic-gate */
573a1b5e53bmcextern int dtrace_addr2str(dtrace_hdl_t *, uint64_t, char *, int);
574a1b5e53bmcextern int dtrace_uaddr2str(dtrace_hdl_t *, pid_t, uint64_t, char *, int);
575a1b5e53bmc
5767c478bdstevel@tonic-gateextern int dtrace_xstr2desc(dtrace_hdl_t *, dtrace_probespec_t,
5777c478bdstevel@tonic-gate    const char *, int, char *const [], dtrace_probedesc_t *);
5787c478bdstevel@tonic-gate
5797c478bdstevel@tonic-gateextern int dtrace_str2desc(dtrace_hdl_t *, dtrace_probespec_t,
5807c478bdstevel@tonic-gate    const char *, dtrace_probedesc_t *);
5817c478bdstevel@tonic-gate
5827c478bdstevel@tonic-gateextern int dtrace_id2desc(dtrace_hdl_t *, dtrace_id_t, dtrace_probedesc_t *);
5837c478bdstevel@tonic-gate
5847c478bdstevel@tonic-gate#define	DTRACE_DESC2STR_MAX	1024	/* min buf size for dtrace_desc2str() */
5857c478bdstevel@tonic-gate
5867c478bdstevel@tonic-gateextern char *dtrace_desc2str(const dtrace_probedesc_t *, char *, size_t);
5877c478bdstevel@tonic-gate
5887c478bdstevel@tonic-gate#define	DTRACE_ATTR2STR_MAX	64	/* min buf size for dtrace_attr2str() */
5897c478bdstevel@tonic-gate
5907c478bdstevel@tonic-gateextern char *dtrace_attr2str(dtrace_attribute_t, char *, size_t);
5917c478bdstevel@tonic-gateextern int dtrace_str2attr(const char *, dtrace_attribute_t *);
5927c478bdstevel@tonic-gate
5937c478bdstevel@tonic-gateextern const char *dtrace_stability_name(dtrace_stability_t);
5947c478bdstevel@tonic-gateextern const char *dtrace_class_name(dtrace_class_t);
5957c478bdstevel@tonic-gate
5967c478bdstevel@tonic-gateextern int dtrace_provider_modules(dtrace_hdl_t *, const char **, int);
5977c478bdstevel@tonic-gate
5987c478bdstevel@tonic-gateextern const char *const _dtrace_version;
5997c478bdstevel@tonic-gateextern int _dtrace_debug;
6007c478bdstevel@tonic-gate
6017c478bdstevel@tonic-gate#ifdef	__cplusplus
6027c478bdstevel@tonic-gate}
6037c478bdstevel@tonic-gate#endif
6047c478bdstevel@tonic-gate
6057c478bdstevel@tonic-gate#endif	/* _DTRACE_H */
606