Add an "enabled" guard around dumpStack

Without this the logging mutex is grabbed each call which can clash with
logging in other threads adding to jitter.
Beq 2019-06-15 21:35:31 +01:00
parent fd20350d6e
commit e54d4692f6
1 changed files with 18 additions and 5 deletions

View File

@ -79,9 +79,22 @@ struct LLContextStatus
LL_COMMON_API std::ostream& operator<<(std::ostream& s, const LLContextStatus& context_status);
// <FS:Beq> Store the check to avoid the nasty mutex monster that lies within
// Note that this won't work quite as expected if called with a variable tag
// No current use cases do this though, nor are they likely.
/* #define dumpStack(tag) \
- if (debugLoggingEnabled(tag)) \
- { \
- LLCallStack cs; \
- LL_DEBUGS(tag) << "STACK:\n" << "====================\n" << cs << "====================" << LL_ENDL; \
- }
*/
#define dumpStack(tag) \
if (debugLoggingEnabled(tag)) \
{ \
LLCallStack cs; \
LL_DEBUGS(tag) << "STACK:\n" << "====================\n" << cs << "====================" << LL_ENDL; \
}
{ static auto _isTagEnabled = debugLoggingEnabled(tag); \
if (_isTagEnabled) \
{ \
LLCallStack cs; \
LL_DEBUGS(tag) << "STACK:\n" << "====================\n" << cs << "====================" << LL_ENDL; \
} \
}
// </FS:Beq>