4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License, Version 1.0 only
6 * (the "License"). You may not use this file except in compliance
9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 * or http://www.opensolaris.org/os/licensing.
11 * See the License for the specific language governing permissions
12 * and limitations under the License.
14 * When distributing Covered Code, include this CDDL HEADER in each
15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 * If applicable, add the following below this CDDL HEADER, with the
17 * fields enclosed by brackets "[]" replaced with your own identifying
18 * information: Portions Copyright [yyyy] [name of copyright owner]
23 * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
31 * This file has been created by splitting up the original DTrace sdt.h
32 * header. Keep the pragma notice here to allow version tracking.
35 /* #pragma ident "@(#)sdt.h 1.7 05/06/08 SMI" */
41 extern const char *sdt_prefix
;
43 typedef struct sdt_probedesc
{
44 char *sdpd_name
; /* name of this probe */
45 char *sdpd_func
; /* APPLE NOTE: function name */
46 unsigned long sdpd_offset
; /* offset of call in text */
47 struct sdt_probedesc
*sdpd_next
; /* next static probe */
54 /* #pragma ident "@(#)sdt_impl.h 1.3 05/06/08 SMI" */
60 #include <sys/dtrace.h>
64 sdt_probedesc_t
*sdt_probes
;
67 extern int sdt_invop(uintptr_t, uintptr_t *, uintptr_t);
68 extern uint64_t sdt_getarg(void *, dtrace_id_t
, void *, int, int);
70 void sdt_provide_module(void *, struct modctl
*);
73 extern int sdt_probetab_size
;
74 extern int sdt_probetab_mask
;
75 #define SDT_ADDR2NDX(addr) ((((uintptr_t)(addr)) >> 4) & sdt_probetab_mask)
78 #if defined(__x86_64__)
79 typedef uint8_t sdt_instr_t
;
81 #error Unknown implementation
84 typedef struct sdt_provider
{
85 const char *sdtp_name
; /* name of provider */
86 const char *sdtp_prefix
; /* prefix for probe names */
87 dtrace_pattr_t
*sdtp_attr
; /* stability attributes */
88 dtrace_provider_id_t sdtp_id
; /* provider ID */
91 extern sdt_provider_t sdt_providers
[]; /* array of providers */
93 typedef struct sdt_probe
{
94 sdt_provider_t
*sdp_provider
; /* provider */
95 char *sdp_name
; /* name of probe */
96 int sdp_namelen
; /* length of allocated name */
97 dtrace_id_t sdp_id
; /* probe ID */
98 struct modctl
*sdp_ctl
; /* modctl for module */
99 int sdp_loadcnt
; /* load count for module */
100 int sdp_primary
; /* non-zero if primary mod */
101 sdt_instr_t
*sdp_patchpoint
; /* patch point */
102 sdt_instr_t sdp_patchval
; /* instruction to patch */
103 sdt_instr_t sdp_savedval
; /* saved instruction value */
104 struct sdt_probe
*sdp_next
; /* next probe */
105 struct sdt_probe
*sdp_hashnext
; /* next on hash */
108 typedef struct sdt_argdesc
{
109 const char *sda_provider
; /* provider for arg */
110 const char *sda_name
; /* name of probe */
111 const int sda_ndx
; /* argument index */
112 const int sda_mapping
; /* mapping of argument */
113 const char *sda_native
; /* native type of argument */
114 const char *sda_xlate
; /* translated type of arg */
117 extern void sdt_getargdesc(void *, dtrace_id_t
, void *, dtrace_argdesc_t
*);
123 #endif /* _SDT_IMPL_H */