Lines Matching refs:child

59 arc_lookup (parent, child)
61 Sym *child;
65 if (!parent || !child)
67 printf ("[arc_lookup] parent == 0 || child == 0\n");
70 DBG (LOOKUPDEBUG, printf ("[arc_lookup] parent %s child %s\n",
71 parent->name, child->name));
74 DBG (LOOKUPDEBUG, printf ("[arc_lookup]\t parent %s child %s\n",
75 arc->parent->name, arc->child->name));
76 if (child->addr >= arc->child->addr
77 && child->end_addr <= arc->child->end_addr)
90 arc_add (parent, child, count)
92 Sym *child;
99 count, parent->name, child->name));
100 arc = arc_lookup (parent, child);
114 arc->child = child;
119 if (parent != child)
148 /* prepend this child to the children of this parent: */
152 /* prepend this parent to the parents of this child: */
153 arc->next_parent = child->cg.parents;
154 child->cg.parents = arc;
175 Sym *child;
187 child = arc->child;
188 if (arc->count == 0 || child == parent || child->cg.prop.fract == 0)
192 if (child->cg.cyc.head != child)
194 if (parent->cg.cyc.num == child->cg.cyc.num)
198 if (parent->cg.top_order <= child->cg.top_order)
202 child = child->cg.cyc.head;
206 if (parent->cg.top_order <= child->cg.top_order)
212 if (child->ncalls == 0)
218 arc->time = child->hist.time * (((double) arc->count)
219 / ((double) child->ncalls));
220 arc->child_time = child->cg.child_time
221 * (((double) arc->count) / ((double) child->ncalls));
229 parent->cg.prop.child += prop_share;
237 parent->cg.cyc.head->cg.prop.child += prop_share;
240 printf ("[prop_time] child \t");
241 print_name (child);
242 printf (" with %f %f %lu/%lu\n", child->hist.time,
243 child->cg.child_time, arc->count, child->ncalls);
362 * Check if any parent of this child (or outside parents of this
364 * child (cycle) appropriately. Similarly, deal with propagation
368 inherit_flags (child)
369 Sym *child;
374 head = child->cg.cyc.head;
375 if (child == head)
377 /* just a regular child, check its parents: */
378 child->cg.print_flag = FALSE;
379 child->cg.prop.fract = 0.0;
380 for (arc = child->cg.parents; arc; arc = arc->next_parent)
383 if (child == parent)
387 child->cg.print_flag |= parent->cg.print_flag;
389 * If the child was never actually called (e.g., this arc
393 if (child->ncalls != 0)
395 child->cg.prop.fract += parent->cg.prop.fract
396 * (((double) arc->count) / ((double) child->ncalls));
451 Sym *old_head, *child;
456 child = symbols[index];
463 if (child->cg.cyc.head != old_head)
465 old_head = child->cg.cyc.head;
466 inherit_flags (child);
470 print_name (child);
472 child->cg.print_flag, child->cg.prop.fract));
473 if (!child->cg.print_flag)
480 if (sym_lookup (&syms[INCL_GRAPH], child->addr)
482 && !sym_lookup (&syms[EXCL_GRAPH], child->addr)))
484 child->cg.print_flag = TRUE;
494 if (!sym_lookup (&syms[INCL_GRAPH], child->addr)
495 && sym_lookup (&syms[EXCL_GRAPH], child->addr))
497 child->cg.print_flag = FALSE;
500 if (child->cg.prop.fract == 0.0)
507 if (sym_lookup (&syms[INCL_TIME], child->addr)
509 && !sym_lookup (&syms[EXCL_TIME], child->addr)))
511 child->cg.prop.fract = 1.0;
522 if (!sym_lookup (&syms[INCL_TIME], child->addr)
523 && sym_lookup (&syms[EXCL_TIME], child->addr))
525 child->cg.prop.fract = 0.0;
528 child->cg.prop.self = child->hist.time * child->cg.prop.fract;
529 print_time += child->cg.prop.self;
532 print_name (child);
534 child->cg.print_flag, child->cg.prop.fract);
536 child->hist.time, child->cg.prop.self, print_time));
556 diff = (left->cg.prop.self + left->cg.prop.child)
557 - (right->cg.prop.self + right->cg.prop.child);
615 * zero out child times.
623 if (arc && parent == arc->child)
634 parent->cg.prop.child = 0.0;