Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Alchemy Viewer
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Package registry
Operate
Terraform modules
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Silent mode is enabled
All outbound communications are blocked.
Learn more
.
Show more breadcrumbs
Alchemy Viewer
Alchemy Viewer
Commits
b9c78533
Commit
b9c78533
authored
12 years ago
by
Richard Linden
Browse files
Options
Downloads
Patches
Plain Diff
separated RecordingBuffers from Recording to make active recording stack more safe (part 2)
parent
24a1ceb2
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
indra/llcommon/lltracethreadrecorder.cpp
+9
-17
9 additions, 17 deletions
indra/llcommon/lltracethreadrecorder.cpp
indra/llcommon/lltracethreadrecorder.h
+3
-3
3 additions, 3 deletions
indra/llcommon/lltracethreadrecorder.h
with
12 additions
and
20 deletions
indra/llcommon/lltracethreadrecorder.cpp
+
9
−
17
View file @
b9c78533
...
...
@@ -118,7 +118,7 @@ ThreadRecorder::active_recording_list_t::iterator ThreadRecorder::update( Record
if
(
next_it
!=
mActiveRecordings
.
end
())
{
// ...push our gathered data down to it
(
*
next_it
)
->
mPartialRecording
.
append
Recording
((
*
it
)
->
mPartialRecording
);
(
*
next_it
)
->
mPartialRecording
.
append
Buffers
((
*
it
)
->
mPartialRecording
);
}
// copy accumulated measurements into result buffer and clear accumulator (mPartialRecording)
...
...
@@ -171,16 +171,8 @@ ThreadRecorder::ActiveRecording::ActiveRecording( Recording* target )
void
ThreadRecorder
::
ActiveRecording
::
moveBaselineToTarget
()
{
mTargetRecording
->
mMeasurementsFloat
.
write
()
->
addSamples
(
*
mPartialRecording
.
mMeasurementsFloat
);
mTargetRecording
->
mCountsFloat
.
write
()
->
addSamples
(
*
mPartialRecording
.
mCountsFloat
);
mTargetRecording
->
mMeasurements
.
write
()
->
addSamples
(
*
mPartialRecording
.
mMeasurements
);
mTargetRecording
->
mCounts
.
write
()
->
addSamples
(
*
mPartialRecording
.
mCounts
);
mTargetRecording
->
mStackTimers
.
write
()
->
addSamples
(
*
mPartialRecording
.
mStackTimers
);
mPartialRecording
.
mMeasurementsFloat
.
write
()
->
reset
();
mPartialRecording
.
mCountsFloat
.
write
()
->
reset
();
mPartialRecording
.
mMeasurements
.
write
()
->
reset
();
mPartialRecording
.
mCounts
.
write
()
->
reset
();
mPartialRecording
.
mStackTimers
.
write
()
->
reset
();
mTargetRecording
->
appendBuffers
(
mPartialRecording
);
mPartialRecording
.
resetBuffers
();
}
...
...
@@ -220,16 +212,16 @@ void SlaveThreadRecorder::SharedData::appendTo( Recording& sink )
sink
.
appendRecording
(
mRecording
);
}
void
SlaveThreadRecorder
::
SharedData
::
mergeFrom
(
const
Recording
&
source
)
void
SlaveThreadRecorder
::
SharedData
::
mergeFrom
(
const
Recording
Buffers
&
source
)
{
LLMutexLock
lock
(
&
mRecordingMutex
);
mRecording
.
merge
Recording
(
source
);
mRecording
.
merge
Buffers
(
source
);
}
void
SlaveThreadRecorder
::
SharedData
::
mergeTo
(
Recording
&
sink
)
void
SlaveThreadRecorder
::
SharedData
::
mergeTo
(
Recording
Buffers
&
sink
)
{
LLMutexLock
lock
(
&
mRecordingMutex
);
sink
.
merge
Recording
(
mRecording
);
sink
.
merge
Buffers
(
mRecording
);
}
void
SlaveThreadRecorder
::
SharedData
::
reset
()
...
...
@@ -251,13 +243,13 @@ void MasterThreadRecorder::pullFromSlaveThreads()
LLMutexLock
lock
(
&
mSlaveListMutex
);
Recording
&
target_recording
=
mActiveRecordings
.
front
()
->
mPartialRecording
;
Recording
Buffers
&
target_recording
_buffers
=
mActiveRecordings
.
front
()
->
mPartialRecording
;
for
(
slave_thread_recorder_list_t
::
iterator
it
=
mSlaveThreadRecorders
.
begin
(),
end_it
=
mSlaveThreadRecorders
.
end
();
it
!=
end_it
;
++
it
)
{
// ignore block timing info for now
(
*
it
)
->
mSharedData
.
mergeTo
(
target_recording
);
(
*
it
)
->
mSharedData
.
mergeTo
(
target_recording
_buffers
);
(
*
it
)
->
mSharedData
.
reset
();
}
}
...
...
This diff is collapsed.
Click to expand it.
indra/llcommon/lltracethreadrecorder.h
+
3
−
3
View file @
b9c78533
...
...
@@ -59,7 +59,7 @@ namespace LLTrace
ActiveRecording
(
Recording
*
target
);
Recording
*
mTargetRecording
;
Recording
mPartialRecording
;
Recording
Buffers
mPartialRecording
;
void
moveBaselineToTarget
();
};
...
...
@@ -111,8 +111,8 @@ namespace LLTrace
public:
void
appendFrom
(
const
Recording
&
source
);
void
appendTo
(
Recording
&
sink
);
void
mergeFrom
(
const
Recording
&
source
);
void
mergeTo
(
Recording
&
sink
);
void
mergeFrom
(
const
Recording
Buffers
&
source
);
void
mergeTo
(
Recording
Buffers
&
sink
);
void
reset
();
private:
LLMutex
mRecordingMutex
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment