Lines Matching defs:dnp
402 dt_node_promote(dt_node_t *lp, dt_node_t *rp, dt_node_t *dnp)
404 dt_type_promote(lp, rp, &dnp->dn_ctfp, &dnp->dn_type);
405 dt_node_type_assign(dnp, dnp->dn_ctfp, dnp->dn_type, B_FALSE);
406 dt_node_attr_assign(dnp, dt_attr_min(lp->dn_attr, rp->dn_attr));
410 dt_node_name(const dt_node_t *dnp, char *buf, size_t len)
419 switch (dnp->dn_kind) {
422 (u_longlong_t)dnp->dn_value);
425 s = strchr2esc(dnp->dn_string, strlen(dnp->dn_string));
427 s != NULL ? s : dnp->dn_string);
431 (void) snprintf(buf, len, "identifier %s", dnp->dn_string);
437 switch (dnp->dn_ident->di_kind) {
448 dt_idkind_name(dnp->dn_ident->di_kind),
449 prefix, dnp->dn_ident->di_name, suffix);
452 dts = dnp->dn_ident->di_data;
458 dt_node_type_name(dnp, n1, sizeof (n1)));
463 (void) snprintf(buf, len, "operator %s", opstr(dnp->dn_op));
467 if (dnp->dn_expr)
468 return (dt_node_name(dnp->dn_expr, buf, len));
472 if (dnp->dn_desc->dtpd_id == 0) {
475 dnp->dn_desc->dtpd_provider, dnp->dn_desc->dtpd_mod,
476 dnp->dn_desc->dtpd_func, dnp->dn_desc->dtpd_name);
479 dnp->dn_desc->dtpd_id);
486 (void) snprintf(buf, len, "member %s", dnp->dn_membname);
490 dt_type_name(dnp->dn_xlator->dx_dst_ctfp,
491 dnp->dn_xlator->dx_dst_type, n1, sizeof (n1)),
492 dt_type_name(dnp->dn_xlator->dx_src_ctfp,
493 dnp->dn_xlator->dx_src_type, n2, sizeof (n2)));
499 (void) snprintf(buf, len, "node <%u>", dnp->dn_kind);
513 dt_node_t *dnp = dt_alloc(dtp, sizeof (dt_node_t));
515 if (dnp == NULL)
518 dnp->dn_ctfp = NULL;
519 dnp->dn_type = CTF_ERR;
520 dnp->dn_kind = (uchar_t)kind;
521 dnp->dn_flags = 0;
522 dnp->dn_op = 0;
523 dnp->dn_line = -1;
524 dnp->dn_reg = -1;
525 dnp->dn_attr = _dtrace_defattr;
526 dnp->dn_list = NULL;
527 dnp->dn_link = NULL;
528 bzero(&dnp->dn_u, sizeof (dnp->dn_u));
530 return (dnp);
542 dt_node_t *dnp = dt_node_xalloc(yypcb->pcb_hdl, kind);
544 if (dnp == NULL)
547 dnp->dn_line = yylineno;
548 dnp->dn_link = yypcb->pcb_list;
549 yypcb->pcb_list = dnp;
551 return (dnp);
555 dt_node_free(dt_node_t *dnp)
557 uchar_t kind = dnp->dn_kind;
559 dnp->dn_kind = DT_NODE_FREE;
565 free(dnp->dn_string);
566 dnp->dn_string = NULL;
572 if (dnp->dn_ident != NULL) {
573 if (dnp->dn_ident->di_flags & DT_IDFLG_ORPHAN)
574 dt_ident_destroy(dnp->dn_ident);
575 dnp->dn_ident = NULL;
577 dt_node_list_free(&dnp->dn_args);
581 if (dnp->dn_child != NULL) {
582 dt_node_free(dnp->dn_child);
583 dnp->dn_child = NULL;
588 if (dnp->dn_expr != NULL) {
589 dt_node_free(dnp->dn_expr);
590 dnp->dn_expr = NULL;
594 if (dnp->dn_left != NULL) {
595 dt_node_free(dnp->dn_left);
596 dnp->dn_left = NULL;
598 if (dnp->dn_right != NULL) {
599 dt_node_free(dnp->dn_right);
600 dnp->dn_right = NULL;
606 if (dnp->dn_expr != NULL) {
607 dt_node_free(dnp->dn_expr);
608 dnp->dn_expr = NULL;
613 if (dnp->dn_aggfun != NULL) {
614 dt_node_free(dnp->dn_aggfun);
615 dnp->dn_aggfun = NULL;
617 dt_node_list_free(&dnp->dn_aggtup);
621 free(dnp->dn_spec);
622 dnp->dn_spec = NULL;
623 free(dnp->dn_desc);
624 dnp->dn_desc = NULL;
628 if (dnp->dn_pred != NULL)
629 dt_node_free(dnp->dn_pred);
630 if (dnp->dn_locals != NULL)
631 dt_idhash_destroy(dnp->dn_locals);
632 dt_node_list_free(&dnp->dn_pdescs);
633 dt_node_list_free(&dnp->dn_acts);
637 free(dnp->dn_membname);
638 dnp->dn_membname = NULL;
639 if (dnp->dn_membexpr != NULL) {
640 dt_node_free(dnp->dn_membexpr);
641 dnp->dn_membexpr = NULL;
646 dt_node_list_free(&dnp->dn_probes);
647 free(dnp->dn_provname);
648 dnp->dn_provname = NULL;
652 dt_node_list_free(&dnp->dn_list);
658 dt_node_attr_assign(dt_node_t *dnp, dtrace_attribute_t attr)
665 dnerror(dnp, D_ATTR_MIN, "attributes for %s (%s) are less than "
666 "predefined minimum\n", dt_node_name(dnp, s, sizeof (s)),
670 dnp->dn_attr = attr;
674 dt_node_type_assign(dt_node_t *dnp, ctf_file_t *fp, ctf_id_t type,
681 dnp->dn_flags &=
688 dnp->dn_flags |= DT_NF_BITFIELD;
691 dnp->dn_flags |= DT_NF_SIGNED;
696 dnp->dn_flags |= DT_NF_REF;
702 dnp->dn_flags |= DT_NF_REF;
705 dnp->dn_flags |= DT_NF_REF;
708 dnp->dn_flags |= DT_NF_USERLAND;
710 dnp->dn_flags |= DT_NF_COOKED;
711 dnp->dn_ctfp = fp;
712 dnp->dn_type = type;
725 dt_node_type_name(const dt_node_t *dnp, char *buf, size_t len)
727 if (dt_node_is_dynamic(dnp) && dnp->dn_ident != NULL) {
729 dt_idkind_name(dt_ident_resolve(dnp->dn_ident)->di_kind));
733 if (dnp->dn_flags & DT_NF_USERLAND) {
736 (void) dt_type_name(dnp->dn_ctfp, dnp->dn_type, buf + n, len);
740 return (dt_type_name(dnp->dn_ctfp, dnp->dn_type, buf, len));
744 dt_node_type_size(const dt_node_t *dnp)
749 if (dnp->dn_kind == DT_NODE_STRING)
750 return (strlen(dnp->dn_string) + 1);
752 if (dt_node_is_dynamic(dnp) && dnp->dn_ident != NULL)
753 return (dt_ident_size(dnp->dn_ident));
755 base = ctf_type_resolve(dnp->dn_ctfp, dnp->dn_type);
757 if (ctf_type_kind(dnp->dn_ctfp, base) == CTF_K_FORWARD)
768 if (ctf_type_kind(dnp->dn_ctfp, base) == CTF_K_POINTER &&
769 ctf_getmodel(dnp->dn_ctfp) == CTF_MODEL_ILP32 &&
770 !(dnp->dn_flags & DT_NF_USERLAND) &&
774 return (ctf_type_size(dnp->dn_ctfp, dnp->dn_type));
783 dt_node_resolve(const dt_node_t *dnp, uint_t idkind)
787 switch (dnp->dn_kind) {
794 idp = dt_ident_resolve(dnp->dn_ident);
798 if (dt_node_is_dynamic(dnp)) {
799 idp = dt_ident_resolve(dnp->dn_ident);
807 dt_node_sizeof(const dt_node_t *dnp)
822 if (dnp->dn_kind != DT_NODE_SYM)
823 return (dt_node_type_size(dnp));
825 sip = dnp->dn_ident->di_data;
835 dt_node_is_integer(const dt_node_t *dnp)
837 ctf_file_t *fp = dnp->dn_ctfp;
842 assert(dnp->dn_flags & DT_NF_COOKED);
844 type = ctf_type_resolve(fp, dnp->dn_type);
855 dt_node_is_float(const dt_node_t *dnp)
857 ctf_file_t *fp = dnp->dn_ctfp;
862 assert(dnp->dn_flags & DT_NF_COOKED);
864 type = ctf_type_resolve(fp, dnp->dn_type);
868 ctf_type_encoding(dnp->dn_ctfp, type, &e) == 0 && (
874 dt_node_is_scalar(const dt_node_t *dnp)
876 ctf_file_t *fp = dnp->dn_ctfp;
881 assert(dnp->dn_flags & DT_NF_COOKED);
883 type = ctf_type_resolve(fp, dnp->dn_type);
895 dt_node_is_arith(const dt_node_t *dnp)
897 ctf_file_t *fp = dnp->dn_ctfp;
902 assert(dnp->dn_flags & DT_NF_COOKED);
904 type = ctf_type_resolve(fp, dnp->dn_type);
914 dt_node_is_vfptr(const dt_node_t *dnp)
916 ctf_file_t *fp = dnp->dn_ctfp;
921 assert(dnp->dn_flags & DT_NF_COOKED);
923 type = ctf_type_resolve(fp, dnp->dn_type);
935 dt_node_is_dynamic(const dt_node_t *dnp)
937 if (dnp->dn_kind == DT_NODE_VAR &&
938 (dnp->dn_ident->di_flags & DT_IDFLG_INLINE)) {
939 const dt_idnode_t *inp = dnp->dn_ident->di_iarg;
943 return (dnp->dn_ctfp == DT_DYN_CTFP(yypcb->pcb_hdl) &&
944 dnp->dn_type == DT_DYN_TYPE(yypcb->pcb_hdl));
948 dt_node_is_string(const dt_node_t *dnp)
950 return (dnp->dn_ctfp == DT_STR_CTFP(yypcb->pcb_hdl) &&
951 dnp->dn_type == DT_STR_TYPE(yypcb->pcb_hdl));
955 dt_node_is_stack(const dt_node_t *dnp)
957 return (dnp->dn_ctfp == DT_STACK_CTFP(yypcb->pcb_hdl) &&
958 dnp->dn_type == DT_STACK_TYPE(yypcb->pcb_hdl));
962 dt_node_is_symaddr(const dt_node_t *dnp)
964 return (dnp->dn_ctfp == DT_SYMADDR_CTFP(yypcb->pcb_hdl) &&
965 dnp->dn_type == DT_SYMADDR_TYPE(yypcb->pcb_hdl));
969 dt_node_is_usymaddr(const dt_node_t *dnp)
971 return (dnp->dn_ctfp == DT_USYMADDR_CTFP(yypcb->pcb_hdl) &&
972 dnp->dn_type == DT_USYMADDR_TYPE(yypcb->pcb_hdl));
976 dt_node_is_strcompat(const dt_node_t *dnp)
978 ctf_file_t *fp = dnp->dn_ctfp;
984 assert(dnp->dn_flags & DT_NF_COOKED);
986 base = ctf_type_resolve(fp, dnp->dn_type);
1004 dt_node_is_pointer(const dt_node_t *dnp)
1006 ctf_file_t *fp = dnp->dn_ctfp;
1009 assert(dnp->dn_flags & DT_NF_COOKED);
1011 if (dt_node_is_string(dnp))
1014 kind = ctf_type_kind(fp, ctf_type_resolve(fp, dnp->dn_type));
1019 dt_node_is_void(const dt_node_t *dnp)
1021 ctf_file_t *fp = dnp->dn_ctfp;
1025 if (dt_node_is_dynamic(dnp))
1028 if (dt_node_is_stack(dnp))
1031 if (dt_node_is_symaddr(dnp) || dt_node_is_usymaddr(dnp))
1034 type = ctf_type_resolve(fp, dnp->dn_type);
1191 dt_node_is_posconst(const dt_node_t *dnp)
1193 return (dnp->dn_kind == DT_NODE_INT && dnp->dn_value != 0 && (
1194 (dnp->dn_flags & DT_NF_SIGNED) == 0 || (int64_t)dnp->dn_value > 0));
1198 dt_node_is_actfunc(const dt_node_t *dnp)
1200 return (dnp->dn_kind == DT_NODE_FUNC &&
1201 dnp->dn_ident->di_kind == DT_IDENT_ACTFUNC);
1237 dt_node_t *dnp = dt_node_alloc(DT_NODE_INT);
1246 dnp->dn_op = DT_TOK_INT;
1247 dnp->dn_value = value;
1258 dt_node_type_assign(dnp,
1268 return (dt_node_op1(DT_TOK_IPOS, dnp));
1270 return (dt_node_op1(DT_TOK_INEG, dnp));
1272 return (dnp);
1287 dt_node_t *dnp;
1292 dnp = dt_node_alloc(DT_NODE_STRING);
1293 dnp->dn_op = DT_TOK_STRING;
1294 dnp->dn_string = string;
1295 dt_node_type_assign(dnp, DT_STR_CTFP(dtp), DT_STR_TYPE(dtp), B_FALSE);
1297 return (dnp);
1304 dt_node_t *dnp;
1323 dnp = dt_node_alloc(DT_NODE_INT);
1324 dnp->dn_op = DT_TOK_INT;
1325 dnp->dn_value = inp->din_root->dn_value;
1326 dt_node_type_propagate(inp->din_root, dnp);
1328 return (dnp);
1332 dnp = dt_node_alloc(DT_NODE_IDENT);
1333 dnp->dn_op = name[0] == '@' ? DT_TOK_AGG : DT_TOK_IDENT;
1334 dnp->dn_string = name;
1336 return (dnp);
1349 dt_node_t *dnp;
1368 dnp = dt_node_alloc(DT_NODE_TYPE);
1369 dnp->dn_op = DT_TOK_IDENT;
1370 dnp->dn_string = name;
1372 dt_node_type_assign(dnp, dtt.dtt_ctfp, dtt.dtt_type, dtt.dtt_flags);
1376 dt_node_attr_assign(dnp, _dtrace_defattr);
1378 dt_node_attr_assign(dnp, _dtrace_typattr);
1380 return (dnp);
1390 dt_node_t *dnp = dt_node_alloc(DT_NODE_TYPE);
1392 dnp->dn_op = DT_TOK_IDENT;
1393 dnp->dn_ctfp = yypcb->pcb_hdl->dt_cdefs->dm_ctfp;
1394 dnp->dn_type = CTF_ERR;
1395 dnp->dn_attr = _dtrace_defattr;
1397 return (dnp);
1645 dt_node_t *dnp = ddp->dd_node;
1648 for (; dnp != NULL; dnp = dnp->dn_list, argc++) {
1654 if (ctf_type_cmp(dnp->dn_ctfp, dnp->dn_type,
1664 dt_node_type_name(dnp, n1, sizeof (n1)),
1751 dt_node_func(dt_node_t *dnp, dt_node_t *args)
1755 if (dnp->dn_kind != DT_NODE_IDENT) {
1760 idp = dt_idstack_lookup(&yypcb->pcb_globals, dnp->dn_string);
1764 "undefined function name: %s\n", dnp->dn_string);
1774 free(dnp->dn_string);
1775 dnp->dn_string = NULL;
1777 dnp->dn_kind = DT_NODE_FUNC;
1778 dnp->dn_flags &= ~DT_NF_COOKED;
1779 dnp->dn_ident = idp;
1780 dnp->dn_args = args;
1781 dnp->dn_list = NULL;
1783 return (dnp);
1839 dt_node_t *dnp;
1892 dnp = dt_node_alloc(DT_NODE_OP1);
1894 dnp->dn_op = (ushort_t)op;
1895 dnp->dn_child = cp;
1897 return (dnp);
1936 dt_node_t *dnp;
1955 dnp = dt_node_int(0); /* allocate new integer node for result */
1959 dnp->dn_value = l || r;
1960 dt_node_type_assign(dnp,
1964 dnp->dn_value = (l != 0) ^ (r != 0);
1965 dt_node_type_assign(dnp,
1969 dnp->dn_value = l && r;
1970 dt_node_type_assign(dnp,
1974 dnp->dn_value = l | r;
1975 dt_node_promote(lp, rp, dnp);
1978 dnp->dn_value = l ^ r;
1979 dt_node_promote(lp, rp, dnp);
1982 dnp->dn_value = l & r;
1983 dt_node_promote(lp, rp, dnp);
1986 dnp->dn_value = l == r;
1987 dt_node_type_assign(dnp,
1991 dnp->dn_value = l != r;
1992 dt_node_type_assign(dnp,
1996 dt_node_promote(lp, rp, dnp);
1997 if (dnp->dn_flags & DT_NF_SIGNED)
1998 dnp->dn_value = (intmax_t)l < (intmax_t)r;
2000 dnp->dn_value = l < r;
2001 dt_node_type_assign(dnp,
2005 dt_node_promote(lp, rp, dnp);
2006 if (dnp->dn_flags & DT_NF_SIGNED)
2007 dnp->dn_value = (intmax_t)l <= (intmax_t)r;
2009 dnp->dn_value = l <= r;
2010 dt_node_type_assign(dnp,
2014 dt_node_promote(lp, rp, dnp);
2015 if (dnp->dn_flags & DT_NF_SIGNED)
2016 dnp->dn_value = (intmax_t)l > (intmax_t)r;
2018 dnp->dn_value = l > r;
2019 dt_node_type_assign(dnp,
2023 dt_node_promote(lp, rp, dnp);
2024 if (dnp->dn_flags & DT_NF_SIGNED)
2025 dnp->dn_value = (intmax_t)l >= (intmax_t)r;
2027 dnp->dn_value = l >= r;
2028 dt_node_type_assign(dnp,
2032 dnp->dn_value = l << r;
2033 dt_node_type_propagate(lp, dnp);
2038 dnp->dn_value = l >> r;
2039 dt_node_type_propagate(lp, dnp);
2044 dnp->dn_value = l + r;
2045 dt_node_promote(lp, rp, dnp);
2048 dnp->dn_value = l - r;
2049 dt_node_promote(lp, rp, dnp);
2052 dnp->dn_value = l * r;
2053 dt_node_promote(lp, rp, dnp);
2056 dt_node_promote(lp, rp, dnp);
2057 if (dnp->dn_flags & DT_NF_SIGNED)
2058 dnp->dn_value = (intmax_t)l / (intmax_t)r;
2060 dnp->dn_value = l / r;
2063 dt_node_promote(lp, rp, dnp);
2064 if (dnp->dn_flags & DT_NF_SIGNED)
2065 dnp->dn_value = (intmax_t)l % (intmax_t)r;
2067 dnp->dn_value = l % r;
2070 dt_node_free(dnp);
2071 dnp = NULL;
2074 if (dnp != NULL) {
2077 return (dnp);
2095 dnp = dt_node_alloc(DT_NODE_OP2);
2097 dnp->dn_op = (ushort_t)op;
2098 dnp->dn_left = lp;
2099 dnp->dn_right = rp;
2101 return (dnp);
2107 dt_node_t *dnp;
2112 dnp = dt_node_alloc(DT_NODE_OP3);
2113 dnp->dn_op = DT_TOK_QUESTION;
2114 dnp->dn_expr = expr;
2115 dnp->dn_left = lp;
2116 dnp->dn_right = rp;
2118 return (dnp);
2124 dt_node_t *dnp;
2131 dnp = dt_node_alloc(DT_NODE_DFUNC);
2133 dnp = dt_node_alloc(DT_NODE_DEXPR);
2135 dnp->dn_expr = expr;
2136 return (dnp);
2142 dt_node_t *dnp = dt_node_alloc(DT_NODE_IF);
2143 dnp->dn_conditional = pred;
2144 dnp->dn_body = acts;
2145 dnp->dn_alternate_body = else_acts;
2147 return (dnp);
2154 dt_node_t *dnp;
2159 dnp = dt_node_alloc(DT_NODE_PDESC);
2160 dnp->dn_spec = spec;
2161 dnp->dn_desc = malloc(sizeof (dtrace_probedesc_t));
2163 if (dnp->dn_desc == NULL)
2166 if (dtrace_xstr2desc(dtp, yypcb->pcb_pspec, dnp->dn_spec,
2167 yypcb->pcb_sargc, yypcb->pcb_sargv, dnp->dn_desc) != 0) {
2169 dnp->dn_spec, dtrace_errmsg(dtp, dtrace_errno(dtp)));
2172 free(dnp->dn_spec);
2173 dnp->dn_spec = NULL;
2175 return (dnp);
2186 dt_node_t *dnp = dt_node_alloc(DT_NODE_PDESC);
2188 if ((dnp->dn_desc = malloc(sizeof (dtrace_probedesc_t))) == NULL)
2202 if (dtrace_id2desc(dtp, (dtrace_id_t)id, dnp->dn_desc) != 0) {
2207 return (dnp);
2213 dt_node_t *dnp = dt_node_alloc(DT_NODE_CLAUSE);
2215 dnp->dn_pdescs = pdescs;
2216 dnp->dn_pred = pred;
2217 dnp->dn_acts = acts;
2219 return (dnp);
2234 dt_node_t *dnp;
2279 dnp = dt_node_alloc(DT_NODE_INLINE);
2280 dt_node_type_assign(dnp, dtt.dtt_ctfp, dtt.dtt_type, B_FALSE);
2281 dt_node_attr_assign(dnp, _dtrace_defattr);
2283 if (dt_node_is_void(dnp)) {
2288 if (ctf_type_kind(dnp->dn_ctfp, ctf_type_resolve(
2289 dnp->dn_ctfp, dnp->dn_type)) == CTF_K_FORWARD) {
2292 dt_node_type_name(dnp, n, sizeof (n)), dsp->ds_ident);
2300 idp = dnp->dn_ident = dt_ident_create(dsp->ds_ident,
2394 (void) dt_ident_cook(dnp, idp, &ddp->dd_node);
2409 * visible, and then cook 'dnp' to check its type against 'expr'.
2412 return (dt_node_cook(dnp, DT_IDFLG_REF));
2419 dt_node_t *dnp;
2430 dnp = dt_node_alloc(DT_NODE_MEMBER);
2431 dnp->dn_membname = name;
2432 dnp->dn_membexpr = expr;
2435 dt_node_type_assign(dnp, dtt.dtt_ctfp, dtt.dtt_type,
2438 return (dnp);
2448 dt_node_t *dnp;
2499 dnp = dt_node_alloc(DT_NODE_XLATOR);
2500 dnp->dn_xlator = dxp;
2501 dnp->dn_members = members;
2503 return (dt_node_cook(dnp, DT_IDFLG_REF));
2511 dt_node_t *dnp;
2530 dnp = dt_node_alloc(DT_NODE_PROBE);
2532 dnp->dn_ident = dt_ident_create(name, DT_IDENT_PROBE,
2552 if (dnp->dn_ident == NULL || dt_probe_create(dtp,
2553 dnp->dn_ident, protoc, nargs, nargc, xargs, xargc) == NULL)
2556 return (dnp);
2563 dt_node_t *dnp = dt_node_alloc(DT_NODE_PROVIDER);
2567 dnp->dn_provname = name;
2568 dnp->dn_probes = probes;
2571 dnerror(dnp, D_PROV_BADNAME, "provider name may not "
2576 dnerror(dnp, D_PROV_BADNAME, "provider name may not exceed %d "
2581 dnerror(dnp, D_PROV_BADNAME, "provider name may not "
2591 if ((dnp->dn_provider = dt_provider_lookup(dtp, name)) != NULL)
2592 dnp->dn_provred = B_TRUE;
2593 else if ((dnp->dn_provider = dt_provider_create(dtp, name)) == NULL)
2596 dnp->dn_provider->pv_flags |= DT_PROVIDER_INTF;
2601 * Note that if dnp->dn_provred is true, we may end up storing dups of
2609 lnp->dn_link = dnp->dn_provider->pv_nodes;
2610 dnp->dn_provider->pv_nodes = yypcb->pcb_list;
2613 return (dnp);
2619 dt_node_t *dnp = dt_node_alloc(DT_NODE_PROG);
2620 dnp->dn_list = lnp;
2621 return (dnp);
2633 dt_xcook_ident(dt_node_t *dnp, dt_idhash_t *dhp, uint_t idkind, int create)
2656 if ((name = strrchr(dnp->dn_string, '`')) != NULL) {
2657 if (name > dnp->dn_string && name[-1] == '`') {
2662 if (name == dnp->dn_string + uref)
2665 scope = dnp->dn_string;
2672 name = dnp->dn_string + 1;
2676 name = dnp->dn_string;
2713 attr = dt_ident_cook(dnp, idp, NULL);
2715 dt_node_type_assign(dnp,
2720 free(dnp->dn_string);
2721 dnp->dn_string = NULL;
2722 dnp->dn_kind = dnkind;
2723 dnp->dn_ident = idp;
2724 dnp->dn_flags |= DT_NF_LVALUE;
2727 dnp->dn_flags |= DT_NF_WRITABLE;
2729 dt_node_attr_assign(dnp, attr);
2786 free(dnp->dn_string);
2787 dnp->dn_string = NULL;
2788 dnp->dn_kind = DT_NODE_SYM;
2789 dnp->dn_ident = idp;
2790 dnp->dn_flags |= DT_NF_LVALUE;
2792 dt_node_type_assign(dnp, dtt.dtt_ctfp, dtt.dtt_type,
2794 dt_node_attr_assign(dnp, _dtrace_symattr);
2798 dnp->dn_flags |= DT_NF_USERLAND;
2838 attr = dt_ident_cook(dnp, idp, NULL);
2840 dt_node_type_assign(dnp,
2845 free(dnp->dn_string);
2846 dnp->dn_string = NULL;
2847 dnp->dn_kind = dnkind;
2848 dnp->dn_ident = idp;
2849 dnp->dn_flags |= DT_NF_LVALUE | DT_NF_WRITABLE;
2851 dt_node_attr_assign(dnp, attr);
2855 dnp->dn_string, mark, name,
2859 dnp->dn_string, dtrace_errmsg(dtp, dtrace_errno(dtp)));
2864 dt_cook_ident(dt_node_t *dnp, uint_t idflags)
2868 if (dnp->dn_op == DT_TOK_AGG)
2869 dt_xcook_ident(dnp, dtp->dt_aggs, DT_IDENT_AGG, B_FALSE);
2871 dt_xcook_ident(dnp, dtp->dt_globals, DT_IDENT_SCALAR, B_FALSE);
2873 return (dt_node_cook(dnp, idflags));
2883 dt_cook_var(dt_node_t *dnp, uint_t idflags)
2885 dt_ident_t *idp = dnp->dn_ident;
2888 dnerror(dnp, D_VAR_UNDEF,
2895 dt_node_attr_assign(dnp, dt_ident_cook(dnp, idp, &dnp->dn_args));
2896 return (dnp);
2901 dt_cook_func(dt_node_t *dnp, uint_t idflags)
2903 dt_node_attr_assign(dnp,
2904 dt_ident_cook(dnp, dnp->dn_ident, &dnp->dn_args));
2906 return (dnp);
2910 dt_cook_op1(dt_node_t *dnp, uint_t idflags)
2913 dt_node_t *cp = dnp->dn_child;
2924 if (dnp->dn_op == DT_TOK_PREINC || dnp->dn_op == DT_TOK_POSTINC ||
2925 dnp->dn_op == DT_TOK_PREDEC || dnp->dn_op == DT_TOK_POSTDEC)
2937 cp = dnp->dn_child = dt_node_cook(cp, 0); /* don't set idflags yet */
2951 switch (dnp->dn_op) {
2960 dnp->dn_ident = &dxp->dx_souid;
2961 dt_node_type_assign(dnp,
2962 dnp->dn_ident->di_ctfp, dnp->dn_ident->di_type,
2983 dt_node_type_assign(dnp, cp->dn_ctfp, type,
2999 if (kind != CTF_K_ARRAY || dt_node_is_string(dnp))
3000 dnp->dn_flags |= DT_NF_LVALUE; /* see K&R[A7.4.3] */
3012 dnp->dn_flags |= DT_NF_WRITABLE;
3015 (kind == CTF_K_POINTER || (dnp->dn_flags & DT_NF_REF)))
3016 dnp->dn_flags |= DT_NF_USERLAND;
3023 "of arithmetic type\n", opstr(dnp->dn_op));
3025 dt_node_type_propagate(cp, dnp); /* see K&R[A7.4.4-6] */
3031 "integral type\n", opstr(dnp->dn_op));
3033 dt_node_type_propagate(cp, dnp); /* see K&R[A7.4.4-6] */
3039 "of scalar type\n", opstr(dnp->dn_op));
3041 dt_node_type_assign(dnp, DT_INT_CTFP(dtp), DT_INT_TYPE(dtp),
3075 dt_node_type_assign(dnp, dtt.dtt_ctfp, dtt.dtt_type,
3090 dt_node_type_assign(dnp, dtp->dt_ddefs->dm_ctfp,
3102 dt_node_type_assign(dnp, DT_STR_CTFP(dtp), DT_STR_TYPE(dtp),
3112 "scalar type\n", opstr(dnp->dn_op));
3117 "of known size\n", opstr(dnp->dn_op));
3122 "lvalue as an operand\n", opstr(dnp->dn_op));
3127 "to a writable variable\n", opstr(dnp->dn_op));
3130 dt_node_type_propagate(cp, dnp); /* see K&R[A7.4.1] */
3134 xyerror(D_UNKNOWN, "invalid unary op %s\n", opstr(dnp->dn_op));
3137 dt_node_attr_assign(dnp, cp->dn_attr);
3138 return (dnp);
3142 dt_assign_common(dt_node_t *dnp)
3144 dt_node_t *lp = dnp->dn_left;
3145 dt_node_t *rp = dnp->dn_right;
3146 int op = dnp->dn_op;
3162 dt_node_type_propagate(lp, dnp); /* see K&R[A7.17] */
3163 dt_node_attr_assign(dnp, dt_attr_min(lp->dn_attr, rp->dn_attr));
3167 dt_cook_op2(dt_node_t *dnp, uint_t idflags)
3170 dt_node_t *lp = dnp->dn_left;
3171 dt_node_t *rp = dnp->dn_right;
3172 int op = dnp->dn_op;
3211 lp = dnp->dn_left = dt_node_cook(lp, 0);
3238 lp = dnp->dn_left = dt_node_cook(lp, DT_IDFLG_REF);
3239 rp = dnp->dn_right = dt_node_cook(rp, DT_IDFLG_REF);
3246 dt_node_promote(lp, rp, dnp); /* see K&R[A7.11-13] */
3251 lp = dnp->dn_left = dt_node_cook(lp, DT_IDFLG_REF);
3252 rp = dnp->dn_right = dt_node_cook(rp, DT_IDFLG_REF);
3259 dt_node_type_propagate(lp, dnp); /* see K&R[A7.8] */
3260 dt_node_attr_assign(dnp, dt_attr_min(lp->dn_attr, rp->dn_attr));
3264 lp = dnp->dn_left = dt_node_cook(lp, DT_IDFLG_REF);
3265 rp = dnp->dn_right = dt_node_cook(rp, DT_IDFLG_REF);
3272 dt_node_promote(lp, rp, dnp); /* see K&R[A7.6] */
3277 lp = dnp->dn_left = dt_node_cook(lp, DT_IDFLG_REF);
3278 rp = dnp->dn_right = dt_node_cook(rp, DT_IDFLG_REF);
3285 dt_node_promote(lp, rp, dnp); /* see K&R[A7.6] */
3291 lp = dnp->dn_left = dt_node_cook(lp, DT_IDFLG_REF);
3292 rp = dnp->dn_right = dt_node_cook(rp, DT_IDFLG_REF);
3299 dt_node_type_assign(dnp, DT_INT_CTFP(dtp), DT_INT_TYPE(dtp),
3301 dt_node_attr_assign(dnp, dt_attr_min(lp->dn_attr, rp->dn_attr));
3318 lp = dnp->dn_left = dt_node_cook(lp, DT_IDFLG_REF);
3349 rp = dnp->dn_right = dt_node_cook(rp, DT_IDFLG_REF);
3377 dt_node_type_assign(dnp, DT_INT_CTFP(dtp), DT_INT_TYPE(dtp),
3379 dt_node_attr_assign(dnp, dt_attr_min(lp->dn_attr, rp->dn_attr));
3392 lp = dnp->dn_left = dt_node_cook(lp, DT_IDFLG_REF);
3393 rp = dnp->dn_right = dt_node_cook(rp, DT_IDFLG_REF);
3426 dt_node_type_assign(dnp, ctfp, type, B_FALSE);
3427 dt_node_attr_assign(dnp, dt_attr_min(lp->dn_attr, rp->dn_attr));
3430 dnp->dn_flags |= DT_NF_USERLAND;
3445 lp = dnp->dn_left =
3448 rp = dnp->dn_right =
3464 lp = dnp->dn_left =
3467 rp = dnp->dn_right =
3493 lp = dnp->dn_left = dt_node_cook(lp, 0); /* don't set mod yet */
3494 rp = dnp->dn_right = dt_node_cook(rp, DT_IDFLG_REF);
3540 dnp->dn_left = dnp->dn_right = NULL;
3541 dt_node_free(dnp);
3616 lp = dnp->dn_left =
3619 rp = dnp->dn_right =
3650 dt_assign_common(dnp);
3677 dnp->dn_right = dnp->dn_left;
3678 dt_node_free(dnp);
3684 lp = dnp->dn_left = dt_node_cook(lp, DT_IDFLG_REF);
3770 dt_node_type_assign(dnp, ctfp, m.ctm_type, B_FALSE);
3771 dt_node_attr_assign(dnp, lp->dn_attr);
3774 dt_node_is_string(dnp)))
3775 dnp->dn_flags |= DT_NF_LVALUE; /* see K&R[A7.3.3] */
3778 (kind != CTF_K_ARRAY || dt_node_is_string(dnp)))
3779 dnp->dn_flags |= DT_NF_LVALUE; /* see K&R[A7.3.3] */
3782 dnp->dn_flags |= DT_NF_WRITABLE;
3785 (dnp->dn_flags & DT_NF_REF)))
3786 dnp->dn_flags |= DT_NF_USERLAND;
3813 dnp->dn_left = dnp->dn_right = NULL;
3814 dt_node_free(dnp);
3857 * [ OP2 "[" ]=dnp [ VAR ]=dnp
3862 * Since the final dt_node_cook(dnp) can fail using longjmp we
3864 * writing 'dnp' to become the VAR node, so that the parse tree
3870 lnp = dnp->dn_link;
3871 bcopy(lp, dnp, sizeof (dt_node_t));
3872 dnp->dn_link = lnp;
3874 dnp->dn_args = rp;
3875 dnp->dn_list = NULL;
3878 return (dt_node_cook(dnp, idflags));
3885 rp = dnp->dn_right = dt_node_cook(rp, DT_IDFLG_REF);
3895 dnp->dn_ident = dt_xlator_ident(dxp, lp->dn_ctfp, lp->dn_type);
3896 dt_node_type_assign(dnp, DT_DYN_CTFP(dtp), DT_DYN_TYPE(dtp),
3898 dt_node_attr_assign(dnp,
3899 dt_attr_min(rp->dn_attr, dnp->dn_ident->di_attr));
3908 rp = dnp->dn_right = dt_node_cook(rp, DT_IDFLG_REF);
3943 dt_node_type_propagate(lp, dnp); /* see K&R[A7.5] */
3944 dt_node_attr_assign(dnp, dt_attr_min(lp->dn_attr, rp->dn_attr));
3951 dnp->dn_flags |= DT_NF_WRITABLE;
3957 lp = dnp->dn_left = dt_node_cook(lp, DT_IDFLG_REF);
3958 rp = dnp->dn_right = dt_node_cook(rp, DT_IDFLG_REF);
3970 dt_node_type_propagate(rp, dnp); /* see K&R[A7.18] */
3971 dt_node_attr_assign(dnp, dt_attr_min(lp->dn_attr, rp->dn_attr));
3985 if (dnp->dn_op == DT_TOK_LBRAC && op == DT_TOK_ADD) {
3994 dnp->dn_op = DT_TOK_ADD;
3995 pnp = dt_node_op1(DT_TOK_DEREF, dnp);
4006 pnp->dn_link = dnp->dn_link;
4007 dnp->dn_link = pnp;
4012 return (dnp);
4017 dt_cook_op3(dt_node_t *dnp, uint_t idflags)
4023 dnp->dn_expr = dt_node_cook(dnp->dn_expr, DT_IDFLG_REF);
4024 lp = dnp->dn_left = dt_node_cook(dnp->dn_left, DT_IDFLG_REF);
4025 rp = dnp->dn_right = dt_node_cook(dnp->dn_right, DT_IDFLG_REF);
4027 if (!dt_node_is_scalar(dnp->dn_expr)) {
4062 dt_node_type_assign(dnp, ctfp, type, B_FALSE);
4063 dt_node_attr_assign(dnp, dt_attr_min(dnp->dn_expr->dn_attr,
4066 return (dnp);
4070 dt_cook_statement(dt_node_t *dnp, uint_t idflags)
4072 dnp->dn_expr = dt_node_cook(dnp->dn_expr, idflags);
4073 dt_node_attr_assign(dnp, dnp->dn_expr->dn_attr);
4075 return (dnp);
4086 dt_cook_aggregation(dt_node_t *dnp, uint_t idflags)
4090 if (dnp->dn_aggfun != NULL) {
4091 dnp->dn_aggfun = dt_node_cook(dnp->dn_aggfun, DT_IDFLG_REF);
4092 dt_node_attr_assign(dnp, dt_ident_cook(dnp,
4093 dnp->dn_ident, &dnp->dn_aggtup));
4095 dt_node_type_assign(dnp, DT_DYN_CTFP(dtp), DT_DYN_TYPE(dtp),
4097 dt_node_attr_assign(dnp, dnp->dn_ident->di_attr);
4100 return (dnp);
4147 dt_cook_clause(dt_node_t *dnp, uint_t idflags)
4154 * to 'dnp' itself to force an attribute check and minimum violation.
4156 dt_node_attr_assign(dnp, yypcb->pcb_pinfo.dtp_attr);
4157 dnp->dn_ctxattr = yypcb->pcb_pinfo.dtp_attr;
4162 if (dnp->dn_pred != NULL && (err = setjmp(yypcb->pcb_jmpbuf)) != 0) {
4173 dt_node_attr_assign(dnp,
4174 dt_node_list_cook(&dnp->dn_acts, idflags));
4180 if (dnp->dn_pred != NULL) {
4183 dnp->dn_pred = dt_node_cook(dnp->dn_pred, idflags);
4184 dt_node_attr_assign(dnp,
4185 dt_attr_min(dnp->dn_attr, dnp->dn_pred->dn_attr));
4187 if (!dt_node_is_scalar(dnp->dn_pred)) {
4198 dt_node_attr_assign(dnp,
4199 dt_node_list_cook(&dnp->dn_acts, idflags));
4204 return (dnp);
4209 dt_cook_inline(dt_node_t *dnp, uint_t idflags)
4211 dt_idnode_t *inp = dnp->dn_ident->di_iarg;
4217 assert(dnp->dn_ident->di_flags & DT_IDFLG_INLINE);
4228 ctf_file_t *lctfp = dnp->dn_ctfp;
4229 ctf_id_t ltype = ctf_type_resolve(lctfp, dnp->dn_type);
4241 dnerror(dnp, D_OP_INCOMPAT,
4243 "\"%s\" = \"%s\"\n", dnp->dn_ident->di_name,
4248 } else if (dt_node_is_argcompat(dnp, inp->din_root) == 0) {
4249 dnerror(dnp, D_OP_INCOMPAT,
4251 "\"%s\" = \"%s\"\n", dnp->dn_ident->di_name,
4252 dt_node_type_name(dnp, n1, sizeof (n1)),
4256 return (dnp);
4260 dt_cook_member(dt_node_t *dnp, uint_t idflags)
4262 dnp->dn_membexpr = dt_node_cook(dnp->dn_membexpr, idflags);
4263 dt_node_attr_assign(dnp, dnp->dn_membexpr->dn_attr);
4264 return (dnp);
4269 dt_cook_xlator(dt_node_t *dnp, uint_t idflags)
4272 dt_xlator_t *dxp = dnp->dn_xlator;
4288 for (mnp = dnp->dn_members; mnp != NULL; mnp = mnp->dn_list) {
4318 dt_node_type_assign(dnp, DT_DYN_CTFP(dtp), DT_DYN_TYPE(dtp), B_FALSE);
4319 dt_node_attr_assign(dnp, _dtrace_defattr);
4321 return (dnp);
4396 dt_cook_probe(dt_node_t *dnp, dt_provider_t *pvp)
4399 dt_probe_t *prp = dnp->dn_ident->di_data;
4424 dnerror(dnp, D_PROV_PRXLATOR, "translator for %s:%s output "
4426 pvp->pv_desc.dtvd_name, dnp->dn_ident->di_name, i + 1,
4434 dt_cook_provider(dt_node_t *dnp, uint_t idflags)
4436 dt_provider_t *pvp = dnp->dn_provider;
4444 for (pnp = dnp->dn_probes; pnp != NULL; pnp = pnp->dn_list) {
4450 if (prp != NULL && dnp->dn_provred) {
4453 } else if (prp == NULL && dnp->dn_provred) {
4458 dnp->dn_provname, dnp->dn_provname,
4459 probename, dnp->dn_provname, probename);
4462 dnp->dn_provname, probename);
4469 return (dnp);
4474 dt_cook_none(dt_node_t *dnp, uint_t idflags)
4476 return (dnp);
4511 dt_node_cook(dt_node_t *dnp, uint_t idflags)
4515 yylineno = dnp->dn_line;
4517 assert(dnp->dn_kind <
4519 dnp = dt_cook_funcs[dnp->dn_kind](dnp, idflags);
4520 dnp->dn_flags |= DT_NF_COOKED;
4522 if (dnp->dn_kind == DT_NODE_VAR || dnp->dn_kind == DT_NODE_AGG)
4523 dnp->dn_ident->di_flags |= idflags;
4526 return (dnp);
4533 dt_node_t *dnp, *nnp;
4535 for (dnp = (pnp != NULL ? *pnp : NULL); dnp != NULL; dnp = nnp) {
4536 nnp = dnp->dn_list;
4537 dnp = *pnp = dt_node_cook(dnp, idflags);
4538 attr = dt_attr_min(attr, dnp->dn_attr);
4539 dnp->dn_list = nnp;
4540 pnp = &dnp->dn_list;
4549 dt_node_t *dnp, *nnp;
4551 for (dnp = (pnp != NULL ? *pnp : NULL); dnp != NULL; dnp = nnp) {
4552 nnp = dnp->dn_list;
4553 dt_node_free(dnp);
4563 dt_node_t *dnp, *nnp;
4565 for (dnp = (pnp != NULL ? *pnp : NULL); dnp != NULL; dnp = nnp) {
4566 nnp = dnp->dn_link;
4567 dt_node_free(dnp);
4570 for (dnp = (pnp != NULL ? *pnp : NULL); dnp != NULL; dnp = nnp) {
4571 nnp = dnp->dn_link;
4572 free(dnp);
4582 dt_node_t *dnp;
4589 for (dnp = lp; dnp->dn_list != NULL; dnp = dnp->dn_list)
4592 dnp->dn_list = rp;
4602 dt_node_diftype(dtrace_hdl_t *dtp, const dt_node_t *dnp, dtrace_diftype_t *tp)
4604 if (dnp->dn_ctfp == DT_STR_CTFP(dtp) &&
4605 dnp->dn_type == DT_STR_TYPE(dtp)) {
4610 tp->dtdt_ckind = ctf_type_kind(dnp->dn_ctfp,
4611 ctf_type_resolve(dnp->dn_ctfp, dnp->dn_type));
4614 tp->dtdt_flags = (dnp->dn_flags & DT_NF_REF) ?
4615 (dnp->dn_flags & DT_NF_USERLAND) ? DIF_TF_BYUREF :
4618 tp->dtdt_size = ctf_type_size(dnp->dn_ctfp, dnp->dn_type);
4637 dt_printd(dt_node_t *dnp, FILE *fp, int depth)
4641 switch (dnp->dn_kind) {
4643 (void) fprintf(fp, "0x%llx", (u_longlong_t)dnp->dn_value);
4644 if (!(dnp->dn_flags & DT_NF_SIGNED))
4649 char *escd = strchr2esc(dnp->dn_string, strlen(dnp->dn_string));
4656 (void) fprintf(fp, "%s", dnp->dn_string);
4661 (dnp->dn_ident->di_flags & DT_IDFLG_LOCAL) ? "this->" :
4662 (dnp->dn_ident->di_flags & DT_IDFLG_TLS) ? "self->" : "",
4663 dnp->dn_ident->di_name);
4665 if (dnp->dn_args != NULL) {
4668 for (arg = dnp->dn_args; arg != NULL;
4680 const dtrace_syminfo_t *dts = dnp->dn_ident->di_data;
4685 (void) fprintf(fp, "%s(", dnp->dn_ident->di_name);
4687 for (arg = dnp->dn_args; arg != NULL; arg = arg->dn_list) {
4696 (void) fprintf(fp, "%s(", opstr(dnp->dn_op));
4697 dt_printd(dnp->dn_child, fp, 0);
4703 dt_printd(dnp->dn_left, fp, 0);
4704 if (dnp->dn_op == DT_TOK_LPAR) {
4706 dt_printd(dnp->dn_right, fp, 0);
4709 if (dnp->dn_op == DT_TOK_PTR || dnp->dn_op == DT_TOK_DOT ||
4710 dnp->dn_op == DT_TOK_LBRAC)
4711 (void) fprintf(fp, "%s", opstr(dnp->dn_op));
4713 (void) fprintf(fp, " %s ", opstr(dnp->dn_op));
4714 dt_printd(dnp->dn_right, fp, 0);
4715 if (dnp->dn_op == DT_TOK_LBRAC) {
4716 dt_node_t *ln = dnp->dn_right;
4729 dt_printd(dnp->dn_expr, fp, 0);
4731 dt_printd(dnp->dn_left, fp, 0);
4733 dt_printd(dnp->dn_right, fp, 0);
4740 dt_printd(dnp->dn_expr, fp, depth + 1);
4746 dnp->dn_desc->dtpd_provider, dnp->dn_desc->dtpd_mod,
4747 dnp->dn_desc->dtpd_func, dnp->dn_desc->dtpd_name);
4751 for (arg = dnp->dn_pdescs; arg != NULL; arg = arg->dn_list) {
4758 if (dnp->dn_pred != NULL) {
4760 dt_printd(dnp->dn_pred, fp, 0);
4765 for (arg = dnp->dn_acts; arg != NULL; arg = arg->dn_list)
4773 dt_printd(dnp->dn_conditional, fp, 0);
4776 for (arg = dnp->dn_body; arg != NULL; arg = arg->dn_list)
4778 if (dnp->dn_alternate_body == NULL) {
4782 for (arg = dnp->dn_alternate_body; arg != NULL;
4792 (void *)dnp, dnp->dn_kind);
4797 dt_node_printr(dt_node_t *dnp, FILE *fp, int depth)
4805 (void) dt_attr_str(dnp->dn_attr, a, sizeof (a));
4807 if (dnp->dn_ctfp != NULL && dnp->dn_type != CTF_ERR &&
4808 ctf_type_name(dnp->dn_ctfp, dnp->dn_type, n, sizeof (n)) != NULL) {
4812 dnp->dn_type, a);
4815 if (dnp->dn_flags != 0) {
4817 if (dnp->dn_flags & DT_NF_SIGNED)
4819 if (dnp->dn_flags & DT_NF_COOKED)
4821 if (dnp->dn_flags & DT_NF_REF)
4823 if (dnp->dn_flags & DT_NF_LVALUE)
4825 if (dnp->dn_flags & DT_NF_WRITABLE)
4827 if (dnp->dn_flags & DT_NF_BITFIELD)
4829 if (dnp->dn_flags & DT_NF_USERLAND)
4835 switch (dnp->dn_kind) {
4837 (void) fprintf(fp, "FREE <node %p>\n", (void *)dnp);
4842 (u_longlong_t)dnp->dn_value, buf);
4846 (void) fprintf(fp, "STRING \"%s\" (%s)\n", dnp->dn_string, buf);
4850 (void) fprintf(fp, "IDENT %s (%s)\n", dnp->dn_string, buf);
4855 (dnp->dn_ident->di_flags & DT_IDFLG_LOCAL) ? "this->" :
4856 (dnp->dn_ident->di_flags & DT_IDFLG_TLS) ? "self->" : "",
4857 dnp->dn_ident->di_name, buf);
4859 if (dnp->dn_args != NULL)
4862 for (arg = dnp->dn_args; arg != NULL; arg = arg->dn_list) {
4868 if (dnp->dn_args != NULL)
4873 dts = dnp->dn_ident->di_data;
4879 if (dnp->dn_string != NULL) {
4881 buf, dnp->dn_string);
4888 dnp->dn_ident->di_name, buf);
4890 for (arg = dnp->dn_args; arg != NULL; arg = arg->dn_list) {
4898 (void) fprintf(fp, "OP1 %s (%s)\n", opstr(dnp->dn_op), buf);
4899 dt_node_printr(dnp->dn_child, fp, depth + 1);
4903 (void) fprintf(fp, "OP2 %s (%s)\n", opstr(dnp->dn_op), buf);
4904 dt_node_printr(dnp->dn_left, fp, depth + 1);
4905 dt_node_printr(dnp->dn_right, fp, depth + 1);
4906 if (dnp->dn_op == DT_TOK_LBRAC) {
4907 dt_node_t *ln = dnp->dn_right;
4917 dt_node_printr(dnp->dn_expr, fp, depth + 1);
4919 dt_node_printr(dnp->dn_left, fp, depth + 1);
4921 dt_node_printr(dnp->dn_right, fp, depth + 1);
4927 dt_node_printr(dnp->dn_expr, fp, depth + 1);
4932 dnp->dn_ident->di_name, a);
4934 for (arg = dnp->dn_aggtup; arg != NULL; arg = arg->dn_list) {
4940 if (dnp->dn_aggfun) {
4942 dt_node_printr(dnp->dn_aggfun, fp, depth + 1);
4946 if (dnp->dn_aggfun)
4952 dnp->dn_desc->dtpd_provider, dnp->dn_desc->dtpd_mod,
4953 dnp->dn_desc->dtpd_func, dnp->dn_desc->dtpd_name,
4954 dnp->dn_desc->dtpd_id);
4960 for (arg = dnp->dn_pdescs; arg != NULL; arg = arg->dn_list)
4964 dt_attr_str(dnp->dn_ctxattr, a, sizeof (a)));
4966 if (dnp->dn_pred != NULL) {
4968 dt_node_printr(dnp->dn_pred, fp, depth + 1);
4972 for (arg = dnp->dn_acts; arg != NULL; arg = arg->dn_list)
4978 inp = dnp->dn_ident->di_iarg;
4981 dnp->dn_ident->di_name, buf);
4986 (void) fprintf(fp, "MEMBER %s (%s)\n", dnp->dn_membname, buf);
4987 if (dnp->dn_membexpr)
4988 dt_node_printr(dnp->dn_membexpr, fp, depth + 1);
4994 if (ctf_type_name(dnp->dn_xlator->dx_src_ctfp,
4995 dnp->dn_xlator->dx_src_type, n, sizeof (n)) != NULL)
4998 if (ctf_type_name(dnp->dn_xlator->dx_dst_ctfp,
4999 dnp->dn_xlator->dx_dst_type, n, sizeof (n)) != NULL)
5004 for (arg = dnp->dn_members; arg != NULL; arg = arg->dn_list)
5009 (void) fprintf(fp, "PROBE %s\n", dnp->dn_ident->di_name);
5014 dnp->dn_provname, dnp->dn_provred ? "redecl" : "decl");
5015 for (arg = dnp->dn_probes; arg != NULL; arg = arg->dn_list)
5021 for (arg = dnp->dn_list; arg != NULL; arg = arg->dn_list)
5028 dt_node_printr(dnp->dn_conditional, fp, depth + 1);
5031 for (arg = dnp->dn_body; arg != NULL; arg = arg->dn_list)
5034 if (dnp->dn_alternate_body != NULL) {
5036 for (arg = dnp->dn_alternate_body; arg != NULL;
5045 (void *)dnp, dnp->dn_kind);
5050 dt_node_root(dt_node_t *dnp)
5052 yypcb->pcb_root = dnp;
5058 dnerror(const dt_node_t *dnp, dt_errtag_t tag, const char *format, ...)
5063 yylineno = dnp->dn_line;
5075 dnwarn(const dt_node_t *dnp, dt_errtag_t tag, const char *format, ...)
5080 yylineno = dnp->dn_line;