From 3d9c74dcc869d7ce3708426a0b45bfb838529d3f Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Mon, 1 Jul 2013 16:19:24 -0400 Subject: CHOP-959: Introduce and use settings vars for some cmd_line switches. The cmd_line.xml entries: analyzeperformance crashonstartup debugsession disablecrashlogger logmetrics logperformance noquicktime replaysession all specify map-to settings.xml variables -- none of which existed! Introduce such variables. Instead of detecting the presence of a particular switch in the command-line parser, use the value of its corresponding settings variable. --- indra/newview/app_settings/settings.xml | 88 +++++++++++++++++++++++++++++++++ indra/newview/llappviewer.cpp | 52 ++++++------------- 2 files changed, 103 insertions(+), 37 deletions(-) diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 997bde37ce..a39b447cca 100755 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -126,6 +126,17 @@ Value 1 + AnalyzePerformance + + Comment + Request performance analysis for a particular viewer run + Persist + 0 + Type + Boolean + Value + 0 + AnimateTextures Comment @@ -1916,6 +1927,17 @@ Value 262144 + CrashOnStartup + + Comment + User-requested crash on viewer startup + Persist + 0 + Type + Boolean + Value + 0 + CreateToolCopyCenters Comment @@ -2158,6 +2180,17 @@ Value 0 + DebugSession + + Comment + Request debugging for a particular viewer session + Persist + 0 + Type + Boolean + Value + 0 + DebugShowColor Comment @@ -2972,6 +3005,17 @@ Value 0 + DisableCrashLogger + + Comment + Do not send crash report to Linden server + Persist + 0 + Type + Boolean + Value + 0 + DisableMouseWarp Comment @@ -5217,6 +5261,28 @@ Value 0 + LogMetrics + + Comment + Log viewer metrics + Persist + 0 + Type + String + Value + + + LogPerformance + + Comment + Log performance analysis for a particular viewer run + Persist + 0 + Type + Boolean + Value + 0 + LogTextureNetworkTraffic Comment @@ -6394,6 +6460,17 @@ Value 0 + NoQuickTime + + Comment + Disable QuickTime for a particular viewer run + Persist + 0 + Type + Boolean + Value + 0 + NoVerifySSLCert Comment @@ -9643,6 +9720,17 @@ Value 1 + ReplaySession + + Comment + Request replay of previously-recorded pilot file + Persist + 0 + Type + Boolean + Value + 0 + RotateRight Comment diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 5b301c03a1..613a23630f 100755 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -2463,7 +2463,7 @@ bool LLAppViewer::initConfiguration() // Register the core crash option as soon as we can // if we want gdb post-mortem on cores we need to be up and running // ASAP or we might miss init issue etc. - if(clp.hasOption("disablecrashlogger")) + if(gSavedSettings.getBOOL("DisableCrashLogger")) { llwarns << "Crashes will be handled by system, stack trace logs and crash logger are both disabled" << llendl; LLAppViewer::instance()->disableCrashlogger(); @@ -2542,59 +2542,37 @@ bool LLAppViewer::initConfiguration() } // If we have specified crash on startup, set the global so we'll trigger the crash at the right time - if(clp.hasOption("crashonstartup")) - { - gCrashOnStartup = TRUE; - } + gCrashOnStartup = gSavedSettings.getBOOL("CrashOnStartup"); - if (clp.hasOption("logperformance")) + if (gSavedSettings.getBOOL("LogPerformance")) { LLFastTimer::sLog = TRUE; LLFastTimer::sLogName = std::string("performance"); } - - if (clp.hasOption("logmetrics")) - { - LLFastTimer::sMetricLog = TRUE ; - // '--logmetrics' can be specified with a named test metric argument so the data gathering is done only on that test - // In the absence of argument, every metric is gathered (makes for a rather slow run and hard to decipher report...) - std::string test_name = clp.getOption("logmetrics")[0]; + + std::string test_name(gSavedSettings.getString("LogMetrics")); + if (! test_name.empty()) + { + LLFastTimer::sMetricLog = TRUE ; + // '--logmetrics' is specified with a named test metric argument so the data gathering is done only on that test + // In the absence of argument, every metric would be gathered (makes for a rather slow run and hard to decipher report...) llinfos << "'--logmetrics' argument : " << test_name << llendl; - if (test_name == "") - { - llwarns << "No '--logmetrics' argument given, will output all metrics to " << DEFAULT_METRIC_NAME << llendl; - LLFastTimer::sLogName = DEFAULT_METRIC_NAME; - } - else - { - LLFastTimer::sLogName = test_name; - } + LLFastTimer::sLogName = test_name; } if (clp.hasOption("graphicslevel")) { // User explicitly requested --graphicslevel on the command line. // We expect this switch has already set RenderQualityPerformance. + // Check that value for validity; if valid, we'll engage it later. mForceGraphicsDetail = LLFeatureManager::instance().isValidGraphicsLevel(gSavedSettings.getU32("RenderQualityPerformance")); } - if (clp.hasOption("analyzeperformance")) - { - LLFastTimerView::sAnalyzePerformance = TRUE; - } + LLFastTimerView::sAnalyzePerformance = gSavedSettings.getBOOL("AnalyzePerformance"); + gAgentPilot.setReplaySession(gSavedSettings.getBOOL("ReplaySession")); - if (clp.hasOption("replaysession")) - { - gAgentPilot.setReplaySession(TRUE); - } - - if (clp.hasOption("nonotifications")) - { - gSavedSettings.getControl("IgnoreAllNotifications")->setValue(true, false); - } - - if (clp.hasOption("debugsession")) + if (gSavedSettings.getBOOL("DebugSession")) { gDebugSession = TRUE; gDebugGL = TRUE; -- cgit v1.2.3