Lines Matching defs:node

43  * We start by constructing the pointer graph.  Each node in the graph is
45 * allocated memory object); the node's outgoing edges represent pointers from
51 * type of the edge's destination node, and therefore to iteratively continue
119 * in this pass; if we discover that a node is larger than twice its inferred
121 * we add the inferred type to the node's tgn_typelist, but we don't descend.
141 * an array of the inferred type, and we abort processing of the node. Note
160 * inference for the unknown type, the node is inferred to be of that type, and
170 * to know which node is the greatest impediment to further recognition.
172 * node (and set it with ::istype), much more type identification should be
173 * possible. To facilitate this, we therefore define the _reach_ of a node to
175 * node's type better known. We determine the reach by performing a
176 * depth-first pass through the graph. The node of greatest reach (along with
194 struct tg_node *tge_src; /* source node */
195 struct tg_node *tge_dest; /* destination node */
196 uintptr_t tge_srcoffs; /* offset in source node */
197 uintptr_t tge_destoffs; /* offset in destination node */
257 tg_node_t *tgbs_src; /* corresponding node */
262 tg_node_t *tgps_node; /* current node */
269 tg_node_t *tgtd_node; /* node to process */
270 uintptr_t tgtd_offs; /* offset within node */
276 tg_node_t *tgd_next; /* next node to fill in */
277 size_t tgd_size; /* size of this node */
534 * (due to, say, size constraints on the destination node), we can propagate
577 * if it's larger than the node that we're pointing to, we know that
878 * back an error on a node that was successfully read in.
1035 tg_node_t *node = tgd->tgd_next++;
1038 node->tgn_base = addr;
1039 node->tgn_limit = limit;
1048 tg_node_t *node = *tgp;
1161 for (; node < *tgp; node++) {
1162 node->tgn_type = type;
1163 node->tgn_smaller = smaller;
1204 tg_node_t *node, *src;
1216 * Add an anchored node.
1252 if ((node = typegraph_search(ptr)) == NULL)
1261 edge->tge_dest = node;
1266 edge->tge_destoffs = ptr - node->tgn_base;
1267 edge->tge_nextin = node->tgn_incoming;
1268 node->tgn_incoming = edge;
1271 * If this node is marked, we don't need to descend.
1273 if (node->tgn_marked)
1280 node->tgn_marked = 1;
1291 src = node;
1294 addr = node->tgn_base;
1295 size = node->tgn_limit - addr;
1363 * to include it as an anchor node.
1397 * If this thread isn't already a node, add it as an anchor. And
1400 tg_node_t *node;
1402 if ((node = typegraph_search(addr)) == NULL) {
1405 node->tgn_type = *type;
1423 typegraph_node_addtype(tg_node_t *node, tg_edge_t *edge, mdb_ctf_id_t rtype,
1430 list = &node->tgn_typelist;
1432 list = &node->tgn_fraglist;
1457 typegraph_stats_node(tg_node_t *node, tg_stats_t *stats)
1463 if (!node->tgn_marked)
1466 if (mdb_ctf_type_valid(node->tgn_type)) {
1471 if (node->tgn_typelist != NULL) {
1474 if (node->tgn_typelist->tgt_next)
1480 if (node->tgn_fraglist != NULL) {
1486 * This node is not typed -- but check if any of its outgoing edges
1490 for (e = node->tgn_outgoing; e != NULL; e = e->tge_nextout) {
1502 tg_node_t *node;
1506 if ((node = typegraph_search(addr)) == NULL) {
1510 typegraph_stats_node(node, stats);
1601 typegraph_pass1_node(tg_node_t *node, mdb_ctf_id_t type)
1619 for (e = node->tgn_outgoing; e != NULL; e = e->tge_nextout) {
1628 * (and the current node is not the root), we refuse to
1631 * we'll allow a later phase to pass in that node and its
1636 * add the type to the type list of the destination node.
1681 * it with is useful, mark the node that we're
1707 * one inference for this node.
1715 * There is either no inference for this node,
1760 node = this->tgtd_node;
1787 typegraph_pass2_node(tg_node_t *node)
1795 if (mdb_ctf_type_valid(node->tgn_type))
1798 for (tp = node->tgn_typelist; tp != NULL; tp = tp->tgt_next) {
1839 nsize = TG_NODE_SIZE(node);
1844 * preferred type is greater than half the size of the node, we
1853 * expecting the type size to evenly divide the node
1856 if (node->tgn_smaller == 0)
1859 if (nsize - rem <= node->tgn_smaller) {
1876 if (node->tgn_smaller != 0) {
1877 limit = node->tgn_smaller;
1879 limit = TG_NODE_SIZE(node);
1882 base = node->tgn_base;
1926 * Now mark this type as an array, and reattempt pass1 from this node.
1929 typegraph_pass1_node(node, type);
1949 tg_node_t *node;
1977 list = (tg_type_t **)((uintptr_t)(node = &tg_node[i]) + loffs);
1979 if (mdb_ctf_type_valid(node->tgn_type))
2025 typegraph_pass4_node(tg_node_t *node)
2032 if (mdb_ctf_type_valid(node->tgn_type))
2035 if (node->tgn_typelist != NULL)
2042 * incoming edge pointing to offset 0 from a node of known or
2043 * conjectured type, check the types of the referring node.
2045 for (e = node->tgn_incoming; e != NULL; e = e->tge_nextin) {
2069 * interpretations for this node -- chicken out.
2110 typegraph_postpass_node(tg_node_t *node)
2113 tg_edge_t *e, *edge = node->tgn_outgoing;
2117 if (node->tgn_postmarked)
2121 node->tgn_postmarked = 1;
2122 node->tgn_reach = 0;
2141 state->tgps_node = node;
2147 node = dest;
2152 if (!mdb_ctf_type_valid(node->tgn_type) &&
2153 node->tgn_typelist == NULL && node->tgn_fraglist == NULL) {
2155 * We are an unknown node; our count must reflect this.
2157 node->tgn_reach++;
2165 node = state->tgps_node;
2180 node->tgn_reach += dest->tgn_reach;
2201 tg_node_t *node, *maxnode = NULL;
2212 node = &tg_node[i];
2214 typegraph_postpass_node(node);
2218 node = &tg_node[i];
2220 if (mdb_ctf_type_valid(node->tgn_type))
2223 if (node->tgn_reach < max)
2226 maxnode = node;
2227 max = node->tgn_reach;
2240 typegraph_stat_str("greatest unknown node reach", c);
2279 tg_node_t *node;
2299 if ((node = typegraph_search((uintptr_t)m->mod_mp)) != NULL) {
2301 node->tgn_type = type;
2330 tg_node_t *node;
2333 if ((node = typegraph_search(addr)) == NULL) {
2334 mdb_warn("couldn't find node corresponding to "
2344 node->tgn_type = type;
2540 tg_node_t *node;
2556 if ((node = typegraph_search(addr)) == NULL) {
2557 mdb_warn("%p does not correspond to a node.\n", addr);
2562 mdb_printf("%p is %p+%p, ", addr, node->tgn_base,
2563 addr - node->tgn_base);
2565 if (mdb_ctf_type_valid(node->tgn_type)) {
2566 mdb_printf("%s\n", mdb_ctf_type_name(node->tgn_type,
2571 if ((tp = node->tgn_typelist) == NULL) {
2572 if ((tp = node->tgn_fraglist) == NULL) {
2595 mdb_printf("at %p", node->tgn_base + offs);
2611 mdb_printf("at %p ", node->tgn_base + offs);
2628 node->tgn_base, node->tgn_limit,
2629 mdb_ctf_type_name(node->tgn_type,
2631 typegraph_size(node->tgn_type), node->tgn_reach,
2632 node->tgn_marked ? "yes" : "no");
2638 for (tp = node->tgn_typelist; tp != NULL; tp = tp->tgt_next) {
2652 for (tp = node->tgn_fraglist; tp != NULL; tp = tp->tgt_next) {
2667 for (e = node->tgn_incoming; e != NULL; e = e->tge_nextin) {
2682 for (e = node->tgn_outgoing; e != NULL; e = e->tge_nextout) {
2702 tg_node_t *node;
2713 * Determine the node corresponding to the passed address.
2715 if ((node = typegraph_search(addr)) == NULL) {
2728 node->tgn_type = type;
2738 tg_node_t *node;
2746 if ((node = typegraph_search(addr)) == NULL) {
2751 mdb_ctf_type_invalidate(&node->tgn_type);
2768 tg_node_t *node;
2771 node = &tg_node[ndx];
2773 if (mdb_ctf_type_valid(node->tgn_type))
2776 if (node->tgn_typelist == NULL)
2779 if (node->tgn_typelist->tgt_next == NULL)
2789 return (wsp->walk_callback(node->tgn_base, NULL, wsp->walk_cbdata));
2796 tg_node_t *node;
2799 node = &tg_node[ndx];
2801 if (mdb_ctf_type_valid(node->tgn_type))
2804 if (node->tgn_typelist != NULL)
2807 if (node->tgn_fraglist != NULL)
2817 return (wsp->walk_callback(node->tgn_base, NULL, wsp->walk_cbdata));
2936 tg_node_t *node;
2946 if (owner == NULL || (node = typegraph_search(owner)) == NULL)
2949 if (!mdb_ctf_type_valid(node->tgn_type))
2952 ttype = typegraph_resolve(node->tgn_type);
3017 findlocks_node(tg_node_t *node, findlocks_t *fl)
3019 mdb_ctf_id_t type = node->tgn_type, ntype;
3026 for (tp = node->tgn_typelist; tp != NULL; tp = tp->tgt_next) {
3042 * node; we have to punt.
3055 fl->fl_node = node;
3063 uintptr_t base, limit = node->tgn_limit;
3066 for (base = node->tgn_base; base < limit; base += size) {
3071 fl->fl_addr = node->tgn_base;
3078 for (tp = node->tgn_fraglist; tp != NULL; tp = tp->tgt_next) {
3084 fl->fl_addr = node->tgn_base + tp->tgt_redge->tge_destoffs;
3181 * (a) The node is an array. That is, the node was either determined to
3182 * be of type CTF_K_ARRAY, or the node was inferred to be an array in
3196 * Any node satisfying these criteria is identified as an object that could
3197 * potentially suffer from false sharing, and the node's address, symbolic
3285 findfalse_node(tg_node_t *node)
3287 mdb_ctf_id_t type = node->tgn_type;
3297 for (tp = node->tgn_typelist; tp != NULL; tp = tp->tgt_next) {
3313 * node; we have to punt.
3367 if (TG_NODE_SIZE(node) <= FINDFALSE_COHERENCE_SIZE)
3378 mdb_printf("%?p ", node->tgn_base);
3380 if (mdb_lookup_by_addr(node->tgn_base, MDB_SYM_EXACT, buf,
3389 TG_NODE_SIZE(node));