Skip to content
Snippets Groups Projects
Commit 2cdfb170 authored by Richard Linden's avatar Richard Linden
Browse files

SH-3275 WIP Run viewer metrics for object update messages

renamed some variables in lltrace
parent 6814906f
No related branches found
No related tags found
No related merge requests found
...@@ -51,18 +51,18 @@ namespace LLTrace ...@@ -51,18 +51,18 @@ namespace LLTrace
struct Accumulator struct Accumulator
{ {
U32 mSelfTimeCounter;
U32 mTotalTimeCounter; U32 mTotalTimeCounter;
U32 mChildTimeCounter;
U32 mCalls; U32 mCalls;
Accumulator* mParent; // info for caller timer Accumulator* mParent; // info for caller timer
Accumulator* mLastCaller; // used to bootstrap tree construction Accumulator* mLastCaller; // used to bootstrap tree construction
const BlockTimer* mTimer; // points to block timer associated with this storage const BlockTimer* mTimer; // points to block timer associated with this storage
U16 mActiveCount; // number of timers with this ID active on stack U8 mActiveCount; // number of timers with this ID active on stack
bool mMoveUpTree; // needs to be moved up the tree of timers at the end of frame bool mMoveUpTree; // needs to be moved up the tree of timers at the end of frame
std::vector<Accumulator*> mChildren; // currently assumed child timers std::vector<Accumulator*> mChildren; // currently assumed child timers
}; };
struct RecorderHead struct RecorderStackEntry
{ {
struct Recorder* mRecorder; struct Recorder* mRecorder;
Accumulator* mAccumulator; Accumulator* mAccumulator;
...@@ -72,7 +72,7 @@ namespace LLTrace ...@@ -72,7 +72,7 @@ namespace LLTrace
struct Recorder struct Recorder
{ {
LL_FORCE_INLINE Recorder(BlockTimer& block_timer) LL_FORCE_INLINE Recorder(BlockTimer& block_timer)
: mLastHead(sRecorderHead) : mLastRecorder(sCurRecorder)
{ {
mStartTime = getCPUClockCount32(); mStartTime = getCPUClockCount32();
Accumulator* accumulator = ???; // get per-thread accumulator Accumulator* accumulator = ???; // get per-thread accumulator
...@@ -81,28 +81,28 @@ namespace LLTrace ...@@ -81,28 +81,28 @@ namespace LLTrace
accumulator->mMoveUpTree |= (accumulator->mParent->mActiveCount == 0); accumulator->mMoveUpTree |= (accumulator->mParent->mActiveCount == 0);
// push new timer on stack // push new timer on stack
sRecorderHead.mRecorder = this; sCurRecorder.mRecorder = this;
sRecorderHead.mAccumulator = accumulator; sCurRecorder.mAccumulator = accumulator;
sRecorderHead.mChildTime = 0; sCurRecorder.mChildTime = 0;
} }
LL_FORCE_INLINE ~Recorder() LL_FORCE_INLINE ~Recorder()
{ {
U32 total_time = getCPUClockCount32() - mStartTime; U32 total_time = getCPUClockCount32() - mStartTime;
Accumulator* accumulator = sRecorderHead.mAccumulator; Accumulator* accumulator = sCurRecorder.mAccumulator;
accumulator->mSelfTimeCounter += total_time- sRecorderHead.mChildTime;
accumulator->mTotalTimeCounter += total_time; accumulator->mTotalTimeCounter += total_time;
accumulator->mChildTimeCounter += sCurRecorder.mChildTime;
accumulator->mActiveCount--; accumulator->mActiveCount--;
accumulator->mLastCaller = mLastHead->mAccumulator; accumulator->mLastCaller = mLastRecorder->mAccumulator;
mLastHead->mChildTime += total_time; mLastRecorder->mChildTime += total_time;
// pop stack // pop stack
sRecorderHead = mLastHead; sCurRecorder = mLastRecorder;
} }
AccumulatorHead mLastHead; RecorderStackEntry mLastRecorder;
U32 mStartTime; U32 mStartTime;
}; };
...@@ -139,10 +139,10 @@ namespace LLTrace ...@@ -139,10 +139,10 @@ namespace LLTrace
} }
const std::string mName; const std::string mName;
static RecorderHead* sRecorderHead; static RecorderStackEntry* sCurRecorder;
}; };
BlockTimer::RecorderHead BlockTimer::sRecorderHead; BlockTimer::RecorderStackEntry BlockTimer::sCurRecorder;
class TimeInterval class TimeInterval
{ {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment