diff probes.c @ 57:85b731b290f8

Merge between VCilk and SSR intermediate Nov 4
author Me
date Thu, 04 Nov 2010 18:27:27 -0700
parents 42dd44df1bb0
children 3bac84e4e56e
line diff
     1.1 --- a/probes.c	Thu Nov 04 17:57:39 2010 -0700
     1.2 +++ b/probes.c	Thu Nov 04 18:27:27 2010 -0700
     1.3 @@ -31,17 +31,6 @@
     1.4  
     1.5  //====================  Probes =================
     1.6  #ifdef STATS__USE_TSC_PROBES
     1.7 -int32
     1.8 -VMS__create_single_interval_probe( char *nameStr )
     1.9 - { IntervalProbe *newProbe;
    1.10 -   int32 idx;
    1.11 -
    1.12 -   newProbe = malloc( sizeof(IntervalProbe) );
    1.13 -   newProbe->nameStr = nameStr;  //caller frees if not constant on stack
    1.14 -   newProbe->hist = NULL;
    1.15 -   idx = addToDynArray( newProbe, _VMSMasterEnv->dynIntervalProbesInfo );
    1.16 -   return idx;
    1.17 - }
    1.18  
    1.19  int32
    1.20  VMS__create_histogram_probe( int32 numBins, float32 startValue,
    1.21 @@ -131,7 +120,7 @@
    1.22  
    1.23     VMS__send_VMSSem_request( &reqData, animPr );
    1.24  
    1.25 -   return animPr->dataReturnedFromReq;
    1.26 +   return animPr->dataRetFromReq;
    1.27   }
    1.28  
    1.29  /*Use this version from outside VMS -- it uses external malloc, and modifies
    1.30 @@ -154,8 +143,19 @@
    1.31     return newProbe;
    1.32   }
    1.33  
    1.34 +
    1.35 +/*Only call from inside master or main startup/shutdown thread
    1.36 + */
    1.37 +void
    1.38 +VMS_impl__free_probe( IntervalProbe *probe )
    1.39 + { if( probe->hist != NULL )   freeDblHist( probe->hist );
    1.40 +   if( probe->nameStr != NULL) VMS__free( probe->nameStr );
    1.41 +   VMS__free( probe );
    1.42 + }
    1.43 +
    1.44 +
    1.45  int32
    1.46 -VMS_impl__record_time_point_into_new_probe( char *nameStr, VirtProcr *animPr )
    1.47 +VMS_impl__record_time_point_into_new_probe( char *nameStr, VirtProcr *animPr)
    1.48   { IntervalProbe *newProbe;
    1.49     struct timeval *startStamp;
    1.50     float64 startSecs;
    1.51 @@ -243,7 +243,7 @@
    1.52     probe->schedChoiceWasRecorded = TRUE;
    1.53     probe->coreNum = animatingPr->coreAnimatedBy;
    1.54     probe->procrID = animatingPr->procrID;
    1.55 -   probe->procrCreateSecs = 0;
    1.56 +   probe->procrCreateSecs = animatingPr->createPtInSecs;
    1.57   }
    1.58  
    1.59  /*Everything is local to the animating procr, so no need for request, do
    1.60 @@ -253,6 +253,7 @@
    1.61  VMS_impl__record_interval_start_in_probe( int32 probeID )
    1.62   { IntervalProbe *probe;
    1.63  
    1.64 +         DEBUG_MSG( dbgProbes, "record start of interval\n" )
    1.65     probe = _VMSMasterEnv->intervalProbes[ probeID ];
    1.66     gettimeofday( &(probe->startStamp), NULL );
    1.67   }
    1.68 @@ -265,8 +266,9 @@
    1.69  VMS_impl__record_interval_end_in_probe( int32 probeID )
    1.70   { IntervalProbe *probe;
    1.71     struct timeval *endStamp, *startStamp;
    1.72 -   double startSecs, endSecs;
    1.73 +   float64 startSecs, endSecs;
    1.74  
    1.75 +         DEBUG_MSG( dbgProbes, "record end of interval\n" )
    1.76        //possible seg-fault if array resized by diff core right after this
    1.77        // one gets probe..?  Something like that?  Might be safe.. don't care
    1.78     probe = _VMSMasterEnv->intervalProbes[ probeID ];