diff options
Diffstat (limited to 'indra/newview/llappviewer.cpp')
-rwxr-xr-x | indra/newview/llappviewer.cpp | 500 |
1 files changed, 257 insertions, 243 deletions
diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index ffb168b43b..339a8f1ab0 100755 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -61,7 +61,8 @@ #include "llcalc.h" #include "llconversationlog.h" #include "lltexturestats.h" -#include "lltexturestats.h" +#include "lltrace.h" +#include "lltracethreadrecorder.h" #include "llviewerwindow.h" #include "llviewerdisplay.h" #include "llviewermedia.h" @@ -92,10 +93,10 @@ #include "llvocache.h" #include "llvopartgroup.h" #include "llweb.h" -#include "llsecondlifeurls.h" #include "llupdaterservice.h" #include "llfloatertexturefetchdebugger.h" #include "llspellcheck.h" +#include "llscenemonitor.h" // Linden library includes #include "llavatarnamecache.h" @@ -292,12 +293,12 @@ U32 gFrameCount = 0; U32 gForegroundFrameCount = 0; // number of frames that app window was in foreground LLPumpIO* gServicePump = NULL; -U64 gFrameTime = 0; -F32 gFrameTimeSeconds = 0.f; -F32 gFrameIntervalSeconds = 0.f; +LLUnitImplicit<U64, LLUnits::Microseconds> gFrameTime = 0; +LLUnitImplicit<F32, LLUnits::Seconds> gFrameTimeSeconds = 0.f; +LLUnitImplicit<F32, LLUnits::Seconds> gFrameIntervalSeconds = 0.f; F32 gFPSClamped = 10.f; // Pretend we start at target rate. F32 gFrameDTClamped = 0.f; // Time between adjacent checks to network for packets -U64 gStartTime = 0; // gStartTime is "private", used only to calculate gFrameTimeSeconds +LLUnitImplicit<U64, LLUnits::Microseconds> gStartTime = 0; // gStartTime is "private", used only to calculate gFrameTimeSeconds U32 gFrameStalls = 0; const F64 FRAME_STALL_THRESHOLD = 1.0; @@ -323,7 +324,7 @@ BOOL gUseWireframe = FALSE; LLVFS* gStaticVFS = NULL; LLMemoryInfo gSysMemory; -U64 gMemoryAllocated = 0; // updated in display_stats() in llviewerdisplay.cpp +U64Bytes gMemoryAllocated(0); // updated in display_stats() in llviewerdisplay.cpp std::string gLastVersionChannel; @@ -625,7 +626,7 @@ public: while (!LLAppViewer::instance()->isQuitting()) { - LLFastTimer::writeLog(os); + LLTrace::TimeBlock::writeLog(os); os.flush(); ms_sleep(32); } @@ -658,8 +659,13 @@ LLTextureCache* LLAppViewer::sTextureCache = NULL; LLImageDecodeThread* LLAppViewer::sImageDecodeThread = NULL; LLTextureFetch* LLAppViewer::sTextureFetch = NULL; -LLAppViewer::LLAppViewer() : - mMarkerFile(), +std::string getRuntime() +{ + return llformat("%.4f", (F32)LLTimer::getElapsedSeconds().value()); +} + +LLAppViewer::LLAppViewer() +: mMarkerFile(), mLogoutMarkerFile(), mReportedCrash(false), mNumSessions(0), @@ -682,7 +688,7 @@ LLAppViewer::LLAppViewer() : { if(NULL != sInstance) { - llerrs << "Oh no! An instance of LLAppViewer already exists! LLAppViewer is sort of like a singleton." << llendl; + LL_ERRS() << "Oh no! An instance of LLAppViewer already exists! LLAppViewer is sort of like a singleton." << LL_ENDL; } setupErrorHandling(); @@ -723,7 +729,6 @@ bool LLAppViewer::init() // into the log files during normal startup until AFTER // we run the "program crashed last time" error handler below. // - LLFastTimer::reset(); // initialize LLWearableType translation bridge. // Memory will be cleaned up in ::cleanupClass() @@ -745,7 +750,7 @@ bool LLAppViewer::init() initLoggingAndGetLastDuration(); processMarkerFiles(); - + // // OK to write stuff to logs now, we've now crash reported if necessary // @@ -1250,10 +1255,12 @@ static LLFastTimer::DeclareTimer FTM_SERVICE_CALLBACK("Callback"); static LLFastTimer::DeclareTimer FTM_AGENT_AUTOPILOT("Autopilot"); static LLFastTimer::DeclareTimer FTM_AGENT_UPDATE("Update"); -LLFastTimer::DeclareTimer FTM_FRAME("Frame", true); +LLFastTimer::DeclareTimer FTM_FRAME("Frame"); bool LLAppViewer::mainLoop() { + LL_INFOS() << "***********************Entering main_loop***********************" << LL_ENDL; + mMainloopTimeout = new LLWatchdogTimeout(); //------------------------------------------- @@ -1290,10 +1297,14 @@ bool LLAppViewer::mainLoop() while (!LLApp::isExiting()) { LLFastTimer _(FTM_FRAME); - LLFastTimer::nextFrame(); + LLTrace::TimeBlock::processTimes(); + LLTrace::get_frame_recording().nextPeriod(); + LLTrace::TimeBlock::logStats(); + + LLTrace::get_master_thread_recorder()->pullFromChildren(); //clear call stack records - llclearcallstacks; + LL_CLEAR_CALLSTACKS(); //check memory availability information checkMemory() ; @@ -1315,7 +1326,7 @@ bool LLAppViewer::mainLoop() LLFastTimer t2(FTM_MESSAGES); if (!restoreErrorTrap()) { - llwarns << " Someone took over my signal/exception handler (post messagehandling)!" << llendl; + LL_WARNS() << " Someone took over my signal/exception handler (post messagehandling)!" << LL_ENDL; } gViewerWindow->getWindow()->gatherInput(); @@ -1407,7 +1418,6 @@ bool LLAppViewer::mainLoop() LLFloaterSnapshot::update(); // take snapshots gGLActive = FALSE; } - } pingMainloopTimeout("Main:Sleep"); @@ -1450,11 +1460,11 @@ bool LLAppViewer::mainLoop() if (mPeriodicSlowFrame && (gFrameCount % 10 == 0)) { - llinfos << "Periodic slow frame - sleeping 500 ms" << llendl; + LL_INFOS() << "Periodic slow frame - sleeping 500 ms" << LL_ENDL; ms_sleep(500); } - const F64 max_idle_time = llmin(.005*10.0*gFrameTimeSeconds, 0.005); // 5 ms a second + const F64 max_idle_time = llmin(.005*10.0*gFrameTimeSeconds, LLUnitImplicit<F32, LLUnits::Seconds>(0.005f)); // 5 ms a second idleTimer.reset(); S32 total_work_pending = 0; S32 total_io_pending = 0; @@ -1462,20 +1472,9 @@ bool LLAppViewer::mainLoop() { S32 work_pending = 0; S32 io_pending = 0; - F32 max_time = llmin(gFrameIntervalSeconds*10.f, 1.f); + F32 max_time = llmin(gFrameIntervalSeconds.value() *10.f, 1.f); - { - LLFastTimer ftm(FTM_TEXTURE_CACHE); - work_pending += LLAppViewer::getTextureCache()->update(max_time); // unpauses the texture cache thread - } - { - LLFastTimer ftm(FTM_DECODE); - work_pending += LLAppViewer::getImageDecodeThread()->update(max_time); // unpauses the image thread - } - { - LLFastTimer ftm(FTM_DECODE); - work_pending += LLAppViewer::getTextureFetch()->update(max_time); // unpauses the texture fetch thread - } + work_pending += updateTextureThreads(max_time); { LLFastTimer ftm(FTM_VFS); @@ -1551,14 +1550,14 @@ bool LLAppViewer::mainLoop() if(mem_leak_instance) { mem_leak_instance->stop() ; - llwarns << "Bad memory allocation in LLAppViewer::mainLoop()!" << llendl ; + LL_WARNS() << "Bad memory allocation in LLAppViewer::mainLoop()!" << LL_ENDL ; } else { //output possible call stacks to log file. LLError::LLCallStacks::print() ; - llerrs << "Bad memory allocation in LLAppViewer::mainLoop()!" << llendl ; + LL_ERRS() << "Bad memory allocation in LLAppViewer::mainLoop()!" << LL_ENDL ; } } } @@ -1572,7 +1571,7 @@ bool LLAppViewer::mainLoop() } catch(std::bad_alloc) { - llwarns << "Bad memory allocation when saveFinalSnapshot() is called!" << llendl ; + LL_WARNS() << "Bad memory allocation when saveFinalSnapshot() is called!" << LL_ENDL ; //stop memory leaking simulation LLFloaterMemLeak* mem_leak_instance = @@ -1588,11 +1587,29 @@ bool LLAppViewer::mainLoop() destroyMainloopTimeout(); - llinfos << "Exiting main_loop" << llendflush; + LL_INFOS() << "***********************Exiting main_loop***********************" << LL_ENDL; return true; } +S32 LLAppViewer::updateTextureThreads(F32 max_time) +{ + S32 work_pending = 0; + { + LLFastTimer ftm(FTM_TEXTURE_CACHE); + work_pending += LLAppViewer::getTextureCache()->update(max_time); // unpauses the texture cache thread + } + { + LLFastTimer ftm(FTM_DECODE); + work_pending += LLAppViewer::getImageDecodeThread()->update(max_time); // unpauses the image thread + } + { + LLFastTimer ftm(FTM_DECODE); + work_pending += LLAppViewer::getTextureFetch()->update(max_time); // unpauses the texture fetch thread + } + return work_pending; +} + void LLAppViewer::flushVFSIO() { while (1) @@ -1603,7 +1620,7 @@ void LLAppViewer::flushVFSIO() { break; } - llinfos << "Waiting for pending IO to finish: " << pending << llendflush; + LL_INFOS() << "Waiting for pending IO to finish: " << pending << LL_ENDL; ms_sleep(100); } } @@ -1616,12 +1633,15 @@ bool LLAppViewer::cleanup() // workaround for DEV-35406 crash on shutdown LLEventPumps::instance().reset(); + //dump scene loading monitor results + LLSceneMonitor::instance().dumpToFile(gDirUtilp->getExpandedFilename(LL_PATH_LOGS, "scene_monitor_results.csv")); + if (LLFastTimerView::sAnalyzePerformance) { - llinfos << "Analyzing performance" << llendl; - std::string baseline_name = LLFastTimer::sLogName + "_baseline.slp"; - std::string current_name = LLFastTimer::sLogName + ".slp"; - std::string report_name = LLFastTimer::sLogName + "_report.csv"; + LL_INFOS() << "Analyzing performance" << LL_ENDL; + std::string baseline_name = LLTrace::TimeBlock::sLogName + "_baseline.slp"; + std::string current_name = LLTrace::TimeBlock::sLogName + ".slp"; + std::string report_name = LLTrace::TimeBlock::sLogName + "_report.csv"; LLFastTimerView::doAnalysis( gDirUtilp->getExpandedFilename(LL_PATH_LOGS, baseline_name), @@ -1664,7 +1684,7 @@ bool LLAppViewer::cleanup() disconnectViewer(); - llinfos << "Viewer disconnected" << llendflush; + LL_INFOS() << "Viewer disconnected" << LL_ENDL; display_cleanup(); @@ -1672,7 +1692,7 @@ bool LLAppViewer::cleanup() LLError::logToFixedBuffer(NULL); - llinfos << "Cleaning Up" << llendflush; + LL_INFOS() << "Cleaning Up" << LL_ENDL; // shut down mesh streamer gMeshRepo.shutdown(); @@ -1687,7 +1707,7 @@ bool LLAppViewer::cleanup() LLHUDObject::updateAll(); LLHUDManager::getInstance()->cleanupEffects(); LLHUDObject::cleanupHUDObjects(); - llinfos << "HUD Objects cleaned up" << llendflush; + LL_INFOS() << "HUD Objects cleaned up" << LL_ENDL; } LLKeyframeDataCache::clear(); @@ -1718,7 +1738,7 @@ bool LLAppViewer::cleanup() LLCalc::cleanUp(); - llinfos << "Global stuff deleted" << llendflush; + LL_INFOS() << "Global stuff deleted" << LL_ENDL; if (gAudiop) { @@ -1729,7 +1749,7 @@ bool LLAppViewer::cleanup() gAudiop->setStreamingAudioImpl(NULL); // shut down the audio subsystem - gAudiop->shutdown(); + gAudiop->shutdown(); delete gAudiop; gAudiop = NULL; @@ -1742,7 +1762,7 @@ bool LLAppViewer::cleanup() // such that we can suck rectangle information out of // it. cleanupSavedSettings(); - llinfos << "Settings patched up" << llendflush; + LL_INFOS() << "Settings patched up" << LL_ENDL; // delete some of the files left around in the cache. removeCacheFiles("*.wav"); @@ -1753,29 +1773,29 @@ bool LLAppViewer::cleanup() removeCacheFiles("*.bodypart"); removeCacheFiles("*.clothing"); - llinfos << "Cache files removed" << llendflush; + LL_INFOS() << "Cache files removed" << LL_ENDL; // Wait for any pending VFS IO flushVFSIO(); - llinfos << "Shutting down Views" << llendflush; + LL_INFOS() << "Shutting down Views" << LL_ENDL; // Destroy the UI if( gViewerWindow) gViewerWindow->shutdownViews(); - llinfos << "Cleaning up Inventory" << llendflush; + LL_INFOS() << "Cleaning up Inventory" << LL_ENDL; // Cleanup Inventory after the UI since it will delete any remaining observers // (Deleted observers should have already removed themselves) gInventory.cleanupInventory(); - llinfos << "Cleaning up Selections" << llendflush; + LL_INFOS() << "Cleaning up Selections" << LL_ENDL; // Clean up selection managers after UI is destroyed, as UI may be observing them. // Clean up before GL is shut down because we might be holding on to objects with texture references LLSelectMgr::cleanupGlobals(); - llinfos << "Shutting down OpenGL" << llendflush; + LL_INFOS() << "Shutting down OpenGL" << LL_ENDL; // Shut down OpenGL if( gViewerWindow) @@ -1787,10 +1807,10 @@ bool LLAppViewer::cleanup() // Therefore must do this before destroying the message system. delete gViewerWindow; gViewerWindow = NULL; - llinfos << "ViewerWindow deleted" << llendflush; + LL_INFOS() << "ViewerWindow deleted" << LL_ENDL; } - llinfos << "Cleaning up Keyboard & Joystick" << llendflush; + LL_INFOS() << "Cleaning up Keyboard & Joystick" << LL_ENDL; // viewer UI relies on keyboard so keep it aound until viewer UI isa gone delete gKeyboard; @@ -1799,7 +1819,7 @@ bool LLAppViewer::cleanup() // Turn off Space Navigator and similar devices LLViewerJoystick::getInstance()->terminate(); - llinfos << "Cleaning up Objects" << llendflush; + LL_INFOS() << "Cleaning up Objects" << LL_ENDL; LLViewerObject::cleanupVOClasses(); @@ -1821,11 +1841,11 @@ bool LLAppViewer::cleanup() LLVolumeMgr* volume_manager = LLPrimitive::getVolumeManager(); if (!volume_manager->cleanup()) { - llwarns << "Remaining references in the volume manager!" << llendflush; + LL_WARNS() << "Remaining references in the volume manager!" << LL_ENDL; } LLPrimitive::cleanupVolumeManager(); - llinfos << "Additional Cleanup..." << llendflush; + LL_INFOS() << "Additional Cleanup..." << LL_ENDL; LLViewerParcelMgr::cleanupGlobals(); @@ -1846,10 +1866,10 @@ bool LLAppViewer::cleanup() // Also after shutting down the messaging system since it has VFS dependencies // - llinfos << "Cleaning up VFS" << llendflush; + LL_INFOS() << "Cleaning up VFS" << LL_ENDL; LLVFile::cleanupClass(); - llinfos << "Saving Data" << llendflush; + LL_INFOS() << "Saving Data" << LL_ENDL; // Store the time of our current logoff gSavedPerAccountSettings.setU32("LastLogoff", time_corrected()); @@ -1864,19 +1884,19 @@ bool LLAppViewer::cleanup() // *FIX:Mani This should get really saved in a "logoff" mode. if (gSavedSettings.getString("PerAccountSettingsFile").empty()) { - llinfos << "Not saving per-account settings; don't know the account name yet." << llendl; + LL_INFOS() << "Not saving per-account settings; don't know the account name yet." << LL_ENDL; } // Only save per account settings if the previous login succeeded, otherwise // we might end up with a cleared out settings file in case a previous login // failed after loading per account settings. else if (!mSavePerAccountSettings) { - llinfos << "Not saving per-account settings; last login was not successful." << llendl; + LL_INFOS() << "Not saving per-account settings; last login was not successful." << LL_ENDL; } else { gSavedPerAccountSettings.saveToFile(gSavedSettings.getString("PerAccountSettingsFile"), TRUE); - llinfos << "Saved settings" << llendflush; + LL_INFOS() << "Saved settings" << LL_ENDL; } std::string warnings_settings_filename = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, getSettingsFilename("Default", "Warnings")); @@ -1893,7 +1913,7 @@ bool LLAppViewer::cleanup() if (mPurgeOnExit) { - llinfos << "Purging all cache files on exit" << llendflush; + LL_INFOS() << "Purging all cache files on exit" << LL_ENDL; gDirUtilp->deleteFilesInDir(gDirUtilp->getExpandedFilename(LL_PATH_CACHE,""), "*.*"); } @@ -1910,7 +1930,7 @@ bool LLAppViewer::cleanup() // Stop the plugin read thread if it's running. LLPluginProcessParent::setUseReadThread(false); - llinfos << "Shutting down Threads" << llendflush; + LL_INFOS() << "Shutting down Threads" << LL_ENDL; // Let threads finish LLTimer idleTimer; @@ -1932,7 +1952,7 @@ bool LLAppViewer::cleanup() } else if(idle_time >= max_idle_time) { - llwarns << "Quitting with pending background tasks." << llendl; + LL_WARNS() << "Quitting with pending background tasks." << LL_ENDL; break; } } @@ -1948,7 +1968,7 @@ bool LLAppViewer::cleanup() sTextureFetch->shutDownTextureCacheThread() ; sTextureFetch->shutDownImageDecodeThread() ; - llinfos << "Shutting down message system" << llendflush; + LL_INFOS() << "Shutting down message system" << LL_ENDL; end_messaging_system(); // *NOTE:Mani - The following call is not thread safe. @@ -1973,11 +1993,11 @@ bool LLAppViewer::cleanup() if (LLFastTimerView::sAnalyzePerformance) { - llinfos << "Analyzing performance" << llendl; + LL_INFOS() << "Analyzing performance" << LL_ENDL; - std::string baseline_name = LLFastTimer::sLogName + "_baseline.slp"; - std::string current_name = LLFastTimer::sLogName + ".slp"; - std::string report_name = LLFastTimer::sLogName + "_report.csv"; + std::string baseline_name = LLTrace::TimeBlock::sLogName + "_baseline.slp"; + std::string current_name = LLTrace::TimeBlock::sLogName + ".slp"; + std::string report_name = LLTrace::TimeBlock::sLogName + "_report.csv"; LLFastTimerView::doAnalysis( gDirUtilp->getExpandedFilename(LL_PATH_LOGS, baseline_name), @@ -1987,7 +2007,7 @@ bool LLAppViewer::cleanup() LLMetricPerformanceTesterBasic::cleanClass() ; - llinfos << "Cleaning up Media and Textures" << llendflush; + LL_INFOS() << "Cleaning up Media and Textures" << LL_ENDL; //Note: //LLViewerMedia::cleanupClass() has to be put before gTextureList.shutdown() @@ -2003,14 +2023,14 @@ bool LLAppViewer::cleanup() LLLFSThread::cleanupClass(); #ifndef LL_RELEASE_FOR_DOWNLOAD - llinfos << "Auditing VFS" << llendl; + LL_INFOS() << "Auditing VFS" << LL_ENDL; if(gVFS) { gVFS->audit(); } #endif - llinfos << "Misc Cleanup" << llendflush; + LL_INFOS() << "Misc Cleanup" << LL_ENDL; // For safety, the LLVFS has to be deleted *after* LLVFSThread. This should be cleaned up. // (LLVFS doesn't know about LLVFSThread so can't kill pending requests) -Steve @@ -2030,7 +2050,7 @@ bool LLAppViewer::cleanup() // is at the right resolution before we launch IE. if (!gLaunchFileOnQuit.empty()) { - llinfos << "Launch file on quit." << llendflush; + LL_INFOS() << "Launch file on quit." << LL_ENDL; #if LL_WINDOWS // Indicate an application is starting. SetCursor(LoadCursor(NULL, IDC_WAIT)); @@ -2040,9 +2060,9 @@ bool LLAppViewer::cleanup() ms_sleep(1000); LLWeb::loadURLExternal( gLaunchFileOnQuit, false ); - llinfos << "File launched." << llendflush; + LL_INFOS() << "File launched." << LL_ENDL; } - llinfos << "Cleaning up LLProxy." << llendl; + LL_INFOS() << "Cleaning up LLProxy." << LL_ENDL; LLProxy::cleanupClass(); LLWearableType::cleanupClass(); @@ -2054,15 +2074,13 @@ bool LLAppViewer::cleanup() ll_close_fail_log(); - MEM_TRACK_RELEASE - - llinfos << "Goodbye!" << llendflush; + LL_INFOS() << "Goodbye!" << LL_ENDL; // return 0; return true; } -// A callback for llerrs to call during the watchdog error. +// A callback for LL_ERRS() to call during the watchdog error. void watchdog_llerrs_callback(const std::string &error_string) { gLLErrorActivated = true; @@ -2078,16 +2096,12 @@ void watchdog_llerrs_callback(const std::string &error_string) void watchdog_killer_callback() { LLError::setFatalFunction(watchdog_llerrs_callback); - llerrs << "Watchdog killer event" << llendl; + LL_ERRS() << "Watchdog killer event" << LL_ENDL; } bool LLAppViewer::initThreads() { -#if MEM_TRACK_MEM - static const bool enable_threads = false; -#else static const bool enable_threads = true; -#endif LLImage::initClass(gSavedSettings.getBOOL("TextureNewByteRange"),gSavedSettings.getS32("TextureReverseByteRange")); @@ -2102,10 +2116,10 @@ bool LLAppViewer::initThreads() enable_threads && true, app_metrics_qa_mode); - if (LLFastTimer::sLog || LLFastTimer::sMetricLog) + if (LLTrace::TimeBlock::sLog || LLTrace::TimeBlock::sMetricLog) { - LLFastTimer::sLogLock = new LLMutex(NULL); - mFastTimerLogThread = new LLFastTimerLogThread(LLFastTimer::sLogName); + LLTrace::TimeBlock::setLogLock(new LLMutex(NULL)); + mFastTimerLogThread = new LLFastTimerLogThread(LLTrace::TimeBlock::sLogName); mFastTimerLogThread->start(); } @@ -2138,6 +2152,7 @@ void LLAppViewer::initLoggingAndGetLastDuration() LLError::initForApplication( gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, "")); LLError::setFatalFunction(errorCallback); + //LLError::setTimeFunction(getRuntime); // Remove the last ".old" log file. std::string old_log_file = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, @@ -2206,7 +2221,7 @@ bool LLAppViewer::loadSettingsFromDirectory(const std::string& location_key, { if (!mSettingsLocationList) { - llerrs << "Invalid settings location list" << llendl; + LL_ERRS() << "Invalid settings location list" << LL_ENDL; } BOOST_FOREACH(const SettingsGroup& group, mSettingsLocationList->groups) @@ -2217,19 +2232,19 @@ bool LLAppViewer::loadSettingsFromDirectory(const std::string& location_key, ELLPath path_index = (ELLPath)group.path_index(); if(path_index <= LL_PATH_NONE || path_index >= LL_PATH_LAST) { - llerrs << "Out of range path index in app_settings/settings_files.xml" << llendl; + LL_ERRS() << "Out of range path index in app_settings/settings_files.xml" << LL_ENDL; return false; } BOOST_FOREACH(const SettingsFile& file, group.files) { - llinfos << "Attempting to load settings for the group " << file.name() - << " - from location " << location_key << llendl; + LL_INFOS() << "Attempting to load settings for the group " << file.name() + << " - from location " << location_key << LL_ENDL; LLControlGroup* settings_group = LLControlGroup::getInstance(file.name); if(!settings_group) { - llwarns << "No matching settings group for name " << file.name() << llendl; + LL_WARNS() << "No matching settings group for name " << file.name() << LL_ENDL; continue; } @@ -2258,13 +2273,13 @@ bool LLAppViewer::loadSettingsFromDirectory(const std::string& location_key, if(settings_group->loadFromFile(full_settings_path, set_defaults, file.persistent)) { // success! - llinfos << "Loaded settings file " << full_settings_path << llendl; + LL_INFOS() << "Loaded settings file " << full_settings_path << LL_ENDL; } else { // failed to load if(file.required) { - llerrs << "Error: Cannot load required settings file from: " << full_settings_path << llendl; + LL_ERRS() << "Error: Cannot load required settings file from: " << full_settings_path << LL_ENDL; return false; } else @@ -2272,7 +2287,7 @@ bool LLAppViewer::loadSettingsFromDirectory(const std::string& location_key, // only complain if we actually have a filename at this point if (!full_settings_path.empty()) { - llinfos << "Cannot load " << full_settings_path << " - No settings found." << llendl; + LL_INFOS() << "Cannot load " << full_settings_path << " - No settings found." << LL_ENDL; } } } @@ -2312,17 +2327,17 @@ bool LLAppViewer::initConfiguration() //Load settings files list std::string settings_file_list = gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, "settings_files.xml"); //LLControlGroup settings_control("SettingsFiles"); - //llinfos << "Loading settings file list " << settings_file_list << llendl; + //LL_INFOS() << "Loading settings file list " << settings_file_list << LL_ENDL; //if (0 == settings_control.loadFromFile(settings_file_list)) //{ - // llerrs << "Cannot load default configuration file " << settings_file_list << llendl; + // LL_ERRS() << "Cannot load default configuration file " << settings_file_list << LL_ENDL; //} LLXMLNodePtr root; BOOL success = LLXMLNode::parseFile(settings_file_list, root, NULL); if (!success) { - llerrs << "Cannot load default configuration file " << settings_file_list << llendl; + LL_ERRS() << "Cannot load default configuration file " << settings_file_list << LL_ENDL; } mSettingsLocationList = new SettingsFiles(); @@ -2332,7 +2347,7 @@ bool LLAppViewer::initConfiguration() if (!mSettingsLocationList->validateBlock()) { - llerrs << "Invalid settings file list " << settings_file_list << llendl; + LL_ERRS() << "Invalid settings file list " << settings_file_list << LL_ENDL; } // The settings and command line parsing have a fragile @@ -2414,9 +2429,9 @@ bool LLAppViewer::initConfiguration() if(!initParseCommandLine(clp)) { - llwarns << "Error parsing command line options. Command Line options ignored." << llendl; + LL_WARNS() << "Error parsing command line options. Command Line options ignored." << LL_ENDL; - llinfos << "Command line usage:\n" << clp << llendl; + LL_INFOS() << "Command line usage:\n" << clp << LL_ENDL; std::ostringstream msg; msg << LLTrans::getString("MBCmdLineError") << clp.getErrorMessage(); @@ -2434,8 +2449,8 @@ bool LLAppViewer::initConfiguration() gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, clp.getOption("settings")[0]); gSavedSettings.setString("ClientSettingsFile", user_settings_filename); - llinfos << "Using command line specified settings filename: " - << user_settings_filename << llendl; + LL_INFOS() << "Using command line specified settings filename: " + << user_settings_filename << LL_ENDL; } // - load overrides from user_settings @@ -2451,8 +2466,8 @@ bool LLAppViewer::initConfiguration() { std::string session_settings_filename = clp.getOption("sessionsettings")[0]; gSavedSettings.setString("SessionSettingsFile", session_settings_filename); - llinfos << "Using session settings filename: " - << session_settings_filename << llendl; + LL_INFOS() << "Using session settings filename: " + << session_settings_filename << LL_ENDL; } loadSettingsFromDirectory("Session"); @@ -2460,8 +2475,8 @@ bool LLAppViewer::initConfiguration() { std::string user_session_settings_filename = clp.getOption("usersessionsettings")[0]; gSavedSettings.setString("UserSessionSettingsFile", user_session_settings_filename); - llinfos << "Using user session settings filename: " - << user_session_settings_filename << llendl; + LL_INFOS() << "Using user session settings filename: " + << user_session_settings_filename << LL_ENDL; } loadSettingsFromDirectory("UserSession"); @@ -2474,7 +2489,7 @@ bool LLAppViewer::initConfiguration() // ASAP or we might miss init issue etc. if(clp.hasOption("disablecrashlogger")) { - llwarns << "Crashes will be handled by system, stack trace logs and crash logger are both disabled" << llendl; + LL_WARNS() << "Crashes will be handled by system, stack trace logs and crash logger are both disabled" << LL_ENDL; LLAppViewer::instance()->disableCrashlogger(); } @@ -2489,7 +2504,7 @@ bool LLAppViewer::initConfiguration() { std::ostringstream msg; msg << LLTrans::getString("MBCmdLineUsg") << "\n" << clp; - llinfos << msg.str() << llendl; + LL_INFOS() << msg.str() << LL_ENDL; OSMessageBox( msg.str().c_str(), @@ -2504,7 +2519,7 @@ bool LLAppViewer::initConfiguration() const LLCommandLineParser::token_vector_t& set_values = clp.getOption("set"); if(0x1 & set_values.size()) { - llwarns << "Invalid '--set' parameter count." << llendl; + LL_WARNS() << "Invalid '--set' parameter count." << LL_ENDL; } else { @@ -2523,13 +2538,13 @@ bool LLAppViewer::initConfiguration() { group_part = name.substr(0, pos); name_part = name.substr(pos+1); - llinfos << "Setting " << group_part << "." << name_part << " to " << value << llendl; + LL_INFOS() << "Setting " << group_part << "." << name_part << " to " << value << LL_ENDL; LLControlGroup* g = LLControlGroup::getInstance(group_part); if (g) control = g->getControl(name_part); } else { - llinfos << "Setting Global." << name << " to " << value << llendl; + LL_INFOS() << "Setting Global." << name << " to " << value << LL_ENDL; control = gSavedSettings.getControl(name); } @@ -2539,7 +2554,7 @@ bool LLAppViewer::initConfiguration() } else { - llwarns << "Failed --set " << name << ": setting name unknown." << llendl; + LL_WARNS() << "Failed --set " << name << ": setting name unknown." << LL_ENDL; } } } @@ -2558,25 +2573,25 @@ bool LLAppViewer::initConfiguration() if (clp.hasOption("logperformance")) { - LLFastTimer::sLog = TRUE; - LLFastTimer::sLogName = std::string("performance"); + LLTrace::TimeBlock::sLog = true; + LLTrace::TimeBlock::sLogName = std::string("performance"); } if (clp.hasOption("logmetrics")) { - LLFastTimer::sMetricLog = TRUE ; + LLTrace::TimeBlock::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]; - llinfos << "'--logmetrics' argument : " << test_name << llendl; + LL_INFOS() << "'--logmetrics' argument : " << test_name << LL_ENDL; if (test_name == "") { - llwarns << "No '--logmetrics' argument given, will output all metrics to " << DEFAULT_METRIC_NAME << llendl; - LLFastTimer::sLogName = DEFAULT_METRIC_NAME; + LL_WARNS() << "No '--logmetrics' argument given, will output all metrics to " << DEFAULT_METRIC_NAME << LL_ENDL; + LLTrace::TimeBlock::sLogName = DEFAULT_METRIC_NAME; } else { - LLFastTimer::sLogName = test_name; + LLTrace::TimeBlock::sLogName = test_name; } } @@ -2585,7 +2600,7 @@ bool LLAppViewer::initConfiguration() const LLCommandLineParser::token_vector_t& value = clp.getOption("graphicslevel"); if(value.size() != 1) { - llwarns << "Usage: -graphicslevel <0-3>" << llendl; + LL_WARNS() << "Usage: -graphicslevel <0-3>" << LL_ENDL; } else { @@ -2608,7 +2623,7 @@ bool LLAppViewer::initConfiguration() break; default: mForceGraphicsDetail = FALSE; - llwarns << "Usage: -graphicslevel <0-3>" << llendl; + LL_WARNS() << "Usage: -graphicslevel <0-3>" << LL_ENDL; break; } } @@ -2702,7 +2717,7 @@ bool LLAppViewer::initConfiguration() // if (!skin_def_tree.parseFile(skin_def_file)) // { - // llerrs << "Failed to parse skin definition." << llendl; + // LL_ERRS() << "Failed to parse skin definition." << LL_ENDL; // } //} @@ -2894,10 +2909,10 @@ namespace { void apply_update_callback(LLSD const & notification, LLSD const & response) { - lldebugs << "LLUpdate user response: " << response << llendl; + LL_DEBUGS() << "LLUpdate user response: " << response << LL_ENDL; if(response["OK_okcancelbuttons"].asBoolean()) { - llinfos << "LLUpdate restarting viewer" << llendl; + LL_INFOS() << "LLUpdate restarting viewer" << LL_ENDL; static const bool install_if_ready = true; // *HACK - this lets us launch the installer immediately for now LLUpdaterService().startChecking(install_if_ready); @@ -2906,7 +2921,7 @@ namespace { void apply_update_ok_callback(LLSD const & notification, LLSD const & response) { - llinfos << "LLUpdate restarting viewer" << llendl; + LL_INFOS() << "LLUpdate restarting viewer" << LL_ENDL; static const bool install_if_ready = true; // *HACK - this lets us launch the installer immediately for now LLUpdaterService().startChecking(install_if_ready); @@ -2987,26 +3002,26 @@ namespace { { LL_WARNS("UpdaterService") << "no info url supplied - defaulting to hard coded release notes pattern" << LL_ENDL; - // truncate version at the rightmost '.' - std::string version_short(data["version"]); - size_t short_length = version_short.rfind('.'); - if (short_length != std::string::npos) - { - version_short.resize(short_length); - } + // truncate version at the rightmost '.' + std::string version_short(data["version"]); + size_t short_length = version_short.rfind('.'); + if (short_length != std::string::npos) + { + version_short.resize(short_length); + } - LLUIString relnotes_url("[RELEASE_NOTES_BASE_URL][CHANNEL_URL]/[VERSION_SHORT]"); - relnotes_url.setArg("[VERSION_SHORT]", version_short); + LLUIString relnotes_url("[RELEASE_NOTES_BASE_URL][CHANNEL_URL]/[VERSION_SHORT]"); + relnotes_url.setArg("[VERSION_SHORT]", version_short); - // *TODO thread the update service's response through to this point - std::string const & channel = LLVersionInfo::getChannel(); - boost::shared_ptr<char> channel_escaped(curl_escape(channel.c_str(), channel.size()), &curl_free); + // *TODO thread the update service's response through to this point + std::string const & channel = LLVersionInfo::getChannel(); + boost::shared_ptr<char> channel_escaped(curl_escape(channel.c_str(), channel.size()), &curl_free); - relnotes_url.setArg("[CHANNEL_URL]", channel_escaped.get()); - relnotes_url.setArg("[RELEASE_NOTES_BASE_URL]", LLTrans::getString("RELEASE_NOTES_BASE_URL")); + relnotes_url.setArg("[CHANNEL_URL]", channel_escaped.get()); + relnotes_url.setArg("[RELEASE_NOTES_BASE_URL]", LLTrans::getString("RELEASE_NOTES_BASE_URL")); substitutions["INFO_URL"] = relnotes_url.getString(); } - + LLNotificationsUtil::add(notification_name, substitutions, LLSD(), apply_callback); } @@ -3107,7 +3122,7 @@ void LLAppViewer::checkForCrash(void) #if LL_SEND_CRASH_REPORTS if (gLastExecEvent == LAST_EXEC_FROZE) { - llinfos << "Last execution froze, sending a crash report." << llendl; + LL_INFOS() << "Last execution froze, sending a crash report." << LL_ENDL; bool report_freeze = true; handleCrashReporting(report_freeze); @@ -3243,7 +3258,7 @@ bool LLAppViewer::initWindow() void LLAppViewer::writeDebugInfo() { std::string debug_filename = gDirUtilp->getExpandedFilename(LL_PATH_LOGS,"debug_info.log"); - llinfos << "Opening debug file " << debug_filename << llendl; + LL_INFOS() << "Opening debug file " << debug_filename << LL_ENDL; llofstream out_file(debug_filename); LLSDSerialize::toPrettyXML(gDebugInfo, out_file); out_file.close(); @@ -3314,8 +3329,8 @@ void LLAppViewer::writeSystemInfo() gDebugInfo["CPUInfo"]["CPUSSE"] = gSysCPU.hasSSE(); gDebugInfo["CPUInfo"]["CPUSSE2"] = gSysCPU.hasSSE2(); - gDebugInfo["RAMInfo"]["Physical"] = (LLSD::Integer)(gSysMemory.getPhysicalMemoryKB()); - gDebugInfo["RAMInfo"]["Allocated"] = (LLSD::Integer)(gMemoryAllocated>>10); // MB -> KB + gDebugInfo["RAMInfo"]["Physical"] = (LLSD::Integer)(gSysMemory.getPhysicalMemoryKB().value()); + gDebugInfo["RAMInfo"]["Allocated"] = (LLSD::Integer)(gMemoryAllocated.valueInUnits<LLUnits::Kibibytes>()); gDebugInfo["OSInfo"] = getOSInfo().getOSStringSimple(); // The user is not logged on yet, but record the current grid choice login url @@ -3366,9 +3381,9 @@ void LLAppViewer::writeSystemInfo() void LLAppViewer::handleViewerCrash() { - llinfos << "Handle viewer crash entry." << llendl; + LL_INFOS() << "Handle viewer crash entry." << LL_ENDL; - llinfos << "Last render pool type: " << LLPipeline::sCurRenderPoolType << llendl ; + LL_INFOS() << "Last render pool type: " << LLPipeline::sCurRenderPoolType << LL_ENDL ; LLMemory::logMemoryInfo(true) ; @@ -3473,9 +3488,9 @@ void LLAppViewer::handleViewerCrash() if (gDirUtilp) { std::string crash_marker_file_name = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, - gLLErrorActivated - ? LLERROR_MARKER_FILE_NAME - : ERROR_MARKER_FILE_NAME); + gLLErrorActivated + ? LLERROR_MARKER_FILE_NAME + : ERROR_MARKER_FILE_NAME); LLAPRFile crash_marker_file ; crash_marker_file.open(crash_marker_file_name, LL_APR_WB); if (crash_marker_file.getFileHandle()) @@ -3486,7 +3501,7 @@ void LLAppViewer::handleViewerCrash() else { LL_WARNS("MarkerFile") << "Cannot create error marker file " << crash_marker_file_name << LL_ENDL; - } + } } else { @@ -3500,7 +3515,7 @@ void LLAppViewer::handleViewerCrash() llofstream file(filename, llofstream::binary); if(file.good()) { - llinfos << "Handle viewer crash generating stats log." << llendl; + LL_INFOS() << "Handle viewer crash generating stats log." << LL_ENDL; gMessageSystem->summarizeLogs(file); file.close(); } @@ -3625,7 +3640,7 @@ void LLAppViewer::processMarkerFiles() } if (mSecondInstance) - { + { LL_INFOS("MarkerFile") << "Exec marker '"<< mMarkerFileName << "' owned by another instance" << LL_ENDL; } else if (marker_is_same_version) @@ -3639,7 +3654,7 @@ void LLAppViewer::processMarkerFiles() { LL_INFOS("MarkerFile") << "Exec marker '"<< mMarkerFileName << "' found, but versions did not match" << LL_ENDL; } - } + } else // marker did not exist... last exec (if any) did not freeze { // Create the marker file for this execution & lock it; it will be deleted on a clean exit @@ -3693,12 +3708,12 @@ void LLAppViewer::processMarkerFiles() { gLastExecEvent = LAST_EXEC_LOGOUT_CRASH; LL_INFOS("MarkerFile") << "LLError marker '"<< llerror_marker_file << "' crashed, setting LastExecEvent to LOGOUT_CRASH" << LL_ENDL; - } - else - { + } + else + { gLastExecEvent = LAST_EXEC_LLERROR_CRASH; LL_INFOS("MarkerFile") << "LLError marker '"<< llerror_marker_file << "' crashed, setting LastExecEvent to LLERROR_CRASH" << LL_ENDL; - } + } } else { @@ -3711,20 +3726,20 @@ void LLAppViewer::processMarkerFiles() if(LLAPRFile::isExist(error_marker_file, NULL, LL_APR_RB)) { if (markerIsSameVersion(error_marker_file)) - { + { if (gLastExecEvent == LAST_EXEC_LOGOUT_FROZE) - { + { gLastExecEvent = LAST_EXEC_LOGOUT_CRASH; LL_INFOS("MarkerFile") << "Error marker '"<< error_marker_file << "' crashed, setting LastExecEvent to LOGOUT_CRASH" << LL_ENDL; - } - else - { - gLastExecEvent = LAST_EXEC_OTHER_CRASH; - LL_INFOS("MarkerFile") << "Error marker '"<< error_marker_file << "' crashed, setting LastExecEvent to " << gLastExecEvent << LL_ENDL; - } } else { + gLastExecEvent = LAST_EXEC_OTHER_CRASH; + LL_INFOS("MarkerFile") << "Error marker '"<< error_marker_file << "' crashed, setting LastExecEvent to " << gLastExecEvent << LL_ENDL; + } + } + else + { LL_INFOS("MarkerFile") << "Error marker '"<< error_marker_file << "' marker found, but versions did not match" << LL_ENDL; } LLAPRFile::remove(error_marker_file); @@ -3736,30 +3751,30 @@ void LLAppViewer::removeMarkerFile(bool leave_logout_marker) if (!mSecondInstance) { LL_DEBUGS("MarkerFile") << (leave_logout_marker?"leave":"remove") <<" logout" << LL_ENDL; - if (mMarkerFile.getFileHandle()) - { + if (mMarkerFile.getFileHandle()) + { LL_DEBUGS("MarkerFile") << "removing exec marker '"<<mMarkerFileName<<"'"<< LL_ENDL; - mMarkerFile.close() ; - LLAPRFile::remove( mMarkerFileName ); - } - else - { + mMarkerFile.close(); + LLAPRFile::remove( mMarkerFileName ); + } + else + { LL_WARNS("MarkerFile") << "marker '"<<mMarkerFileName<<"' not open"<< LL_ENDL; - } - if (!leave_logout_marker) + } + if (!leave_logout_marker) + { + if (mLogoutMarkerFile.getFileHandle()) { - if (mLogoutMarkerFile.getFileHandle()) - { LL_DEBUGS("MarkerFile") << "removing logout marker '"<<mLogoutMarkerFileName<<"'"<< LL_ENDL; - mLogoutMarkerFile.close(); - } - else - { + mLogoutMarkerFile.close(); + } + else + { LL_WARNS("MarkerFile") << "logout marker '"<<mLogoutMarkerFileName<<"' not open"<< LL_ENDL; - } - LLAPRFile::remove( mLogoutMarkerFileName ); } + LLAPRFile::remove( mLogoutMarkerFileName ); } +} else { LL_WARNS("MarkerFile") << "leaving markers because this is a second instance" << LL_ENDL; @@ -3790,7 +3805,7 @@ void LLAppViewer::fastQuit(S32 error_code) void LLAppViewer::requestQuit() { - llinfos << "requestQuit" << llendl; + LL_INFOS() << "requestQuit" << LL_ENDL; LLViewerRegion* region = gAgent.getRegion(); @@ -3875,7 +3890,7 @@ static bool finish_early_exit(const LLSD& notification, const LLSD& response) void LLAppViewer::earlyExit(const std::string& name, const LLSD& substitutions) { - llwarns << "app_early_exit: " << name << llendl; + LL_WARNS() << "app_early_exit: " << name << LL_ENDL; gDoDisconnect = TRUE; LLNotificationsUtil::add(name, substitutions, LLSD(), finish_early_exit); } @@ -3883,14 +3898,14 @@ void LLAppViewer::earlyExit(const std::string& name, const LLSD& substitutions) // case where we need the viewer to exit without any need for notifications void LLAppViewer::earlyExitNoNotify() { - llwarns << "app_early_exit with no notification: " << llendl; + LL_WARNS() << "app_early_exit with no notification: " << LL_ENDL; gDoDisconnect = TRUE; finish_early_exit( LLSD(), LLSD() ); } void LLAppViewer::abortQuit() { - llinfos << "abortQuit()" << llendl; + LL_INFOS() << "abortQuit()" << LL_ENDL; mQuitRequested = false; } @@ -3922,7 +3937,7 @@ void LLAppViewer::migrateCacheDirectory() if (gDirUtilp->fileExists(old_cache_dir)) { - llinfos << "Migrating cache from " << old_cache_dir << " to " << new_cache_dir << llendl; + LL_INFOS() << "Migrating cache from " << old_cache_dir << " to " << new_cache_dir << LL_ENDL; // Migrate inventory cache to avoid pain to inventory database after mass update S32 file_count = 0; @@ -3940,7 +3955,7 @@ void LLAppViewer::migrateCacheDirectory() file_count++; } } - llinfos << "Moved " << file_count << " files" << llendl; + LL_INFOS() << "Moved " << file_count << " files" << LL_ENDL; // Nuke the old cache gDirUtilp->setCacheDir(old_cache_dir); @@ -3957,7 +3972,7 @@ void LLAppViewer::migrateCacheDirectory() #endif if (LLFile::rmdir(old_cache_dir) != 0) { - llwarns << "could not delete old cache directory " << old_cache_dir << llendl; + LL_WARNS() << "could not delete old cache directory " << old_cache_dir << LL_ENDL; } } } @@ -3966,10 +3981,10 @@ void LLAppViewer::migrateCacheDirectory() void dumpVFSCaches() { - llinfos << "======= Static VFS ========" << llendl; + LL_INFOS() << "======= Static VFS ========" << LL_ENDL; gStaticVFS->listFiles(); #if LL_WINDOWS - llinfos << "======= Dumping static VFS to StaticVFSDump ========" << llendl; + LL_INFOS() << "======= Dumping static VFS to StaticVFSDump ========" << LL_ENDL; WCHAR w_str[MAX_PATH]; GetCurrentDirectory(MAX_PATH, w_str); S32 res = LLFile::mkdir("StaticVFSDump"); @@ -3977,7 +3992,7 @@ void dumpVFSCaches() { if (errno != EEXIST) { - llwarns << "Couldn't create dir StaticVFSDump" << llendl; + LL_WARNS() << "Couldn't create dir StaticVFSDump" << LL_ENDL; } } SetCurrentDirectory(utf8str_to_utf16str("StaticVFSDump").c_str()); @@ -3985,16 +4000,16 @@ void dumpVFSCaches() SetCurrentDirectory(w_str); #endif - llinfos << "========= Dynamic VFS ====" << llendl; + LL_INFOS() << "========= Dynamic VFS ====" << LL_ENDL; gVFS->listFiles(); #if LL_WINDOWS - llinfos << "========= Dumping dynamic VFS to VFSDump ====" << llendl; + LL_INFOS() << "========= Dumping dynamic VFS to VFSDump ====" << LL_ENDL; res = LLFile::mkdir("VFSDump"); if (res == -1) { if (errno != EEXIST) { - llwarns << "Couldn't create dir VFSDump" << llendl; + LL_WARNS() << "Couldn't create dir VFSDump" << LL_ENDL; } } SetCurrentDirectory(utf8str_to_utf16str("VFSDump").c_str()); @@ -4017,7 +4032,7 @@ U32 LLAppViewer::getObjectCacheVersion() { // Viewer object cache version, change if object update // format changes. JC - const U32 INDRA_OBJECT_CACHE_VERSION = 14; + const U32 INDRA_OBJECT_CACHE_VERSION = 15; return INDRA_OBJECT_CACHE_VERSION; } @@ -4172,7 +4187,7 @@ bool LLAppViewer::initCache() { sscanf(found_file.substr(start_pos+1).c_str(), "%d", &old_salt); } - LL_DEBUGS("AppCache") << "Default vfs data file not present, found: " << old_vfs_data_file << " Old salt: " << old_salt << llendl; + LL_DEBUGS("AppCache") << "Default vfs data file not present, found: " << old_vfs_data_file << " Old salt: " << old_salt << LL_ENDL; } } @@ -4274,6 +4289,14 @@ void LLAppViewer::purgeCache() gDirUtilp->deleteFilesInDir(gDirUtilp->getExpandedFilename(LL_PATH_CACHE, ""), "*.*"); } +//purge cache immediately, do not wait until the next login. +void LLAppViewer::purgeCacheImmediate() +{ + LL_INFOS("AppCache") << "Purging Object Cache and Texture Cache immediately..." << LL_ENDL; + LLAppViewer::getTextureCache()->purgeCache(LL_PATH_CACHE, false); + LLVOCache::getInstance()->removeCache(LL_PATH_CACHE, true); +} + std::string LLAppViewer::getSecondLifeTitle() const { return LLTrans::getString("APP_NAME"); @@ -4458,6 +4481,8 @@ static LLFastTimer::DeclareTimer FTM_WORLD_UPDATE("Update World"); static LLFastTimer::DeclareTimer FTM_NETWORK("Network"); static LLFastTimer::DeclareTimer FTM_AGENT_NETWORK("Agent Network"); static LLFastTimer::DeclareTimer FTM_VLMANAGER("VL Manager"); +static LLFastTimer::DeclareTimer FTM_AGENT_POSITION("Agent Position"); +static LLFastTimer::DeclareTimer FTM_HUD_EFFECTS("HUD Effects"); /////////////////////////////////////////////////////// // idle() @@ -4476,7 +4501,7 @@ void LLAppViewer::idle() LLFrameTimer::updateFrameCount(); LLEventTimer::updateClass(); LLNotificationsUI::LLToast::updateClass(); - LLCriticalDamp::updateInterpolants(); + LLSmoothInterpolation::updateInterpolants(); LLMortician::updateClass(); LLFilePickerThread::clearDead(); //calls LLFilePickerThread::notify() @@ -4501,6 +4526,7 @@ void LLAppViewer::idle() { if (gRenderStartTime.getElapsedTimeF32() > qas) { + LL_INFOS() << "Quitting after " << qas << " seconds. See setting \"QuitAfterSeconds\"." << LL_ENDL; LLAppViewer::instance()->forceQuit(); } } @@ -4532,7 +4558,7 @@ void LLAppViewer::idle() { LLFastTimer t(FTM_NETWORK); // Update spaceserver timeinfo - LLWorld::getInstance()->setSpaceTimeUSec(LLWorld::getInstance()->getSpaceTimeUSec() + (U32)(dt_raw * SEC_TO_MICROSEC)); + LLWorld::getInstance()->setSpaceTimeUSec(LLWorld::getInstance()->getSpaceTimeUSec() + LLUnits::Seconds::fromValue(dt_raw)); ////////////////////////////////////// @@ -4584,7 +4610,7 @@ void LLAppViewer::idle() // *FIX: (???) SAMANTHA if (viewer_stats_timer.getElapsedTimeF32() >= SEND_STATS_PERIOD && !gDisconnected) { - llinfos << "Transmitting sessions stats" << llendl; + LL_INFOS() << "Transmitting sessions stats" << LL_ENDL; send_stats(); viewer_stats_timer.reset(); } @@ -4596,19 +4622,15 @@ void LLAppViewer::idle() object_debug_timer.reset(); if (gObjectList.mNumDeadObjectUpdates) { - llinfos << "Dead object updates: " << gObjectList.mNumDeadObjectUpdates << llendl; + LL_INFOS() << "Dead object updates: " << gObjectList.mNumDeadObjectUpdates << LL_ENDL; gObjectList.mNumDeadObjectUpdates = 0; } if (gObjectList.mNumUnknownUpdates) { - llinfos << "Unknown object updates: " << gObjectList.mNumUnknownUpdates << llendl; + LL_INFOS() << "Unknown object updates: " << gObjectList.mNumUnknownUpdates << LL_ENDL; 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(gFPSClamped); } } @@ -4689,8 +4711,7 @@ void LLAppViewer::idle() { // Handle pending gesture processing - static LLFastTimer::DeclareTimer ftm("Agent Position"); - LLFastTimer t(ftm); + LLFastTimer t(FTM_AGENT_POSITION); LLGestureMgr::instance().update(); gAgent.updateAgentPosition(gFrameDTClamped, yaw, current_mouse.mX, current_mouse.mY); @@ -4737,8 +4758,7 @@ void LLAppViewer::idle() // { - static LLFastTimer::DeclareTimer ftm("HUD Effects"); - LLFastTimer t(ftm); + LLFastTimer t(FTM_HUD_EFFECTS); LLSelectMgr::getInstance()->updateEffects(); LLHUDManager::getInstance()->cleanupEffects(); LLHUDManager::getInstance()->sendEffects(); @@ -5133,16 +5153,16 @@ void LLAppViewer::idleNetwork() if( remaining_possible_decodes <= 0 ) { - llinfos << "Maxed out number of messages per frame at " << MESSAGE_MAX_PER_FRAME << llendl; + LL_INFOS() << "Maxed out number of messages per frame at " << MESSAGE_MAX_PER_FRAME << LL_ENDL; } if (gPrintMessagesThisFrame) { - llinfos << "Decoded " << total_decoded << " msgs this frame!" << llendl; + LL_INFOS() << "Decoded " << total_decoded << " msgs this frame!" << LL_ENDL; gPrintMessagesThisFrame = FALSE; } } - LLViewerStats::getInstance()->mNumNewObjectsStat.addValue(gObjectList.mNumNewObjects); + add(LLStatViewer::NUM_NEW_OBJECTS, gObjectList.mNumNewObjects); // Retransmit unacknowledged packets. gXferManager->retransmitUnackedPackets(); @@ -5177,7 +5197,7 @@ void LLAppViewer::disconnectViewer() // // Save snapshot for next time, if we made it through initialization - llinfos << "Disconnecting viewer!" << llendl; + LL_INFOS() << "Disconnecting viewer!" << LL_ENDL; // Dump our frame statistics @@ -5221,6 +5241,7 @@ void LLAppViewer::disconnectViewer() { LLWorld::getInstance()->destroyClass(); } + LLVOCache::deleteSingleton(); // call all self-registered classes LLDestroyClassList::instance().fireCallbacks(); @@ -5235,12 +5256,12 @@ void LLAppViewer::disconnectViewer() void LLAppViewer::forceErrorLLError() { - llerrs << "This is a deliberate llerror" << llendl; + LL_ERRS() << "This is a deliberate llerror" << LL_ENDL; } void LLAppViewer::forceErrorBreakpoint() { - llwarns << "Forcing a deliberate breakpoint" << llendl; + LL_WARNS() << "Forcing a deliberate breakpoint" << LL_ENDL; #ifdef LL_WINDOWS DebugBreak(); #endif @@ -5249,7 +5270,7 @@ void LLAppViewer::forceErrorBreakpoint() void LLAppViewer::forceErrorBadMemoryAccess() { - llwarns << "Forcing a deliberate bad memory access" << llendl; + LL_WARNS() << "Forcing a deliberate bad memory access" << LL_ENDL; S32* crash = NULL; *crash = 0xDEADBEEF; return; @@ -5257,7 +5278,7 @@ void LLAppViewer::forceErrorBadMemoryAccess() void LLAppViewer::forceErrorInfiniteLoop() { - llwarns << "Forcing a deliberate infinite loop" << llendl; + LL_WARNS() << "Forcing a deliberate infinite loop" << LL_ENDL; while(true) { ; @@ -5267,14 +5288,14 @@ void LLAppViewer::forceErrorInfiniteLoop() void LLAppViewer::forceErrorSoftwareException() { - llwarns << "Forcing a deliberate exception" << llendl; + LL_WARNS() << "Forcing a deliberate exception" << LL_ENDL; // *FIX: Any way to insure it won't be handled? throw; } void LLAppViewer::forceErrorDriverCrash() { - llwarns << "Forcing a deliberate driver crash" << llendl; + LL_WARNS() << "Forcing a deliberate driver crash" << LL_ENDL; glDeleteTextures(1, NULL); } @@ -5322,7 +5343,7 @@ void LLAppViewer::pingMainloopTimeout(const std::string& state, F32 secs) { // if(!restoreErrorTrap()) // { -// llwarns << "!!!!!!!!!!!!! Its an error trap!!!!" << state << llendl; +// LL_WARNS() << "!!!!!!!!!!!!! Its an error trap!!!!" << state << LL_ENDL; // } if(mMainloopTimeout) @@ -5381,13 +5402,13 @@ void LLAppViewer::handleLoginComplete() writeDebugInfo(); // we logged in successfully, so save settings on logout - llinfos << "Login successful, per account settings will be saved on log out." << llendl; + LL_INFOS() << "Login successful, per account settings will be saved on log out." << LL_ENDL; mSavePerAccountSettings=true; } void LLAppViewer::launchUpdater() { - LLSD query_map = LLSD::emptyMap(); + LLSD query_map = LLSD::emptyMap(); query_map["os"] = gPlatform; // *TODO change userserver to be grid on both viewer and sim, since @@ -5484,7 +5505,7 @@ void LLAppViewer::launchUpdater() // Although we already have the full set of paths with the filename // appended, the linux-updater.bin command-line switches require us to // snip the filename OFF and pass it as a separate switch argument. :-P - llinfos << "Got a XUI path: " << this_skin_path << llendl; + LL_INFOS() << "Got a XUI path: " << this_skin_path << LL_ENDL; xml_search_paths.append(delim); xml_search_paths.append(gDirUtilp->getDirName(this_skin_path)); delim = ","; @@ -5506,9 +5527,9 @@ void LLAppViewer::launchUpdater() GError *error = NULL; if (!g_spawn_command_line_async(LLAppViewer::sUpdaterInfo->mUpdateExePath.c_str(), &error)) { - llerrs << "Failed to launch updater: " + LL_ERRS() << "Failed to launch updater: " << error->message - << llendl; + << LL_ENDL; } if (error) { g_error_free(error); @@ -5549,17 +5570,7 @@ void LLAppViewer::metricsUpdateRegion(U64 region_handle) { if (0 != region_handle) { - 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_handle); - } - else - { - // No 'thread1', a.k.a. TextureFetch, so update directly - LLViewerAssetStatsFF::set_region_thread1(region_handle); - } + LLViewerAssetStatsFF::set_region(region_handle); } } @@ -5570,7 +5581,7 @@ void LLAppViewer::metricsUpdateRegion(U64 region_handle) */ void LLAppViewer::metricsSend(bool enable_reporting) { - if (! gViewerAssetStatsMain) + if (! gViewerAssetStats) return; if (LLAppViewer::sTextureFetch) @@ -5583,7 +5594,10 @@ void LLAppViewer::metricsSend(bool enable_reporting) // Make a copy of the main stats to send into another thread. // Receiving thread takes ownership. - LLViewerAssetStats * main_stats(new LLViewerAssetStats(*gViewerAssetStatsMain)); + LLViewerAssetStats * main_stats(new LLViewerAssetStats(*gViewerAssetStats)); + main_stats->stop(); + + main_stats->updateStats(); // Send a report request into 'thread1' to get the rest of the data // and provide some additional parameters while here. @@ -5602,6 +5616,6 @@ void LLAppViewer::metricsSend(bool enable_reporting) // 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(); + gViewerAssetStats->restart(); } |