summaryrefslogtreecommitdiff
path: root/indra/llcommon/lltraceaccumulators.h
diff options
context:
space:
mode:
authorPtolemy <ptolemy@lindenlab.com>2021-10-29 15:11:42 -0700
committerPtolemy <ptolemy@lindenlab.com>2021-10-29 15:11:42 -0700
commit1be8a8d10bd3542b0b5c2943a508509c5cfcf3ef (patch)
treea4bd2bdddb24ae0b443878b0337e77787d3fea40 /indra/llcommon/lltraceaccumulators.h
parent61bca72d37f695ee15897ddc3b9215c969ecf648 (diff)
parent68b75be652575ff301172b7b19522d4f0494bdf0 (diff)
Fix merge conflict
Diffstat (limited to 'indra/llcommon/lltraceaccumulators.h')
-rw-r--r--indra/llcommon/lltraceaccumulators.h19
1 files changed, 16 insertions, 3 deletions
diff --git a/indra/llcommon/lltraceaccumulators.h b/indra/llcommon/lltraceaccumulators.h
index 8eb5338a2a..b183fcd14a 100644
--- a/indra/llcommon/lltraceaccumulators.h
+++ b/indra/llcommon/lltraceaccumulators.h
@@ -66,6 +66,7 @@ namespace LLTrace
: mStorageSize(0),
mStorage(NULL)
{
+ LL_PROFILE_ZONE_SCOPED;
const AccumulatorBuffer& other = *getDefaultBuffer();
resize(sNextStorageSlot);
for (S32 i = 0; i < sNextStorageSlot; i++)
@@ -76,6 +77,7 @@ namespace LLTrace
~AccumulatorBuffer()
{
+ LL_PROFILE_ZONE_SCOPED;
if (isCurrent())
{
LLThreadLocalSingletonPointer<ACCUMULATOR>::setInstance(NULL);
@@ -98,6 +100,7 @@ namespace LLTrace
: mStorageSize(0),
mStorage(NULL)
{
+ LL_PROFILE_ZONE_SCOPED;
resize(sNextStorageSlot);
for (S32 i = 0; i < sNextStorageSlot; i++)
{
@@ -107,6 +110,7 @@ namespace LLTrace
void addSamples(const AccumulatorBuffer<ACCUMULATOR>& other, EBufferAppendType append_type)
{
+ LL_PROFILE_ZONE_SCOPED;
llassert(mStorageSize >= sNextStorageSlot && other.mStorageSize >= sNextStorageSlot);
for (size_t i = 0; i < sNextStorageSlot; i++)
{
@@ -116,6 +120,7 @@ namespace LLTrace
void copyFrom(const AccumulatorBuffer<ACCUMULATOR>& other)
{
+ LL_PROFILE_ZONE_SCOPED;
llassert(mStorageSize >= sNextStorageSlot && other.mStorageSize >= sNextStorageSlot);
for (size_t i = 0; i < sNextStorageSlot; i++)
{
@@ -125,6 +130,7 @@ namespace LLTrace
void reset(const AccumulatorBuffer<ACCUMULATOR>* other = NULL)
{
+ LL_PROFILE_ZONE_SCOPED;
llassert(mStorageSize >= sNextStorageSlot);
for (size_t i = 0; i < sNextStorageSlot; i++)
{
@@ -134,6 +140,7 @@ namespace LLTrace
void sync(F64SecondsImplicit time_stamp)
{
+ LL_PROFILE_ZONE_SCOPED;
llassert(mStorageSize >= sNextStorageSlot);
for (size_t i = 0; i < sNextStorageSlot; i++)
{
@@ -153,12 +160,13 @@ namespace LLTrace
static void clearCurrent()
{
- LLThreadLocalSingletonPointer<ACCUMULATOR>::setInstance(NULL);
+ LLThreadLocalSingletonPointer<ACCUMULATOR>::setInstance(NULL);
}
// NOTE: this is not thread-safe. We assume that slots are reserved in the main thread before any child threads are spawned
size_t reserveSlot()
{
+ LL_PROFILE_ZONE_SCOPED;
size_t next_slot = sNextStorageSlot++;
if (next_slot >= mStorageSize)
{
@@ -172,6 +180,7 @@ namespace LLTrace
void resize(size_t new_size)
{
+ LL_PROFILE_ZONE_SCOPED;
if (new_size <= mStorageSize) return;
ACCUMULATOR* old_storage = mStorage;
@@ -212,6 +221,7 @@ namespace LLTrace
static self_t* getDefaultBuffer()
{
+ LL_PROFILE_ZONE_SCOPED;
static bool sInitialized = false;
if (!sInitialized)
{
@@ -326,6 +336,7 @@ namespace LLTrace
void sample(F64 value)
{
+ LL_PROFILE_ZONE_SCOPED;
F64SecondsImplicit time_stamp = LLTimer::getTotalSeconds();
// store effect of last value
@@ -444,9 +455,9 @@ namespace LLTrace
S32 mNumSamples;
};
- class TimeBlockAccumulator
+ class alignas(32) TimeBlockAccumulator
{
- public:
+ public:
typedef F64Seconds value_t;
static F64Seconds getDefaultValue() { return F64Seconds(0); }
@@ -539,6 +550,7 @@ namespace LLTrace
void addSamples(const MemAccumulator& other, EBufferAppendType append_type)
{
+ LL_PROFILE_ZONE_SCOPED;
mAllocations.addSamples(other.mAllocations, append_type);
mDeallocations.addSamples(other.mDeallocations, append_type);
@@ -557,6 +569,7 @@ namespace LLTrace
void reset(const MemAccumulator* other)
{
+ LL_PROFILE_ZONE_SCOPED;
mSize.reset(other ? &other->mSize : NULL);
mAllocations.reset(other ? &other->mAllocations : NULL);
mDeallocations.reset(other ? &other->mDeallocations : NULL);