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
d5fce3a8
Commit
d5fce3a8
authored
12 years ago
by
Richard Linden
Browse files
Options
Downloads
Patches
Plain Diff
SH-3275 WIP Run viewer metrics for object update messages
renamed some variables/methods
parent
917ed449
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
indra/llcommon/lltrace.h
+18
-23
18 additions, 23 deletions
indra/llcommon/lltrace.h
with
18 additions
and
23 deletions
indra/llcommon/lltrace.h
+
18
−
23
View file @
d5fce3a8
...
@@ -36,11 +36,6 @@
...
@@ -36,11 +36,6 @@
namespace
LLTrace
namespace
LLTrace
{
{
//TODO figure out best way to do this and proper naming convention
static
void
init
()
{
}
// one per thread per type
// one per thread per type
template
<
typename
ACCUMULATOR
>
template
<
typename
ACCUMULATOR
>
...
@@ -354,13 +349,13 @@ namespace LLTrace
...
@@ -354,13 +349,13 @@ namespace LLTrace
void
stop
()
void
stop
()
{
{
getThread
Data
()
->
deactivate
(
this
);
getThread
Tracer
()
->
deactivate
(
this
);
}
}
void
resume
()
void
resume
()
{
{
Thread
Data
*
thread_data
=
getThread
Data
();
Thread
Tracer
*
thread_data
=
getThread
Tracer
();
thread_data
->
flush
PrimarySampler
();
thread_data
->
flush
Data
();
thread_data
->
activate
(
this
);
thread_data
->
activate
(
this
);
}
}
...
@@ -380,7 +375,7 @@ namespace LLTrace
...
@@ -380,7 +375,7 @@ namespace LLTrace
private
:
private
:
// returns data for current thread
// returns data for current thread
struct
Thread
Data
*
getThread
Data
()
{
return
NULL
;
}
struct
Thread
Tracer
*
getThread
Tracer
()
{
return
NULL
;
}
AccumulatorBuffer
<
StatAccumulator
<
F32
>
>
mF32Stats
;
AccumulatorBuffer
<
StatAccumulator
<
F32
>
>
mF32Stats
;
AccumulatorBuffer
<
StatAccumulator
<
S32
>
>
mS32Stats
;
AccumulatorBuffer
<
StatAccumulator
<
S32
>
>
mS32Stats
;
...
@@ -388,9 +383,9 @@ namespace LLTrace
...
@@ -388,9 +383,9 @@ namespace LLTrace
AccumulatorBuffer
<
TimerAccumulator
>
mTimers
;
AccumulatorBuffer
<
TimerAccumulator
>
mTimers
;
};
};
struct
Thread
Data
struct
Thread
Tracer
{
{
Thread
Data
(
LLThread
&
this_thread
,
Thread
Data
&
parent_data
)
Thread
Tracer
(
LLThread
&
this_thread
,
Thread
Tracer
&
parent_data
)
:
mPrimarySampler
(
parent_data
.
mPrimarySampler
),
:
mPrimarySampler
(
parent_data
.
mPrimarySampler
),
mSharedSampler
(
parent_data
.
mSharedSampler
),
mSharedSampler
(
parent_data
.
mSharedSampler
),
mSharedSamplerMutex
(
this_thread
.
getAPRPool
()),
mSharedSamplerMutex
(
this_thread
.
getAPRPool
()),
...
@@ -400,27 +395,27 @@ namespace LLTrace
...
@@ -400,27 +395,27 @@ namespace LLTrace
parent_data
.
addChildThread
(
this
);
parent_data
.
addChildThread
(
this
);
}
}
~
Thread
Data
()
~
Thread
Tracer
()
{
{
mParent
.
removeChildThread
(
this
);
mParent
.
removeChildThread
(
this
);
}
}
void
addChildThread
(
Thread
Data
*
child
)
void
addChildThread
(
Thread
Tracer
*
child
)
{
{
mChildThread
Data
.
push_back
(
child
);
mChildThread
Tracers
.
push_back
(
child
);
}
}
void
removeChildThread
(
Thread
Data
*
child
)
void
removeChildThread
(
Thread
Tracer
*
child
)
{
{
// TODO: replace with intrusive list
// TODO: replace with intrusive list
std
::
list
<
Thread
Data
*>::
iterator
found_it
=
std
::
find
(
mChildThread
Data
.
begin
(),
mChildThread
Data
.
end
(),
child
);
std
::
list
<
Thread
Tracer
*>::
iterator
found_it
=
std
::
find
(
mChildThread
Tracers
.
begin
(),
mChildThread
Tracers
.
end
(),
child
);
if
(
found_it
!=
mChildThread
Data
.
end
())
if
(
found_it
!=
mChildThread
Tracers
.
end
())
{
{
mChildThread
Data
.
erase
(
found_it
);
mChildThread
Tracers
.
erase
(
found_it
);
}
}
}
}
void
flush
PrimarySampler
()
void
flush
Data
()
{
{
for
(
std
::
list
<
Sampler
*>::
iterator
it
=
mActiveSamplers
.
begin
(),
end_it
=
mActiveSamplers
.
end
();
for
(
std
::
list
<
Sampler
*>::
iterator
it
=
mActiveSamplers
.
begin
(),
end_it
=
mActiveSamplers
.
end
();
it
!=
end_it
;
it
!=
end_it
;
...
@@ -459,7 +454,7 @@ namespace LLTrace
...
@@ -459,7 +454,7 @@ namespace LLTrace
// call this periodically to gather stats data from children
// call this periodically to gather stats data from children
void
gatherChildData
()
void
gatherChildData
()
{
{
for
(
std
::
list
<
Thread
Data
*>::
iterator
child_it
=
mChildThread
Data
.
begin
(),
end_it
=
mChildThread
Data
.
end
();
for
(
std
::
list
<
Thread
Tracer
*>::
iterator
child_it
=
mChildThread
Tracers
.
begin
(),
end_it
=
mChildThread
Tracers
.
end
();
child_it
!=
end_it
;
child_it
!=
end_it
;
++
child_it
)
++
child_it
)
{
{
...
@@ -474,9 +469,9 @@ namespace LLTrace
...
@@ -474,9 +469,9 @@ namespace LLTrace
Sampler
mPrimarySampler
;
Sampler
mPrimarySampler
;
Thread
Data
&
mParent
;
Thread
Tracer
&
mParent
;
std
::
list
<
Sampler
*>
mActiveSamplers
;
std
::
list
<
Sampler
*>
mActiveSamplers
;
std
::
list
<
Thread
Data
*>
mChildThread
Data
;
std
::
list
<
Thread
Tracer
*>
mChildThread
Tracers
;
// TODO: add unused space here to avoid false sharing?
// TODO: add unused space here to avoid false sharing?
LLMutex
mSharedSamplerMutex
;
LLMutex
mSharedSamplerMutex
;
...
...
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