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 /*
23 * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
25 */
26
27 /*
28 * Copyright (c) 2011, Joyent, Inc. All rights reserved.
29 */
30
31 #ifndef _DTRACE_H
32 #define _DTRACE_H
33
34 #include <sys/dtrace.h>
35 #include <stdarg.h>
36 #include <stdio.h>
37 #include <gelf.h>
38
39 #ifdef __cplusplus
40 extern "C" {
41 #endif
42
43 /*
44 * DTrace Dynamic Tracing Software: Library Interfaces
45 *
46 * Note: The contents of this file are private to the implementation of the
47 * Solaris system and DTrace subsystem and are subject to change at any time
48 * without notice. Applications and drivers using these interfaces will fail
474
475 extern int dtrace_object_iter(dtrace_hdl_t *, dtrace_obj_f *, void *);
476 extern int dtrace_object_info(dtrace_hdl_t *, const char *, dtrace_objinfo_t *);
477
478 typedef struct dtrace_syminfo {
479 const char *dts_object; /* object name */
480 const char *dts_name; /* symbol name */
481 ulong_t dts_id; /* symbol id */
482 } dtrace_syminfo_t;
483
484 extern int dtrace_lookup_by_name(dtrace_hdl_t *, const char *, const char *,
485 GElf_Sym *, dtrace_syminfo_t *);
486
487 extern int dtrace_lookup_by_addr(dtrace_hdl_t *, GElf_Addr addr,
488 GElf_Sym *, dtrace_syminfo_t *);
489
490 typedef struct dtrace_typeinfo {
491 const char *dtt_object; /* object containing type */
492 ctf_file_t *dtt_ctfp; /* CTF container handle */
493 ctf_id_t dtt_type; /* CTF type identifier */
494 } dtrace_typeinfo_t;
495
496 extern int dtrace_lookup_by_type(dtrace_hdl_t *, const char *, const char *,
497 dtrace_typeinfo_t *);
498
499 extern int dtrace_symbol_type(dtrace_hdl_t *, const GElf_Sym *,
500 const dtrace_syminfo_t *, dtrace_typeinfo_t *);
501
502 extern int dtrace_type_strcompile(dtrace_hdl_t *,
503 const char *, dtrace_typeinfo_t *);
504
505 extern int dtrace_type_fcompile(dtrace_hdl_t *,
506 FILE *, dtrace_typeinfo_t *);
507
508 /*
509 * DTrace Probe Interface
510 *
511 * Library clients can use these functions to iterate over the set of available
512 * probe definitions and inquire as to their attributes. The probe iteration
513 * interfaces report probes that are declared as well as those from dtrace(7D).
514 */
515 typedef struct dtrace_probeinfo {
|
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 /*
23 * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
25 */
26
27 /*
28 * Copyright (c) 2013 by Delphix. All rights reserved.
29 * Copyright (c) 2013, Joyent, Inc. All rights reserved.
30 */
31
32 #ifndef _DTRACE_H
33 #define _DTRACE_H
34
35 #include <sys/dtrace.h>
36 #include <stdarg.h>
37 #include <stdio.h>
38 #include <gelf.h>
39
40 #ifdef __cplusplus
41 extern "C" {
42 #endif
43
44 /*
45 * DTrace Dynamic Tracing Software: Library Interfaces
46 *
47 * Note: The contents of this file are private to the implementation of the
48 * Solaris system and DTrace subsystem and are subject to change at any time
49 * without notice. Applications and drivers using these interfaces will fail
475
476 extern int dtrace_object_iter(dtrace_hdl_t *, dtrace_obj_f *, void *);
477 extern int dtrace_object_info(dtrace_hdl_t *, const char *, dtrace_objinfo_t *);
478
479 typedef struct dtrace_syminfo {
480 const char *dts_object; /* object name */
481 const char *dts_name; /* symbol name */
482 ulong_t dts_id; /* symbol id */
483 } dtrace_syminfo_t;
484
485 extern int dtrace_lookup_by_name(dtrace_hdl_t *, const char *, const char *,
486 GElf_Sym *, dtrace_syminfo_t *);
487
488 extern int dtrace_lookup_by_addr(dtrace_hdl_t *, GElf_Addr addr,
489 GElf_Sym *, dtrace_syminfo_t *);
490
491 typedef struct dtrace_typeinfo {
492 const char *dtt_object; /* object containing type */
493 ctf_file_t *dtt_ctfp; /* CTF container handle */
494 ctf_id_t dtt_type; /* CTF type identifier */
495 uint_t dtt_flags; /* Misc. flags */
496 } dtrace_typeinfo_t;
497
498 #define DTT_FL_USER 0x1 /* user type */
499
500 extern int dtrace_lookup_by_type(dtrace_hdl_t *, const char *, const char *,
501 dtrace_typeinfo_t *);
502
503 extern int dtrace_symbol_type(dtrace_hdl_t *, const GElf_Sym *,
504 const dtrace_syminfo_t *, dtrace_typeinfo_t *);
505
506 extern int dtrace_type_strcompile(dtrace_hdl_t *,
507 const char *, dtrace_typeinfo_t *);
508
509 extern int dtrace_type_fcompile(dtrace_hdl_t *,
510 FILE *, dtrace_typeinfo_t *);
511
512 /*
513 * DTrace Probe Interface
514 *
515 * Library clients can use these functions to iterate over the set of available
516 * probe definitions and inquire as to their attributes. The probe iteration
517 * interfaces report probes that are declared as well as those from dtrace(7D).
518 */
519 typedef struct dtrace_probeinfo {
|