From 3346281be35ab6fa3a46c7f166bb1f7da066d5e3 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Mon, 18 Sep 2017 19:51:44 +0100 Subject: SL-790 - Adding UI checks for actions that would increase the animated object attachment count --- indra/llcommon/indra_constants.h | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/llcommon') diff --git a/indra/llcommon/indra_constants.h b/indra/llcommon/indra_constants.h index fda84aa5a8..99ad5f2473 100644 --- a/indra/llcommon/indra_constants.h +++ b/indra/llcommon/indra_constants.h @@ -154,6 +154,7 @@ const U8 SIM_ACCESS_MAX = SIM_ACCESS_ADULT; // attachment constants const S32 MAX_AGENT_ATTACHMENTS = 38; +const S32 MAX_AGENT_ANIMATED_OBJECT_ATTACHMENTS = 1; const U8 ATTACHMENT_ADD = 0x80; // god levels -- cgit v1.2.3 From a6068419e7fe1a5a0eda007b2e989769c0a92262 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Fri, 22 Sep 2017 18:04:03 +0100 Subject: SL-794, SL-790 - viewer-side enforcement in UI for various animated object limits that are also enforced on the server. --- indra/llcommon/indra_constants.h | 1 - 1 file changed, 1 deletion(-) (limited to 'indra/llcommon') diff --git a/indra/llcommon/indra_constants.h b/indra/llcommon/indra_constants.h index 99ad5f2473..fda84aa5a8 100644 --- a/indra/llcommon/indra_constants.h +++ b/indra/llcommon/indra_constants.h @@ -154,7 +154,6 @@ const U8 SIM_ACCESS_MAX = SIM_ACCESS_ADULT; // attachment constants const S32 MAX_AGENT_ATTACHMENTS = 38; -const S32 MAX_AGENT_ANIMATED_OBJECT_ATTACHMENTS = 1; const U8 ATTACHMENT_ADD = 0x80; // god levels -- cgit v1.2.3 From 36c44242133697611216375c94d637ef88cd66cc Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Tue, 3 Oct 2017 22:26:00 +0100 Subject: SL-808 - more work on arc display. area calculations still have some issues, especially for animated objects. --- indra/llcommon/llstring.cpp | 19 +++++++++++++++++++ indra/llcommon/llstring.h | 3 +++ 2 files changed, 22 insertions(+) (limited to 'indra/llcommon') diff --git a/indra/llcommon/llstring.cpp b/indra/llcommon/llstring.cpp index c45db3b185..9a02fecd72 100644 --- a/indra/llcommon/llstring.cpp +++ b/indra/llcommon/llstring.cpp @@ -869,6 +869,25 @@ std::string LLStringOps::getDatetimeCode (std::string key) } } +std::string LLStringOps::getReadableNumber(F64 num) +{ + if (fabs(num)>=1e9) + { + return llformat("%.2lfB", num / 1e9); + } + else if (fabs(num)>=1e6) + { + return llformat("%.2lfM", num / 1e6); + } + else if (fabs(num)>=1e3) + { + return llformat("%.2lfK", num / 1e3); + } + else + { + return llformat("%.2lf", num); + } +} namespace LLStringFn { diff --git a/indra/llcommon/llstring.h b/indra/llcommon/llstring.h index abe5fda603..627ca05f14 100644 --- a/indra/llcommon/llstring.h +++ b/indra/llcommon/llstring.h @@ -211,6 +211,9 @@ public: static bool getPacificDaylightTime(void) { return sPacificDaylightTime;} static std::string getDatetimeCode (std::string key); + + // Express a value like 1234567 as "1.23M" + static std::string getReadableNumber(F64 num); }; /** -- cgit v1.2.3 From 3a8b1bf1e4b30e8efb1fe161706c8d5f41fccad8 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Mon, 29 Jan 2018 16:35:56 +0000 Subject: SL-859 - exceptionally verbose logging of object state updates, likely temporary --- indra/llcommon/llcallstack.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'indra/llcommon') diff --git a/indra/llcommon/llcallstack.h b/indra/llcommon/llcallstack.h index 1f7a7689d7..5acf04a49f 100644 --- a/indra/llcommon/llcallstack.h +++ b/indra/llcommon/llcallstack.h @@ -78,3 +78,10 @@ struct LLContextStatus }; LL_COMMON_API std::ostream& operator<<(std::ostream& s, const LLContextStatus& context_status); + +#define dumpStack(tag) \ + if (debugLoggingEnabled(tag)) \ + { \ + LLCallStack cs; \ + LL_DEBUGS(tag) << "STACK:\n" << "====================\n" << cs << "====================" << LL_ENDL; \ + } -- cgit v1.2.3 From 430f9420cf0094635b0b0428a29ff7dfaf5718e8 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Thu, 7 Jun 2018 22:18:15 +0100 Subject: SL-915 - more on dynamic extent tracking, possible fix for 32-bit crash issues --- indra/llcommon/llerror.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'indra/llcommon') diff --git a/indra/llcommon/llerror.cpp b/indra/llcommon/llerror.cpp index f31a054139..916555a71d 100644 --- a/indra/llcommon/llerror.cpp +++ b/indra/llcommon/llerror.cpp @@ -51,6 +51,10 @@ #include "llstl.h" #include "lltimer.h" +//#if LL_WINDOWS +//#pragma optimize("", off) +//#endif + namespace { #if LL_WINDOWS void debugger_print(const std::string& s) @@ -361,6 +365,7 @@ namespace } } + LL_INFOS("LogControlFile") << "logging reconfiguring from " << filename() << LL_ENDL; LLError::configure(configuration); LL_INFOS("LogControlFile") << "logging reconfigured from " << filename() << LL_ENDL; return true; @@ -1292,7 +1297,7 @@ namespace LLError #if LL_WINDOWS // VC80 was optimizing the error away. - #pragma optimize("", off) +// #pragma optimize("", off) #endif void crashAndLoop(const std::string& message) { @@ -1310,7 +1315,7 @@ namespace LLError exit(EXIT_FAILURE); } #if LL_WINDOWS - #pragma optimize("", on) +// #pragma optimize("", on) #endif std::string utcTime() -- cgit v1.2.3 From 887638c4d274d067f44d97128b34fde837ab69a9 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Mon, 11 Jun 2018 13:55:34 +0100 Subject: SL-915 - fix for crash when logcontrol file reloaded --- indra/llcommon/llerror.cpp | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) (limited to 'indra/llcommon') diff --git a/indra/llcommon/llerror.cpp b/indra/llcommon/llerror.cpp index 916555a71d..f81030b0e7 100644 --- a/indra/llcommon/llerror.cpp +++ b/indra/llcommon/llerror.cpp @@ -29,6 +29,7 @@ #include "llerror.h" #include "llerrorcontrol.h" +#include "llsdutil.h" #include #ifdef __GNUC__ @@ -51,10 +52,6 @@ #include "llstl.h" #include "lltimer.h" -//#if LL_WINDOWS -//#pragma optimize("", off) -//#endif - namespace { #if LL_WINDOWS void debugger_print(const std::string& s) @@ -365,7 +362,6 @@ namespace } } - LL_INFOS("LogControlFile") << "logging reconfiguring from " << filename() << LL_ENDL; LLError::configure(configuration); LL_INFOS("LogControlFile") << "logging reconfigured from " << filename() << LL_ENDL; return true; @@ -408,7 +404,7 @@ namespace i != callSites.end(); ++i) { - (*i)->invalidate(); + (*i)->invalidate(); } callSites.clear(); @@ -1523,18 +1519,16 @@ namespace LLError bool debugLoggingEnabled(const std::string& tag) { - const char* tags[] = {tag.c_str()}; - ::size_t tag_count = 1; - LLError::CallSite _site(LLError::LEVEL_DEBUG, __FILE__, __LINE__, - typeid(_LL_CLASS_TO_LOG), __FUNCTION__, false, tags, tag_count); - if (LL_UNLIKELY(_site.shouldLog())) - { - return true; - } - else + LogLock lock; + if (!lock.ok()) { return false; } + + LLError::SettingsConfigPtr s = LLError::Settings::getInstance()->getSettingsConfig(); + LLError::ELevel level = LLError::LEVEL_DEBUG; + bool res = checkLevelMap(s->mTagLevelMap, tag, level); + return res; } -- cgit v1.2.3 From edf6795edaa4ec822ac0e2bc906c71606b84b5c8 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Wed, 13 Jun 2018 21:49:24 +0100 Subject: SL-915, MAINT-8554 - cleanup/reorg, added encroachment fix info to DebugAnimatedObjects output --- indra/llcommon/llerror.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/llcommon') diff --git a/indra/llcommon/llerror.cpp b/indra/llcommon/llerror.cpp index f81030b0e7..d0e7c06f36 100644 --- a/indra/llcommon/llerror.cpp +++ b/indra/llcommon/llerror.cpp @@ -1293,7 +1293,7 @@ namespace LLError #if LL_WINDOWS // VC80 was optimizing the error away. -// #pragma optimize("", off) + #pragma optimize("", off) #endif void crashAndLoop(const std::string& message) { @@ -1311,7 +1311,7 @@ namespace LLError exit(EXIT_FAILURE); } #if LL_WINDOWS -// #pragma optimize("", on) + #pragma optimize("", on) #endif std::string utcTime() -- cgit v1.2.3 From 91dfd7e06c8e1e5499ffd4137053b4b238b7eb45 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Tue, 31 Jul 2018 14:02:42 +0100 Subject: SL-944 - disabled a not-very-useful assert that greatly slows the RWD build --- indra/llcommon/llmemory.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'indra/llcommon') diff --git a/indra/llcommon/llmemory.h b/indra/llcommon/llmemory.h index 5b17d9e3a4..f04ae5f5cb 100644 --- a/indra/llcommon/llmemory.h +++ b/indra/llcommon/llmemory.h @@ -60,6 +60,12 @@ class LLMutex ; LL_COMMON_API void ll_assert_aligned_func(uintptr_t ptr,U32 alignment); #ifdef SHOW_ASSERT +// This is incredibly expensive - in profiling Windows RWD builds, 30% +// of CPU time was in aligment checks. +//#define ASSERT_ALIGNMENT +#endif + +#ifdef ASSERT_ALIGNMENT #define ll_assert_aligned(ptr,alignment) ll_assert_aligned_func(uintptr_t(ptr),((U32)alignment)) #else #define ll_assert_aligned(ptr,alignment) -- cgit v1.2.3 From 9c6678b5e76c485ae915b539327069b43185e16f Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Fri, 24 Aug 2018 21:55:07 +0100 Subject: SL-944 - logcontrol options to control which log recorders get used. This can be useful for performance reasons when especially verbose debug logging is needed. --- indra/llcommon/llerror.cpp | 99 ++++++++++++++++++++++++++++++++++++++--- indra/llcommon/llerrorcontrol.h | 6 +++ 2 files changed, 100 insertions(+), 5 deletions(-) (limited to 'indra/llcommon') diff --git a/indra/llcommon/llerror.cpp b/indra/llcommon/llerror.cpp index ba71f4ddfb..3e4dd708a8 100644 --- a/indra/llcommon/llerror.cpp +++ b/indra/llcommon/llerror.cpp @@ -89,7 +89,12 @@ namespace { { closelog(); } - + + virtual bool enabled() override + { + return LLError::getEnabledLogTypesMask() & 0x01; + } + virtual void recordMessage(LLError::ELevel level, const std::string& message) { @@ -119,6 +124,13 @@ namespace { { LL_INFOS() << "Error setting log file to " << filename << LL_ENDL; } + else + { + if (!LLError::getAlwaysFlush()) + { + mFile.sync_with_stdio(false); + } + } mWantsTime = true; mWantsTags = true; } @@ -128,12 +140,28 @@ namespace { mFile.close(); } + virtual bool enabled() override + { +#ifdef LL_RELEASE_FOR_DOWNLOAD + return 1; +#else + return LLError::getEnabledLogTypesMask() & 0x02; +#endif + } + bool okay() { return mFile.good(); } virtual void recordMessage(LLError::ELevel level, const std::string& message) { - mFile << message << std::endl; + if (LLError::getAlwaysFlush()) + { + mFile << message << std::endl; + } + else + { + mFile << message << "\n"; + } } private: @@ -149,6 +177,11 @@ namespace { mWantsTime = timestamp; } + virtual bool enabled() override + { + return LLError::getEnabledLogTypesMask() & 0x04; + } + virtual void recordMessage(LLError::ELevel level, const std::string& message) { @@ -209,6 +242,11 @@ namespace { public: RecordToFixedBuffer(LLLineBuffer* buffer) : mBuffer(buffer) { } + virtual bool enabled() override + { + return LLError::getEnabledLogTypesMask() & 0x08; + } + virtual void recordMessage(LLError::ELevel level, const std::string& message) { @@ -226,6 +264,11 @@ namespace { RecordToWinDebug() {} + virtual bool enabled() override + { + return LLError::getEnabledLogTypesMask() & 0x10; + } + virtual void recordMessage(LLError::ELevel level, const std::string& message) { @@ -413,7 +456,11 @@ namespace LLError bool mPrintLocation; LLError::ELevel mDefaultLevel; - + + bool mLogAlwaysFlush; + + U32 mEnabledLogTypesMask; + LevelMap mFunctionLevelMap; LevelMap mClassLevelMap; LevelMap mFileLevelMap; @@ -454,6 +501,8 @@ namespace LLError : LLRefCount(), mPrintLocation(false), mDefaultLevel(LLError::LEVEL_DEBUG), + mLogAlwaysFlush(true), + mEnabledLogTypesMask(0xFFFFFFFF), mFunctionLevelMap(), mClassLevelMap(), mFileLevelMap(), @@ -613,6 +662,8 @@ namespace LLError::Settings::getInstance()->reset(); LLError::setDefaultLevel(LLError::LEVEL_INFO); + LLError::setAlwaysFlush(true); + LLError::setEnabledLogTypesMask(0xFFFFFFFF); LLError::setFatalFunction(LLError::crashAndLoop); LLError::setTimeFunction(LLError::utcTime); @@ -686,6 +737,30 @@ namespace LLError return s->mDefaultLevel; } + void setAlwaysFlush(bool flush) + { + SettingsConfigPtr s = Settings::getInstance()->getSettingsConfig(); + s->mLogAlwaysFlush = flush; + } + + bool getAlwaysFlush() + { + SettingsConfigPtr s = Settings::getInstance()->getSettingsConfig(); + return s->mLogAlwaysFlush; + } + + void setEnabledLogTypesMask(U32 mask) + { + SettingsConfigPtr s = Settings::getInstance()->getSettingsConfig(); + s->mEnabledLogTypesMask = mask; + } + + U32 getEnabledLogTypesMask() + { + SettingsConfigPtr s = Settings::getInstance()->getSettingsConfig(); + return s->mEnabledLogTypesMask; + } + void setFunctionLevel(const std::string& function_name, ELevel level) { Globals::getInstance()->invalidateCallSites(); @@ -766,7 +841,15 @@ namespace LLError setPrintLocation(config["print-location"]); setDefaultLevel(decodeLevel(config["default-level"])); - + if (config.has("log-always-flush")) + { + setAlwaysFlush(config["log-always-flush"]); + } + if (config.has("enabled-log-types-mask")) + { + setEnabledLogTypesMask(config["enabled-log-types-mask"].asInteger()); + } + LLSD sets = config["settings"]; LLSD::array_const_iterator a, end; for (a = sets.beginArray(), end = sets.endArray(); a != end; ++a) @@ -910,7 +993,12 @@ namespace ++i) { LLError::RecorderPtr r = *i; - + + if (!r->enabled()) + { + continue; + } + std::ostringstream message_stream; if (show_time && r->wantsTime() && s->mTimeFunction != NULL) @@ -1039,6 +1127,7 @@ namespace { namespace LLError { + bool Log::shouldLog(CallSite& site) { LogLock lock; diff --git a/indra/llcommon/llerrorcontrol.h b/indra/llcommon/llerrorcontrol.h index caf2ba72c2..1730f0c640 100644 --- a/indra/llcommon/llerrorcontrol.h +++ b/indra/llcommon/llerrorcontrol.h @@ -74,6 +74,10 @@ namespace LLError LL_COMMON_API void setPrintLocation(bool); LL_COMMON_API void setDefaultLevel(LLError::ELevel); LL_COMMON_API ELevel getDefaultLevel(); + LL_COMMON_API void setAlwaysFlush(bool flush); + LL_COMMON_API bool getAlwaysFlush(); + LL_COMMON_API void setEnabledLogTypesMask(U32 mask); + LL_COMMON_API U32 getEnabledLogTypesMask(); LL_COMMON_API void setFunctionLevel(const std::string& function_name, LLError::ELevel); LL_COMMON_API void setClassLevel(const std::string& class_name, LLError::ELevel); LL_COMMON_API void setFileLevel(const std::string& file_name, LLError::ELevel); @@ -140,6 +144,8 @@ namespace LLError virtual void recordMessage(LLError::ELevel, const std::string& message) = 0; // use the level for better display, not for filtering + virtual bool enabled() { return true; } + bool wantsTime(); bool wantsTags(); bool wantsLevel(); -- cgit v1.2.3 From 9ae973ec5b271b99d192644cc094ef2d1e3ded2a Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Mon, 27 Aug 2018 14:22:42 +0100 Subject: SL-944 - mac build error fix: wants override to be used throughout a class if it is used at all --- indra/llcommon/llerror.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'indra/llcommon') diff --git a/indra/llcommon/llerror.cpp b/indra/llcommon/llerror.cpp index 3e4dd708a8..843244ce92 100644 --- a/indra/llcommon/llerror.cpp +++ b/indra/llcommon/llerror.cpp @@ -96,7 +96,7 @@ namespace { } virtual void recordMessage(LLError::ELevel level, - const std::string& message) + const std::string& message) override { int syslogPriority = LOG_CRIT; switch (level) { @@ -152,7 +152,7 @@ namespace { bool okay() { return mFile.good(); } virtual void recordMessage(LLError::ELevel level, - const std::string& message) + const std::string& message) override { if (LLError::getAlwaysFlush()) { @@ -183,7 +183,7 @@ namespace { } virtual void recordMessage(LLError::ELevel level, - const std::string& message) + const std::string& message) override { if (ANSI_PROBE == mUseANSI) mUseANSI = (checkANSI() ? ANSI_YES : ANSI_NO); @@ -248,7 +248,7 @@ namespace { } virtual void recordMessage(LLError::ELevel level, - const std::string& message) + const std::string& message) override { mBuffer->addLine(message); } @@ -270,7 +270,7 @@ namespace { } virtual void recordMessage(LLError::ELevel level, - const std::string& message) + const std::string& message) override { debugger_print(message); } -- cgit v1.2.3 From d6cec8d68de437a3ccc66739cdabc9de6631dddc Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Fri, 7 Sep 2018 16:00:43 +0100 Subject: SL-944 - enabled log types consistent notation in xml and cpp --- indra/llcommon/llerror.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/llcommon') diff --git a/indra/llcommon/llerror.cpp b/indra/llcommon/llerror.cpp index 843244ce92..0d19287dd9 100644 --- a/indra/llcommon/llerror.cpp +++ b/indra/llcommon/llerror.cpp @@ -502,7 +502,7 @@ namespace LLError mPrintLocation(false), mDefaultLevel(LLError::LEVEL_DEBUG), mLogAlwaysFlush(true), - mEnabledLogTypesMask(0xFFFFFFFF), + mEnabledLogTypesMask(255), mFunctionLevelMap(), mClassLevelMap(), mFileLevelMap(), -- cgit v1.2.3