changeset 60:7b799a46cc87

Added compiler switch to turn on and off debug-only probes, deleted time-junk
author Me
date Mon, 08 Nov 2010 03:57:46 -0800
parents 407f8ede98b4
children 984f7d78bfdf dd3e60aeae26
files VMS.h probes.c vmalloc.c
diffstat 3 files changed, 9 insertions(+), 37 deletions(-) [+]
line diff
     1.1 --- a/VMS.h	Sun Nov 07 06:51:34 2010 -0800
     1.2 +++ b/VMS.h	Mon Nov 08 03:57:46 2010 -0800
     1.3 @@ -33,21 +33,22 @@
     1.4     //turns on the probe-instrumentation in the application -- when not
     1.5     // defined, the calls to the probe functions turn into comments
     1.6  #define STATS__ENABLE_PROBES
     1.7 +//#define TURN_ON_DEBUG_PROBES
     1.8  
     1.9     //These defines turn types of bug messages on and off
    1.10     // be sure debug messages are un-commented (next block of defines)
    1.11 -#define dbgProbes FALSE   /* for issues inside probes themselves*/
    1.12 -#define dbgAppFlow TRUE  /* Top level flow of application code -- general*/
    1.13 -#define dbgB2BMaster FALSE/* in coreloop, back to back master VPs*/
    1.14 -#define dbgRqstHdlr FALSE /* in request handler code*/
    1.15 +#define dbgProbes    FALSE /* for issues inside probes themselves*/
    1.16 +#define dbgAppFlow   FALSE /* Top level flow of application code -- general*/
    1.17 +#define dbgB2BMaster FALSE /* in coreloop, back to back master VPs*/
    1.18 +#define dbgRqstHdlr  FALSE /* in request handler code*/
    1.19  
    1.20     //Comment or un- the substitute half to turn on/off types of debug message
    1.21  #define DEBUG(  bool, msg)         \
    1.22 -   if( bool){ printf(msg); fflush(stdin);}
    1.23 +//   if( bool){ printf(msg); fflush(stdin);}
    1.24  #define DEBUG1( bool, msg, param)  \
    1.25 -   if(bool){printf(msg, param); fflush(stdin);}
    1.26 +//   if(bool){printf(msg, param); fflush(stdin);}
    1.27  #define DEBUG2( bool, msg, p1, p2) \
    1.28 -   //if(bool) {printf(msg, p1, p2); fflush(stdin);}
    1.29 +//   if(bool) {printf(msg, p1, p2); fflush(stdin);}
    1.30  
    1.31  #define ERROR(msg) printf(msg); fflush(stdin);
    1.32  #define ERROR1(msg, param) printf(msg, param); fflush(stdin);
     2.1 --- a/probes.c	Sun Nov 07 06:51:34 2010 -0800
     2.2 +++ b/probes.c	Mon Nov 08 03:57:46 2010 -0800
     2.3 @@ -91,7 +91,6 @@
     2.4      }
     2.5   }
     2.6  #else
     2.7 -#ifdef STATS__USE_DBL_PROBES
     2.8  
     2.9  /*
    2.10   * In practice, probe operations are called from the app, from inside slaves
    2.11 @@ -353,31 +352,3 @@
    2.12     fflush( stdout );
    2.13   }
    2.14  #endif
    2.15 -#endif
    2.16 -
    2.17 -/* Junk left over from when trying the different ways to get time stamps..
    2.18 -         struct timeval tim;
    2.19 -         gettimeofday(&tim, NULL);
    2.20 -         double t1=tim.tv_sec+(tim.tv_usec/1000000.0);
    2.21 -
    2.22 -         clock_t startClockStamp = clock();
    2.23 -
    2.24 -         TSCount startMultStamp = getTSCount();
    2.25 -*/
    2.26 -
    2.27 -/*
    2.28 -         TSCount endMultStamp = getTSCount();
    2.29 -
    2.30 -         dividerParams->numTSCsToExe = endMultStamp - startMultStamp;
    2.31 -         printf("\ntime to execute: %d\n", endMultStamp - startMultStamp);
    2.32 -
    2.33 -         //==================================================================
    2.34 -         clock_t endClockStamp = clock();
    2.35 -         printf("%.4lf seconds of processing\n",
    2.36 -                (endClockStamp - startClockStamp)/(double)CLOCKS_PER_SEC);
    2.37 -
    2.38 -         //==================================================================
    2.39 -         gettimeofday(&tim, NULL);
    2.40 -         double t2=tim.tv_sec+(tim.tv_usec/1000000.0);
    2.41 -         printf("%.6lf seconds elapsed\n", t2-t1);
    2.42 -*/
     3.1 --- a/vmalloc.c	Sun Nov 07 06:51:34 2010 -0800
     3.2 +++ b/vmalloc.c	Mon Nov 08 03:57:46 2010 -0800
     3.3 @@ -68,7 +68,7 @@
     3.4  
     3.5     if( foundElem == NULL )
     3.6      { ERROR("\nmalloc failed\n")
     3.7 -      return NULL;  //indicates malloc failed
     3.8 +      return (void *)NULL;  //indicates malloc failed
     3.9      }
    3.10        //Using a kludge to identify the element that is the top chunk in the
    3.11        // heap -- saving top-of-heap addr in head's nextHigherInMem -- and