Stop profiling for an item
| 342 | |
| 343 | // Stop profiling for an item |
| 344 | void CProfilerImpl::Exit( SProfileItemHandle handle ) |
| 345 | { |
| 346 | DAEDALUS_ASSERT( handle.Handle < mItems.size(), "Invalid handle!" ); |
| 347 | DAEDALUS_ASSERT( mActiveCallstacks.size() == mActiveItems.size(), "Why are there different numbers of callstacks/items?" ); |
| 348 | |
| 349 | u64 now = GetNow(); |
| 350 | CProfileItem * item = mItems[ handle.Handle ]; |
| 351 | |
| 352 | if( !mActiveItems.empty() ) |
| 353 | { |
| 354 | if( item == mActiveItems.back() ) |
| 355 | { |
| 356 | CProfileCallstack * callstack = mActiveCallstacks.back(); |
| 357 | mActiveItems.pop_back(); |
| 358 | mActiveCallstacks.pop_back(); |
| 359 | |
| 360 | callstack->StopTiming( now ); |
| 361 | } |
| 362 | else |
| 363 | { |
| 364 | DAEDALUS_ERROR( "Popping the wrong item" ); |
| 365 | } |
| 366 | } |
| 367 | else |
| 368 | { |
| 369 | DAEDALUS_ERROR( "Item stack underflow" ); |
| 370 | } |
| 371 | |
| 372 | DAEDALUS_ASSERT( mActiveCallstacks.size() == mActiveItems.size(), "Why are there different numbers of callstacks/items?" ); |
| 373 | } |
| 374 | |
| 375 | void CProfileCallstack::Reset() |
| 376 | { |
no test coverage detected