2 * Copyright (c) 1983, 1993
3 * The Regents of the University of California. All rights reserved.
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
13 * 4. Neither the name of the University nor the names of its contributors
14 * may be used to endorse or promote products derived from this software
15 * without specific prior written permission.
17 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
18 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
21 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32 static char sccsid[] = "@(#)arcs.c 8.1 (Berkeley) 6/6/93";
36 #include <sys/cdefs.h>
37 __FBSDID("$FreeBSD$");
49 int topcmp(const void *, const void *);
52 * add (or just increment) an arc
55 addarc(nltype *parentp, nltype *childp, long count)
60 if ( debug & TALLYDEBUG ) {
61 printf( "[addarc] %ld arcs from %s to %s\n" ,
62 count , parentp -> name , childp -> name );
65 arcp = arclookup( parentp , childp );
68 * a hit: just increment the count.
71 if ( debug & TALLYDEBUG ) {
72 printf( "[tally] hit %ld += %ld\n" ,
73 arcp -> arc_count , count );
76 arcp -> arc_count += count;
79 arcp = (arctype *)calloc( 1 , sizeof *arcp );
81 errx( 1 , "malloc failed" );
82 arcp -> arc_parentp = parentp;
83 arcp -> arc_childp = childp;
84 arcp -> arc_count = count;
86 * prepend this child to the children of this parent
88 arcp -> arc_childlist = parentp -> children;
89 parentp -> children = arcp;
91 * prepend this parent to the parents of this child
93 arcp -> arc_parentlist = childp -> parents;
94 childp -> parents = arcp;
98 * the code below topologically sorts the graph (collapsing cycles),
99 * and propagates time bottom up and flags top down.
103 * the topologically sorted name list pointers
108 topcmp(const void *v1, const void *v2)
110 const nltype **npp1 = (const nltype **)v1;
111 const nltype **npp2 = (const nltype **)v2;
113 return (*npp1) -> toporder - (*npp2) -> toporder;
119 nltype *parentp, **timesortnlp;
125 * initialize various things:
126 * zero out child times.
127 * count self-recursive calls.
128 * indicate that nothing is on cycles.
130 for ( parentp = nl ; parentp < npe ; parentp++ ) {
131 parentp -> childtime = 0.0;
132 arcp = arclookup( parentp , parentp );
134 parentp -> ncall -= arcp -> arc_count;
135 parentp -> selfcalls = arcp -> arc_count;
137 parentp -> selfcalls = 0;
139 parentp -> npropcall = parentp -> ncall;
140 parentp -> propfraction = 0.0;
141 parentp -> propself = 0.0;
142 parentp -> propchild = 0.0;
143 parentp -> printflag = FALSE;
144 parentp -> toporder = DFN_NAN;
145 parentp -> cycleno = 0;
146 parentp -> cyclehead = parentp;
147 parentp -> cnext = 0;
149 for ( pass = 1 ; ; pass++ ) {
151 * topologically order things
152 * if any node is unnumbered,
153 * number it and any of its descendents.
155 for ( dfn_init() , parentp = nl ; parentp < npe ; parentp++ ) {
156 if ( parentp -> toporder == DFN_NAN ) {
161 * link together nodes on the same cycle
165 * if no cycles to break up, proceed
170 * analyze cycles to determine breakup
173 if ( debug & BREAKCYCLE ) {
174 printf("[doarcs] pass %ld, cycle(s) %d\n" , pass , ncycle );
178 printf( "\n\n%s %s\n%s %d:\n" ,
179 "The following arcs were deleted" ,
180 "from the propagation calculation" ,
181 "to reduce the maximum cycle size to", cyclethreshold );
183 if ( cycleanalyze() )
187 for ( parentp = nl ; parentp < npe ; parentp++ ) {
188 parentp -> toporder = DFN_NAN;
189 parentp -> cycleno = 0;
190 parentp -> cyclehead = parentp;
191 parentp -> cnext = 0;
197 printf( "\tNone\n\n" );
200 * Sort the symbol table in reverse topological order
202 topsortnlp = (nltype **) calloc( nname , sizeof(nltype *) );
203 if ( topsortnlp == (nltype **) 0 )
204 errx( 1 , "[doarcs] ran out of memory for topo sorting" );
205 for ( index = 0 ; index < nname ; index += 1 ) {
206 topsortnlp[ index ] = &nl[ index ];
208 qsort( topsortnlp , nname , sizeof(nltype *) , topcmp );
210 if ( debug & DFNDEBUG ) {
211 printf( "[doarcs] topological sort listing\n" );
212 for ( index = 0 ; index < nname ; index += 1 ) {
213 printf( "[doarcs] " );
214 printf( "%d:" , topsortnlp[ index ] -> toporder );
215 printname( topsortnlp[ index ] );
221 * starting from the topological top,
222 * propagate print flags to children.
223 * also, calculate propagation fractions.
224 * this happens before time propagation
225 * since time propagation uses the fractions.
229 * starting from the topological bottom,
230 * propagate children times up to parents.
234 * Now, sort by propself + propchild.
235 * sorting both the regular function names
238 timesortnlp = (nltype **) calloc( nname + ncycle , sizeof(nltype *) );
239 if ( timesortnlp == (nltype **) 0 )
240 errx( 1 , "ran out of memory for sorting" );
241 for ( index = 0 ; index < nname ; index++ ) {
242 timesortnlp[index] = &nl[index];
244 for ( index = 1 ; index <= ncycle ; index++ ) {
245 timesortnlp[nname+index-1] = &cyclenl[index];
247 qsort( timesortnlp , nname + ncycle , sizeof(nltype *) , totalcmp );
248 for ( index = 0 ; index < nname + ncycle ; index++ ) {
249 timesortnlp[ index ] -> index = index + 1;
251 return( timesortnlp );
260 for ( index = 0 ; index < nname ; index += 1 ) {
261 timepropagate( topsortnlp[ index ] );
266 timepropagate(nltype *parentp)
273 if ( parentp -> propfraction == 0.0 ) {
277 * gather time from children of this parent.
279 for ( arcp = parentp -> children ; arcp ; arcp = arcp -> arc_childlist ) {
280 childp = arcp -> arc_childp;
281 if ( arcp -> arc_flags & DEADARC ) {
284 if ( arcp -> arc_count == 0 ) {
287 if ( childp == parentp ) {
290 if ( childp -> propfraction == 0.0 ) {
293 if ( childp -> cyclehead != childp ) {
294 if ( parentp -> cycleno == childp -> cycleno ) {
297 if ( parentp -> toporder <= childp -> toporder ) {
298 fprintf( stderr , "[propagate] toporder botches\n" );
300 childp = childp -> cyclehead;
302 if ( parentp -> toporder <= childp -> toporder ) {
303 fprintf( stderr , "[propagate] toporder botches\n" );
307 if ( childp -> npropcall == 0 ) {
311 * distribute time for this arc
313 arcp -> arc_time = childp -> time
314 * ( ( (double) arcp -> arc_count ) /
315 ( (double) childp -> npropcall ) );
316 arcp -> arc_childtime = childp -> childtime
317 * ( ( (double) arcp -> arc_count ) /
318 ( (double) childp -> npropcall ) );
319 share = arcp -> arc_time + arcp -> arc_childtime;
320 parentp -> childtime += share;
322 * ( 1 - propfraction ) gets lost along the way
324 propshare = parentp -> propfraction * share;
326 * fix things for printing
328 parentp -> propchild += propshare;
329 arcp -> arc_time *= parentp -> propfraction;
330 arcp -> arc_childtime *= parentp -> propfraction;
332 * add this share to the parent's cycle header, if any.
334 if ( parentp -> cyclehead != parentp ) {
335 parentp -> cyclehead -> childtime += share;
336 parentp -> cyclehead -> propchild += propshare;
339 if ( debug & PROPDEBUG ) {
340 printf( "[dotime] child \t" );
342 printf( " with %f %f %ld/%ld\n" ,
343 childp -> time , childp -> childtime ,
344 arcp -> arc_count , childp -> npropcall );
345 printf( "[dotime] parent\t" );
346 printname( parentp );
347 printf( "\n[dotime] share %f\n" , share );
356 register nltype *nlp;
357 register nltype *cyclenlp;
363 * Count the number of cycles, and initialize the cycle lists
366 for ( nlp = nl ; nlp < npe ; nlp++ ) {
368 * this is how you find unattached cycles
370 if ( nlp -> cyclehead == nlp && nlp -> cnext != 0 ) {
375 * cyclenl is indexed by cycle number:
376 * i.e. it is origin 1, not origin 0.
378 cyclenl = (nltype *) calloc( ncycle + 1 , sizeof( nltype ) );
380 errx( 1 , "no room for %zu bytes of cycle headers" ,
381 ( ncycle + 1 ) * sizeof( nltype ) );
383 * now link cycles to true cycleheads,
384 * number them, accumulate the data for the cycle
387 for ( nlp = nl ; nlp < npe ; nlp++ ) {
388 if ( !( nlp -> cyclehead == nlp && nlp -> cnext != 0 ) ) {
392 cyclenlp = &cyclenl[cycle];
393 cyclenlp -> name = 0; /* the name */
394 cyclenlp -> value = 0; /* the pc entry point */
395 cyclenlp -> time = 0.0; /* ticks in this routine */
396 cyclenlp -> childtime = 0.0; /* cumulative ticks in children */
397 cyclenlp -> ncall = 0; /* how many times called */
398 cyclenlp -> selfcalls = 0; /* how many calls to self */
399 cyclenlp -> propfraction = 0.0; /* what % of time propagates */
400 cyclenlp -> propself = 0.0; /* how much self time propagates */
401 cyclenlp -> propchild = 0.0; /* how much child time propagates */
402 cyclenlp -> printflag = TRUE; /* should this be printed? */
403 cyclenlp -> index = 0; /* index in the graph list */
404 cyclenlp -> toporder = DFN_NAN; /* graph call chain top-sort order */
405 cyclenlp -> cycleno = cycle; /* internal number of cycle on */
406 cyclenlp -> cyclehead = cyclenlp; /* pointer to head of cycle */
407 cyclenlp -> cnext = nlp; /* pointer to next member of cycle */
408 cyclenlp -> parents = 0; /* list of caller arcs */
409 cyclenlp -> children = 0; /* list of callee arcs */
411 if ( debug & CYCLEDEBUG ) {
412 printf( "[cyclelink] " );
414 printf( " is the head of cycle %d\n" , cycle );
418 * link members to cycle header
420 for ( memberp = nlp ; memberp ; memberp = memberp -> cnext ) {
421 memberp -> cycleno = cycle;
422 memberp -> cyclehead = cyclenlp;
425 * count calls from outside the cycle
426 * and those among cycle members
428 for ( memberp = nlp ; memberp ; memberp = memberp -> cnext ) {
429 for ( arcp=memberp->parents ; arcp ; arcp=arcp->arc_parentlist ) {
430 if ( arcp -> arc_parentp == memberp ) {
433 if ( arcp -> arc_parentp -> cycleno == cycle ) {
434 cyclenlp -> selfcalls += arcp -> arc_count;
436 cyclenlp -> npropcall += arcp -> arc_count;
444 * analyze cycles to determine breakup
449 arctype **cyclestack;
462 * calculate the size of the cycle, and find nodes that
463 * exit the cycle as they are desirable targets to cut
464 * some of their parents
466 for ( done = TRUE , cycleno = 1 ; cycleno <= ncycle ; cycleno++ ) {
468 for (nlp = cyclenl[ cycleno ] . cnext; nlp; nlp = nlp -> cnext) {
470 nlp -> parentcnt = 0;
471 nlp -> flags &= ~HASCYCLEXIT;
472 for ( arcp = nlp -> parents; arcp; arcp = arcp -> arc_parentlist ) {
473 nlp -> parentcnt += 1;
474 if ( arcp -> arc_parentp -> cycleno != cycleno )
475 nlp -> flags |= HASCYCLEXIT;
478 if ( size <= cyclethreshold )
481 cyclestack = (arctype **) calloc( size + 1 , sizeof( arctype *) );
482 if ( cyclestack == 0 )
483 errx( 1, "no room for %zu bytes of cycle stack" ,
484 ( size + 1 ) * sizeof( arctype * ) );
486 if ( debug & BREAKCYCLE ) {
487 printf( "[cycleanalyze] starting cycle %d of %d, size %d\n" ,
488 cycleno , ncycle , size );
491 for ( nlp = cyclenl[ cycleno ] . cnext ; nlp ; nlp = nlp -> cnext ) {
492 stkp = &cyclestack[0];
493 nlp -> flags |= CYCLEHEAD;
494 ret = descend ( nlp , cyclestack , stkp );
495 nlp -> flags &= ~CYCLEHEAD;
500 if ( cyclecnt > 0 ) {
502 for ( clp = cyclehead ; clp ; ) {
503 endlist = &clp -> list[ clp -> size ];
504 for ( arcpp = clp -> list ; arcpp < endlist ; arcpp++ )
505 (*arcpp) -> arc_cyclecnt--;
514 if ( debug & BREAKCYCLE ) {
515 printf("%s visited %d, viable %d, newcycle %d, oldcycle %d\n",
516 "[doarcs]" , visited , viable , newcycle , oldcycle);
523 descend(nltype *node, arctype **stkstart, arctype **stkp)
528 for ( arcp = node -> children ; arcp ; arcp = arcp -> arc_childlist ) {
532 if ( arcp -> arc_childp -> cycleno != node -> cycleno
533 || ( arcp -> arc_childp -> flags & VISITED )
534 || ( arcp -> arc_flags & DEADARC ) )
540 if ( arcp -> arc_childp -> flags & CYCLEHEAD ) {
541 if ( addcycle( stkstart , stkp ) == FALSE )
545 arcp -> arc_childp -> flags |= VISITED;
546 ret = descend( arcp -> arc_childp , stkstart , stkp + 1 );
547 arcp -> arc_childp -> flags &= ~VISITED;
555 addcycle(arctype **stkstart, arctype **stkend)
566 size = stkend - stkstart + 1;
569 for ( arcpp = stkstart , minarc = *arcpp ; arcpp <= stkend ; arcpp++ ) {
570 if ( *arcpp > minarc )
575 for ( clp = cyclehead ; clp ; clp = clp -> next ) {
576 if ( clp -> size != size )
579 endlist = &clp -> list[ size ];
580 for ( arcpp = clp -> list ; arcpp < endlist ; arcpp++ ) {
581 if ( *stkp++ != *arcpp )
586 if ( arcpp == endlist ) {
594 calloc( 1 , sizeof ( cltype ) + ( size - 1 ) * sizeof( arctype * ) );
596 warnx( "no room for %zu bytes of subcycle storage" ,
597 sizeof ( cltype ) + ( size - 1 ) * sizeof( arctype * ) );
601 endlist = &clp -> list[ size ];
602 for ( arcpp = clp -> list ; arcpp < endlist ; arcpp++ ) {
603 arcp = *arcpp = *stkp++;
606 arcp -> arc_cyclecnt++;
607 if ( ( arcp -> arc_flags & ONLIST ) == 0 ) {
608 arcp -> arc_flags |= ONLIST;
609 arcp -> arc_next = archead;
614 clp -> next = cyclehead;
618 if ( debug & SUBCYCLELIST ) {
619 printsubcycle( clp );
623 if ( cyclecnt >= CYCLEMAX )
637 arctype *maxexitarcp;
638 arctype *maxwithparentarcp;
639 arctype *maxnoparentarcp;
641 int maxwithparentcnt;
648 maxwithparentcnt = 0;
650 for ( endlist = &archead , arcp = archead ; arcp ; ) {
651 if ( arcp -> arc_cyclecnt == 0 ) {
652 arcp -> arc_flags &= ~ONLIST;
653 *endlist = arcp -> arc_next;
654 arcp -> arc_next = 0;
658 if ( arcp -> arc_childp -> flags & HASCYCLEXIT ) {
659 if ( arcp -> arc_cyclecnt > maxexitcnt ||
660 ( arcp -> arc_cyclecnt == maxexitcnt &&
661 arcp -> arc_cyclecnt < maxexitarcp -> arc_count ) ) {
662 maxexitcnt = arcp -> arc_cyclecnt;
665 } else if ( arcp -> arc_childp -> parentcnt > 1 ) {
666 if ( arcp -> arc_cyclecnt > maxwithparentcnt ||
667 ( arcp -> arc_cyclecnt == maxwithparentcnt &&
668 arcp -> arc_cyclecnt < maxwithparentarcp -> arc_count ) ) {
669 maxwithparentcnt = arcp -> arc_cyclecnt;
670 maxwithparentarcp = arcp;
673 if ( arcp -> arc_cyclecnt > maxnoparentcnt ||
674 ( arcp -> arc_cyclecnt == maxnoparentcnt &&
675 arcp -> arc_cyclecnt < maxnoparentarcp -> arc_count ) ) {
676 maxnoparentcnt = arcp -> arc_cyclecnt;
677 maxnoparentarcp = arcp;
680 endlist = &arcp -> arc_next;
681 arcp = arcp -> arc_next;
683 if ( maxexitcnt > 0 ) {
685 * first choice is edge leading to node with out-of-cycle parent
687 maxarcp = maxexitarcp;
691 } else if ( maxwithparentcnt > 0 ) {
693 * second choice is edge leading to node with at least one
694 * other in-cycle parent
696 maxarcp = maxwithparentarcp;
702 * last choice is edge leading to node with only this arc as
703 * a parent (as it will now be orphaned)
705 maxarcp = maxnoparentarcp;
710 maxarcp -> arc_flags |= DEADARC;
711 maxarcp -> arc_childp -> parentcnt -= 1;
712 maxarcp -> arc_childp -> npropcall -= maxarcp -> arc_count;
714 if ( debug & BREAKCYCLE ) {
715 printf( "%s delete %s arc: %s (%ld) -> %s from %u cycle(s)\n" ,
716 "[compresslist]" , type , maxarcp -> arc_parentp -> name ,
717 maxarcp -> arc_count , maxarcp -> arc_childp -> name ,
718 maxarcp -> arc_cyclecnt );
721 printf( "\t%s to %s with %ld calls\n" , maxarcp -> arc_parentp -> name ,
722 maxarcp -> arc_childp -> name , maxarcp -> arc_count );
724 for ( clp = cyclehead ; clp ; ) {
725 endlist = &clp -> list[ clp -> size ];
726 for ( arcpp = clp -> list ; arcpp < endlist ; arcpp++ )
727 if ( (*arcpp) -> arc_flags & DEADARC )
729 if ( arcpp == endlist ) {
734 for ( arcpp = clp -> list ; arcpp < endlist ; arcpp++ )
735 (*arcpp) -> arc_cyclecnt--;
745 printsubcycle(cltype *clp)
751 printf( "%s <cycle %d>\n" , (*arcpp) -> arc_parentp -> name ,
752 (*arcpp) -> arc_parentp -> cycleno ) ;
753 for ( endlist = &clp -> list[ clp -> size ]; arcpp < endlist ; arcpp++ )
754 printf( "\t(%ld) -> %s\n" , (*arcpp) -> arc_count ,
755 (*arcpp) -> arc_childp -> name ) ;
766 for ( cycle = 1 ; cycle <= ncycle ; cycle += 1 ) {
767 cyclenlp = &cyclenl[ cycle ];
768 for ( childp = cyclenlp -> cnext ; childp ; childp = childp -> cnext ) {
769 if ( childp -> propfraction == 0.0 ) {
771 * all members have the same propfraction except those
772 * that were excluded with -E
776 cyclenlp -> time += childp -> time;
778 cyclenlp -> propself = cyclenlp -> propfraction * cyclenlp -> time;
783 * in one top to bottom pass over the topologically sorted namelist
785 * printflag as the union of parents' printflags
786 * propfraction as the sum of fractional parents' propfractions
787 * and while we're here, sum time for functions.
797 for ( index = nname-1 ; index >= 0 ; index -= 1 ) {
798 childp = topsortnlp[ index ];
800 * if we haven't done this function or cycle,
801 * inherit things from parent.
802 * this way, we are linear in the number of arcs
803 * since we do all members of a cycle (and the cycle itself)
804 * as we hit the first member of the cycle.
806 if ( childp -> cyclehead != oldhead ) {
807 oldhead = childp -> cyclehead;
808 inheritflags( childp );
811 if ( debug & PROPDEBUG ) {
812 printf( "[doflags] " );
814 printf( " inherits printflag %d and propfraction %f\n" ,
815 childp -> printflag , childp -> propfraction );
818 if ( ! childp -> printflag ) {
821 * it gets turned on by
823 * or there not being any -f list and not being on -e list.
825 if ( onlist( flist , childp -> name )
826 || ( !fflag && !onlist( elist , childp -> name ) ) ) {
827 childp -> printflag = TRUE;
831 * this function has printing parents:
832 * maybe someone wants to shut it up
833 * by putting it on -e list. (but favor -f over -e)
835 if ( ( !onlist( flist , childp -> name ) )
836 && onlist( elist , childp -> name ) ) {
837 childp -> printflag = FALSE;
840 if ( childp -> propfraction == 0.0 ) {
842 * no parents to pass time to.
843 * collect time from children if
845 * or there isn't any -F list and its not on -E list.
847 if ( onlist( Flist , childp -> name )
848 || ( !Fflag && !onlist( Elist , childp -> name ) ) ) {
849 childp -> propfraction = 1.0;
853 * it has parents to pass time to,
854 * but maybe someone wants to shut it up
855 * by putting it on -E list. (but favor -F over -E)
857 if ( !onlist( Flist , childp -> name )
858 && onlist( Elist , childp -> name ) ) {
859 childp -> propfraction = 0.0;
862 childp -> propself = childp -> time * childp -> propfraction;
863 printtime += childp -> propself;
865 if ( debug & PROPDEBUG ) {
866 printf( "[doflags] " );
868 printf( " ends up with printflag %d and propfraction %f\n" ,
869 childp -> printflag , childp -> propfraction );
870 printf( "time %f propself %f printtime %f\n" ,
871 childp -> time , childp -> propself , printtime );
878 * check if any parent of this child
879 * (or outside parents of this cycle)
880 * have their print flags on and set the
881 * print flag of the child (cycle) appropriately.
882 * similarly, deal with propagation fractions from parents.
885 inheritflags(nltype *childp)
892 headp = childp -> cyclehead;
893 if ( childp == headp ) {
895 * just a regular child, check its parents
897 childp -> printflag = FALSE;
898 childp -> propfraction = 0.0;
899 for (arcp = childp -> parents ; arcp ; arcp = arcp -> arc_parentlist) {
900 parentp = arcp -> arc_parentp;
901 if ( childp == parentp ) {
904 childp -> printflag |= parentp -> printflag;
906 * if the child was never actually called
907 * (e.g. this arc is static (and all others are, too))
908 * no time propagates along this arc.
910 if ( arcp -> arc_flags & DEADARC ) {
913 if ( childp -> npropcall ) {
914 childp -> propfraction += parentp -> propfraction
915 * ( ( (double) arcp -> arc_count )
916 / ( (double) childp -> npropcall ) );
921 * its a member of a cycle, look at all parents from
924 headp -> printflag = FALSE;
925 headp -> propfraction = 0.0;
926 for ( memp = headp -> cnext ; memp ; memp = memp -> cnext ) {
927 for (arcp = memp->parents ; arcp ; arcp = arcp->arc_parentlist) {
928 if ( arcp -> arc_parentp -> cyclehead == headp ) {
931 parentp = arcp -> arc_parentp;
932 headp -> printflag |= parentp -> printflag;
934 * if the cycle was never actually called
935 * (e.g. this arc is static (and all others are, too))
936 * no time propagates along this arc.
938 if ( arcp -> arc_flags & DEADARC ) {
941 if ( headp -> npropcall ) {
942 headp -> propfraction += parentp -> propfraction
943 * ( ( (double) arcp -> arc_count )
944 / ( (double) headp -> npropcall ) );
948 for ( memp = headp ; memp ; memp = memp -> cnext ) {
949 memp -> printflag = headp -> printflag;
950 memp -> propfraction = headp -> propfraction;