303 304 // add to the list of all perf data items 305 _all->append(p); 306 307 if (p->variability() == PerfData::V_Constant) { 308 if (_constants == NULL) { 309 _constants = new PerfDataList(25); 310 } 311 _constants->append(p); 312 return; 313 } 314 315 if (sampled) { 316 if (_sampled == NULL) { 317 _sampled = new PerfDataList(25); 318 } 319 _sampled->append(p); 320 } 321 } 322 323 PerfDataList* PerfDataManager::all() { 324 325 MutexLocker ml(PerfDataManager_lock); 326 327 if (_all == NULL) 328 return NULL; 329 330 PerfDataList* clone = _all->clone(); 331 return clone; 332 } 333 334 PerfDataList* PerfDataManager::sampled() { 335 336 MutexLocker ml(PerfDataManager_lock); 337 338 if (_sampled == NULL) 339 return NULL; 340 341 PerfDataList* clone = _sampled->clone(); 342 return clone; | 303 304 // add to the list of all perf data items 305 _all->append(p); 306 307 if (p->variability() == PerfData::V_Constant) { 308 if (_constants == NULL) { 309 _constants = new PerfDataList(25); 310 } 311 _constants->append(p); 312 return; 313 } 314 315 if (sampled) { 316 if (_sampled == NULL) { 317 _sampled = new PerfDataList(25); 318 } 319 _sampled->append(p); 320 } 321 } 322 323 PerfData* PerfDataManager::find_by_name(const char* name) { 324 return _all->find_by_name(name); 325 } 326 327 PerfDataList* PerfDataManager::all() { 328 329 MutexLocker ml(PerfDataManager_lock); 330 331 if (_all == NULL) 332 return NULL; 333 334 PerfDataList* clone = _all->clone(); 335 return clone; 336 } 337 338 PerfDataList* PerfDataManager::sampled() { 339 340 MutexLocker ml(PerfDataManager_lock); 341 342 if (_sampled == NULL) 343 return NULL; 344 345 PerfDataList* clone = _sampled->clone(); 346 return clone; |