[BACK]Return to arcs.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / gprof

Diff for /src/usr.bin/gprof/arcs.c between version 1.5 and 1.6

version 1.5, 2001/11/19 19:02:14 version 1.6, 2002/03/25 16:30:55
Line 67 
Line 67 
             printf( "[addarc] %d arcs from %s to %s\n" ,              printf( "[addarc] %d arcs from %s to %s\n" ,
                     count , parentp -> name , childp -> name );                      count , parentp -> name , childp -> name );
         }          }
 #   endif DEBUG  #   endif /* DEBUG */
     arcp = arclookup( parentp , childp );      arcp = arclookup( parentp , childp );
     if ( arcp != 0 ) {      if ( arcp != 0 ) {
             /*              /*
Line 78 
Line 78 
                 printf( "[tally] hit %d += %d\n" ,                  printf( "[tally] hit %d += %d\n" ,
                         arcp -> arc_count , count );                          arcp -> arc_count , count );
             }              }
 #       endif DEBUG  #       endif /* DEBUG */
         arcp -> arc_count += count;          arcp -> arc_count += count;
         return;          return;
     }      }
Line 179 
Line 179 
             if ( debug & BREAKCYCLE ) {              if ( debug & BREAKCYCLE ) {
                 printf("[doarcs] pass %d, cycle(s) %d\n" , pass , ncycle );                  printf("[doarcs] pass %d, cycle(s) %d\n" , pass , ncycle );
             }              }
 #       endif DEBUG  #       endif /* DEBUG */
         if ( pass == 1 ) {          if ( pass == 1 ) {
             printf( "\n\n%s %s\n%s %d:\n" ,              printf( "\n\n%s %s\n%s %d:\n" ,
                 "The following arcs were deleted" ,                  "The following arcs were deleted" ,
Line 222 
Line 222 
                 printf( "\n" );                  printf( "\n" );
             }              }
         }          }
 #   endif DEBUG  #   endif /* DEBUG */
         /*          /*
          *      starting from the topological top,           *      starting from the topological top,
          *      propagate print flags to children.           *      propagate print flags to children.
Line 352 
Line 352 
                 printname( parentp );                  printname( parentp );
                 printf( "\n[dotime] share %f\n" , share );                  printf( "\n[dotime] share %f\n" , share );
             }              }
 #       endif DEBUG  #       endif /* DEBUG */
     }      }
 }  }
   
Line 419 
Line 419 
                 printname( nlp );                  printname( nlp );
                 printf( " is the head of cycle %d\n" , cycle );                  printf( " is the head of cycle %d\n" , cycle );
             }              }
 #       endif DEBUG  #       endif /* DEBUG */
             /*              /*
              *  link members to cycle header               *  link members to cycle header
              */               */
Line 495 
Line 495 
                 printf( "[cycleanalyze] starting cycle %d of %d, size %d\n" ,                  printf( "[cycleanalyze] starting cycle %d of %d, size %d\n" ,
                     cycleno , ncycle , size );                      cycleno , ncycle , size );
             }              }
 #       endif DEBUG  #       endif /* DEBUG */
         for ( nlp = cyclenl[ cycleno ] . cnext ; nlp ; nlp = nlp -> cnext ) {          for ( nlp = cyclenl[ cycleno ] . cnext ; nlp ; nlp = nlp -> cnext ) {
             stkp = &cyclestack[0];              stkp = &cyclestack[0];
             nlp -> flags |= CYCLEHEAD;              nlp -> flags |= CYCLEHEAD;
Line 523 
Line 523 
             printf("%s visited %d, viable %d, newcycle %d, oldcycle %d\n",              printf("%s visited %d, viable %d, newcycle %d, oldcycle %d\n",
                 "[doarcs]" , visited , viable , newcycle , oldcycle);                  "[doarcs]" , visited , viable , newcycle , oldcycle);
         }          }
 #   endif DEBUG  #   endif /* DEBUG */
     return (done);      return (done);
 }  }
   
