Lines Matching defs:idp
51 dt_idcook_sign(dt_node_t *dnp, dt_ident_t *idp,
54 dt_idsig_t *isp = idp->di_data;
60 iskey = idp->di_kind == DT_IDENT_ARRAY || idp->di_kind == DT_IDENT_AGG;
75 "passed, %s%d expected\n", prefix, idp->di_name, suffix,
91 prefix, idp->di_name, suffix,
100 dt_node_type_assign(dnp, idp->di_ctfp, idp->di_type, B_FALSE);
109 dt_idcook_assc(dt_node_t *dnp, dt_ident_t *idp, int argc, dt_node_t *args)
111 if (idp->di_data == NULL) {
112 dt_idsig_t *isp = idp->di_data = malloc(sizeof (dt_idsig_t));
127 idp->di_data = NULL;
139 if (!(idp->di_flags & DT_IDFLG_DECL)) {
140 idp->di_ctfp = DT_DYN_CTFP(yypcb->pcb_hdl);
141 idp->di_type = DT_DYN_TYPE(yypcb->pcb_hdl);
149 dt_idkind_name(idp->di_kind), i + 1);
159 dt_node_type_assign(dnp, idp->di_ctfp, idp->di_type, B_FALSE);
162 dt_idcook_sign(dnp, idp, argc, args,
163 idp->di_kind == DT_IDENT_AGG ? "@" : "", "[ ]");
173 dt_idcook_func(dt_node_t *dnp, dt_ident_t *idp, int argc, dt_node_t *args)
175 if (idp->di_data == NULL) {
182 assert(idp->di_iarg != NULL);
183 s = strdupa(idp->di_iarg);
193 "for built-in function %s\n", idp->di_name);
211 if ((isp = idp->di_data = malloc(sizeof (dt_idsig_t))) == NULL)
222 idp->di_data = NULL;
229 " %s\n", idp->di_name, s,
233 if (idp->di_kind == DT_IDENT_AGGFUNC) {
234 idp->di_ctfp = DT_DYN_CTFP(dtp);
235 idp->di_type = DT_DYN_TYPE(dtp);
237 idp->di_ctfp = dtt.dtt_ctfp;
238 idp->di_type = dtt.dtt_type;
294 "%s arg#%d (%s): %s\n", idp->di_name, i + 1,
303 dt_idcook_sign(dnp, idp, argc, args, "", "( )");
312 dt_idcook_args(dt_node_t *dnp, dt_ident_t *idp, int argc, dt_node_t *ap)
326 "passed, 1 expected\n", idp->di_name, argc,
333 idp->di_name, "integer constant",
339 "of a probe clause\n", idp->di_name);
345 "matches an unstable set of probes\n", idp->di_name,
352 n1, sizeof (n1)), idp->di_name);
367 "%s[%lld]\n", idp->di_name, (longlong_t)ap->dn_value);
372 "%s[%lld]\n", idp->di_name, (longlong_t)ap->dn_value);
377 dnp->dn_ident = dt_ident_create(idp->di_name, idp->di_kind,
378 idp->di_flags | DT_IDFLG_ORPHAN, idp->di_id, idp->di_attr,
379 idp->di_vers, idp->di_ops, idp->di_iarg, idp->di_gen);
397 dnp->dn_ident = dt_ident_create(idp->di_name, xidp->di_kind,
398 xidp->di_flags | DT_IDFLG_ORPHAN, idp->di_id, idp->di_attr,
399 idp->di_vers, idp->di_ops, idp->di_iarg, idp->di_gen);
421 "is not defined\n", idp->di_name, (longlong_t)ap->dn_value,
427 assert(dnp->dn_ident->di_id == idp->di_id);
431 dt_idcook_regs(dt_node_t *dnp, dt_ident_t *idp, int argc, dt_node_t *ap)
439 "passed, 1 expected\n", idp->di_name,
446 idp->di_name, "integer constant",
452 (longlong_t)ap->dn_value, idp->di_name);
457 idp->di_name, dtrace_errmsg(dtp, dtrace_errno(dtp)));
460 idp->di_ctfp = dtt.dtt_ctfp;
461 idp->di_type = dtt.dtt_type;
463 dt_node_type_assign(dnp, idp->di_ctfp, idp->di_type, B_FALSE);
468 dt_idcook_type(dt_node_t *dnp, dt_ident_t *idp, int argc, dt_node_t *args)
470 if (idp->di_type == CTF_ERR) {
474 if (dt_type_lookup(idp->di_iarg, &dtt) == -1) {
477 (const char *)idp->di_iarg, idp->di_name,
481 idp->di_ctfp = dtt.dtt_ctfp;
482 idp->di_type = dtt.dtt_type;
485 dt_node_type_assign(dnp, idp->di_ctfp, idp->di_type, B_FALSE);
490 dt_idcook_thaw(dt_node_t *dnp, dt_ident_t *idp, int argc, dt_node_t *args)
492 if (idp->di_ctfp != NULL && idp->di_type != CTF_ERR)
493 dt_node_type_assign(dnp, idp->di_ctfp, idp->di_type, B_FALSE);
497 dt_idcook_inline(dt_node_t *dnp, dt_ident_t *idp, int argc, dt_node_t *args)
499 if (idp->di_kind == DT_IDENT_ARRAY)
500 dt_idcook_assc(dnp, idp, argc, args);
502 dt_idcook_thaw(dnp, idp, argc, args);
506 dt_iddtor_sign(dt_ident_t *idp)
508 if (idp->di_data != NULL)
509 free(((dt_idsig_t *)idp->di_data)->dis_args);
510 free(idp->di_data);
514 dt_iddtor_free(dt_ident_t *idp)
516 free(idp->di_data);
520 dt_iddtor_inline(dt_ident_t *idp)
522 dt_idnode_t *inp = idp->di_iarg;
534 if (idp->di_kind == DT_IDENT_ARRAY)
535 dt_iddtor_sign(idp);
537 dt_iddtor_free(idp);
542 dt_iddtor_none(dt_ident_t *idp)
548 dt_iddtor_probe(dt_ident_t *idp)
550 if (idp->di_data != NULL)
551 dt_probe_destroy(idp->di_data);
555 dt_idsize_type(dt_ident_t *idp)
557 return (ctf_type_size(idp->di_ctfp, idp->di_type));
562 dt_idsize_none(dt_ident_t *idp)
618 const dt_ident_t *idp = dhp->dh_tmpl;
621 dt_dprintf("populating %s idhash from %p\n", dhp->dh_name, (void *)idp);
623 for (; idp->di_name != NULL; idp++) {
624 if (dt_idhash_insert(dhp, idp->di_name,
625 idp->di_kind, idp->di_flags, idp->di_id, idp->di_attr,
626 idp->di_vers, idp->di_ops ? idp->di_ops : &dt_idops_thaw,
627 idp->di_iarg, 0) == NULL)
670 dt_ident_t *idp, *next;
674 for (idp = dhp->dh_hash[i]; idp != NULL; idp = next) {
675 next = idp->di_next;
676 idp->di_ops->di_dtor(idp);
681 for (idp = dhp->dh_hash[i]; idp != NULL; idp = next) {
682 next = idp->di_next;
683 free(idp->di_name);
684 free(idp);
695 dt_ident_t *idp;
699 for (idp = dhp->dh_hash[i]; idp != NULL; idp = idp->di_next) {
704 if (idp->di_kind == DT_IDENT_ARRAY ||
705 idp->di_kind == DT_IDENT_SCALAR ||
706 idp->di_kind == DT_IDENT_AGG)
707 nextid = MAX(nextid, idp->di_id + 1);
719 dt_ident_t *idp;
724 for (idp = dhp->dh_hash[h]; idp != NULL; idp = idp->di_next) {
725 if (strcmp(idp->di_name, name) == 0)
726 return (idp);
759 dt_ident_t *idp;
765 idp = dt_ident_create(name, kind, flags, id,
768 if (idp == NULL)
772 idp->di_next = dhp->dh_hash[h];
774 dhp->dh_hash[h] = idp;
778 dhp->dh_defer(dhp, idp);
780 return (idp);
784 dt_idhash_xinsert(dt_idhash_t *dhp, dt_ident_t *idp)
791 h = dt_strtab_hash(idp->di_name, NULL) % dhp->dh_hashsz;
792 idp->di_next = dhp->dh_hash[h];
793 idp->di_flags &= ~DT_IDFLG_ORPHAN;
795 dhp->dh_hash[h] = idp;
799 dhp->dh_defer(dhp, idp);
808 dt_ident_t *idp;
810 for (idp = dhp->dh_hash[h]; idp != NULL; idp = idp->di_next) {
811 if (idp == key)
814 pp = &idp->di_next;
817 assert(idp == key);
818 *pp = idp->di_next;
823 if (!(idp->di_flags & DT_IDFLG_ORPHAN))
824 dt_ident_destroy(idp);
843 dt_ident_t *idp;
854 for (idp = dhp->dh_hash[i]; idp != NULL; idp = idp->di_next)
855 ids[j++] = idp;
872 dt_ident_t *idp;
876 if ((idp = dt_idhash_lookup(dhp, name)) != NULL)
877 return (idp);
901 dt_ident_t *idp;
905 (idp = malloc(sizeof (dt_ident_t))) == NULL) {
910 idp->di_name = s;
911 idp->di_kind = kind;
912 idp->di_flags = flags;
913 idp->di_id = id;
914 idp->di_attr = attr;
915 idp->di_vers = vers;
916 idp->di_ops = ops;
917 idp->di_iarg = iarg;
918 idp->di_data = NULL;
919 idp->di_ctfp = NULL;
920 idp->di_type = CTF_ERR;
921 idp->di_next = NULL;
922 idp->di_gen = gen;
923 idp->di_lineno = yylineno;
925 return (idp);
933 dt_ident_destroy(dt_ident_t *idp)
935 idp->di_ops->di_dtor(idp);
936 free(idp->di_name);
937 free(idp);
941 dt_ident_morph(dt_ident_t *idp, ushort_t kind,
944 idp->di_ops->di_dtor(idp);
945 idp->di_kind = kind;
946 idp->di_ops = ops;
947 idp->di_iarg = iarg;
948 idp->di_data = NULL;
952 dt_ident_cook(dt_node_t *dnp, dt_ident_t *idp, dt_node_t **pargp)
964 idp->di_ops->di_cook(dnp, idp, argc, args);
966 if (idp->di_flags & DT_IDFLG_USER)
969 return (dt_attr_min(attr, idp->di_attr));
973 dt_ident_type_assign(dt_ident_t *idp, ctf_file_t *fp, ctf_id_t type)
975 idp->di_ctfp = fp;
976 idp->di_type = type;
980 dt_ident_resolve(dt_ident_t *idp)
982 while (idp->di_flags & DT_IDFLG_INLINE) {
983 const dt_node_t *dnp = ((dt_idnode_t *)idp->di_iarg)->din_root;
995 idp = dnp->dn_ident;
1000 idp = dnp->dn_ident;
1005 return (idp);
1009 dt_ident_size(dt_ident_t *idp)
1011 idp = dt_ident_resolve(idp);
1012 return (idp->di_ops->di_size(idp));
1016 dt_ident_unref(const dt_ident_t *idp)
1018 return (idp->di_gen == yypcb->pcb_hdl->dt_gen &&
1019 (idp->di_flags & (DT_IDFLG_REF|DT_IDFLG_MOD|DT_IDFLG_DECL)) == 0);