From aa7d505882f07cffea8b7cd145296f3c114c3f50 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Wed, 22 Sep 2010 12:27:48 -0700 Subject: EXP-108 FIX Create new "minimal" UI skin --- indra/newview/llappviewer.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/newview/llappviewer.cpp') diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 333c92e50d..1fd3632b85 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -2182,8 +2182,8 @@ bool LLAppViewer::initConfiguration() if(skinfolder && LLStringUtil::null != skinfolder->getValue().asString()) { // hack to force the skin to default. - //gDirUtilp->setSkinFolder(skinfolder->getValue().asString()); - gDirUtilp->setSkinFolder("default"); + gDirUtilp->setSkinFolder(skinfolder->getValue().asString()); + //gDirUtilp->setSkinFolder("default"); } mYieldTime = gSavedSettings.getS32("YieldTime"); -- cgit v1.2.3 From 18404624e0c9c2544b0ebba2b9758a606d2fe574 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Wed, 22 Sep 2010 15:02:23 -0700 Subject: support older use of "IgnoreAllNotifications" by command line option "nonotifications" such that value isn't saved --- indra/newview/llappviewer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llappviewer.cpp') diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 1fd3632b85..02a8c3e674 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -2135,7 +2135,7 @@ bool LLAppViewer::initConfiguration() if (clp.hasOption("nonotifications")) { - gSavedSettings.setBOOL("IgnoreAllNotifications", TRUE); + gSavedSettings.getControl("IgnoreAllNotifications")->setValue(true, false); } if (clp.hasOption("debugsession")) -- cgit v1.2.3 From 95ecad54c6f037910a5a22f7ef30026cf628fe80 Mon Sep 17 00:00:00 2001 From: callum Date: Tue, 28 Sep 2010 16:52:56 -0700 Subject: EXP-112 Enable fullscreen mode (with mode switch, not resize to desktop) as per 1.x viewer. --- indra/newview/llappviewer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llappviewer.cpp') diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 02a8c3e674..956f67df86 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -2386,7 +2386,7 @@ bool LLAppViewer::initWindow() VIEWER_WINDOW_CLASSNAME, gSavedSettings.getS32("WindowX"), gSavedSettings.getS32("WindowY"), gSavedSettings.getS32("WindowWidth"), gSavedSettings.getS32("WindowHeight"), - FALSE, ignorePixelDepth); + gSavedSettings.getBOOL("WindowFullScreen"), ignorePixelDepth); // Need to load feature table before cheking to start watchdog. const S32 NEVER_SUBMIT_REPORT = 2; -- cgit v1.2.3 From 7f003fa20df6ed60532271084696076ee61128de Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Thu, 30 Sep 2010 16:43:44 -0700 Subject: converted keys.ini to keys.xml and use LLInitParam parsing --- indra/newview/llappviewer.cpp | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) (limited to 'indra/newview/llappviewer.cpp') diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 956f67df86..a9bdabe794 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -820,16 +820,22 @@ bool LLAppViewer::init() gGLManager.getGLInfo(gDebugInfo); gGLManager.printGLInfoString(); - //load key settings - bind_keyboard_functions(); - // Load Default bindings - if (!gViewerKeyboard.loadBindings(gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS,"keys.ini"))) + std::string key_bindings_file = gDirUtilp->findFile("keys.xml", + gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, ""), + gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, "")); + + + if (!gViewerKeyboard.loadBindingsXML(key_bindings_file)) { - LL_ERRS("InitInfo") << "Unable to open keys.ini" << LL_ENDL; + std::string key_bindings_file = gDirUtilp->findFile("keys.ini", + gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, ""), + gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, "")); + if (!gViewerKeyboard.loadBindings(key_bindings_file)) + { + LL_ERRS("InitInfo") << "Unable to open keys.ini" << LL_ENDL; + } } - // Load Custom bindings (override defaults) - gViewerKeyboard.loadBindings(gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS,"custom_keys.ini")); // If we don't have the right GL requirements, exit. if (!gGLManager.mHasRequirements && !gNoRender) -- cgit v1.2.3 From dd2eff8da2b2508d5fc46492147e015d2455f957 Mon Sep 17 00:00:00 2001 From: callum Date: Thu, 7 Oct 2010 12:08:03 -0700 Subject: EXP-167: Quit On Login Page Activated - viewer code /default setting --- indra/newview/llappviewer.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'indra/newview/llappviewer.cpp') diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index a9bdabe794..e6661e4c9a 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -2951,6 +2951,14 @@ void LLAppViewer::earlyExit(const std::string& name, const LLSD& substitutions) LLNotificationsUtil::add(name, substitutions, LLSD(), finish_early_exit); } +// case where we need the viewer to exit without any need for notifications +void LLAppViewer::earlyExitNoNotify() +{ + llwarns << "app_early_exit with no notification: " << llendl; + gDoDisconnect = TRUE; + finish_early_exit( LLSD(), LLSD() ); +} + void LLAppViewer::forceExit(S32 arg) { removeMarkerFile(); -- cgit v1.2.3 From 77d1fa974ad6cc9be0b84e574b455693bfa7f702 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Fri, 8 Oct 2010 17:37:38 -0700 Subject: added "FastQuit" option for forceful termination, default is off --- indra/newview/llappviewer.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'indra/newview/llappviewer.cpp') diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index e6661e4c9a..91fae709df 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -2879,8 +2879,22 @@ void LLAppViewer::forceQuit() LLApp::setQuitting(); } +void LLAppViewer::fastQuit() +{ + if (LLStartUp::getStartupState() >= STATE_STARTED) + { + sendLogoutRequest(); + } + _exit(isError()); +} + void LLAppViewer::requestQuit() { + if (gSavedSettings.getBOOL("FastQuit")) + { + fastQuit(); + } + llinfos << "requestQuit" << llendl; LLViewerRegion* region = gAgent.getRegion(); -- cgit v1.2.3 From 0732b48be9c6378c31515ed92d29101e3743c8c9 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Wed, 13 Oct 2010 11:57:38 -0700 Subject: improved fastquit logic which should reliably disconnect viewer from sim --- indra/newview/llappviewer.cpp | 54 +++++++++++++++++++++++-------------------- 1 file changed, 29 insertions(+), 25 deletions(-) (limited to 'indra/newview/llappviewer.cpp') diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 91fae709df..a245639fac 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -1284,6 +1284,21 @@ bool LLAppViewer::mainLoop() return true; } +void LLAppViewer::flushVFSIO() +{ + while (1) + { + S32 pending = LLVFSThread::updateClass(0); + pending += LLLFSThread::updateClass(0); + if (!pending) + { + break; + } + llinfos << "Waiting for pending IO to finish: " << pending << llendflush; + ms_sleep(100); + } +} + bool LLAppViewer::cleanup() { // workaround for DEV-35406 crash on shutdown @@ -1419,17 +1434,7 @@ bool LLAppViewer::cleanup() llinfos << "Cache files removed" << llendflush; // Wait for any pending VFS IO - while (1) - { - S32 pending = LLVFSThread::updateClass(0); - pending += LLLFSThread::updateClass(0); - if (!pending) - { - break; - } - llinfos << "Waiting for pending IO to finish: " << pending << llendflush; - ms_sleep(100); - } + flushVFSIO(); llinfos << "Shutting down Views" << llendflush; // Destroy the UI @@ -2879,13 +2884,20 @@ void LLAppViewer::forceQuit() LLApp::setQuitting(); } -void LLAppViewer::fastQuit() +void LLAppViewer::fastQuit(S32 error_code) { - if (LLStartUp::getStartupState() >= STATE_STARTED) - { - sendLogoutRequest(); - } - _exit(isError()); + // finish pending transfers + flushVFSIO(); + // let sim know we're logging out + sendLogoutRequest(); + // flush network buffers by shutting down messaging system + end_messaging_system(); + // figure out the error code + S32 final_error_code = error_code ? error_code : (S32)isError(); + // this isn't a crash + removeMarkerFile(); + // get outta here + _exit(final_error_code); } void LLAppViewer::requestQuit() @@ -2973,14 +2985,6 @@ void LLAppViewer::earlyExitNoNotify() finish_early_exit( LLSD(), LLSD() ); } -void LLAppViewer::forceExit(S32 arg) -{ - removeMarkerFile(); - - // *FIX:Mani - This kind of exit hardly seems appropriate. - exit(arg); -} - void LLAppViewer::abortQuit() { llinfos << "abortQuit()" << llendl; -- cgit v1.2.3 From 8b9b7fed7367eeb7b055f7b2a44a37539634045e Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Thu, 14 Oct 2010 13:31:54 -0700 Subject: removed fastquit --- indra/newview/llappviewer.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'indra/newview/llappviewer.cpp') diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index a245639fac..39c3181cdc 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -2884,6 +2884,7 @@ void LLAppViewer::forceQuit() LLApp::setQuitting(); } +//TODO: remove void LLAppViewer::fastQuit(S32 error_code) { // finish pending transfers @@ -2902,11 +2903,6 @@ void LLAppViewer::fastQuit(S32 error_code) void LLAppViewer::requestQuit() { - if (gSavedSettings.getBOOL("FastQuit")) - { - fastQuit(); - } - llinfos << "requestQuit" << llendl; LLViewerRegion* region = gAgent.getRegion(); -- cgit v1.2.3 From eea2b8f9d3fe909befd43ca8db7878855ddd661d Mon Sep 17 00:00:00 2001 From: callum Date: Thu, 14 Oct 2010 15:18:00 -0700 Subject: EXP-225 FIX Add debug setting to quit the viewer after N seconds of AFK behavior. Viewer specific setting for this feature including default value in settings file --- indra/newview/llappviewer.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'indra/newview/llappviewer.cpp') diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index a245639fac..ba3c6a5916 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -3569,6 +3569,18 @@ void LLAppViewer::idle() } } + // debug setting to quit after N seconds of being AFK - 0 to never do this + F32 qas_afk = gSavedSettings.getF32("QuitAfterSecondsOfAFK"); + if (qas_afk > 0.f) + { + // idle time is more than setting + if ( gAwayTriggerTimer.getElapsedTimeF32() > qas_afk ) + { + // go ahead and just quit + LLAppViewer::instance()->forceQuit(); + } + } + // Must wait until both have avatar object and mute list, so poll // here. request_initial_instant_messages(); -- cgit v1.2.3 From a5bf17539846834d3e30eb16cae66b313b2dd060 Mon Sep 17 00:00:00 2001 From: callum Date: Fri, 15 Oct 2010 14:57:29 -0700 Subject: EXP-225 FIX Add debug setting to quit the viewer after N seconds of AFK behavior. This change makes the logout process less aggressive so zombie sessions do not get left behind --- indra/newview/llappviewer.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/newview/llappviewer.cpp') diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 61599ad435..ca2503c447 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -3572,8 +3572,8 @@ void LLAppViewer::idle() // idle time is more than setting if ( gAwayTriggerTimer.getElapsedTimeF32() > qas_afk ) { - // go ahead and just quit - LLAppViewer::instance()->forceQuit(); + // go ahead and just quit gracefully + LLAppViewer::instance()->requestQuit(); } } -- cgit v1.2.3 From 2a2256e8b06dfcefa10f32bf2c6775df19dfc782 Mon Sep 17 00:00:00 2001 From: Monroe Linden Date: Tue, 19 Oct 2010 16:44:09 -0700 Subject: Fix for EXP-201 -- "Clean shutdown" Reviewed by Brad and Mani. --- indra/newview/llappviewer.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'indra/newview/llappviewer.cpp') diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index ca2503c447..d658ad5c0e 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -2909,6 +2909,13 @@ void LLAppViewer::requestQuit() if( (LLStartUp::getStartupState() < STATE_STARTED) || !region ) { + // If we have a region, make some attempt to send a logout request first. + // This prevents the halfway-logged-in avatar from hanging around inworld for a couple minutes. + if(region) + { + sendLogoutRequest(); + } + // Quit immediately forceQuit(); return; @@ -4012,7 +4019,10 @@ void LLAppViewer::sendLogoutRequest() gLogoutMaxTime = LOGOUT_REQUEST_TIME; mLogoutRequestSent = TRUE; - LLVoiceClient::getInstance()->leaveChannel(); + if(LLVoiceClient::instanceExists()) + { + LLVoiceClient::getInstance()->leaveChannel(); + } //Set internal status variables and marker files gLogoutInProgress = TRUE; -- cgit v1.2.3 From d666a3d92cb5dd9844c29e5472db542de7b5ac9e Mon Sep 17 00:00:00 2001 From: Monty Brandenberg Date: Thu, 18 Nov 2010 08:43:09 -0800 Subject: ESC-154 ESC-155 ESC-156 Asset fetch requests wrapped to allow for measurements. Asset fetch enqueues, dequeues and completion times recorded to asset stats collector. Texture fetch operations (http and udp) recorded to asset stats collector. Stats collector time vallue switched from F32 to U64 which is the more common type in the viewer. Cross-thread mechanism introduced to communicate region changes and generate global statistics messages. Facility to deliver metrics via Capabilities sketched in but needs additional work. Documentation and diagrams added. --- indra/newview/llappviewer.cpp | 114 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 114 insertions(+) (limited to 'indra/newview/llappviewer.cpp') diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 333c92e50d..2e056238e4 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -190,6 +190,7 @@ #include "llparcel.h" #include "llavatariconctrl.h" #include "llgroupiconctrl.h" +#include "llviewerassetstats.h" // Include for security api initialization #include "llsecapi.h" @@ -332,6 +333,14 @@ static std::string gWindowTitle; LLAppViewer::LLUpdaterInfo *LLAppViewer::sUpdaterInfo = NULL ; +//---------------------------------------------------------------------------- +// Metrics logging control constants +//---------------------------------------------------------------------------- +static const F32 METRICS_INTERVAL_MIN = 300.0; +static const F32 METRICS_INTERVAL_MAX = 3600.0; +static const F32 METRICS_INTERVAL_DEFAULT = 600.0; + + void idle_afk_check() { // check idle timers @@ -656,6 +665,8 @@ bool LLAppViewer::init() LLCurl::initClass(); LLMachineID::init(); + LLViewerAssetStatsFF::init(); + initThreads(); writeSystemInfo(); @@ -1670,6 +1681,8 @@ bool LLAppViewer::cleanup() LLWatchdog::getInstance()->cleanup(); + LLViewerAssetStatsFF::cleanup(); + llinfos << "Shutting down message system" << llendflush; end_messaging_system(); @@ -3683,6 +3696,18 @@ void LLAppViewer::idle() gInventory.idleNotifyObservers(); } + // Metrics logging (LLViewerAssetStats, etc.) + { + static LLTimer report_interval; + + // *TODO: Add configuration controls for this + if (report_interval.getElapsedTimeF32() >= METRICS_INTERVAL_DEFAULT) + { + metricsIdle(! gDisconnected); + report_interval.reset(); + } + } + if (gDisconnected) { return; @@ -4525,3 +4550,92 @@ bool LLAppViewer::getMasterSystemAudioMute() { return gSavedSettings.getBOOL("MuteAudio"); } + +//---------------------------------------------------------------------------- +// Metrics-related methods (static and otherwise) +//---------------------------------------------------------------------------- + +/** + * LLViewerAssetStats collects data on a per-region (as defined by the agent's + * location) so we need to tell it about region changes which become a kind of + * hidden variable/global state in the collectors. For collectors not running + * on the main thread, we need to send a message to move the data over safely + * and cheaply (amortized over a run). + */ +void LLAppViewer::metricsUpdateRegion(const LLUUID & region_id) +{ + if (! region_id.isNull()) + { + LLViewerAssetStatsFF::set_region_main(region_id); + if (LLAppViewer::sTextureFetch) + { + // Send a region update message into 'thread1' to get the new region. + LLAppViewer::sTextureFetch->commandSetRegion(region_id); + } + else + { + // No 'thread1', a.k.a. TextureFetch, so update directly + LLViewerAssetStatsFF::set_region_thread1(region_id); + } + } +} + + +/** + * Attempts to start a multi-threaded metrics report to be sent back to + * the grid for consumption. + */ +void LLAppViewer::metricsIdle(bool enable_reporting) +{ + if (! gViewerAssetStatsMain) + return; + + std::string caps_url; + LLViewerRegion * regionp = gAgent.getRegion(); + if (regionp) + { + caps_url = regionp->getCapability("ViewerMetrics"); + caps_url = "http://localhost:80/putz/"; + } + + if (enable_reporting && regionp && ! caps_url.empty()) + { + // *NOTE: Pay attention here. LLSD's are not safe for thread sharing + // and their ownership is difficult to transfer across threads. We do + // it here by having only one reference (the new'd pointer) to the LLSD + // or any subtree of it. This pointer is then transfered to the other + // thread using correct thread logic. + + LLSD * envelope = new LLSD(LLSD::emptyMap()); + { + (*envelope)["session_id"] = gAgentSessionID; + (*envelope)["agent_id"] = gAgentID; + (*envelope)["regions"] = gViewerAssetStatsMain->asLLSD(); + } + + if (LLAppViewer::sTextureFetch) + { + // Send a report request into 'thread1' to get the rest of the data + // and have it sent to the stats collector. LLSD ownership transfers + // with this call. + LLAppViewer::sTextureFetch->commandSendMetrics(caps_url, envelope); + envelope = 0; // transfer noted + } + else + { + // No 'thread1' so transfer doesn't happen and we need to clean up + delete envelope; + envelope = 0; + } + } + else + { + LLAppViewer::sTextureFetch->commandDataBreak(); + } + + // Reset even if we can't report. Rather than gather up a huge chunk of + // data, we'll keep to our sampling interval and retain the data + // resolution in time. + gViewerAssetStatsMain->reset(); +} + -- cgit v1.2.3 From a99db82e9b3ce25bf2745721b57f0259a770b26a Mon Sep 17 00:00:00 2001 From: Monty Brandenberg Date: Fri, 19 Nov 2010 15:14:40 -0800 Subject: ESC-155 Multi-threaded umbrella collector for stats aggregation Code complete with the intelligence to merge counts, mins, maxes and means with reasonable defences. Added QAMode controls to the viewer so that we can QA this more quickly by reducing the timing interval and sending the metrics body to local logging as well as to the caps service. --- indra/newview/llappviewer.cpp | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) (limited to 'indra/newview/llappviewer.cpp') diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 2e056238e4..e696e1af84 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -336,10 +336,9 @@ LLAppViewer::LLUpdaterInfo *LLAppViewer::sUpdaterInfo = NULL ; //---------------------------------------------------------------------------- // Metrics logging control constants //---------------------------------------------------------------------------- -static const F32 METRICS_INTERVAL_MIN = 300.0; -static const F32 METRICS_INTERVAL_MAX = 3600.0; static const F32 METRICS_INTERVAL_DEFAULT = 600.0; - +static const F32 METRICS_INTERVAL_QA = 30.0; +static F32 app_metrics_interval = METRICS_INTERVAL_DEFAULT; void idle_afk_check() { @@ -664,8 +663,15 @@ bool LLAppViewer::init() // Called before threads are created. LLCurl::initClass(); LLMachineID::init(); - - LLViewerAssetStatsFF::init(); + + { + // Viewer metrics initialization + if (gSavedSettings.getBOOL("QAMode") && gSavedSettings.getBOOL("QAModeMetricsSubmode")) + { + app_metrics_interval = METRICS_INTERVAL_QA; + } + LLViewerAssetStatsFF::init(); + } initThreads(); writeSystemInfo(); @@ -3701,7 +3707,7 @@ void LLAppViewer::idle() static LLTimer report_interval; // *TODO: Add configuration controls for this - if (report_interval.getElapsedTimeF32() >= METRICS_INTERVAL_DEFAULT) + if (report_interval.getElapsedTimeF32() >= app_metrics_interval) { metricsIdle(! gDisconnected); report_interval.reset(); @@ -4595,7 +4601,6 @@ void LLAppViewer::metricsIdle(bool enable_reporting) if (regionp) { caps_url = regionp->getCapability("ViewerMetrics"); - caps_url = "http://localhost:80/putz/"; } if (enable_reporting && regionp && ! caps_url.empty()) @@ -4608,9 +4613,9 @@ void LLAppViewer::metricsIdle(bool enable_reporting) LLSD * envelope = new LLSD(LLSD::emptyMap()); { + (*envelope) = gViewerAssetStatsMain->asLLSD(); (*envelope)["session_id"] = gAgentSessionID; (*envelope)["agent_id"] = gAgentID; - (*envelope)["regions"] = gViewerAssetStatsMain->asLLSD(); } if (LLAppViewer::sTextureFetch) -- cgit v1.2.3 From 9ec3334184c71879c2f8bd0f27095b71c4302559 Mon Sep 17 00:00:00 2001 From: Monty Brandenberg Date: Tue, 23 Nov 2010 13:31:22 -0500 Subject: ESC-154 ESC-156 Data collection and control for viewer metrics Detect QAMode (and new QAModeMetricsSubmode) settings which enable logging of metrics report locally and a faster cycle time to reduce test waiting. Do this only in the main thread and propagate the result via collector constructors (will likely move that out and put it in llappviewer/lltexturefetch which is more correct scope). Managed to deadlock myself with a recursive mutex (sheesh). --- indra/newview/llappviewer.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'indra/newview/llappviewer.cpp') diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index e696e1af84..587d887146 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -666,11 +666,18 @@ bool LLAppViewer::init() { // Viewer metrics initialization - if (gSavedSettings.getBOOL("QAMode") && gSavedSettings.getBOOL("QAModeMetricsSubmode")) + static LLCachedControl metrics_submode(gSavedSettings, + "QAModeMetricsSubmode", + FALSE, + "Enables metrics submode when QAMode is also enabled"); + + bool qa_mode(false); + if (gSavedSettings.getBOOL("QAMode") && metrics_submode) { app_metrics_interval = METRICS_INTERVAL_QA; + qa_mode = true; } - LLViewerAssetStatsFF::init(); + LLViewerAssetStatsFF::init(qa_mode); } initThreads(); -- cgit v1.2.3 From 3962b155b4939f831dfd82701d46c4f15aa9f7ac Mon Sep 17 00:00:00 2001 From: Monty Brandenberg Date: Tue, 23 Nov 2010 12:29:15 -0800 Subject: ESC-154 ESC-156 Integrating metrics collector into viewer. After discussions, renamed 'QAModeMetricsSubmetrics' to 'QAModeMetrics' and confirmed that LLCachedControl<> is the way to go. Moved the resulting flag out of LLViewerAssetStats (where it didn't belong) and it lives in both LLAppViewer and LLTextureFetch where it does belong. --- indra/newview/llappviewer.cpp | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'indra/newview/llappviewer.cpp') diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 587d887146..07f4e71ebf 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -339,6 +339,7 @@ LLAppViewer::LLUpdaterInfo *LLAppViewer::sUpdaterInfo = NULL ; static const F32 METRICS_INTERVAL_DEFAULT = 600.0; static const F32 METRICS_INTERVAL_QA = 30.0; static F32 app_metrics_interval = METRICS_INTERVAL_DEFAULT; +static bool app_metrics_qa_mode = false; void idle_afk_check() { @@ -667,17 +668,16 @@ bool LLAppViewer::init() { // Viewer metrics initialization static LLCachedControl metrics_submode(gSavedSettings, - "QAModeMetricsSubmode", + "QAModeMetrics", FALSE, - "Enables metrics submode when QAMode is also enabled"); + "Enables QA features (logging, faster cycling) for metrics collector"); - bool qa_mode(false); - if (gSavedSettings.getBOOL("QAMode") && metrics_submode) + if (metrics_submode) { + app_metrics_qa_mode = true; app_metrics_interval = METRICS_INTERVAL_QA; - qa_mode = true; } - LLViewerAssetStatsFF::init(qa_mode); + LLViewerAssetStatsFF::init(); } initThreads(); @@ -1760,7 +1760,10 @@ bool LLAppViewer::initThreads() // Image decoding LLAppViewer::sImageDecodeThread = new LLImageDecodeThread(enable_threads && true); LLAppViewer::sTextureCache = new LLTextureCache(enable_threads && true); - LLAppViewer::sTextureFetch = new LLTextureFetch(LLAppViewer::getTextureCache(), sImageDecodeThread, enable_threads && true); + LLAppViewer::sTextureFetch = new LLTextureFetch(LLAppViewer::getTextureCache(), + sImageDecodeThread, + enable_threads && true, + app_metrics_qa_mode); LLImage::initClass(); if (LLFastTimer::sLog || LLFastTimer::sMetricLog) -- cgit v1.2.3 From 6abc60be577bd29c2428d85143c8f583eab54723 Mon Sep 17 00:00:00 2001 From: Monty Brandenberg Date: Tue, 23 Nov 2010 17:28:21 -0500 Subject: ESC-154 ESC-156 Viewer metrics Get the metrics message generation working in QAModeMetrics mode. Sample interval and data aren't correct yet but getting there. --- indra/newview/llappviewer.cpp | 50 +++++++++++++++++-------------------------- 1 file changed, 20 insertions(+), 30 deletions(-) (limited to 'indra/newview/llappviewer.cpp') diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 07f4e71ebf..86fba90ff7 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -667,9 +667,9 @@ bool LLAppViewer::init() { // Viewer metrics initialization - static LLCachedControl metrics_submode(gSavedSettings, + static LLCachedControl metrics_submode(gSavedSettings, "QAModeMetrics", - FALSE, + false, "Enables QA features (logging, faster cycling) for metrics collector"); if (metrics_submode) @@ -4606,30 +4606,26 @@ void LLAppViewer::metricsIdle(bool enable_reporting) if (! gViewerAssetStatsMain) return; - std::string caps_url; - LLViewerRegion * regionp = gAgent.getRegion(); - if (regionp) + if (LLAppViewer::sTextureFetch) { - caps_url = regionp->getCapability("ViewerMetrics"); - } - - if (enable_reporting && regionp && ! caps_url.empty()) - { - // *NOTE: Pay attention here. LLSD's are not safe for thread sharing - // and their ownership is difficult to transfer across threads. We do - // it here by having only one reference (the new'd pointer) to the LLSD - // or any subtree of it. This pointer is then transfered to the other - // thread using correct thread logic. - - LLSD * envelope = new LLSD(LLSD::emptyMap()); + LLViewerRegion * regionp = gAgent.getRegion(); + + if (enable_reporting && regionp) { - (*envelope) = gViewerAssetStatsMain->asLLSD(); - (*envelope)["session_id"] = gAgentSessionID; - (*envelope)["agent_id"] = gAgentID; - } + std::string caps_url = regionp->getCapability("ViewerMetrics"); + + // *NOTE: Pay attention here. LLSD's are not safe for thread sharing + // and their ownership is difficult to transfer across threads. We do + // it here by having only one reference (the new'd pointer) to the LLSD + // or any subtree of it. This pointer is then transfered to the other + // thread using correct thread logic to do all data ordering. + LLSD * envelope = new LLSD(LLSD::emptyMap()); + { + (*envelope) = gViewerAssetStatsMain->asLLSD(); + (*envelope)["session_id"] = gAgentSessionID; + (*envelope)["agent_id"] = gAgentID; + } - if (LLAppViewer::sTextureFetch) - { // Send a report request into 'thread1' to get the rest of the data // and have it sent to the stats collector. LLSD ownership transfers // with this call. @@ -4638,15 +4634,9 @@ void LLAppViewer::metricsIdle(bool enable_reporting) } else { - // No 'thread1' so transfer doesn't happen and we need to clean up - delete envelope; - envelope = 0; + LLAppViewer::sTextureFetch->commandDataBreak(); } } - else - { - LLAppViewer::sTextureFetch->commandDataBreak(); - } // Reset even if we can't report. Rather than gather up a huge chunk of // data, we'll keep to our sampling interval and retain the data -- cgit v1.2.3 From 0fd80d09972657e6417193abf577084a3b3b85f1 Mon Sep 17 00:00:00 2001 From: Monty Brandenberg Date: Wed, 24 Nov 2010 16:46:40 -0500 Subject: ESC-154 ESC-156 Metrics integration across threads Using unpause() method in derived class rather than wake() in furthest base class solved the stalling problem. I still think too many levels of the LLTextureFetch hierarchy are keeping thread state, however. The LLViewerRegion instance an agent enters doesn't necessarily have its region_id yet, that only comes after the handshake, if any. So add a few more metrics insertion points to propagate region into metrics. Finally, try to launch a final metrics report when a quit is initiated. --- indra/newview/llappviewer.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'indra/newview/llappviewer.cpp') diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 86fba90ff7..bf79523078 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -2932,6 +2932,7 @@ void LLAppViewer::requestQuit() LLSideTray::getInstance()->notifyChildren(LLSD().with("request","quit")); send_stats(); + metricsSend(!gDisconnected); gLogoutTimer.reset(); mQuitRequested = true; @@ -3719,7 +3720,7 @@ void LLAppViewer::idle() // *TODO: Add configuration controls for this if (report_interval.getElapsedTimeF32() >= app_metrics_interval) { - metricsIdle(! gDisconnected); + metricsSend(! gDisconnected); report_interval.reset(); } } @@ -4601,7 +4602,7 @@ void LLAppViewer::metricsUpdateRegion(const LLUUID & region_id) * Attempts to start a multi-threaded metrics report to be sent back to * the grid for consumption. */ -void LLAppViewer::metricsIdle(bool enable_reporting) +void LLAppViewer::metricsSend(bool enable_reporting) { if (! gViewerAssetStatsMain) return; -- cgit v1.2.3 From 0f2ed092c5712cd5dcd928e079671df383227068 Mon Sep 17 00:00:00 2001 From: Monty Brandenberg Date: Mon, 29 Nov 2010 08:31:08 -0800 Subject: ESC-154 ESC-156 Now using region hash rather than region uuid as identifier. In the viewer, the region's UUID is acquired very late and isn't generally used as the canonical region identifier. The U64 region hash is a better and more consistently used identifier so I'm moving over to using that as the region key. Don't have a proper reserved invalid region hash which is unfortunate, but then, so much is. --- indra/newview/llappviewer.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'indra/newview/llappviewer.cpp') diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index bf79523078..d73f3cd2fc 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -4579,20 +4579,20 @@ bool LLAppViewer::getMasterSystemAudioMute() * on the main thread, we need to send a message to move the data over safely * and cheaply (amortized over a run). */ -void LLAppViewer::metricsUpdateRegion(const LLUUID & region_id) +void LLAppViewer::metricsUpdateRegion(U64 region_handle) { - if (! region_id.isNull()) + if (0 != region_handle) { - LLViewerAssetStatsFF::set_region_main(region_id); + LLViewerAssetStatsFF::set_region_main(region_handle); if (LLAppViewer::sTextureFetch) { // Send a region update message into 'thread1' to get the new region. - LLAppViewer::sTextureFetch->commandSetRegion(region_id); + LLAppViewer::sTextureFetch->commandSetRegion(region_handle); } else { // No 'thread1', a.k.a. TextureFetch, so update directly - LLViewerAssetStatsFF::set_region_thread1(region_id); + LLViewerAssetStatsFF::set_region_thread1(region_handle); } } } -- cgit v1.2.3 From c51608633ddfdcf9a053fff37461059398ed4500 Mon Sep 17 00:00:00 2001 From: "Mark Palange (Mani)" Date: Wed, 1 Dec 2010 16:02:43 -0800 Subject: CHOP-238 Fix to bug introduced by http://hg.secondlife.com/viewer-beta/changeset/4072bd5389b2 Reviewed by Brad --- indra/newview/llappviewer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llappviewer.cpp') diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index b6f52e3e15..6c07974f69 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -906,7 +906,7 @@ bool LLAppViewer::init() // Save the current version to the prefs file gSavedSettings.setString("LastRunVersion", - LLVersionInfo::getVersionAndChannel()); + LLVersionInfo::getChannelAndVersion()); gSimLastTime = gRenderStartTime.getElapsedTimeF32(); gSimFrames = (F32)gFrameCount; -- cgit v1.2.3 From cf6147f7c092e6ca10697dea341099c5e281df00 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Wed, 8 Dec 2010 17:28:27 -0800 Subject: EXP-465 FIX Viewer window does not fill screen on Mac and Linux using --fullscreen disabled fullscreen mode for merge to viewer-development --- indra/newview/llappviewer.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'indra/newview/llappviewer.cpp') diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index cd53fb8970..b460885a53 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -505,6 +505,9 @@ static void settings_modify() gSavedSettings.setBOOL("VectorizeEnable", FALSE ); gSavedSettings.setU32("VectorizeProcessor", 0 ); gSavedSettings.setBOOL("VectorizeSkin", FALSE); + + // disable fullscreen mode, unsupported + gSavedSettings.setBOOL("WindowFullScreen", FALSE); #endif } -- cgit v1.2.3 From 4bab98f5cd2a815d10fe494a0a7e51cc237adb4a Mon Sep 17 00:00:00 2001 From: Monty Brandenberg Date: Fri, 10 Dec 2010 16:05:19 -0500 Subject: ESC-228 ESC-227 Corrections for metrics counters and send-on-quit delivery. Wanted to avoid computing metrics for duplicate requests as much as possible, they artificially depress averages but missed an opportunity and was including them in the counts. The non-texture case is solid. Textures are.... confounding still. Do a better job of trying to send one last packet to the grid when quitting. It is succeeding now, at least sometimes. Put a comment in base llassetstorage.cpp pointing to cut-n-paste derivation in llviewerassetstorage.cpp so that changes can be replicated. Hate doing this but current design forces it. --- indra/newview/llappviewer.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'indra/newview/llappviewer.cpp') diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 30005258ed..c667fba86f 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -3036,6 +3036,9 @@ void LLAppViewer::requestQuit() return; } + // Try to send metrics back to the grid + metricsSend(!gDisconnected); + LLHUDEffectSpiral *effectp = (LLHUDEffectSpiral*)LLHUDManager::getInstance()->createViewerEffect(LLHUDObject::LL_HUD_EFFECT_POINT, TRUE); effectp->setPositionGlobal(gAgent.getPositionGlobal()); effectp->setColor(LLColor4U(gAgent.getEffectColor())); @@ -3053,7 +3056,6 @@ void LLAppViewer::requestQuit() LLSideTray::getInstance()->notifyChildren(LLSD().with("request","quit")); send_stats(); - metricsSend(!gDisconnected); gLogoutTimer.reset(); mQuitRequested = true; -- cgit v1.2.3 From 11d420dd32e643a191c16b04f2fbb42c2b4db628 Mon Sep 17 00:00:00 2001 From: Monty Brandenberg Date: Fri, 10 Dec 2010 17:41:05 -0800 Subject: Decided to refactor a bit. Was using LLSD as an internal data representation transferring ownership, doing data aggregation in a very pedantic way. That's just adding unneeded cost and complication. Used the same objects to transport data as are collecting it and everything got simpler, faster, easier to read with fewer gotchas. Bit myself *again* doing the min/max/mean merges but the unittests where there to pick me up again. Added a per-region FPS metric while I was at it. This is much asked for and there was a convenient place to sample the value. --- indra/newview/llappviewer.cpp | 31 +++++++++++++++---------------- 1 file changed, 15 insertions(+), 16 deletions(-) (limited to 'indra/newview/llappviewer.cpp') diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index c667fba86f..3640d01642 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -3804,6 +3804,11 @@ void LLAppViewer::idle() llinfos << "Unknown object updates: " << gObjectList.mNumUnknownUpdates << llendl; gObjectList.mNumUnknownUpdates = 0; } + + // ViewerMetrics FPS piggy-backing on the debug timer. + // The 5-second interval is nice for this purpose. If the object debug + // bit moves or is disabled, please give this a suitable home. + LLViewerAssetStatsFF::record_fps_main(frame_rate_clamped); } } @@ -4805,23 +4810,17 @@ void LLAppViewer::metricsSend(bool enable_reporting) { std::string caps_url = regionp->getCapability("ViewerMetrics"); - // *NOTE: Pay attention here. LLSD's are not safe for thread sharing - // and their ownership is difficult to transfer across threads. We do - // it here by having only one reference (the new'd pointer) to the LLSD - // or any subtree of it. This pointer is then transfered to the other - // thread using correct thread logic to do all data ordering. - LLSD * envelope = new LLSD(LLSD::emptyMap()); - { - (*envelope) = gViewerAssetStatsMain->asLLSD(); - (*envelope)["session_id"] = gAgentSessionID; - (*envelope)["agent_id"] = gAgentID; - } - + // Make a copy of the main stats to send into another thread. + // Receiving thread takes ownership. + LLViewerAssetStats * main_stats(new LLViewerAssetStats(*gViewerAssetStatsMain)); + // Send a report request into 'thread1' to get the rest of the data - // and have it sent to the stats collector. LLSD ownership transfers - // with this call. - LLAppViewer::sTextureFetch->commandSendMetrics(caps_url, envelope); - envelope = 0; // transfer noted + // and provide some additional parameters while here. + LLAppViewer::sTextureFetch->commandSendMetrics(caps_url, + gAgentSessionID, + gAgentID, + main_stats); + main_stats = 0; // Ownership transferred } else { -- cgit v1.2.3 From bb53d27b7ad6e7bb7b1871f103b221703d56e4d2 Mon Sep 17 00:00:00 2001 From: Monty Brandenberg Date: Sat, 11 Dec 2010 16:16:07 -0500 Subject: ESC-211 ESC-212 Use arrays in payload to grid and compact payload First, introduced a compact payload format that allows blocks of metrics to be dropped from the viewer->collector payload compressing 1200 bytes of LLSD into about 300, give-or-take. Then converted to using LLSD arrays in the payload to enumerate the regions encountered. This simplifies much data handling from the viewer all the way into the final formatter of the metrics on the grid. --- indra/newview/llappviewer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llappviewer.cpp') diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 3640d01642..32bd51d3e2 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -3808,7 +3808,7 @@ void LLAppViewer::idle() // ViewerMetrics FPS piggy-backing on the debug timer. // The 5-second interval is nice for this purpose. If the object debug // bit moves or is disabled, please give this a suitable home. - LLViewerAssetStatsFF::record_fps_main(frame_rate_clamped); + LLViewerAssetStatsFF::record_fps_main(gFPSClamped); } } -- cgit v1.2.3