From 9d77e030d9a0d23cebce616631677459eec1612c Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Wed, 14 Nov 2012 23:52:27 -0800 Subject: SH-3406 WIP convert fast timers to lltrace system cleaning up build moved most includes of windows.h to llwin32headers.h to disable min/max macros, etc streamlined Time class and consolidated functionality in BlockTimer class llfasttimer is no longer included via llstring.h, so had to add it manually in several places --- indra/llmessage/llurlrequest.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/llmessage/llurlrequest.cpp') diff --git a/indra/llmessage/llurlrequest.cpp b/indra/llmessage/llurlrequest.cpp index 5831c3c1c1..982f4804f0 100644 --- a/indra/llmessage/llurlrequest.cpp +++ b/indra/llmessage/llurlrequest.cpp @@ -33,6 +33,7 @@ #include #include #include "llcurl.h" +#include "llfasttimer.h" #include "llioutil.h" #include "llproxy.h" #include "llpumpio.h" -- cgit v1.2.3 From 6db6cb39f41e921e75970d1570a74cf35d353a35 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Fri, 16 Nov 2012 23:02:53 -0800 Subject: SH-3406 WIP convert fast timers to lltrace system got new fast timer code to compile and run --- indra/llmessage/llurlrequest.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/llmessage/llurlrequest.cpp') diff --git a/indra/llmessage/llurlrequest.cpp b/indra/llmessage/llurlrequest.cpp index 982f4804f0..0e5fe1de08 100644 --- a/indra/llmessage/llurlrequest.cpp +++ b/indra/llmessage/llurlrequest.cpp @@ -281,6 +281,8 @@ LLIOPipe::EStatus LLURLRequest::handleError( static LLFastTimer::DeclareTimer FTM_PROCESS_URL_REQUEST("URL Request"); static LLFastTimer::DeclareTimer FTM_PROCESS_URL_REQUEST_GET_RESULT("Get Result"); static LLFastTimer::DeclareTimer FTM_URL_PERFORM("Perform"); +static LLFastTimer::DeclareTimer FTM_PROCESS_URL_PUMP_RESPOND("Pump Respond"); +static LLFastTimer::DeclareTimer FTM_URL_ADJUST_TIMEOUT("Adjust Timeout"); // virtual LLIOPipe::EStatus LLURLRequest::process_impl( @@ -300,7 +302,6 @@ LLIOPipe::EStatus LLURLRequest::process_impl( const S32 MIN_ACCUMULATION = 100000; if(pump && (mDetail->mByteAccumulator > MIN_ACCUMULATION)) { - static LLFastTimer::DeclareTimer FTM_URL_ADJUST_TIMEOUT("Adjust Timeout"); LLFastTimer t(FTM_URL_ADJUST_TIMEOUT); // This is a pretty sloppy calculation, but this // tries to make the gross assumption that if data @@ -398,7 +399,6 @@ LLIOPipe::EStatus LLURLRequest::process_impl( link.mChannels = LLBufferArray::makeChannelConsumer( channels); chain.push_back(link); - static LLFastTimer::DeclareTimer FTM_PROCESS_URL_PUMP_RESPOND("Pump Respond"); { LLFastTimer t(FTM_PROCESS_URL_PUMP_RESPOND); pump->respond(chain, buffer, context); -- cgit v1.2.3 From e340009fc59d59e59b2e8d903a884acb76b178eb Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Fri, 9 Aug 2013 17:11:19 -0700 Subject: second phase summer cleaning replace llinfos, lldebugs, etc with new LL_INFOS(), LL_DEBUGS(), etc. --- indra/llmessage/llurlrequest.cpp | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) (limited to 'indra/llmessage/llurlrequest.cpp') diff --git a/indra/llmessage/llurlrequest.cpp b/indra/llmessage/llurlrequest.cpp index 7281ac35af..898545bd86 100755 --- a/indra/llmessage/llurlrequest.cpp +++ b/indra/llmessage/llurlrequest.cpp @@ -177,7 +177,7 @@ void LLURLRequest::setURL(const std::string& url) mDetail->mURL = url; if (url.empty()) { - llwarns << "empty URL specified" << llendl; + LL_WARNS() << "empty URL specified" << LL_ENDL; } } @@ -230,7 +230,7 @@ void LLURLRequest::useProxy(bool use_proxy) } - lldebugs << "use_proxy = " << (use_proxy?'Y':'N') << ", env_proxy = " << (env_proxy ? env_proxy : "(null)") << llendl; + LL_DEBUGS() << "use_proxy = " << (use_proxy?'Y':'N') << ", env_proxy = " << (env_proxy ? env_proxy : "(null)") << LL_ENDL; if (env_proxy && use_proxy) { @@ -298,7 +298,7 @@ LLIOPipe::EStatus LLURLRequest::process_impl( { LLFastTimer t(FTM_PROCESS_URL_REQUEST); PUMP_DEBUG; - //llinfos << "LLURLRequest::process_impl()" << llendl; + //LL_INFOS() << "LLURLRequest::process_impl()" << LL_ENDL; if (!buffer) return STATUS_ERROR; // we're still waiting or prcessing, check how many @@ -316,10 +316,10 @@ LLIOPipe::EStatus LLURLRequest::process_impl( const F32 TIMEOUT_ADJUSTMENT = 2.0f; mDetail->mByteAccumulator = 0; pump->adjustTimeoutSeconds(TIMEOUT_ADJUSTMENT); - lldebugs << "LLURLRequest adjustTimeoutSeconds for request: " << mDetail->mURL << llendl; + LL_DEBUGS() << "LLURLRequest adjustTimeoutSeconds for request: " << mDetail->mURL << LL_ENDL; if (mState == STATE_INITIALIZED) { - llinfos << "LLURLRequest adjustTimeoutSeconds called during upload" << llendl; + LL_INFOS() << "LLURLRequest adjustTimeoutSeconds called during upload" << LL_ENDL; } } @@ -383,7 +383,7 @@ LLIOPipe::EStatus LLURLRequest::process_impl( mState = STATE_HAVE_RESPONSE; context[CONTEXT_REQUEST][CONTEXT_TRANSFERED_BYTES] = mRequestTransferedBytes; context[CONTEXT_RESPONSE][CONTEXT_TRANSFERED_BYTES] = mResponseTransferedBytes; - lldebugs << this << "Setting context to " << context << llendl; + LL_DEBUGS() << this << "Setting context to " << context << LL_ENDL; switch(result) { case CURLE_OK: @@ -417,12 +417,12 @@ LLIOPipe::EStatus LLURLRequest::process_impl( keep_looping = false; break; default: // CURLE_URL_MALFORMAT - llwarns << "URLRequest Error: " << result + LL_WARNS() << "URLRequest Error: " << result << ", " << LLCurl::strerror(result) << ", " << (mDetail->mURL.empty() ? "" : mDetail->mURL) - << llendl; + << LL_ENDL; status = STATUS_ERROR; keep_looping = false; break; @@ -437,14 +437,14 @@ LLIOPipe::EStatus LLURLRequest::process_impl( eos = true; context[CONTEXT_REQUEST][CONTEXT_TRANSFERED_BYTES] = mRequestTransferedBytes; context[CONTEXT_RESPONSE][CONTEXT_TRANSFERED_BYTES] = mResponseTransferedBytes; - lldebugs << this << "Setting context to " << context << llendl; + LL_DEBUGS() << this << "Setting context to " << context << LL_ENDL; return STATUS_DONE; default: PUMP_DEBUG; context[CONTEXT_REQUEST][CONTEXT_TRANSFERED_BYTES] = mRequestTransferedBytes; context[CONTEXT_RESPONSE][CONTEXT_TRANSFERED_BYTES] = mResponseTransferedBytes; - lldebugs << this << "Setting context to " << context << llendl; + LL_DEBUGS() << this << "Setting context to " << context << LL_ENDL; return STATUS_ERROR; } } @@ -533,7 +533,7 @@ bool LLURLRequest::configure() break; default: - llwarns << "Unhandled URLRequest action: " << mAction << llendl; + LL_WARNS() << "Unhandled URLRequest action: " << mAction << LL_ENDL; break; } if(rv) @@ -661,7 +661,7 @@ static size_t headerCallback(void* data, size_t size, size_t nmemb, void* user) LLStringUtil::trim(header); if (!header.empty()) { - llwarns << "Unable to parse header: " << header << llendl; + LL_WARNS() << "Unable to parse header: " << header << LL_ENDL; } } @@ -739,15 +739,15 @@ void LLURLRequestComplete::complete(const LLChannelDescriptors& channels, void LLURLRequestComplete::response(const LLChannelDescriptors& channels, const buffer_ptr_t& buffer) { - llwarns << "LLURLRequestComplete::response default implementation called" - << llendl; + LL_WARNS() << "LLURLRequestComplete::response default implementation called" + << LL_ENDL; } //virtual void LLURLRequestComplete::noResponse() { - llwarns << "LLURLRequestComplete::noResponse default implementation called" - << llendl; + LL_WARNS() << "LLURLRequestComplete::noResponse default implementation called" + << LL_ENDL; } void LLURLRequestComplete::responseStatus(LLIOPipe::EStatus status) -- cgit v1.2.3 From cbe397ad13665c7bc993e10d8fe1e4a876253378 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Thu, 5 Sep 2013 14:04:13 -0700 Subject: changed fast timer over to using macro another attempt to move mem stat into base class --- indra/llmessage/llurlrequest.cpp | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) (limited to 'indra/llmessage/llurlrequest.cpp') diff --git a/indra/llmessage/llurlrequest.cpp b/indra/llmessage/llurlrequest.cpp index 898545bd86..70c0354d62 100755 --- a/indra/llmessage/llurlrequest.cpp +++ b/indra/llmessage/llurlrequest.cpp @@ -282,11 +282,11 @@ LLIOPipe::EStatus LLURLRequest::handleError( return status; } -static LLFastTimer::DeclareTimer FTM_PROCESS_URL_REQUEST("URL Request"); -static LLFastTimer::DeclareTimer FTM_PROCESS_URL_REQUEST_GET_RESULT("Get Result"); -static LLFastTimer::DeclareTimer FTM_URL_PERFORM("Perform"); -static LLFastTimer::DeclareTimer FTM_PROCESS_URL_PUMP_RESPOND("Pump Respond"); -static LLFastTimer::DeclareTimer FTM_URL_ADJUST_TIMEOUT("Adjust Timeout"); +static LLTrace::TimeBlock FTM_PROCESS_URL_REQUEST("URL Request"); +static LLTrace::TimeBlock FTM_PROCESS_URL_REQUEST_GET_RESULT("Get Result"); +static LLTrace::TimeBlock FTM_URL_PERFORM("Perform"); +static LLTrace::TimeBlock FTM_PROCESS_URL_PUMP_RESPOND("Pump Respond"); +static LLTrace::TimeBlock FTM_URL_ADJUST_TIMEOUT("Adjust Timeout"); // virtual LLIOPipe::EStatus LLURLRequest::process_impl( @@ -296,7 +296,7 @@ LLIOPipe::EStatus LLURLRequest::process_impl( LLSD& context, LLPumpIO* pump) { - LLFastTimer t(FTM_PROCESS_URL_REQUEST); + LL_RECORD_BLOCK_TIME(FTM_PROCESS_URL_REQUEST); PUMP_DEBUG; //LL_INFOS() << "LLURLRequest::process_impl()" << LL_ENDL; if (!buffer) return STATUS_ERROR; @@ -306,7 +306,7 @@ LLIOPipe::EStatus LLURLRequest::process_impl( const S32 MIN_ACCUMULATION = 100000; if(pump && (mDetail->mByteAccumulator > MIN_ACCUMULATION)) { - LLFastTimer t(FTM_URL_ADJUST_TIMEOUT); + LL_RECORD_BLOCK_TIME(FTM_URL_ADJUST_TIMEOUT); // This is a pretty sloppy calculation, but this // tries to make the gross assumption that if data // is coming in at 56kb/s, then this transfer will @@ -355,7 +355,7 @@ LLIOPipe::EStatus LLURLRequest::process_impl( PUMP_DEBUG; LLIOPipe::EStatus status = STATUS_BREAK; { - LLFastTimer t(FTM_URL_PERFORM); + LL_RECORD_BLOCK_TIME(FTM_URL_PERFORM); if(!mDetail->mCurlRequest->wait()) { return status ; @@ -369,7 +369,7 @@ LLIOPipe::EStatus LLURLRequest::process_impl( bool newmsg = false; { - LLFastTimer t(FTM_PROCESS_URL_REQUEST_GET_RESULT); + LL_RECORD_BLOCK_TIME(FTM_PROCESS_URL_REQUEST_GET_RESULT); newmsg = mDetail->mCurlRequest->getResult(&result); } @@ -405,7 +405,7 @@ LLIOPipe::EStatus LLURLRequest::process_impl( channels); chain.push_back(link); { - LLFastTimer t(FTM_PROCESS_URL_PUMP_RESPOND); + LL_RECORD_BLOCK_TIME(FTM_PROCESS_URL_PUMP_RESPOND); pump->respond(chain, buffer, context); } mCompletionCallback = NULL; @@ -466,10 +466,10 @@ void LLURLRequest::initialize() mResponseTransferedBytes = 0; } -static LLFastTimer::DeclareTimer FTM_URL_REQUEST_CONFIGURE("URL Configure"); +static LLTrace::TimeBlock FTM_URL_REQUEST_CONFIGURE("URL Configure"); bool LLURLRequest::configure() { - LLFastTimer t(FTM_URL_REQUEST_CONFIGURE); + LL_RECORD_BLOCK_TIME(FTM_URL_REQUEST_CONFIGURE); bool rv = false; S32 bytes = mDetail->mResponseBuffer->countAfter( @@ -668,7 +668,7 @@ static size_t headerCallback(void* data, size_t size, size_t nmemb, void* user) return header_len; } -static LLFastTimer::DeclareTimer FTM_PROCESS_URL_EXTRACTOR("URL Extractor"); +static LLTrace::TimeBlock FTM_PROCESS_URL_EXTRACTOR("URL Extractor"); /** * LLContextURLExtractor */ @@ -680,7 +680,7 @@ LLIOPipe::EStatus LLContextURLExtractor::process_impl( LLSD& context, LLPumpIO* pump) { - LLFastTimer t(FTM_PROCESS_URL_EXTRACTOR); + LL_RECORD_BLOCK_TIME(FTM_PROCESS_URL_EXTRACTOR); PUMP_DEBUG; // The destination host is in the context. if(context.isUndefined() || !mRequest) @@ -755,7 +755,7 @@ void LLURLRequestComplete::responseStatus(LLIOPipe::EStatus status) mRequestStatus = status; } -static LLFastTimer::DeclareTimer FTM_PROCESS_URL_COMPLETE("URL Complete"); +static LLTrace::TimeBlock FTM_PROCESS_URL_COMPLETE("URL Complete"); // virtual LLIOPipe::EStatus LLURLRequestComplete::process_impl( const LLChannelDescriptors& channels, @@ -764,7 +764,7 @@ LLIOPipe::EStatus LLURLRequestComplete::process_impl( LLSD& context, LLPumpIO* pump) { - LLFastTimer t(FTM_PROCESS_URL_COMPLETE); + LL_RECORD_BLOCK_TIME(FTM_PROCESS_URL_COMPLETE); PUMP_DEBUG; complete(channels, buffer); return STATUS_OK; -- cgit v1.2.3 From 697d2e720ba75e142a4d56ae8794bab8d7698dad Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Tue, 15 Oct 2013 20:24:42 -0700 Subject: renamed TimeBlock to BlockTimerStatHandle --- indra/llmessage/llurlrequest.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'indra/llmessage/llurlrequest.cpp') diff --git a/indra/llmessage/llurlrequest.cpp b/indra/llmessage/llurlrequest.cpp index 70c0354d62..11630ac022 100755 --- a/indra/llmessage/llurlrequest.cpp +++ b/indra/llmessage/llurlrequest.cpp @@ -282,11 +282,11 @@ LLIOPipe::EStatus LLURLRequest::handleError( return status; } -static LLTrace::TimeBlock FTM_PROCESS_URL_REQUEST("URL Request"); -static LLTrace::TimeBlock FTM_PROCESS_URL_REQUEST_GET_RESULT("Get Result"); -static LLTrace::TimeBlock FTM_URL_PERFORM("Perform"); -static LLTrace::TimeBlock FTM_PROCESS_URL_PUMP_RESPOND("Pump Respond"); -static LLTrace::TimeBlock FTM_URL_ADJUST_TIMEOUT("Adjust Timeout"); +static LLTrace::BlockTimerStatHandle FTM_PROCESS_URL_REQUEST("URL Request"); +static LLTrace::BlockTimerStatHandle FTM_PROCESS_URL_REQUEST_GET_RESULT("Get Result"); +static LLTrace::BlockTimerStatHandle FTM_URL_PERFORM("Perform"); +static LLTrace::BlockTimerStatHandle FTM_PROCESS_URL_PUMP_RESPOND("Pump Respond"); +static LLTrace::BlockTimerStatHandle FTM_URL_ADJUST_TIMEOUT("Adjust Timeout"); // virtual LLIOPipe::EStatus LLURLRequest::process_impl( @@ -466,7 +466,7 @@ void LLURLRequest::initialize() mResponseTransferedBytes = 0; } -static LLTrace::TimeBlock FTM_URL_REQUEST_CONFIGURE("URL Configure"); +static LLTrace::BlockTimerStatHandle FTM_URL_REQUEST_CONFIGURE("URL Configure"); bool LLURLRequest::configure() { LL_RECORD_BLOCK_TIME(FTM_URL_REQUEST_CONFIGURE); @@ -668,7 +668,7 @@ static size_t headerCallback(void* data, size_t size, size_t nmemb, void* user) return header_len; } -static LLTrace::TimeBlock FTM_PROCESS_URL_EXTRACTOR("URL Extractor"); +static LLTrace::BlockTimerStatHandle FTM_PROCESS_URL_EXTRACTOR("URL Extractor"); /** * LLContextURLExtractor */ @@ -755,7 +755,7 @@ void LLURLRequestComplete::responseStatus(LLIOPipe::EStatus status) mRequestStatus = status; } -static LLTrace::TimeBlock FTM_PROCESS_URL_COMPLETE("URL Complete"); +static LLTrace::BlockTimerStatHandle FTM_PROCESS_URL_COMPLETE("URL Complete"); // virtual LLIOPipe::EStatus LLURLRequestComplete::process_impl( const LLChannelDescriptors& channels, -- cgit v1.2.3