2 * SPDX-License-Identifier: BSD-3-Clause
4 * Copyright (c) 1983, 1993
5 * The Regents of the University of California. All rights reserved.
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution.
15 * 3. Neither the name of the University nor the names of its contributors
16 * may be used to endorse or promote products derived from this software
17 * without specific prior written permission.
19 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
20 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
23 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
25 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
34 static char sccsid[] = "@(#)arcs.c 8.1 (Berkeley) 6/6/93";
38 #include <sys/cdefs.h>
39 __FBSDID("$FreeBSD$");
51 int topcmp(const void *, const void *);
54 * add (or just increment) an arc
57 addarc(nltype *parentp, nltype *childp, long count)
62 if ( debug & TALLYDEBUG ) {
63 printf( "[addarc] %ld arcs from %s to %s\n" ,
64 count , parentp -> name , childp -> name );
67 arcp = arclookup( parentp , childp );
70 * a hit: just increment the count.
73 if ( debug & TALLYDEBUG ) {
74 printf( "[tally] hit %ld += %ld\n" ,
75 arcp -> arc_count , count );
78 arcp -> arc_count += count;
81 arcp = (arctype *)calloc( 1 , sizeof *arcp );
83 errx( 1 , "malloc failed" );
84 arcp -> arc_parentp = parentp;
85 arcp -> arc_childp = childp;
86 arcp -> arc_count = count;
88 * prepend this child to the children of this parent
90 arcp -> arc_childlist = parentp -> children;
91 parentp -> children = arcp;
93 * prepend this parent to the parents of this child
95 arcp -> arc_parentlist = childp -> parents;
96 childp -> parents = arcp;
100 * the code below topologically sorts the graph (collapsing cycles),
101 * and propagates time bottom up and flags top down.
105 * the topologically sorted name list pointers
110 topcmp(const void *v1, const void *v2)
112 const nltype **npp1 = (const nltype **)v1;
113 const nltype **npp2 = (const nltype **)v2;
115 return (*npp1) -> toporder - (*npp2) -> toporder;
121 nltype *parentp, **timesortnlp;
127 * initialize various things:
128 * zero out child times.
129 * count self-recursive calls.
130 * indicate that nothing is on cycles.
132 for ( parentp = nl ; parentp < npe ; parentp++ ) {
133 parentp -> childtime = 0.0;
134 arcp = arclookup( parentp , parentp );
136 parentp -> ncall -= arcp -> arc_count;
137 parentp -> selfcalls = arcp -> arc_count;
139 parentp -> selfcalls = 0;
141 parentp -> npropcall = parentp -> ncall;
142 parentp -> propfraction = 0.0;
143 parentp -> propself = 0.0;
144 parentp -> propchild = 0.0;
145 parentp -> printflag = FALSE;
146 parentp -> toporder = DFN_NAN;
147 parentp -> cycleno = 0;
148 parentp -> cyclehead = parentp;
149 parentp -> cnext = 0;
151 for ( pass = 1 ; ; pass++ ) {
153 * topologically order things
154 * if any node is unnumbered,
155 * number it and any of its descendents.
157 for ( dfn_init() , parentp = nl ; parentp < npe ; parentp++ ) {
158 if ( parentp -> toporder == DFN_NAN ) {
163 * link together nodes on the same cycle
167 * if no cycles to break up, proceed
172 * analyze cycles to determine breakup
175 if ( debug & BREAKCYCLE ) {
176 printf("[doarcs] pass %ld, cycle(s) %d\n" , pass , ncycle );
180 printf( "\n\n%s %s\n%s %d:\n" ,
181 "The following arcs were deleted" ,
182 "from the propagation calculation" ,
183 "to reduce the maximum cycle size to", cyclethreshold );
185 if ( cycleanalyze() )
189 for ( parentp = nl ; parentp < npe ; parentp++ ) {
190 parentp -> toporder = DFN_NAN;
191 parentp -> cycleno = 0;
192 parentp -> cyclehead = parentp;
193 parentp -> cnext = 0;
199 printf( "\tNone\n\n" );
202 * Sort the symbol table in reverse topological order
204 topsortnlp = (nltype **) calloc( nname , sizeof(nltype *) );
205 if ( topsortnlp == (nltype **) 0 )
206 errx( 1 , "[doarcs] ran out of memory for topo sorting" );
207 for ( index = 0 ; index < nname ; index += 1 ) {
208 topsortnlp[ index ] = &nl[ index ];
210 qsort( topsortnlp , nname , sizeof(nltype *) , topcmp );
212 if ( debug & DFNDEBUG ) {
213 printf( "[doarcs] topological sort listing\n" );
214 for ( index = 0 ; index < nname ; index += 1 ) {
215 printf( "[doarcs] " );
216 printf( "%d:" , topsortnlp[ index ] -> toporder );
217 printname( topsortnlp[ index ] );
223 * starting from the topological top,
224 * propagate print flags to children.
225 * also, calculate propagation fractions.
226 * this happens before time propagation
227 * since time propagation uses the fractions.
231 * starting from the topological bottom,
232 * propagate children times up to parents.
236 * Now, sort by propself + propchild.
237 * sorting both the regular function names
240 timesortnlp = (nltype **) calloc( nname + ncycle , sizeof(nltype *) );
241 if ( timesortnlp == (nltype **) 0 )
242 errx( 1 , "ran out of memory for sorting" );
243 for ( index = 0 ; index < nname ; index++ ) {
244 timesortnlp[index] = &nl[index];
246 for ( index = 1 ; index <= ncycle ; index++ ) {
247 timesortnlp[nname+index-1] = &cyclenl[index];
249 qsort( timesortnlp , nname + ncycle , sizeof(nltype *) , totalcmp );
250 for ( index = 0 ; index < nname + ncycle ; index++ ) {
251 timesortnlp[ index ] -> index = index + 1;
253 return( timesortnlp );
262 for ( index = 0 ; index < nname ; index += 1 ) {
263 timepropagate( topsortnlp[ index ] );
268 timepropagate(nltype *parentp)
275 if ( parentp -> propfraction == 0.0 ) {
279 * gather time from children of this parent.
281 for ( arcp = parentp -> children ; arcp ; arcp = arcp -> arc_childlist ) {
282 childp = arcp -> arc_childp;
283 if ( arcp -> arc_flags & DEADARC ) {
286 if ( arcp -> arc_count == 0 ) {
289 if ( childp == parentp ) {
292 if ( childp -> propfraction == 0.0 ) {
295 if ( childp -> cyclehead != childp ) {
296 if ( parentp -> cycleno == childp -> cycleno ) {
299 if ( parentp -> toporder <= childp -> toporder ) {
300 fprintf( stderr , "[propagate] toporder botches\n" );
302 childp = childp -> cyclehead;
304 if ( parentp -> toporder <= childp -> toporder ) {
305 fprintf( stderr , "[propagate] toporder botches\n" );
309 if ( childp -> npropcall == 0 ) {
313 * distribute time for this arc
315 arcp -> arc_time = childp -> time
316 * ( ( (double) arcp -> arc_count ) /
317 ( (double) childp -> npropcall ) );
318 arcp -> arc_childtime = childp -> childtime
319 * ( ( (double) arcp -> arc_count ) /
320 ( (double) childp -> npropcall ) );
321 share = arcp -> arc_time + arcp -> arc_childtime;
322 parentp -> childtime += share;
324 * ( 1 - propfraction ) gets lost along the way
326 propshare = parentp -> propfraction * share;
328 * fix things for printing
330 parentp -> propchild += propshare;
331 arcp -> arc_time *= parentp -> propfraction;
332 arcp -> arc_childtime *= parentp -> propfraction;
334 * add this share to the parent's cycle header, if any.
336 if ( parentp -> cyclehead != parentp ) {
337 parentp -> cyclehead -> childtime += share;
338 parentp -> cyclehead -> propchild += propshare;
341 if ( debug & PROPDEBUG ) {
342 printf( "[dotime] child \t" );
344 printf( " with %f %f %ld/%ld\n" ,
345 childp -> time , childp -> childtime ,
346 arcp -> arc_count , childp -> npropcall );
347 printf( "[dotime] parent\t" );
348 printname( parentp );
349 printf( "\n[dotime] share %f\n" , share );
358 register nltype *nlp;
359 register nltype *cyclenlp;
365 * Count the number of cycles, and initialize the cycle lists
368 for ( nlp = nl ; nlp < npe ; nlp++ ) {
370 * this is how you find unattached cycles
372 if ( nlp -> cyclehead == nlp && nlp -> cnext != 0 ) {
377 * cyclenl is indexed by cycle number:
378 * i.e. it is origin 1, not origin 0.
380 cyclenl = (nltype *) calloc( ncycle + 1 , sizeof( nltype ) );
381 if ( cyclenl == NULL )
382 errx( 1 , "no room for %zu bytes of cycle headers" ,
383 ( ncycle + 1 ) * sizeof( nltype ) );
385 * now link cycles to true cycleheads,
386 * number them, accumulate the data for the cycle
389 for ( nlp = nl ; nlp < npe ; nlp++ ) {
390 if ( !( nlp -> cyclehead == nlp && nlp -> cnext != 0 ) ) {
394 cyclenlp = &cyclenl[cycle];
395 cyclenlp -> name = 0; /* the name */
396 cyclenlp -> value = 0; /* the pc entry point */
397 cyclenlp -> time = 0.0; /* ticks in this routine */
398 cyclenlp -> childtime = 0.0; /* cumulative ticks in children */
399 cyclenlp -> ncall = 0; /* how many times called */
400 cyclenlp -> selfcalls = 0; /* how many calls to self */
401 cyclenlp -> propfraction = 0.0; /* what % of time propagates */
402 cyclenlp -> propself = 0.0; /* how much self time propagates */
403 cyclenlp -> propchild = 0.0; /* how much child time propagates */
404 cyclenlp -> printflag = TRUE; /* should this be printed? */
405 cyclenlp -> index = 0; /* index in the graph list */
406 cyclenlp -> toporder = DFN_NAN; /* graph call chain top-sort order */
407 cyclenlp -> cycleno = cycle; /* internal number of cycle on */
408 cyclenlp -> cyclehead = cyclenlp; /* pointer to head of cycle */
409 cyclenlp -> cnext = nlp; /* pointer to next member of cycle */
410 cyclenlp -> parents = 0; /* list of caller arcs */
411 cyclenlp -> children = 0; /* list of callee arcs */
413 if ( debug & CYCLEDEBUG ) {
414 printf( "[cyclelink] " );
416 printf( " is the head of cycle %d\n" , cycle );
420 * link members to cycle header
422 for ( memberp = nlp ; memberp ; memberp = memberp -> cnext ) {
423 memberp -> cycleno = cycle;
424 memberp -> cyclehead = cyclenlp;
427 * count calls from outside the cycle
428 * and those among cycle members
430 for ( memberp = nlp ; memberp ; memberp = memberp -> cnext ) {
431 for ( arcp=memberp->parents ; arcp ; arcp=arcp->arc_parentlist ) {
432 if ( arcp -> arc_parentp == memberp ) {
435 if ( arcp -> arc_parentp -> cycleno == cycle ) {
436 cyclenlp -> selfcalls += arcp -> arc_count;
438 cyclenlp -> npropcall += arcp -> arc_count;
446 * analyze cycles to determine breakup
451 arctype **cyclestack;
464 * calculate the size of the cycle, and find nodes that
465 * exit the cycle as they are desirable targets to cut
466 * some of their parents
468 for ( done = TRUE , cycleno = 1 ; cycleno <= ncycle ; cycleno++ ) {
470 for (nlp = cyclenl[ cycleno ] . cnext; nlp; nlp = nlp -> cnext) {
472 nlp -> parentcnt = 0;
473 nlp -> flags &= ~HASCYCLEXIT;
474 for ( arcp = nlp -> parents; arcp; arcp = arcp -> arc_parentlist ) {
475 nlp -> parentcnt += 1;
476 if ( arcp -> arc_parentp -> cycleno != cycleno )
477 nlp -> flags |= HASCYCLEXIT;
480 if ( size <= cyclethreshold )
483 cyclestack = (arctype **) calloc( size + 1 , sizeof( arctype *) );
484 if ( cyclestack == NULL )
485 errx( 1, "no room for %zu bytes of cycle stack" ,
486 ( size + 1 ) * sizeof( arctype * ) );
488 if ( debug & BREAKCYCLE ) {
489 printf( "[cycleanalyze] starting cycle %d of %d, size %d\n" ,
490 cycleno , ncycle , size );
493 for ( nlp = cyclenl[ cycleno ] . cnext ; nlp ; nlp = nlp -> cnext ) {
494 stkp = &cyclestack[0];
495 nlp -> flags |= CYCLEHEAD;
496 ret = descend ( nlp , cyclestack , stkp );
497 nlp -> flags &= ~CYCLEHEAD;
502 if ( cyclecnt > 0 ) {
504 for ( clp = cyclehead ; clp ; ) {
505 endlist = &clp -> list[ clp -> size ];
506 for ( arcpp = clp -> list ; arcpp < endlist ; arcpp++ )
507 (*arcpp) -> arc_cyclecnt--;
516 if ( debug & BREAKCYCLE ) {
517 printf("%s visited %d, viable %d, newcycle %d, oldcycle %d\n",
518 "[doarcs]" , visited , viable , newcycle , oldcycle);
525 descend(nltype *node, arctype **stkstart, arctype **stkp)
530 for ( arcp = node -> children ; arcp ; arcp = arcp -> arc_childlist ) {
534 if ( arcp -> arc_childp -> cycleno != node -> cycleno
535 || ( arcp -> arc_childp -> flags & VISITED )
536 || ( arcp -> arc_flags & DEADARC ) )
542 if ( arcp -> arc_childp -> flags & CYCLEHEAD ) {
543 if ( addcycle( stkstart , stkp ) == FALSE )
547 arcp -> arc_childp -> flags |= VISITED;
548 ret = descend( arcp -> arc_childp , stkstart , stkp + 1 );
549 arcp -> arc_childp -> flags &= ~VISITED;
557 addcycle(arctype **stkstart, arctype **stkend)
568 size = stkend - stkstart + 1;
571 for ( arcpp = stkstart , minarc = *arcpp ; arcpp <= stkend ; arcpp++ ) {
572 if ( *arcpp > minarc )
577 for ( clp = cyclehead ; clp ; clp = clp -> next ) {
578 if ( clp -> size != size )
581 endlist = &clp -> list[ size ];
582 for ( arcpp = clp -> list ; arcpp < endlist ; arcpp++ ) {
583 if ( *stkp++ != *arcpp )
588 if ( arcpp == endlist ) {
596 calloc( 1 , sizeof ( cltype ) + ( size - 1 ) * sizeof( arctype * ) );
598 warnx( "no room for %zu bytes of subcycle storage" ,
599 sizeof ( cltype ) + ( size - 1 ) * sizeof( arctype * ) );
603 endlist = &clp -> list[ size ];
604 for ( arcpp = clp -> list ; arcpp < endlist ; arcpp++ ) {
605 arcp = *arcpp = *stkp++;
608 arcp -> arc_cyclecnt++;
609 if ( ( arcp -> arc_flags & ONLIST ) == 0 ) {
610 arcp -> arc_flags |= ONLIST;
611 arcp -> arc_next = archead;
616 clp -> next = cyclehead;
620 if ( debug & SUBCYCLELIST ) {
621 printsubcycle( clp );
625 if ( cyclecnt >= CYCLEMAX )
639 arctype *maxexitarcp;
640 arctype *maxwithparentarcp;
641 arctype *maxnoparentarcp;
643 int maxwithparentcnt;
650 maxwithparentcnt = 0;
652 for ( endlist = &archead , arcp = archead ; arcp ; ) {
653 if ( arcp -> arc_cyclecnt == 0 ) {
654 arcp -> arc_flags &= ~ONLIST;
655 *endlist = arcp -> arc_next;
656 arcp -> arc_next = 0;
660 if ( arcp -> arc_childp -> flags & HASCYCLEXIT ) {
661 if ( arcp -> arc_cyclecnt > maxexitcnt ||
662 ( arcp -> arc_cyclecnt == maxexitcnt &&
663 arcp -> arc_cyclecnt < maxexitarcp -> arc_count ) ) {
664 maxexitcnt = arcp -> arc_cyclecnt;
667 } else if ( arcp -> arc_childp -> parentcnt > 1 ) {
668 if ( arcp -> arc_cyclecnt > maxwithparentcnt ||
669 ( arcp -> arc_cyclecnt == maxwithparentcnt &&
670 arcp -> arc_cyclecnt < maxwithparentarcp -> arc_count ) ) {
671 maxwithparentcnt = arcp -> arc_cyclecnt;
672 maxwithparentarcp = arcp;
675 if ( arcp -> arc_cyclecnt > maxnoparentcnt ||
676 ( arcp -> arc_cyclecnt == maxnoparentcnt &&
677 arcp -> arc_cyclecnt < maxnoparentarcp -> arc_count ) ) {
678 maxnoparentcnt = arcp -> arc_cyclecnt;
679 maxnoparentarcp = arcp;
682 endlist = &arcp -> arc_next;
683 arcp = arcp -> arc_next;
685 if ( maxexitcnt > 0 ) {
687 * first choice is edge leading to node with out-of-cycle parent
689 maxarcp = maxexitarcp;
693 } else if ( maxwithparentcnt > 0 ) {
695 * second choice is edge leading to node with at least one
696 * other in-cycle parent
698 maxarcp = maxwithparentarcp;
704 * last choice is edge leading to node with only this arc as
705 * a parent (as it will now be orphaned)
707 maxarcp = maxnoparentarcp;
712 maxarcp -> arc_flags |= DEADARC;
713 maxarcp -> arc_childp -> parentcnt -= 1;
714 maxarcp -> arc_childp -> npropcall -= maxarcp -> arc_count;
716 if ( debug & BREAKCYCLE ) {
717 printf( "%s delete %s arc: %s (%ld) -> %s from %u cycle(s)\n" ,
718 "[compresslist]" , type , maxarcp -> arc_parentp -> name ,
719 maxarcp -> arc_count , maxarcp -> arc_childp -> name ,
720 maxarcp -> arc_cyclecnt );
723 printf( "\t%s to %s with %ld calls\n" , maxarcp -> arc_parentp -> name ,
724 maxarcp -> arc_childp -> name , maxarcp -> arc_count );
726 for ( clp = cyclehead ; clp ; ) {
727 endlist = &clp -> list[ clp -> size ];
728 for ( arcpp = clp -> list ; arcpp < endlist ; arcpp++ )
729 if ( (*arcpp) -> arc_flags & DEADARC )
731 if ( arcpp == endlist ) {
736 for ( arcpp = clp -> list ; arcpp < endlist ; arcpp++ )
737 (*arcpp) -> arc_cyclecnt--;
747 printsubcycle(cltype *clp)
753 printf( "%s <cycle %d>\n" , (*arcpp) -> arc_parentp -> name ,
754 (*arcpp) -> arc_parentp -> cycleno ) ;
755 for ( endlist = &clp -> list[ clp -> size ]; arcpp < endlist ; arcpp++ )
756 printf( "\t(%ld) -> %s\n" , (*arcpp) -> arc_count ,
757 (*arcpp) -> arc_childp -> name ) ;
768 for ( cycle = 1 ; cycle <= ncycle ; cycle += 1 ) {
769 cyclenlp = &cyclenl[ cycle ];
770 for ( childp = cyclenlp -> cnext ; childp ; childp = childp -> cnext ) {
771 if ( childp -> propfraction == 0.0 ) {
773 * all members have the same propfraction except those
774 * that were excluded with -E
778 cyclenlp -> time += childp -> time;
780 cyclenlp -> propself = cyclenlp -> propfraction * cyclenlp -> time;
785 * in one top to bottom pass over the topologically sorted namelist
787 * printflag as the union of parents' printflags
788 * propfraction as the sum of fractional parents' propfractions
789 * and while we're here, sum time for functions.
799 for ( index = nname-1 ; index >= 0 ; index -= 1 ) {
800 childp = topsortnlp[ index ];
802 * if we haven't done this function or cycle,
803 * inherit things from parent.
804 * this way, we are linear in the number of arcs
805 * since we do all members of a cycle (and the cycle itself)
806 * as we hit the first member of the cycle.
808 if ( childp -> cyclehead != oldhead ) {
809 oldhead = childp -> cyclehead;
810 inheritflags( childp );
813 if ( debug & PROPDEBUG ) {
814 printf( "[doflags] " );
816 printf( " inherits printflag %d and propfraction %f\n" ,
817 childp -> printflag , childp -> propfraction );
820 if ( ! childp -> printflag ) {
823 * it gets turned on by
825 * or there not being any -f list and not being on -e list.
827 if ( onlist( flist , childp -> name )
828 || ( !fflag && !onlist( elist , childp -> name ) ) ) {
829 childp -> printflag = TRUE;
833 * this function has printing parents:
834 * maybe someone wants to shut it up
835 * by putting it on -e list. (but favor -f over -e)
837 if ( ( !onlist( flist , childp -> name ) )
838 && onlist( elist , childp -> name ) ) {
839 childp -> printflag = FALSE;
842 if ( childp -> propfraction == 0.0 ) {
844 * no parents to pass time to.
845 * collect time from children if
847 * or there isn't any -F list and its not on -E list.
849 if ( onlist( Flist , childp -> name )
850 || ( !Fflag && !onlist( Elist , childp -> name ) ) ) {
851 childp -> propfraction = 1.0;
855 * it has parents to pass time to,
856 * but maybe someone wants to shut it up
857 * by putting it on -E list. (but favor -F over -E)
859 if ( !onlist( Flist , childp -> name )
860 && onlist( Elist , childp -> name ) ) {
861 childp -> propfraction = 0.0;
864 childp -> propself = childp -> time * childp -> propfraction;
865 printtime += childp -> propself;
867 if ( debug & PROPDEBUG ) {
868 printf( "[doflags] " );
870 printf( " ends up with printflag %d and propfraction %f\n" ,
871 childp -> printflag , childp -> propfraction );
872 printf( "time %f propself %f printtime %f\n" ,
873 childp -> time , childp -> propself , printtime );
880 * check if any parent of this child
881 * (or outside parents of this cycle)
882 * have their print flags on and set the
883 * print flag of the child (cycle) appropriately.
884 * similarly, deal with propagation fractions from parents.
887 inheritflags(nltype *childp)
894 headp = childp -> cyclehead;
895 if ( childp == headp ) {
897 * just a regular child, check its parents
899 childp -> printflag = FALSE;
900 childp -> propfraction = 0.0;
901 for (arcp = childp -> parents ; arcp ; arcp = arcp -> arc_parentlist) {
902 parentp = arcp -> arc_parentp;
903 if ( childp == parentp ) {
906 childp -> printflag |= parentp -> printflag;
908 * if the child was never actually called
909 * (e.g. this arc is static (and all others are, too))
910 * no time propagates along this arc.
912 if ( arcp -> arc_flags & DEADARC ) {
915 if ( childp -> npropcall ) {
916 childp -> propfraction += parentp -> propfraction
917 * ( ( (double) arcp -> arc_count )
918 / ( (double) childp -> npropcall ) );
923 * its a member of a cycle, look at all parents from
926 headp -> printflag = FALSE;
927 headp -> propfraction = 0.0;
928 for ( memp = headp -> cnext ; memp ; memp = memp -> cnext ) {
929 for (arcp = memp->parents ; arcp ; arcp = arcp->arc_parentlist) {
930 if ( arcp -> arc_parentp -> cyclehead == headp ) {
933 parentp = arcp -> arc_parentp;
934 headp -> printflag |= parentp -> printflag;
936 * if the cycle was never actually called
937 * (e.g. this arc is static (and all others are, too))
938 * no time propagates along this arc.
940 if ( arcp -> arc_flags & DEADARC ) {
943 if ( headp -> npropcall ) {
944 headp -> propfraction += parentp -> propfraction
945 * ( ( (double) arcp -> arc_count )
946 / ( (double) headp -> npropcall ) );
950 for ( memp = headp ; memp ; memp = memp -> cnext ) {
951 memp -> printflag = headp -> printflag;
952 memp -> propfraction = headp -> propfraction;