From 07c4be092b276f0d7c14ba12872efb31c1f16764 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Wed, 26 Sep 2012 19:12:40 -0700 Subject: SH-3275 WIP Run viewer metrics for object update messages slave threads now pushing data to master thread --- indra/llcommon/llqueuedthread.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'indra/llcommon/llqueuedthread.cpp') diff --git a/indra/llcommon/llqueuedthread.cpp b/indra/llcommon/llqueuedthread.cpp index 1738c16dea..a741d342d3 100644 --- a/indra/llcommon/llqueuedthread.cpp +++ b/indra/llcommon/llqueuedthread.cpp @@ -111,6 +111,8 @@ void LLQueuedThread::shutdown() // virtual S32 LLQueuedThread::update(F32 max_time_ms) { + LLThread::getTraceData()->pushToMaster(); + if (!mStarted) { if (!mThreaded) -- cgit v1.2.3 From 38354e19063478c8cda0408547ad05023b457041 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Fri, 28 Sep 2012 10:45:14 -0700 Subject: SH-3275 WIP Run viewer metrics for object update messages created separate constructor for static allocation of sampler buffer fixed start/stop/resume semantics of samplers and added sampler time interval tracking --- indra/llcommon/llqueuedthread.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/llcommon/llqueuedthread.cpp') diff --git a/indra/llcommon/llqueuedthread.cpp b/indra/llcommon/llqueuedthread.cpp index a741d342d3..0a35474b7f 100644 --- a/indra/llcommon/llqueuedthread.cpp +++ b/indra/llcommon/llqueuedthread.cpp @@ -28,6 +28,7 @@ #include "llstl.h" #include "lltimer.h" // ms_sleep() +#include "lltrace.h" //============================================================================ -- cgit v1.2.3 From 14b1b0b2bb6bac5bc688cc4d14c33f1b680dd3b4 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Mon, 1 Oct 2012 19:39:04 -0700 Subject: SH-3275 WIP Run viewer metrics for object update messages cleaned up API samplers are now value types with copy-on-write buffers under the hood removed coupling with LLThread --- indra/llcommon/llqueuedthread.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/llcommon/llqueuedthread.cpp') diff --git a/indra/llcommon/llqueuedthread.cpp b/indra/llcommon/llqueuedthread.cpp index 0a35474b7f..9aa449d037 100644 --- a/indra/llcommon/llqueuedthread.cpp +++ b/indra/llcommon/llqueuedthread.cpp @@ -112,7 +112,7 @@ void LLQueuedThread::shutdown() // virtual S32 LLQueuedThread::update(F32 max_time_ms) { - LLThread::getTraceData()->pushToMaster(); + LLTrace::get_thread_trace()->pushToMaster(); if (!mStarted) { -- cgit v1.2.3 From dbe9742703cf14db85ec3d16c540efc68dce95a6 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Tue, 2 Oct 2012 15:37:16 -0700 Subject: SH-3404 create sampler class renamed LLTrace::ThreadTrace to LLTrace::ThreadRecorder renamed LLTrace::Sampler to LLTrace::Recording --- indra/llcommon/llqueuedthread.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/llcommon/llqueuedthread.cpp') diff --git a/indra/llcommon/llqueuedthread.cpp b/indra/llcommon/llqueuedthread.cpp index 9aa449d037..6e2a2b140f 100644 --- a/indra/llcommon/llqueuedthread.cpp +++ b/indra/llcommon/llqueuedthread.cpp @@ -112,7 +112,7 @@ void LLQueuedThread::shutdown() // virtual S32 LLQueuedThread::update(F32 max_time_ms) { - LLTrace::get_thread_trace()->pushToMaster(); + LLTrace::get_thread_recorder()->pushToMaster(); if (!mStarted) { -- cgit v1.2.3 From 74ac0182ec8f7a0f6d0ea89f5814f0998ab90b62 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Wed, 10 Oct 2012 19:25:56 -0700 Subject: SH-3405 WIP convert existing stats to lltrace system fixed units conversion so that trace getters return convertable units removed circular dependencies from lltrace* converted more stats to lltrace --- indra/llcommon/llqueuedthread.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/llcommon/llqueuedthread.cpp') diff --git a/indra/llcommon/llqueuedthread.cpp b/indra/llcommon/llqueuedthread.cpp index 6e2a2b140f..218f6dbcd0 100644 --- a/indra/llcommon/llqueuedthread.cpp +++ b/indra/llcommon/llqueuedthread.cpp @@ -28,7 +28,7 @@ #include "llstl.h" #include "lltimer.h" // ms_sleep() -#include "lltrace.h" +#include "lltracethreadrecorder.h" //============================================================================ -- cgit v1.2.3 From 860ff2f7e2a7fe932dfb7c148f0dbc0067018038 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Wed, 7 Nov 2012 00:38:21 -0800 Subject: SH-3499 WIP Ensure asset stats output is correct fixed trace data gathering and routing from background thread simplified slave->master thread communication (eliminated redundant recording and proxy object) improved performance of fast timer data gathering (slow iterators) --- indra/llcommon/llqueuedthread.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'indra/llcommon/llqueuedthread.cpp') diff --git a/indra/llcommon/llqueuedthread.cpp b/indra/llcommon/llqueuedthread.cpp index 218f6dbcd0..956642e97a 100644 --- a/indra/llcommon/llqueuedthread.cpp +++ b/indra/llcommon/llqueuedthread.cpp @@ -112,8 +112,6 @@ void LLQueuedThread::shutdown() // virtual S32 LLQueuedThread::update(F32 max_time_ms) { - LLTrace::get_thread_recorder()->pushToMaster(); - if (!mStarted) { if (!mThreaded) @@ -511,6 +509,9 @@ void LLQueuedThread::run() threadedUpdate(); int res = processNextRequest(); + + LLTrace::get_thread_recorder()->pushToMaster(); + if (res == 0) { mIdleThread = TRUE; -- cgit v1.2.3 From f850ae03b399a5cc7aa32f82b8ed996518a86a2a Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Mon, 20 May 2013 00:01:57 -0700 Subject: SH-3931 WIP Interesting: Add graphs to visualize scene load metrics fixed copy construction of Recorders, eliminated most zero-length frames fixed reset behavior of periodic recordings and extendable recordings to clear entire history removed busy-loop recording of stats from worker threads...stats reported only when work is done --- indra/llcommon/llqueuedthread.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'indra/llcommon/llqueuedthread.cpp') diff --git a/indra/llcommon/llqueuedthread.cpp b/indra/llcommon/llqueuedthread.cpp index 956642e97a..4339f203db 100644 --- a/indra/llcommon/llqueuedthread.cpp +++ b/indra/llcommon/llqueuedthread.cpp @@ -404,6 +404,7 @@ S32 LLQueuedThread::processNextRequest() QueuedRequest *req; // Get next request from pool lockData(); + while(1) { req = NULL; @@ -468,10 +469,11 @@ S32 LLQueuedThread::processNextRequest() ms_sleep(1); // sleep the thread a little } } + + LLTrace::get_thread_recorder()->pushToMaster(); } S32 pending = getPending(); - return pending; } @@ -500,6 +502,7 @@ void LLQueuedThread::run() if (isQuitting()) { + LLTrace::get_thread_recorder()->pushToMaster(); endThread(); break; } @@ -508,11 +511,9 @@ void LLQueuedThread::run() threadedUpdate(); - int res = processNextRequest(); - - LLTrace::get_thread_recorder()->pushToMaster(); + int pending_work = processNextRequest(); - if (res == 0) + if (pending_work == 0) { mIdleThread = TRUE; ms_sleep(1); -- cgit v1.2.3 From 2fc422f39ddaca25c69e8cf2092a9d66840379f3 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Sun, 30 Jun 2013 13:32:34 -0700 Subject: fixed memory leak due to implementation of LLThreadLocalSingleton removed LLThreadLocalSingleton collapsed all thread recorder classes to single type, LLTrace::ThreadRecorder moved fasttimer stack head to llthreadlocalsingletonpointer via ThreadRecorder --- indra/llcommon/llqueuedthread.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/llcommon/llqueuedthread.cpp') diff --git a/indra/llcommon/llqueuedthread.cpp b/indra/llcommon/llqueuedthread.cpp index 4339f203db..3689c4728e 100755 --- a/indra/llcommon/llqueuedthread.cpp +++ b/indra/llcommon/llqueuedthread.cpp @@ -470,7 +470,7 @@ S32 LLQueuedThread::processNextRequest() } } - LLTrace::get_thread_recorder()->pushToMaster(); + LLTrace::get_thread_recorder()->pushToParent(); } S32 pending = getPending(); @@ -502,7 +502,7 @@ void LLQueuedThread::run() if (isQuitting()) { - LLTrace::get_thread_recorder()->pushToMaster(); + LLTrace::get_thread_recorder()->pushToParent(); endThread(); break; } -- 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/llcommon/llqueuedthread.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'indra/llcommon/llqueuedthread.cpp') diff --git a/indra/llcommon/llqueuedthread.cpp b/indra/llcommon/llqueuedthread.cpp index 3689c4728e..176761c17c 100755 --- a/indra/llcommon/llqueuedthread.cpp +++ b/indra/llcommon/llqueuedthread.cpp @@ -81,7 +81,7 @@ void LLQueuedThread::shutdown() } if (timeout == 0) { - llwarns << "~LLQueuedThread (" << mName << ") timed out!" << llendl; + LL_WARNS() << "~LLQueuedThread (" << mName << ") timed out!" << LL_ENDL; } } else @@ -102,7 +102,7 @@ void LLQueuedThread::shutdown() } if (active_count) { - llwarns << "~LLQueuedThread() called with active requests: " << active_count << llendl; + LL_WARNS() << "~LLQueuedThread() called with active requests: " << active_count << LL_ENDL; } } @@ -199,11 +199,11 @@ void LLQueuedThread::printQueueStats() if (!mRequestQueue.empty()) { QueuedRequest *req = *mRequestQueue.begin(); - llinfos << llformat("Pending Requests:%d Current status:%d", mRequestQueue.size(), req->getStatus()) << llendl; + LL_INFOS() << llformat("Pending Requests:%d Current status:%d", mRequestQueue.size(), req->getStatus()) << LL_ENDL; } else { - llinfos << "Queued Thread Idle" << llendl; + LL_INFOS() << "Queued Thread Idle" << LL_ENDL; } unlockData(); } @@ -234,7 +234,7 @@ bool LLQueuedThread::addRequest(QueuedRequest* req) mRequestQueue.insert(req); mRequestHash.insert(req); #if _DEBUG -// llinfos << llformat("LLQueuedThread::Added req [%08d]",handle) << llendl; +// LL_INFOS() << llformat("LLQueuedThread::Added req [%08d]",handle) << LL_ENDL; #endif unlockData(); @@ -365,7 +365,7 @@ bool LLQueuedThread::completeRequest(handle_t handle) llassert_always(req->getStatus() != STATUS_QUEUED); llassert_always(req->getStatus() != STATUS_INPROGRESS); #if _DEBUG -// llinfos << llformat("LLQueuedThread::Completed req [%08d]",handle) << llendl; +// LL_INFOS() << llformat("LLQueuedThread::Completed req [%08d]",handle) << LL_ENDL; #endif mRequestHash.erase(handle); req->deleteRequest(); @@ -386,7 +386,7 @@ bool LLQueuedThread::check() { if (entry->getHashKey() > mNextHandle) { - llerrs << "Hash Error" << llendl; + LL_ERRS() << "Hash Error" << LL_ENDL; return false; } entry = entry->getNextEntry(); @@ -520,7 +520,7 @@ void LLQueuedThread::run() } //LLThread::yield(); // thread should yield after each request } - llinfos << "LLQueuedThread " << mName << " EXITING." << llendl; + LL_INFOS() << "LLQueuedThread " << mName << " EXITING." << LL_ENDL; } // virtual -- cgit v1.2.3