comparison probes.c @ 53:42dd44df1bb0

Init changed to only use VMS__malloc & uses VMS__malloc versions of utilities
author Me
date Mon, 01 Nov 2010 21:21:32 -0700
parents f59cfa31a579
children f8508572f3de
comparison
equal deleted inserted replaced
1:3a0026f3a65e 2:9c74727f79a0
29 29
30 30
31 31
32 //==================== Probes ================= 32 //==================== Probes =================
33 #ifdef STATS__USE_TSC_PROBES 33 #ifdef STATS__USE_TSC_PROBES
34 int32
35 VMS__create_single_interval_probe( char *nameStr )
36 { IntervalProbe *newProbe;
37 int32 idx;
38
39 newProbe = malloc( sizeof(IntervalProbe) );
40 newProbe->nameStr = nameStr; //caller frees if not constant on stack
41 newProbe->hist = NULL;
42 idx = addToDynArray( newProbe, _VMSMasterEnv->dynIntervalProbesInfo );
43 return idx;
44 }
45 34
46 int32 35 int32
47 VMS__create_histogram_probe( int32 numBins, float32 startValue, 36 VMS__create_histogram_probe( int32 numBins, float32 startValue,
48 float32 binWidth, char *nameStr ) 37 float32 binWidth, char *nameStr )
49 { IntervalProbe *newProbe; 38 { IntervalProbe *newProbe;
129 reqData.reqType = createProbe; 118 reqData.reqType = createProbe;
130 reqData.nameStr = nameStr; 119 reqData.nameStr = nameStr;
131 120
132 VMS__send_VMSSem_request( &reqData, animPr ); 121 VMS__send_VMSSem_request( &reqData, animPr );
133 122
134 return animPr->dataReturnedFromReq; 123 return animPr->dataRetFromReq;
135 } 124 }
136 125
137 /*Use this version from outside VMS -- it uses external malloc, and modifies 126 /*Use this version from outside VMS -- it uses external malloc, and modifies
138 * dynamic array, so can't be animated in a slave VP 127 * dynamic array, so can't be animated in a slave VP
139 */ 128 */
152 addToDynArray( newProbe, _VMSMasterEnv->dynIntervalProbesInfo ); 141 addToDynArray( newProbe, _VMSMasterEnv->dynIntervalProbesInfo );
153 142
154 return newProbe; 143 return newProbe;
155 } 144 }
156 145
157 int32 146
158 VMS_impl__record_time_point_into_new_probe( char *nameStr, VirtProcr *animPr ) 147 /*Only call from inside master or main startup/shutdown thread
148 */
149 void
150 VMS_impl__free_probe( IntervalProbe *probe )
151 { if( probe->hist != NULL ) freeDblHist( probe->hist );
152 if( probe->nameStr != NULL) VMS__free( probe->nameStr );
153 VMS__free( probe );
154 }
155
156
157 int32
158 VMS_impl__record_time_point_into_new_probe( char *nameStr, VirtProcr *animPr)
159 { IntervalProbe *newProbe; 159 { IntervalProbe *newProbe;
160 struct timeval *startStamp; 160 struct timeval *startStamp;
161 float64 startSecs; 161 float64 startSecs;
162 162
163 newProbe = create_generic_probe( nameStr, animPr ); 163 newProbe = create_generic_probe( nameStr, animPr );
241 241
242 probe = _VMSMasterEnv->intervalProbes[ probeID ]; 242 probe = _VMSMasterEnv->intervalProbes[ probeID ];
243 probe->schedChoiceWasRecorded = TRUE; 243 probe->schedChoiceWasRecorded = TRUE;
244 probe->coreNum = animatingPr->coreAnimatedBy; 244 probe->coreNum = animatingPr->coreAnimatedBy;
245 probe->procrID = animatingPr->procrID; 245 probe->procrID = animatingPr->procrID;
246 probe->procrCreateSecs = 0; 246 probe->procrCreateSecs = animatingPr->createPtInSecs;
247 } 247 }
248 248
249 /*Everything is local to the animating procr, so no need for request, do 249 /*Everything is local to the animating procr, so no need for request, do
250 * work locally, in the anim Pr 250 * work locally, in the anim Pr
251 */ 251 */