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 * 3. All advertising materials mentioning features or use of this software
14 * must display the following acknowledgement:
15 * This product includes software developed by the University of
16 * California, Berkeley and its contributors.
17 * 4. Neither the name of the University nor the names of its contributors
18 * may be used to endorse or promote products derived from this software
19 * without specific prior written permission.
21 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
22 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
25 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
33 * @(#)arcs.c 8.1 (Berkeley) 6/6/93
34 * $FreeBSD: src/usr.bin/gprof/arcs.c,v 1.6 1999/08/28 01:01:54 peter Exp $
35 * $DragonFly: src/usr.bin/gprof/arcs.c,v 1.2 2003/06/17 04:29:27 dillon Exp $
49 * add (or just increment) an arc
51 addarc( parentp , childp , count )
59 if ( debug & TALLYDEBUG ) {
60 printf( "[addarc] %d arcs from %s to %s\n" ,
61 count , parentp -> name , childp -> name );
64 arcp = arclookup( parentp , childp );
67 * a hit: just increment the count.
70 if ( debug & TALLYDEBUG ) {
71 printf( "[tally] hit %d += %d\n" ,
72 arcp -> arc_count , count );
75 arcp -> arc_count += count;
78 arcp = (arctype *)calloc( 1 , sizeof *arcp );
79 arcp -> arc_parentp = parentp;
80 arcp -> arc_childp = childp;
81 arcp -> arc_count = count;
83 * prepend this child to the children of this parent
85 arcp -> arc_childlist = parentp -> children;
86 parentp -> children = arcp;
88 * prepend this parent to the parents of this child
90 arcp -> arc_parentlist = childp -> parents;
91 childp -> parents = arcp;
95 * the code below topologically sorts the graph (collapsing cycles),
96 * and propagates time bottom up and flags top down.
100 * the topologically sorted name list pointers
104 topcmp( npp1 , npp2 )
108 return (*npp1) -> toporder - (*npp2) -> toporder;
114 nltype *parentp, **timesortnlp;
120 * initialize various things:
121 * zero out child times.
122 * count self-recursive calls.
123 * indicate that nothing is on cycles.
125 for ( parentp = nl ; parentp < npe ; parentp++ ) {
126 parentp -> childtime = 0.0;
127 arcp = arclookup( parentp , parentp );
129 parentp -> ncall -= arcp -> arc_count;
130 parentp -> selfcalls = arcp -> arc_count;
132 parentp -> selfcalls = 0;
134 parentp -> npropcall = parentp -> ncall;
135 parentp -> propfraction = 0.0;
136 parentp -> propself = 0.0;
137 parentp -> propchild = 0.0;
138 parentp -> printflag = FALSE;
139 parentp -> toporder = DFN_NAN;
140 parentp -> cycleno = 0;
141 parentp -> cyclehead = parentp;
142 parentp -> cnext = 0;
144 findcall( parentp , parentp -> value , (parentp+1) -> value );
147 for ( pass = 1 ; ; pass++ ) {
149 * topologically order things
150 * if any node is unnumbered,
151 * number it and any of its descendents.
153 for ( dfn_init() , parentp = nl ; parentp < npe ; parentp++ ) {
154 if ( parentp -> toporder == DFN_NAN ) {
159 * link together nodes on the same cycle
163 * if no cycles to break up, proceed
168 * analyze cycles to determine breakup
171 if ( debug & BREAKCYCLE ) {
172 printf("[doarcs] pass %d, cycle(s) %d\n" , pass , ncycle );
176 printf( "\n\n%s %s\n%s %d:\n" ,
177 "The following arcs were deleted" ,
178 "from the propagation calculation" ,
179 "to reduce the maximum cycle size to", cyclethreshold );
181 if ( cycleanalyze() )
185 for ( parentp = nl ; parentp < npe ; parentp++ ) {
186 parentp -> toporder = DFN_NAN;
187 parentp -> cycleno = 0;
188 parentp -> cyclehead = parentp;
189 parentp -> cnext = 0;
195 printf( "\tNone\n\n" );
198 * Sort the symbol table in reverse topological order
200 topsortnlp = (nltype **) calloc( nname , sizeof(nltype *) );
201 if ( topsortnlp == (nltype **) 0 ) {
202 fprintf( stderr , "[doarcs] ran out of memory for topo sorting\n" );
204 for ( index = 0 ; index < nname ; index += 1 ) {
205 topsortnlp[ index ] = &nl[ index ];
207 qsort( topsortnlp , nname , sizeof(nltype *) , topcmp );
209 if ( debug & DFNDEBUG ) {
210 printf( "[doarcs] topological sort listing\n" );
211 for ( index = 0 ; index < nname ; index += 1 ) {
212 printf( "[doarcs] " );
213 printf( "%d:" , topsortnlp[ index ] -> toporder );
214 printname( topsortnlp[ index ] );
220 * starting from the topological top,
221 * propagate print flags to children.
222 * also, calculate propagation fractions.
223 * this happens before time propagation
224 * since time propagation uses the fractions.
228 * starting from the topological bottom,
229 * propogate children times up to parents.
233 * Now, sort by propself + propchild.
234 * sorting both the regular function names
237 timesortnlp = (nltype **) calloc( nname + ncycle , sizeof(nltype *) );
238 if ( timesortnlp == (nltype **) 0 ) {
239 warnx("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 );
259 for ( index = 0 ; index < nname ; index += 1 ) {
260 timepropagate( topsortnlp[ index ] );
264 timepropagate( parentp )
272 if ( parentp -> propfraction == 0.0 ) {
276 * gather time from children of this parent.
278 for ( arcp = parentp -> children ; arcp ; arcp = arcp -> arc_childlist ) {
279 childp = arcp -> arc_childp;
280 if ( arcp -> arc_flags & DEADARC ) {
283 if ( arcp -> arc_count == 0 ) {
286 if ( childp == parentp ) {
289 if ( childp -> propfraction == 0.0 ) {
292 if ( childp -> cyclehead != childp ) {
293 if ( parentp -> cycleno == childp -> cycleno ) {
296 if ( parentp -> toporder <= childp -> toporder ) {
297 fprintf( stderr , "[propagate] toporder botches\n" );
299 childp = childp -> cyclehead;
301 if ( parentp -> toporder <= childp -> toporder ) {
302 fprintf( stderr , "[propagate] toporder botches\n" );
306 if ( childp -> npropcall == 0 ) {
310 * distribute time for this arc
312 arcp -> arc_time = childp -> time
313 * ( ( (double) arcp -> arc_count ) /
314 ( (double) childp -> npropcall ) );
315 arcp -> arc_childtime = childp -> childtime
316 * ( ( (double) arcp -> arc_count ) /
317 ( (double) childp -> npropcall ) );
318 share = arcp -> arc_time + arcp -> arc_childtime;
319 parentp -> childtime += share;
321 * ( 1 - propfraction ) gets lost along the way
323 propshare = parentp -> propfraction * share;
325 * fix things for printing
327 parentp -> propchild += propshare;
328 arcp -> arc_time *= parentp -> propfraction;
329 arcp -> arc_childtime *= parentp -> propfraction;
331 * add this share to the parent's cycle header, if any.
333 if ( parentp -> cyclehead != parentp ) {
334 parentp -> cyclehead -> childtime += share;
335 parentp -> cyclehead -> propchild += propshare;
338 if ( debug & PROPDEBUG ) {
339 printf( "[dotime] child \t" );
341 printf( " with %f %f %d/%d\n" ,
342 childp -> time , childp -> childtime ,
343 arcp -> arc_count , childp -> npropcall );
344 printf( "[dotime] parent\t" );
345 printname( parentp );
346 printf( "\n[dotime] share %f\n" , share );
354 register nltype *nlp;
355 register nltype *cyclenlp;
361 * Count the number of cycles, and initialze the cycle lists
364 for ( nlp = nl ; nlp < npe ; nlp++ ) {
366 * this is how you find unattached cycles
368 if ( nlp -> cyclehead == nlp && nlp -> cnext != 0 ) {
373 * cyclenl is indexed by cycle number:
374 * i.e. it is origin 1, not origin 0.
376 cyclenl = (nltype *) calloc( ncycle + 1 , sizeof( nltype ) );
377 if ( cyclenl == 0 ) {
378 warnx("no room for %d bytes of cycle headers",
379 ( 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
448 arctype **cyclestack;
461 * calculate the size of the cycle, and find nodes that
462 * exit the cycle as they are desirable targets to cut
463 * some of their parents
465 for ( done = TRUE , cycleno = 1 ; cycleno <= ncycle ; cycleno++ ) {
467 for (nlp = cyclenl[ cycleno ] . cnext; nlp; nlp = nlp -> cnext) {
469 nlp -> parentcnt = 0;
470 nlp -> flags &= ~HASCYCLEXIT;
471 for ( arcp = nlp -> parents; arcp; arcp = arcp -> arc_parentlist ) {
472 nlp -> parentcnt += 1;
473 if ( arcp -> arc_parentp -> cycleno != cycleno )
474 nlp -> flags |= HASCYCLEXIT;
477 if ( size <= cyclethreshold )
480 cyclestack = (arctype **) calloc( size + 1 , sizeof( arctype *) );
481 if ( cyclestack == 0 ) {
482 warnx("no room for %d bytes of cycle stack",
483 ( size + 1 ) * sizeof( arctype * ) );
487 if ( debug & BREAKCYCLE ) {
488 printf( "[cycleanalyze] starting cycle %d of %d, size %d\n" ,
489 cycleno , ncycle , size );
492 for ( nlp = cyclenl[ cycleno ] . cnext ; nlp ; nlp = nlp -> cnext ) {
493 stkp = &cyclestack[0];
494 nlp -> flags |= CYCLEHEAD;
495 ret = descend ( nlp , cyclestack , stkp );
496 nlp -> flags &= ~CYCLEHEAD;
501 if ( cyclecnt > 0 ) {
503 for ( clp = cyclehead ; clp ; ) {
504 endlist = &clp -> list[ clp -> size ];
505 for ( arcpp = clp -> list ; arcpp < endlist ; arcpp++ )
506 (*arcpp) -> arc_cyclecnt--;
515 if ( debug & BREAKCYCLE ) {
516 printf("%s visited %d, viable %d, newcycle %d, oldcycle %d\n",
517 "[doarcs]" , visited , viable , newcycle , oldcycle);
523 descend( node , stkstart , stkp )
531 for ( arcp = node -> children ; arcp ; arcp = arcp -> arc_childlist ) {
535 if ( arcp -> arc_childp -> cycleno != node -> cycleno
536 || ( arcp -> arc_childp -> flags & VISITED )
537 || ( arcp -> arc_flags & DEADARC ) )
543 if ( arcp -> arc_childp -> flags & CYCLEHEAD ) {
544 if ( addcycle( stkstart , stkp ) == FALSE )
548 arcp -> arc_childp -> flags |= VISITED;
549 ret = descend( arcp -> arc_childp , stkstart , stkp + 1 );
550 arcp -> arc_childp -> flags &= ~VISITED;
556 addcycle( stkstart , stkend )
569 size = stkend - stkstart + 1;
572 for ( arcpp = stkstart , minarc = *arcpp ; arcpp <= stkend ; arcpp++ ) {
573 if ( *arcpp > minarc )
578 for ( clp = cyclehead ; clp ; clp = clp -> next ) {
579 if ( clp -> size != size )
582 endlist = &clp -> list[ size ];
583 for ( arcpp = clp -> list ; arcpp < endlist ; arcpp++ ) {
584 if ( *stkp++ != *arcpp )
589 if ( arcpp == endlist ) {
597 calloc( 1 , sizeof ( cltype ) + ( size - 1 ) * sizeof( arctype * ) );
599 warnx("no room for %d bytes of subcycle storage",
600 sizeof ( cltype ) + ( size - 1 ) * sizeof( arctype * ) );
604 endlist = &clp -> list[ size ];
605 for ( arcpp = clp -> list ; arcpp < endlist ; arcpp++ ) {
606 arcp = *arcpp = *stkp++;
609 arcp -> arc_cyclecnt++;
610 if ( ( arcp -> arc_flags & ONLIST ) == 0 ) {
611 arcp -> arc_flags |= ONLIST;
612 arcp -> arc_next = archead;
617 clp -> next = cyclehead;
621 if ( debug & SUBCYCLELIST ) {
622 printsubcycle( clp );
626 if ( cyclecnt >= CYCLEMAX )
639 arctype *maxexitarcp;
640 arctype *maxwithparentarcp;
641 arctype *maxnoparentarcp;
643 int maxwithparentcnt;
647 maxwithparentcnt = 0;
649 for ( endlist = &archead , arcp = archead ; arcp ; ) {
650 if ( arcp -> arc_cyclecnt == 0 ) {
651 arcp -> arc_flags &= ~ONLIST;
652 *endlist = arcp -> arc_next;
653 arcp -> arc_next = 0;
657 if ( arcp -> arc_childp -> flags & HASCYCLEXIT ) {
658 if ( arcp -> arc_cyclecnt > maxexitcnt ||
659 ( arcp -> arc_cyclecnt == maxexitcnt &&
660 arcp -> arc_cyclecnt < maxexitarcp -> arc_count ) ) {
661 maxexitcnt = arcp -> arc_cyclecnt;
664 } else if ( arcp -> arc_childp -> parentcnt > 1 ) {
665 if ( arcp -> arc_cyclecnt > maxwithparentcnt ||
666 ( arcp -> arc_cyclecnt == maxwithparentcnt &&
667 arcp -> arc_cyclecnt < maxwithparentarcp -> arc_count ) ) {
668 maxwithparentcnt = arcp -> arc_cyclecnt;
669 maxwithparentarcp = arcp;
672 if ( arcp -> arc_cyclecnt > maxnoparentcnt ||
673 ( arcp -> arc_cyclecnt == maxnoparentcnt &&
674 arcp -> arc_cyclecnt < maxnoparentarcp -> arc_count ) ) {
675 maxnoparentcnt = arcp -> arc_cyclecnt;
676 maxnoparentarcp = arcp;
679 endlist = &arcp -> arc_next;
680 arcp = arcp -> arc_next;
682 if ( maxexitcnt > 0 ) {
684 * first choice is edge leading to node with out-of-cycle parent
686 maxarcp = maxexitarcp;
690 } else if ( maxwithparentcnt > 0 ) {
692 * second choice is edge leading to node with at least one
693 * other in-cycle parent
695 maxarcp = maxwithparentarcp;
701 * last choice is edge leading to node with only this arc as
702 * a parent (as it will now be orphaned)
704 maxarcp = maxnoparentarcp;
709 maxarcp -> arc_flags |= DEADARC;
710 maxarcp -> arc_childp -> parentcnt -= 1;
711 maxarcp -> arc_childp -> npropcall -= maxarcp -> arc_count;
713 if ( debug & BREAKCYCLE ) {
714 printf( "%s delete %s arc: %s (%d) -> %s from %d cycle(s)\n" ,
715 "[compresslist]" , type , maxarcp -> arc_parentp -> name ,
716 maxarcp -> arc_count , maxarcp -> arc_childp -> name ,
717 maxarcp -> arc_cyclecnt );
720 printf( "\t%s to %s with %d calls\n" , maxarcp -> arc_parentp -> name ,
721 maxarcp -> arc_childp -> name , maxarcp -> arc_count );
723 for ( clp = cyclehead ; clp ; ) {
724 endlist = &clp -> list[ clp -> size ];
725 for ( arcpp = clp -> list ; arcpp < endlist ; arcpp++ )
726 if ( (*arcpp) -> arc_flags & DEADARC )
728 if ( arcpp == endlist ) {
733 for ( arcpp = clp -> list ; arcpp < endlist ; arcpp++ )
734 (*arcpp) -> arc_cyclecnt--;
750 printf( "%s <cycle %d>\n" , (*arcpp) -> arc_parentp -> name ,
751 (*arcpp) -> arc_parentp -> cycleno ) ;
752 for ( endlist = &clp -> list[ clp -> size ]; arcpp < endlist ; arcpp++ )
753 printf( "\t(%d) -> %s\n" , (*arcpp) -> arc_count ,
754 (*arcpp) -> arc_childp -> name ) ;
764 for ( cycle = 1 ; cycle <= ncycle ; cycle += 1 ) {
765 cyclenlp = &cyclenl[ cycle ];
766 for ( childp = cyclenlp -> cnext ; childp ; childp = childp -> cnext ) {
767 if ( childp -> propfraction == 0.0 ) {
769 * all members have the same propfraction except those
770 * that were excluded with -E
774 cyclenlp -> time += childp -> time;
776 cyclenlp -> propself = cyclenlp -> propfraction * cyclenlp -> time;
781 * in one top to bottom pass over the topologically sorted namelist
783 * printflag as the union of parents' printflags
784 * propfraction as the sum of fractional parents' propfractions
785 * and while we're here, sum time for functions.
794 for ( index = nname-1 ; index >= 0 ; index -= 1 ) {
795 childp = topsortnlp[ index ];
797 * if we haven't done this function or cycle,
798 * inherit things from parent.
799 * this way, we are linear in the number of arcs
800 * since we do all members of a cycle (and the cycle itself)
801 * as we hit the first member of the cycle.
803 if ( childp -> cyclehead != oldhead ) {
804 oldhead = childp -> cyclehead;
805 inheritflags( childp );
808 if ( debug & PROPDEBUG ) {
809 printf( "[doflags] " );
811 printf( " inherits printflag %d and propfraction %f\n" ,
812 childp -> printflag , childp -> propfraction );
815 if ( ! childp -> printflag ) {
818 * it gets turned on by
820 * or there not being any -f list and not being on -e list.
822 if ( onlist( flist , childp -> name )
823 || ( !fflag && !onlist( elist , childp -> name ) ) ) {
824 childp -> printflag = TRUE;
828 * this function has printing parents:
829 * maybe someone wants to shut it up
830 * by putting it on -e list. (but favor -f over -e)
832 if ( ( !onlist( flist , childp -> name ) )
833 && onlist( elist , childp -> name ) ) {
834 childp -> printflag = FALSE;
837 if ( childp -> propfraction == 0.0 ) {
839 * no parents to pass time to.
840 * collect time from children if
842 * or there isn't any -F list and its not on -E list.
844 if ( onlist( Flist , childp -> name )
845 || ( !Fflag && !onlist( Elist , childp -> name ) ) ) {
846 childp -> propfraction = 1.0;
850 * it has parents to pass time to,
851 * but maybe someone wants to shut it up
852 * by puttting it on -E list. (but favor -F over -E)
854 if ( !onlist( Flist , childp -> name )
855 && onlist( Elist , childp -> name ) ) {
856 childp -> propfraction = 0.0;
859 childp -> propself = childp -> time * childp -> propfraction;
860 printtime += childp -> propself;
862 if ( debug & PROPDEBUG ) {
863 printf( "[doflags] " );
865 printf( " ends up with printflag %d and propfraction %f\n" ,
866 childp -> printflag , childp -> propfraction );
867 printf( "time %f propself %f printtime %f\n" ,
868 childp -> time , childp -> propself , printtime );
875 * check if any parent of this child
876 * (or outside parents of this cycle)
877 * have their print flags on and set the
878 * print flag of the child (cycle) appropriately.
879 * similarly, deal with propagation fractions from parents.
881 inheritflags( childp )
889 headp = childp -> cyclehead;
890 if ( childp == headp ) {
892 * just a regular child, check its parents
894 childp -> printflag = FALSE;
895 childp -> propfraction = 0.0;
896 for (arcp = childp -> parents ; arcp ; arcp = arcp -> arc_parentlist) {
897 parentp = arcp -> arc_parentp;
898 if ( childp == parentp ) {
901 childp -> printflag |= parentp -> printflag;
903 * if the child was never actually called
904 * (e.g. this arc is static (and all others are, too))
905 * no time propagates along this arc.
907 if ( arcp -> arc_flags & DEADARC ) {
910 if ( childp -> npropcall ) {
911 childp -> propfraction += parentp -> propfraction
912 * ( ( (double) arcp -> arc_count )
913 / ( (double) childp -> npropcall ) );
918 * its a member of a cycle, look at all parents from
921 headp -> printflag = FALSE;
922 headp -> propfraction = 0.0;
923 for ( memp = headp -> cnext ; memp ; memp = memp -> cnext ) {
924 for (arcp = memp->parents ; arcp ; arcp = arcp->arc_parentlist) {
925 if ( arcp -> arc_parentp -> cyclehead == headp ) {
928 parentp = arcp -> arc_parentp;
929 headp -> printflag |= parentp -> printflag;
931 * if the cycle was never actually called
932 * (e.g. this arc is static (and all others are, too))
933 * no time propagates along this arc.
935 if ( arcp -> arc_flags & DEADARC ) {
938 if ( headp -> npropcall ) {
939 headp -> propfraction += parentp -> propfraction
940 * ( ( (double) arcp -> arc_count )
941 / ( (double) headp -> npropcall ) );
945 for ( memp = headp ; memp ; memp = memp -> cnext ) {
946 memp -> printflag = headp -> printflag;
947 memp -> propfraction = headp -> propfraction;