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

Diff for /src/usr.bin/gprof/lookup.c between version 1.4 and 1.5

version 1.4, 2001/11/19 19:02:14 version 1.5, 2002/03/25 16:30:55
Line 60 
Line 60 
         int     probes;          int     probes;
   
         probes = 0;          probes = 0;
 #   endif DEBUG  #   endif /* DEBUG */
     for ( low = 0 , high = nname - 1 ; low != high ; ) {      for ( low = 0 , high = nname - 1 ; low != high ; ) {
 #       ifdef DEBUG  #       ifdef DEBUG
             probes += 1;              probes += 1;
 #       endif DEBUG  #       endif /* DEBUG */
         middle = ( high + low ) >> 1;          middle = ( high + low ) >> 1;
         if ( nl[ middle ].value <= address && nl[ middle+1 ].value > address ) {          if ( nl[ middle ].value <= address && nl[ middle+1 ].value > address ) {
 #           ifdef DEBUG  #           ifdef DEBUG
                 if ( debug & LOOKUPDEBUG ) {                  if ( debug & LOOKUPDEBUG ) {
                     printf( "[nllookup] %d (%d) probes\n" , probes , nname-1 );                      printf( "[nllookup] %d (%d) probes\n" , probes , nname-1 );
                 }                  }
 #           endif DEBUG  #           endif /* DEBUG */
             return &nl[ middle ];              return &nl[ middle ];
         }          }
         if ( nl[ middle ].value > address ) {          if ( nl[ middle ].value > address ) {
Line 83 
Line 83 
 #   ifdef DEBUG  #   ifdef DEBUG
         if ( debug & LOOKUPDEBUG )          if ( debug & LOOKUPDEBUG )
             warnx("[nllookup] (%d) binary search fails", nname - 1);              warnx("[nllookup] (%d) binary search fails", nname - 1);
 #   endif DEBUG  #   endif /* DEBUG */
     return 0;      return 0;
 }  }
   
Line 103 
Line 103 
             printf( "[arclookup] parent %s child %s\n" ,              printf( "[arclookup] parent %s child %s\n" ,
                     parentp -> name , childp -> name );                      parentp -> name , childp -> name );
         }          }
 #   endif DEBUG  #   endif /* DEBUG */
     for ( arcp = parentp -> children ; arcp ; arcp = arcp -> arc_childlist ) {      for ( arcp = parentp -> children ; arcp ; arcp = arcp -> arc_childlist ) {
 #       ifdef DEBUG  #       ifdef DEBUG
             if ( debug & LOOKUPDEBUG ) {              if ( debug & LOOKUPDEBUG ) {
Line 111 
Line 111 
                         arcp -> arc_parentp -> name ,                          arcp -> arc_parentp -> name ,
                         arcp -> arc_childp -> name );                          arcp -> arc_childp -> name );
             }              }
 #       endif DEBUG  #       endif /* DEBUG */
         if ( arcp -> arc_childp == childp ) {          if ( arcp -> arc_childp == childp ) {
             return arcp;              return arcp;
         }          }

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