97 #define DT_VERS_1_2 DT_VERSION_NUMBER(1, 2, 0)
98 #define DT_VERS_1_2_1 DT_VERSION_NUMBER(1, 2, 1)
99 #define DT_VERS_1_2_2 DT_VERSION_NUMBER(1, 2, 2)
100 #define DT_VERS_1_3 DT_VERSION_NUMBER(1, 3, 0)
101 #define DT_VERS_1_4 DT_VERSION_NUMBER(1, 4, 0)
102 #define DT_VERS_1_4_1 DT_VERSION_NUMBER(1, 4, 1)
103 #define DT_VERS_1_5 DT_VERSION_NUMBER(1, 5, 0)
104 #define DT_VERS_1_6 DT_VERSION_NUMBER(1, 6, 0)
105 #define DT_VERS_1_6_1 DT_VERSION_NUMBER(1, 6, 1)
106 #define DT_VERS_1_6_2 DT_VERSION_NUMBER(1, 6, 2)
107 #define DT_VERS_1_6_3 DT_VERSION_NUMBER(1, 6, 3)
108 #define DT_VERS_1_7 DT_VERSION_NUMBER(1, 7, 0)
109 #define DT_VERS_1_7_1 DT_VERSION_NUMBER(1, 7, 1)
110 #define DT_VERS_1_8 DT_VERSION_NUMBER(1, 8, 0)
111 #define DT_VERS_1_8_1 DT_VERSION_NUMBER(1, 8, 1)
112 #define DT_VERS_1_9 DT_VERSION_NUMBER(1, 9, 0)
113 #define DT_VERS_1_9_1 DT_VERSION_NUMBER(1, 9, 1)
114 #define DT_VERS_1_10 DT_VERSION_NUMBER(1, 10, 0)
115 #define DT_VERS_1_11 DT_VERSION_NUMBER(1, 11, 0)
116 #define DT_VERS_1_12 DT_VERSION_NUMBER(1, 12, 0)
117 #define DT_VERS_LATEST DT_VERS_1_12
118 #define DT_VERS_STRING "Sun D 1.12"
119
120 const dt_version_t _dtrace_versions[] = {
121 DT_VERS_1_0, /* D API 1.0.0 (PSARC 2001/466) Solaris 10 FCS */
122 DT_VERS_1_1, /* D API 1.1.0 Solaris Express 6/05 */
123 DT_VERS_1_2, /* D API 1.2.0 Solaris 10 Update 1 */
124 DT_VERS_1_2_1, /* D API 1.2.1 Solaris Express 4/06 */
125 DT_VERS_1_2_2, /* D API 1.2.2 Solaris Express 6/06 */
126 DT_VERS_1_3, /* D API 1.3 Solaris Express 10/06 */
127 DT_VERS_1_4, /* D API 1.4 Solaris Express 2/07 */
128 DT_VERS_1_4_1, /* D API 1.4.1 Solaris Express 4/07 */
129 DT_VERS_1_5, /* D API 1.5 Solaris Express 7/07 */
130 DT_VERS_1_6, /* D API 1.6 */
131 DT_VERS_1_6_1, /* D API 1.6.1 */
132 DT_VERS_1_6_2, /* D API 1.6.2 */
133 DT_VERS_1_6_3, /* D API 1.6.3 */
134 DT_VERS_1_7, /* D API 1.7 */
135 DT_VERS_1_7_1, /* D API 1.7.1 */
136 DT_VERS_1_8, /* D API 1.8 */
137 DT_VERS_1_8_1, /* D API 1.8.1 */
138 DT_VERS_1_9, /* D API 1.9 */
139 DT_VERS_1_9_1, /* D API 1.9.1 */
140 DT_VERS_1_10, /* D API 1.10 */
141 DT_VERS_1_11, /* D API 1.11 */
142 DT_VERS_1_12, /* D API 1.12 */
143 0
144 };
145
146 /*
147 * Table of global identifiers. This is used to populate the global identifier
148 * hash when a new dtrace client open occurs. For more info see dt_ident.h.
149 * The global identifiers that represent functions use the dt_idops_func ops
150 * and specify the private data pointer as a prototype string which is parsed
151 * when the identifier is first encountered. These prototypes look like ANSI
152 * C function prototypes except that the special symbol "@" can be used as a
153 * wildcard to represent a single parameter of any type (i.e. any dt_node_t).
154 * The standard "..." notation can also be used to represent varargs. An empty
155 * parameter list is taken to mean void (that is, no arguments are permitted).
156 * A parameter enclosed in square brackets (e.g. "[int]") denotes an optional
157 * argument.
158 */
159 static const dt_ident_t _dtrace_globals[] = {
160 { "alloca", DT_IDENT_FUNC, 0, DIF_SUBR_ALLOCA, DT_ATTR_STABCMN, DT_VERS_1_0,
161 &dt_idops_func, "void *(size_t)" },
162 { "arg0", DT_IDENT_SCALAR, 0, DIF_VAR_ARG0, DT_ATTR_STABCMN, DT_VERS_1_0,
923 err = EDT_ACCESS;
924 break;
925 }
926 return (set_open_errno(dtp, errp, err));
927 }
928
929 (void) fcntl(dtfd, F_SETFD, FD_CLOEXEC);
930 (void) fcntl(ftfd, F_SETFD, FD_CLOEXEC);
931
932 alloc:
933 if ((dtp = malloc(sizeof (dtrace_hdl_t))) == NULL)
934 return (set_open_errno(dtp, errp, EDT_NOMEM));
935
936 bzero(dtp, sizeof (dtrace_hdl_t));
937 dtp->dt_oflags = flags;
938 dtp->dt_prcmode = DT_PROC_STOP_PREINIT;
939 dtp->dt_linkmode = DT_LINK_KERNEL;
940 dtp->dt_linktype = DT_LTYP_ELF;
941 dtp->dt_xlatemode = DT_XL_STATIC;
942 dtp->dt_stdcmode = DT_STDC_XA;
943 dtp->dt_version = version;
944 dtp->dt_fd = dtfd;
945 dtp->dt_ftfd = ftfd;
946 dtp->dt_fterr = fterr;
947 dtp->dt_cdefs_fd = -1;
948 dtp->dt_ddefs_fd = -1;
949 dtp->dt_stdout_fd = -1;
950 dtp->dt_modbuckets = _dtrace_strbuckets;
951 dtp->dt_mods = calloc(dtp->dt_modbuckets, sizeof (dt_module_t *));
952 dtp->dt_provbuckets = _dtrace_strbuckets;
953 dtp->dt_provs = calloc(dtp->dt_provbuckets, sizeof (dt_provider_t *));
954 dt_proc_init(dtp);
955 dtp->dt_vmax = DT_VERS_LATEST;
956 dtp->dt_cpp_path = strdup(_dtrace_defcpp);
957 dtp->dt_cpp_argv = malloc(sizeof (char *));
958 dtp->dt_cpp_argc = 1;
959 dtp->dt_cpp_args = 1;
960 dtp->dt_ld_path = strdup(_dtrace_defld);
961 dtp->dt_provmod = provmod;
962 dtp->dt_vector = vector;
|
97 #define DT_VERS_1_2 DT_VERSION_NUMBER(1, 2, 0)
98 #define DT_VERS_1_2_1 DT_VERSION_NUMBER(1, 2, 1)
99 #define DT_VERS_1_2_2 DT_VERSION_NUMBER(1, 2, 2)
100 #define DT_VERS_1_3 DT_VERSION_NUMBER(1, 3, 0)
101 #define DT_VERS_1_4 DT_VERSION_NUMBER(1, 4, 0)
102 #define DT_VERS_1_4_1 DT_VERSION_NUMBER(1, 4, 1)
103 #define DT_VERS_1_5 DT_VERSION_NUMBER(1, 5, 0)
104 #define DT_VERS_1_6 DT_VERSION_NUMBER(1, 6, 0)
105 #define DT_VERS_1_6_1 DT_VERSION_NUMBER(1, 6, 1)
106 #define DT_VERS_1_6_2 DT_VERSION_NUMBER(1, 6, 2)
107 #define DT_VERS_1_6_3 DT_VERSION_NUMBER(1, 6, 3)
108 #define DT_VERS_1_7 DT_VERSION_NUMBER(1, 7, 0)
109 #define DT_VERS_1_7_1 DT_VERSION_NUMBER(1, 7, 1)
110 #define DT_VERS_1_8 DT_VERSION_NUMBER(1, 8, 0)
111 #define DT_VERS_1_8_1 DT_VERSION_NUMBER(1, 8, 1)
112 #define DT_VERS_1_9 DT_VERSION_NUMBER(1, 9, 0)
113 #define DT_VERS_1_9_1 DT_VERSION_NUMBER(1, 9, 1)
114 #define DT_VERS_1_10 DT_VERSION_NUMBER(1, 10, 0)
115 #define DT_VERS_1_11 DT_VERSION_NUMBER(1, 11, 0)
116 #define DT_VERS_1_12 DT_VERSION_NUMBER(1, 12, 0)
117 #define DT_VERS_1_12_1 DT_VERSION_NUMBER(1, 12, 1)
118 #define DT_VERS_LATEST DT_VERS_1_12_1
119 #define DT_VERS_STRING "Sun D 1.12.1"
120
121 const dt_version_t _dtrace_versions[] = {
122 DT_VERS_1_0, /* D API 1.0.0 (PSARC 2001/466) Solaris 10 FCS */
123 DT_VERS_1_1, /* D API 1.1.0 Solaris Express 6/05 */
124 DT_VERS_1_2, /* D API 1.2.0 Solaris 10 Update 1 */
125 DT_VERS_1_2_1, /* D API 1.2.1 Solaris Express 4/06 */
126 DT_VERS_1_2_2, /* D API 1.2.2 Solaris Express 6/06 */
127 DT_VERS_1_3, /* D API 1.3 Solaris Express 10/06 */
128 DT_VERS_1_4, /* D API 1.4 Solaris Express 2/07 */
129 DT_VERS_1_4_1, /* D API 1.4.1 Solaris Express 4/07 */
130 DT_VERS_1_5, /* D API 1.5 Solaris Express 7/07 */
131 DT_VERS_1_6, /* D API 1.6 */
132 DT_VERS_1_6_1, /* D API 1.6.1 */
133 DT_VERS_1_6_2, /* D API 1.6.2 */
134 DT_VERS_1_6_3, /* D API 1.6.3 */
135 DT_VERS_1_7, /* D API 1.7 */
136 DT_VERS_1_7_1, /* D API 1.7.1 */
137 DT_VERS_1_8, /* D API 1.8 */
138 DT_VERS_1_8_1, /* D API 1.8.1 */
139 DT_VERS_1_9, /* D API 1.9 */
140 DT_VERS_1_9_1, /* D API 1.9.1 */
141 DT_VERS_1_10, /* D API 1.10 */
142 DT_VERS_1_11, /* D API 1.11 */
143 DT_VERS_1_12, /* D API 1.12 */
144 DT_VERS_1_12_1, /* D API 1.12.1 */
145 0
146 };
147
148 /*
149 * Table of global identifiers. This is used to populate the global identifier
150 * hash when a new dtrace client open occurs. For more info see dt_ident.h.
151 * The global identifiers that represent functions use the dt_idops_func ops
152 * and specify the private data pointer as a prototype string which is parsed
153 * when the identifier is first encountered. These prototypes look like ANSI
154 * C function prototypes except that the special symbol "@" can be used as a
155 * wildcard to represent a single parameter of any type (i.e. any dt_node_t).
156 * The standard "..." notation can also be used to represent varargs. An empty
157 * parameter list is taken to mean void (that is, no arguments are permitted).
158 * A parameter enclosed in square brackets (e.g. "[int]") denotes an optional
159 * argument.
160 */
161 static const dt_ident_t _dtrace_globals[] = {
162 { "alloca", DT_IDENT_FUNC, 0, DIF_SUBR_ALLOCA, DT_ATTR_STABCMN, DT_VERS_1_0,
163 &dt_idops_func, "void *(size_t)" },
164 { "arg0", DT_IDENT_SCALAR, 0, DIF_VAR_ARG0, DT_ATTR_STABCMN, DT_VERS_1_0,
925 err = EDT_ACCESS;
926 break;
927 }
928 return (set_open_errno(dtp, errp, err));
929 }
930
931 (void) fcntl(dtfd, F_SETFD, FD_CLOEXEC);
932 (void) fcntl(ftfd, F_SETFD, FD_CLOEXEC);
933
934 alloc:
935 if ((dtp = malloc(sizeof (dtrace_hdl_t))) == NULL)
936 return (set_open_errno(dtp, errp, EDT_NOMEM));
937
938 bzero(dtp, sizeof (dtrace_hdl_t));
939 dtp->dt_oflags = flags;
940 dtp->dt_prcmode = DT_PROC_STOP_PREINIT;
941 dtp->dt_linkmode = DT_LINK_KERNEL;
942 dtp->dt_linktype = DT_LTYP_ELF;
943 dtp->dt_xlatemode = DT_XL_STATIC;
944 dtp->dt_stdcmode = DT_STDC_XA;
945 dtp->dt_encoding = DT_ENCODING_UNSET;
946 dtp->dt_version = version;
947 dtp->dt_fd = dtfd;
948 dtp->dt_ftfd = ftfd;
949 dtp->dt_fterr = fterr;
950 dtp->dt_cdefs_fd = -1;
951 dtp->dt_ddefs_fd = -1;
952 dtp->dt_stdout_fd = -1;
953 dtp->dt_modbuckets = _dtrace_strbuckets;
954 dtp->dt_mods = calloc(dtp->dt_modbuckets, sizeof (dt_module_t *));
955 dtp->dt_provbuckets = _dtrace_strbuckets;
956 dtp->dt_provs = calloc(dtp->dt_provbuckets, sizeof (dt_provider_t *));
957 dt_proc_init(dtp);
958 dtp->dt_vmax = DT_VERS_LATEST;
959 dtp->dt_cpp_path = strdup(_dtrace_defcpp);
960 dtp->dt_cpp_argv = malloc(sizeof (char *));
961 dtp->dt_cpp_argc = 1;
962 dtp->dt_cpp_args = 1;
963 dtp->dt_ld_path = strdup(_dtrace_defld);
964 dtp->dt_provmod = provmod;
965 dtp->dt_vector = vector;
|