Line 539 
Line 539 
     for ( arcp = node -> children ; arcp ; arcp = arcp -> arc_childlist ) {      for ( arcp = node -> children ; arcp ; arcp = arcp -> arc_childlist ) {
 #       ifdef DEBUG  #       ifdef DEBUG
             visited++;              visited++;
 #       endif DEBUG  #       endif /* DEBUG */
         if ( arcp -> arc_childp -> cycleno != node -> cycleno          if ( arcp -> arc_childp -> cycleno != node -> cycleno
             || ( arcp -> arc_childp -> flags & VISITED )              || ( arcp -> arc_childp -> flags & VISITED )
             || ( arcp -> arc_flags & DEADARC ) )              || ( arcp -> arc_flags & DEADARC ) )
             continue;              continue;
 #       ifdef DEBUG  #       ifdef DEBUG
             viable++;              viable++;
 #       endif DEBUG  #       endif /* DEBUG */
         *stkp = arcp;          *stkp = arcp;
         if ( arcp -> arc_childp -> flags & CYCLEHEAD ) {          if ( arcp -> arc_childp -> flags & CYCLEHEAD ) {
             if ( addcycle( stkstart , stkp ) == FALSE )              if ( addcycle( stkstart , stkp ) == FALSE )
Line 599 
Line 599 
         if ( arcpp == endlist ) {          if ( arcpp == endlist ) {
 #           ifdef DEBUG  #           ifdef DEBUG
                 oldcycle++;                  oldcycle++;
 #           endif DEBUG  #           endif /* DEBUG */
             return( TRUE );              return( TRUE );
         }          }
     }      }
Line 631 
Line 631 
         if ( debug & SUBCYCLELIST ) {          if ( debug & SUBCYCLELIST ) {
             printsubcycle( clp );              printsubcycle( clp );
         }          }
 #   endif DEBUG  #   endif /* DEBUG */
     cyclecnt++;      cyclecnt++;
     if ( cyclecnt >= CYCLEMAX )      if ( cyclecnt >= CYCLEMAX )
         return( FALSE );          return( FALSE );
Line 700 
Line 700 
         maxarcp = maxexitarcp;          maxarcp = maxexitarcp;
 #       ifdef DEBUG  #       ifdef DEBUG
             type = "exit";              type = "exit";
 #       endif DEBUG  #       endif /* DEBUG */
     } else if ( maxwithparentcnt > 0 ) {      } else if ( maxwithparentcnt > 0 ) {
         /*          /*
          *      second choice is edge leading to node with at least one           *      second choice is edge leading to node with at least one
Line 709 
Line 709 
         maxarcp = maxwithparentarcp;          maxarcp = maxwithparentarcp;
 #       ifdef DEBUG  #       ifdef DEBUG
             type = "internal";              type = "internal";
 #       endif DEBUG  #       endif /* DEBUG */
     } else {      } else {
         /*          /*
          *      last choice is edge leading to node with only this arc as           *      last choice is edge leading to node with only this arc as
Line 718 
Line 718 
         maxarcp = maxnoparentarcp;          maxarcp = maxnoparentarcp;
 #       ifdef DEBUG  #       ifdef DEBUG
             type = "orphan";              type = "orphan";
 #       endif DEBUG  #       endif /* DEBUG */
     }      }
     maxarcp -> arc_flags |= DEADARC;      maxarcp -> arc_flags |= DEADARC;
     maxarcp -> arc_childp -> parentcnt -= 1;      maxarcp -> arc_childp -> parentcnt -= 1;
Line 730 
Line 730 
                 maxarcp -> arc_parentp -> name, maxarcp -> arc_count,                  maxarcp -> arc_parentp -> name, maxarcp -> arc_count,
                 maxarcp -> arc_childp -> name, maxarcp -> arc_cyclecnt);                  maxarcp -> arc_childp -> name, maxarcp -> arc_cyclecnt);
         }          }
 #   endif DEBUG  #   endif /* DEBUG */
     printf("\t%s to %s with %ld calls\n", maxarcp->arc_parentp -> name,      printf("\t%s to %s with %ld calls\n", maxarcp->arc_parentp -> name,
         maxarcp->arc_childp->name, maxarcp->arc_count);          maxarcp->arc_childp->name, maxarcp->arc_count);
     prev = &cyclehead;      prev = &cyclehead;
Line 827 
Line 827 
                 printf( " inherits printflag %d and propfraction %f\n" ,                  printf( " inherits printflag %d and propfraction %f\n" ,
                         childp -> printflag , childp -> propfraction );                          childp -> printflag , childp -> propfraction );
             }              }
 #       endif DEBUG  #       endif /* DEBUG */
         if ( ! childp -> printflag ) {          if ( ! childp -> printflag ) {
                 /*                  /*
                  *      printflag is off                   *      printflag is off
Line 883 
Line 883 
                 printf( "time %f propself %f printtime %f\n" ,                  printf( "time %f propself %f printtime %f\n" ,
                         childp -> time , childp -> propself , printtime );                          childp -> time , childp -> propself , printtime );
             }              }
 #       endif DEBUG  #       endif /* DEBUG */
     }      }
 }  }
   

Legend:
Removed from v.1.5  
changed lines
  Added in v.1.6