This commit is contained in:
Shyotl
2017-03-14 04:02:53 -05:00
parent 4a9ff22eeb
commit f4a713a500
99 changed files with 1010 additions and 989 deletions

View File

@@ -86,11 +86,11 @@ std::string LLDate::asRFC1123() const
return toHTTPDateString (std::string ("%A, %d %b %Y %H:%M:%S GMT"));
}
LLFastTimer::DeclareTimer FT_DATE_FORMAT("Date Format");
LLTrace::BlockTimerStatHandle FT_DATE_FORMAT("Date Format");
std::string LLDate::toHTTPDateString(std::string fmt) const
{
LLFastTimer ft1(FT_DATE_FORMAT);
LL_RECORD_BLOCK_TIME(FT_DATE_FORMAT);
std::time_t locSeconds = (std::time_t) mSecondsSinceEpoch;
std::tm * gmt = gmtime (&locSeconds);
@@ -104,7 +104,7 @@ std::string LLDate::toHTTPDateString(std::string fmt) const
std::string LLDate::toHTTPDateString(tm * gmt, std::string fmt)
{
LLFastTimer ft1(FT_DATE_FORMAT);
LL_RECORD_BLOCK_TIME(FT_DATE_FORMAT);
// avoid calling setlocale() unnecessarily - it's expensive.
std::string this_locale = LLStringUtil::getLocale();

View File

@@ -38,6 +38,8 @@ class LLMutex;
#include <queue>
#include "llsd.h"
#define LL_RECORD_BLOCK_TIME(timer_stat) LLFastTimer LL_GLUE_TOKENS(block_time_recorder, __LINE__)(timer_stat);
LL_COMMON_API void assert_main_thread();
class LL_COMMON_API LLFastTimer
@@ -273,4 +275,9 @@ private:
};
namespace LLTrace
{
typedef LLFastTimer::DeclareTimer BlockTimerStatHandle;
}
#endif // LL_LLFASTTIMER_H

View File

@@ -37,7 +37,7 @@ static LLInitParam::Parser::parser_write_func_map_t sWriteFuncs;
static LLInitParam::Parser::parser_inspect_func_map_t sInspectFuncs;
static const LLSD NO_VALUE_MARKER;
LLFastTimer::DeclareTimer FTM_SD_PARAM_ADAPTOR("LLSD to LLInitParam conversion");
LLTrace::BlockTimerStatHandle FTM_SD_PARAM_ADAPTOR("LLSD to LLInitParam conversion");
//
// LLParamSDParser

View File

@@ -110,7 +110,7 @@ private:
};
extern LL_COMMON_API LLFastTimer::DeclareTimer FTM_SD_PARAM_ADAPTOR;
extern LL_COMMON_API LLTrace::BlockTimerStatHandle FTM_SD_PARAM_ADAPTOR;
template<typename T>
class LLSDParamAdapter : public T
{
@@ -118,7 +118,7 @@ public:
LLSDParamAdapter() {}
LLSDParamAdapter(const LLSD& sd)
{
LLFastTimer _(FTM_SD_PARAM_ADAPTOR);
LL_RECORD_BLOCK_TIME(FTM_SD_PARAM_ADAPTOR);
LLParamSDParser parser;
// don't spam for implicit parsing of LLSD, as we want to allow arbitrary freeform data and ignore most of it
bool parse_silently = true;

View File

@@ -467,24 +467,24 @@ void LLConditionVariableImpl::wait(LLMutex& lock)
#endif
#endif
LLFastTimer::DeclareTimer FT_WAIT_FOR_MUTEX("LLMutex::lock()");
void LLMutex::lock_main(LLFastTimer::DeclareTimer* timer)
LLTrace::BlockTimerStatHandle FT_WAIT_FOR_MUTEX("LLMutex::lock()");
void LLMutex::lock_main(LLTrace::BlockTimerStatHandle* timer)
{
llassert(!isSelfLocked());
LLFastTimer ft1(timer ? *timer : FT_WAIT_FOR_MUTEX);
LL_RECORD_BLOCK_TIME(timer ? *timer : FT_WAIT_FOR_MUTEX);
LLMutexImpl::lock();
}
LLFastTimer::DeclareTimer FT_WAIT_FOR_CONDITION("LLCondition::wait()");
LLTrace::BlockTimerStatHandle FT_WAIT_FOR_CONDITION("LLCondition::wait()");
void LLCondition::wait_main()
{
llassert(isSelfLocked());
LLFastTimer ft1(FT_WAIT_FOR_CONDITION);
LL_RECORD_BLOCK_TIME(FT_WAIT_FOR_CONDITION);
LLConditionVariableImpl::wait(*this);
llassert(isSelfLocked());
}
LLFastTimer::DeclareTimer FT_WAIT_FOR_MUTEXLOCK("LLMutexLock::lock()");
LLTrace::BlockTimerStatHandle FT_WAIT_FOR_MUTEXLOCK("LLMutexLock::lock()");
void LLMutexLock::lock()
{
if (mMutex)

View File

@@ -269,7 +269,7 @@ public:
~LLMutex()
{}
void lock(LLFastTimer::DeclareTimer* timer = NULL) // blocks
void lock(LLTrace::BlockTimerStatHandle* timer = NULL) // blocks
{
if (inc_lock_if_recursive())
return;
@@ -384,7 +384,7 @@ public:
#endif
private:
void lock_main(LLFastTimer::DeclareTimer* timer);
void lock_main(LLTrace::BlockTimerStatHandle* timer);
bool inc_lock_if_recursive()
{