diff options
author | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2016-03-07 11:24:48 -0500 |
---|---|---|
committer | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2016-03-07 11:24:48 -0500 |
commit | 88cb6814f0883cdce15ca1942409da708ab07af5 (patch) | |
tree | d0067d27341a945fbfab91299c0c79cce9037b54 /indra/llcommon/llcallstack.cpp | |
parent | 9ca9a44acfc06de529489d76eea934ed6652fe81 (diff) |
SL-315 WIP - more call stack tracing, initial hooks for avatar reset skeleton option.
Diffstat (limited to 'indra/llcommon/llcallstack.cpp')
-rw-r--r-- | indra/llcommon/llcallstack.cpp | 40 |
1 files changed, 37 insertions, 3 deletions
diff --git a/indra/llcommon/llcallstack.cpp b/indra/llcommon/llcallstack.cpp index 2409f7a876..9978645ff4 100644 --- a/indra/llcommon/llcallstack.cpp +++ b/indra/llcommon/llcallstack.cpp @@ -29,6 +29,7 @@ #include "llcommon.h" #include "llcallstack.h" #include "StackWalker.h" +#include "llthreadlocalstorage.h" #if LL_WINDOWS class LLCallStackImpl: public StackWalker @@ -88,6 +89,19 @@ LLCallStack::LLCallStack(S32 skip_count, bool verbose): s_impl->getStack(m_strings, m_skipCount, m_verbose); } +bool LLCallStack::contains(const std::string& str) +{ + for (std::vector<std::string>::const_iterator it = m_strings.begin(); + it != m_strings.end(); ++it) + { + if (it->find(str) != std::string::npos) + { + return true; + } + } + return false; +} + std::ostream& operator<<(std::ostream& s, const LLCallStack& call_stack) { std::vector<std::string>::const_iterator it; @@ -98,8 +112,6 @@ std::ostream& operator<<(std::ostream& s, const LLCallStack& call_stack) return s; } -#include "llthreadlocalstorage.h" - LLContextStrings::LLContextStrings() { } @@ -136,17 +148,39 @@ void LLContextStrings::removeContextString(const std::string& str) } // static +bool LLContextStrings::contains(const std::string& str) +{ + const std::map<std::string,S32>& strings = + LLThreadLocalSingletonPointer<LLContextStrings>::getInstance()->m_contextStrings; + for (std::map<std::string,S32>::const_iterator it = strings.begin(); it!=strings.end(); ++it) + { + if (it->first.find(str) != std::string::npos) + { + return true; + } + } + return false; +} + +// static void LLContextStrings::output(std::ostream& os) { - const std::map<std::string,S32>& strings = LLThreadLocalSingletonPointer<LLContextStrings>::getInstance()->m_contextStrings; + const std::map<std::string,S32>& strings = + LLThreadLocalSingletonPointer<LLContextStrings>::getInstance()->m_contextStrings; for (std::map<std::string,S32>::const_iterator it = strings.begin(); it!=strings.end(); ++it) { os << it->first << "[" << it->second << "]" << "\n"; } } +// static std::ostream& operator<<(std::ostream& s, const LLContextStatus& context_status) { LLThreadLocalSingletonPointer<LLContextStrings>::getInstance()->output(s); return s; } + +bool LLContextStatus::contains(const std::string& str) +{ + return LLThreadLocalSingletonPointer<LLContextStrings>::getInstance()->contains(str); +} |