Lines Matching defs:dxp
48 dt_xlator_t *dxp = arg;
49 dtrace_hdl_t *dtp = dxp->dx_hdl;
55 enp->dn_link = dxp->dx_nodes;
56 dxp->dx_nodes = enp;
61 mnp->dn_link = dxp->dx_nodes;
62 dxp->dx_nodes = mnp;
70 enp->dn_xlator = dxp;
72 dt_node_type_assign(enp, dxp->dx_dst_ctfp, type);
78 if (dxp->dx_members != NULL) {
82 dxp->dx_members = mnp;
86 dt_node_type_assign(mnp, dxp->dx_dst_ctfp, type);
99 dt_xlator_t *dxp = dt_zalloc(dtp, sizeof (dt_xlator_t));
105 if (dxp == NULL)
108 dxp->dx_hdl = dtp;
109 dxp->dx_id = dtp->dt_xlatorid++;
110 dxp->dx_gen = dtp->dt_gen;
111 dxp->dx_arg = -1;
113 if ((map = dt_alloc(dtp, sizeof (void *) * (dxp->dx_id + 1))) == NULL) {
114 dt_free(dtp, dxp);
118 dt_list_append(&dtp->dt_xlators, dxp);
119 bcopy(dtp->dt_xlatormap, map, sizeof (void *) * dxp->dx_id);
122 dtp->dt_xlatormap[dxp->dx_id] = dxp;
129 dxp->dx_ident = dt_ident_create(name ? name : "T",
133 if (dxp->dx_ident == NULL)
136 dxp->dx_ident->di_ctfp = src->dtt_ctfp;
137 dxp->dx_ident->di_type = src->dtt_type;
144 dxp->dx_locals = dt_idhash_create("xlparams", NULL, 0, 0);
146 if (dxp->dx_locals == NULL)
149 dt_idhash_xinsert(dxp->dx_locals, dxp->dx_ident);
152 dxp->dx_souid.di_name = "translator";
153 dxp->dx_souid.di_kind = DT_IDENT_XLSOU;
154 dxp->dx_souid.di_flags = DT_IDFLG_REF;
155 dxp->dx_souid.di_id = dxp->dx_id;
156 dxp->dx_souid.di_attr = _dtrace_defattr;
157 dxp->dx_souid.di_ops = &dt_idops_thaw;
158 dxp->dx_souid.di_data = dxp;
159 dxp->dx_souid.di_ctfp = dst->dtt_ctfp;
160 dxp->dx_souid.di_type = dst->dtt_type;
161 dxp->dx_souid.di_gen = dtp->dt_gen;
163 dxp->dx_ptrid.di_name = "translator";
164 dxp->dx_ptrid.di_kind = DT_IDENT_XLPTR;
165 dxp->dx_ptrid.di_flags = DT_IDFLG_REF;
166 dxp->dx_ptrid.di_id = dxp->dx_id;
167 dxp->dx_ptrid.di_attr = _dtrace_defattr;
168 dxp->dx_ptrid.di_ops = &dt_idops_thaw;
169 dxp->dx_ptrid.di_data = dxp;
170 dxp->dx_ptrid.di_ctfp = ptr.dtt_ctfp;
171 dxp->dx_ptrid.di_type = ptr.dtt_type;
172 dxp->dx_ptrid.di_gen = dtp->dt_gen;
181 dtp->dt_globals->dh_defer(dtp->dt_globals, &dxp->dx_souid);
182 dxp->dx_ptrid.di_attr = dxp->dx_souid.di_attr;
183 dxp->dx_ptrid.di_vers = dxp->dx_souid.di_vers;
186 dxp->dx_src_ctfp = src->dtt_ctfp;
187 dxp->dx_src_type = src->dtt_type;
188 dxp->dx_src_base = ctf_type_resolve(src->dtt_ctfp, src->dtt_type);
190 dxp->dx_dst_ctfp = dst->dtt_ctfp;
191 dxp->dx_dst_type = dst->dtt_type;
192 dxp->dx_dst_base = ctf_type_resolve(dst->dtt_ctfp, dst->dtt_type);
194 kind = ctf_type_kind(dst->dtt_ctfp, dxp->dx_dst_base);
203 if (ctf_member_iter(dxp->dx_dst_ctfp, dxp->dx_dst_base,
204 dt_xlator_create_member, dxp) != 0)
207 dxp->dx_members = members;
208 dxp->dx_nodes = nodes;
215 for (dnp = dxp->dx_members; dnp != NULL; dnp = dnp->dn_list) {
216 dnp->dn_membxlator = dxp;
217 dnp->dn_membid = dxp->dx_nmembers++;
220 dxp->dx_membdif = dt_zalloc(dtp,
221 sizeof (dtrace_difo_t *) * dxp->dx_nmembers);
223 if (dxp->dx_membdif == NULL) {
224 dxp->dx_nmembers = 0;
228 return (dxp);
231 dt_xlator_destroy(dtp, dxp);
236 dt_xlator_destroy(dtrace_hdl_t *dtp, dt_xlator_t *dxp)
240 dt_node_link_free(&dxp->dx_nodes);
242 if (dxp->dx_locals != NULL)
243 dt_idhash_destroy(dxp->dx_locals);
244 else if (dxp->dx_ident != NULL)
245 dt_ident_destroy(dxp->dx_ident);
247 for (i = 0; i < dxp->dx_nmembers; i++)
248 dt_difo_free(dtp, dxp->dx_membdif[i]);
250 dt_free(dtp, dxp->dx_membdif);
251 dt_list_delete(&dtp->dt_xlators, dxp);
252 dt_free(dtp, dxp);
270 dt_xlator_t *dxp = NULL;
298 for (dxp = dt_list_next(&dtp->dt_xlators); dxp != NULL;
299 dxp = dt_list_next(dxp)) {
300 if (ctf_type_compat(dxp->dx_src_ctfp, dxp->dx_src_type,
302 ctf_type_compat(dxp->dx_dst_ctfp, dxp->dx_dst_base,
310 for (dxp = dt_list_next(&dtp->dt_xlators); dxp != NULL;
311 dxp = dt_list_next(dxp)) {
312 if (ctf_type_compat(dxp->dx_src_ctfp, dxp->dx_src_base,
314 ctf_type_compat(dxp->dx_dst_ctfp, dxp->dx_dst_base,
319 for (dxp = dt_list_next(&dtp->dt_xlators); dxp != NULL;
320 dxp = dt_list_next(dxp)) {
321 dt_node_type_assign(&xn, dxp->dx_src_ctfp, dxp->dx_src_type);
322 if (ctf_type_compat(dxp->dx_dst_ctfp, dxp->dx_dst_base,
328 if (ptr && dxp != NULL && dxp->dx_ptrid.di_type == CTF_ERR)
331 if (dxp != NULL || !(flags & DT_XLATE_EXTERN) ||
333 return (dxp); /* we succeeded or not allowed to extern */
358 dt_xlator_ident(dt_xlator_t *dxp, ctf_file_t *ctfp, ctf_id_t type)
361 return (&dxp->dx_ptrid);
363 return (&dxp->dx_souid);
367 dt_xlator_member(dt_xlator_t *dxp, const char *name)
371 for (dnp = dxp->dx_members; dnp != NULL; dnp = dnp->dn_list) {
380 dt_xlator_dynamic(const dt_xlator_t *dxp)
382 return (dxp->dx_locals == NULL);