From 1b68f71348ecf3983b76b40d7940da8377f049b7 Mon Sep 17 00:00:00 2001 From: Andrey Lihatskiy Date: Mon, 29 Apr 2024 07:43:28 +0300 Subject: #824 Process source files in bulk: replace tabs with spaces, convert CRLF to LF, and trim trailing whitespaces as needed --- indra/llcommon/lltrace.h | 222 +++++++++++++++++++++++------------------------ 1 file changed, 111 insertions(+), 111 deletions(-) (limited to 'indra/llcommon/lltrace.h') diff --git a/indra/llcommon/lltrace.h b/indra/llcommon/lltrace.h index 21a5803a76..edb010b0a4 100644 --- a/indra/llcommon/lltrace.h +++ b/indra/llcommon/lltrace.h @@ -1,25 +1,25 @@ -/** +/** * @file lltrace.h * @brief Runtime statistics accumulation. * * $LicenseInfo:firstyear=2001&license=viewerlgpl$ * Second Life Viewer Source Code * Copyright (C) 2012, Linden Research, Inc. - * + * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; * version 2.1 of the License only. - * + * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. - * + * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * + * * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ @@ -47,90 +47,90 @@ class Recording; template T storage_value(T val) { return val; } -template +template STORAGE_TYPE storage_value(LLUnit val) { return val.value(); } -template +template STORAGE_TYPE storage_value(LLUnitImplicit val) { return val.value(); } class StatBase { public: - StatBase(const char* name, const char* description); - virtual ~StatBase() {} - virtual const char* getUnitLabel() const; + StatBase(const char* name, const char* description); + virtual ~StatBase() {} + virtual const char* getUnitLabel() const; - const std::string& getName() const { return mName; } - const std::string& getDescription() const { return mDescription; } + const std::string& getName() const { return mName; } + const std::string& getDescription() const { return mDescription; } protected: - std::string mName; - std::string mDescription; + std::string mName; + std::string mDescription; }; template -class StatType -: public StatBase, - public LLInstanceTracker, std::string> +class StatType +: public StatBase, + public LLInstanceTracker, std::string> { public: - typedef LLInstanceTracker, std::string> instance_tracker_t; - StatType(const char* name, const char* description) - : instance_tracker_t(name), - StatBase(name, description), - mAccumulatorIndex(AccumulatorBuffer::getDefaultBuffer()->reserveSlot()) - {} - - LL_FORCE_INLINE ACCUMULATOR& getCurrentAccumulator() const - { - ACCUMULATOR* accumulator_storage = LLThreadLocalSingletonPointer::getInstance(); - return accumulator_storage ? accumulator_storage[mAccumulatorIndex] : (*AccumulatorBuffer::getDefaultBuffer())[mAccumulatorIndex]; - } - - size_t getIndex() const { return mAccumulatorIndex; } - static size_t getNumIndices() { return AccumulatorBuffer::getNumIndices(); } + typedef LLInstanceTracker, std::string> instance_tracker_t; + StatType(const char* name, const char* description) + : instance_tracker_t(name), + StatBase(name, description), + mAccumulatorIndex(AccumulatorBuffer::getDefaultBuffer()->reserveSlot()) + {} + + LL_FORCE_INLINE ACCUMULATOR& getCurrentAccumulator() const + { + ACCUMULATOR* accumulator_storage = LLThreadLocalSingletonPointer::getInstance(); + return accumulator_storage ? accumulator_storage[mAccumulatorIndex] : (*AccumulatorBuffer::getDefaultBuffer())[mAccumulatorIndex]; + } + + size_t getIndex() const { return mAccumulatorIndex; } + static size_t getNumIndices() { return AccumulatorBuffer::getNumIndices(); } protected: - const size_t mAccumulatorIndex; + const size_t mAccumulatorIndex; }; template<> class StatType -: public StatType +: public StatType { public: - StatType(const char* name, const char* description = "") - : StatType(name, description) - {} + StatType(const char* name, const char* description = "") + : StatType(name, description) + {} }; template<> class StatType - : public StatType + : public StatType { public: - StatType(const char* name, const char* description = "") - : StatType(name, description) - {} + StatType(const char* name, const char* description = "") + : StatType(name, description) + {} }; template class EventStatHandle -: public StatType +: public StatType { public: - typedef F64 storage_t; - typedef StatType stat_t; - typedef EventStatHandle self_t; + typedef F64 storage_t; + typedef StatType stat_t; + typedef EventStatHandle self_t; - EventStatHandle(const char* name, const char* description = NULL) - : stat_t(name, description) - {} + EventStatHandle(const char* name, const char* description = NULL) + : stat_t(name, description) + {} - /*virtual*/ const char* getUnitLabel() const { return LLGetUnitLabel::getUnitLabel(); } + /*virtual*/ const char* getUnitLabel() const { return LLGetUnitLabel::getUnitLabel(); } }; @@ -138,58 +138,58 @@ template void record(EventStatHandle& measurement, VALUE_T value) { #if LL_TRACE_ENABLED - T converted_value(value); - measurement.getCurrentAccumulator().record(storage_value(converted_value)); + T converted_value(value); + measurement.getCurrentAccumulator().record(storage_value(converted_value)); #endif } template class SampleStatHandle -: public StatType +: public StatType { public: - typedef F64 storage_t; - typedef StatType stat_t; - typedef SampleStatHandle self_t; + typedef F64 storage_t; + typedef StatType stat_t; + typedef SampleStatHandle self_t; - SampleStatHandle(const char* name, const char* description = NULL) - : stat_t(name, description) - {} + SampleStatHandle(const char* name, const char* description = NULL) + : stat_t(name, description) + {} - /*virtual*/ const char* getUnitLabel() const { return LLGetUnitLabel::getUnitLabel(); } + /*virtual*/ const char* getUnitLabel() const { return LLGetUnitLabel::getUnitLabel(); } }; template void sample(SampleStatHandle& measurement, VALUE_T value) { #if LL_TRACE_ENABLED - T converted_value(value); - measurement.getCurrentAccumulator().sample(storage_value(converted_value)); + T converted_value(value); + measurement.getCurrentAccumulator().sample(storage_value(converted_value)); #endif } template class CountStatHandle -: public StatType +: public StatType { public: - typedef F64 storage_t; - typedef StatType stat_t; - typedef CountStatHandle self_t; + typedef F64 storage_t; + typedef StatType stat_t; + typedef CountStatHandle self_t; - CountStatHandle(const char* name, const char* description = NULL) - : stat_t(name, description) - {} + CountStatHandle(const char* name, const char* description = NULL) + : stat_t(name, description) + {} - /*virtual*/ const char* getUnitLabel() const { return LLGetUnitLabel::getUnitLabel(); } + /*virtual*/ const char* getUnitLabel() const { return LLGetUnitLabel::getUnitLabel(); } }; template void add(CountStatHandle& count, VALUE_T value) { #if LL_TRACE_ENABLED - T converted_value(value); - count.getCurrentAccumulator().add(storage_value(converted_value)); + T converted_value(value); + count.getCurrentAccumulator().add(storage_value(converted_value)); #endif } @@ -198,85 +198,85 @@ void add(CountStatHandle& count, VALUE_T value) template struct MeasureMem { - static size_t measureFootprint(const T& value) - { - return sizeof(T); - } + static size_t measureFootprint(const T& value) + { + return sizeof(T); + } }; template struct MeasureMem { - static size_t measureFootprint(const T& value) - { + static size_t measureFootprint(const T& value) + { LL_PROFILE_ZONE_SCOPED_CATEGORY_STATS; - return sizeof(T) + value.getMemFootprint(); - } + return sizeof(T) + value.getMemFootprint(); + } }; template struct MeasureMem { - static size_t measureFootprint(const T& value) - { + static size_t measureFootprint(const T& value) + { LL_PROFILE_ZONE_SCOPED_CATEGORY_STATS; - return U32Bytes(value).value(); - } + return U32Bytes(value).value(); + } }; template struct MeasureMem { - static size_t measureFootprint(const T* value) - { + static size_t measureFootprint(const T* value) + { LL_PROFILE_ZONE_SCOPED_CATEGORY_STATS; - if (!value) - { - return 0; - } - return MeasureMem::measureFootprint(*value); - } + if (!value) + { + return 0; + } + return MeasureMem::measureFootprint(*value); + } }; template struct MeasureMem, IS_MEM_TRACKABLE, IS_BYTES> { - static size_t measureFootprint(const LLPointer value) - { - if (value.isNull()) - { - return 0; - } - return MeasureMem::measureFootprint(*value); - } + static size_t measureFootprint(const LLPointer value) + { + if (value.isNull()) + { + return 0; + } + return MeasureMem::measureFootprint(*value); + } }; template struct MeasureMem { - static size_t measureFootprint(S32 value) - { - return value; - } + static size_t measureFootprint(S32 value) + { + return value; + } }; template struct MeasureMem { - static size_t measureFootprint(U32 value) - { - return value; - } + static size_t measureFootprint(U32 value) + { + return value; + } }; template struct MeasureMem, IS_MEM_TRACKABLE, IS_BYTES> { - static size_t measureFootprint(const std::basic_string& value) - { + static size_t measureFootprint(const std::basic_string& value) + { LL_PROFILE_ZONE_SCOPED_CATEGORY_STATS; - return value.capacity() * sizeof(T); - } + return value.capacity() * sizeof(T); + } }; } -- cgit v1.2.3