From d80981de767e2ae34eb7dde9ad367fa360890215 Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Tue, 27 Jun 2017 22:51:39 +0300 Subject: MAINT-7554 Frame throttling --- indra/newview/llappviewer.cpp | 61 +++++++++++++++++++++++++++---------------- 1 file changed, 38 insertions(+), 23 deletions(-) (limited to 'indra/newview/llappviewer.cpp') diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 37340a42b6..b4c433893d 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -315,8 +315,6 @@ F32SecondsImplicit 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 U64MicrosecondsImplicit gStartTime = 0; // gStartTime is "private", used only to calculate gFrameTimeSeconds -U32 gFrameStalls = 0; -const F64 FRAME_STALL_THRESHOLD = 1.0; LLTimer gRenderStartTime; LLFrameTimer gForegroundTime; @@ -705,7 +703,8 @@ LLAppViewer::LLAppViewer() mFastTimerLogThread(NULL), mUpdater(new LLUpdaterService()), mSettingsLocationList(NULL), - mIsFirstRun(false) + mIsFirstRun(false), + mMinMicroSecPerFrame(0.f) { if(NULL != sInstance) { @@ -1249,6 +1248,9 @@ bool LLAppViewer::init() joystick->setNeedsReset(true); /*----------------------------------------------------------------------*/ + gSavedSettings.getControl("FramePerSecondLimit")->getSignal()->connect(boost::bind(&LLAppViewer::onChangeFrameLimit, this, _2)); + onChangeFrameLimit(gSavedSettings.getLLSD("FramePerSecondLimit")); + return true; } @@ -1328,9 +1330,6 @@ bool LLAppViewer::frame() LLEventPump& mainloop(LLEventPumps::instance().obtain("mainloop")); LLSD newFrame; - LLTimer frameTimer,idleTimer; - LLTimer debugTime; - //LLPrivateMemoryPoolTester::getInstance()->run(false) ; //LLPrivateMemoryPoolTester::getInstance()->run(true) ; //LLPrivateMemoryPoolTester::destroy() ; @@ -1371,14 +1370,6 @@ bool LLAppViewer::frame() gViewerWindow->getWindow()->gatherInput(); } -#if 1 && !LL_RELEASE_FOR_DOWNLOAD - // once per second debug info - if (debugTime.getElapsedTimeF32() > 1.f) - { - debugTime.reset(); - } - -#endif //memory leaking simulation LLFloaterMemLeak* mem_leak_instance = LLFloaterReg::findTypedInstance("mem_leaking"); @@ -1432,7 +1423,25 @@ bool LLAppViewer::frame() { pingMainloopTimeout("Main:Display"); gGLActive = TRUE; + + static U64 last_call = 0; + if (LLStartUp::getStartupState() == STATE_STARTED + && !gTeleportDisplay) + { + // Frame/draw throttling + U64 elapsed_time = LLTimer::getTotalTime() - last_call; + if (elapsed_time < mMinMicroSecPerFrame) + { + LL_RECORD_BLOCK_TIME(FTM_SLEEP); + // llclamp for when time function gets funky + U64 sleep_time = llclamp(mMinMicroSecPerFrame - elapsed_time, (U64)1, (U64)1e6); + micro_sleep(sleep_time, 0); + } + } + last_call = LLTimer::getTotalTime(); + display(); + pingMainloopTimeout("Main:Snapshot"); LLFloaterSnapshot::update(); // take snapshots LLFloaterOutfitSnapshot::update(); @@ -1460,7 +1469,8 @@ bool LLAppViewer::frame() || !gFocusMgr.getAppHasFocus()) { // Sleep if we're not rendering, or the window is minimized. - S32 milliseconds_to_sleep = llclamp(gSavedSettings.getS32("BackgroundYieldTime"), 0, 1000); + static LLCachedControl s_bacground_yeild_time(gSavedSettings, "BackgroundYieldTime", 40); + S32 milliseconds_to_sleep = llclamp((S32)s_bacground_yeild_time, 0, 1000); // don't sleep when BackgroundYieldTime set to 0, since this will still yield to other threads // of equal priority on Windows if (milliseconds_to_sleep > 0) @@ -1484,7 +1494,6 @@ bool LLAppViewer::frame() ms_sleep(500); } - idleTimer.reset(); S32 total_work_pending = 0; S32 total_io_pending = 0; { @@ -1537,13 +1546,6 @@ bool LLAppViewer::frame() } } - if ((LLStartUp::getStartupState() >= STATE_CLEANUP) && - (frameTimer.getElapsedTimeF64() > FRAME_STALL_THRESHOLD)) - { - gFrameStalls++; - } - frameTimer.reset(); - resumeMainloopTimeout(); pingMainloopTimeout("Main:End"); @@ -5585,6 +5587,19 @@ void LLAppViewer::disconnectViewer() LLUrlEntryParcel::setDisconnected(gDisconnected); } +bool LLAppViewer::onChangeFrameLimit(LLSD const & evt) +{ + if (evt.asInteger() > 0) + { + mMinMicroSecPerFrame = 1000000 / evt.asInteger(); + } + else + { + mMinMicroSecPerFrame = 0; + } + return false; +} + void LLAppViewer::forceErrorLLError() { LL_ERRS() << "This is a deliberate llerror" << LL_ENDL; -- cgit v1.2.3 From 2c77a197be1b1c5c19008f9cd5ea7508a61d1bfe Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Tue, 11 Jul 2017 11:38:52 +0300 Subject: MAINT-7554 Removed unneeded check --- indra/newview/llappviewer.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'indra/newview/llappviewer.cpp') diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index b4c433893d..6a9d22dd07 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -1425,8 +1425,7 @@ bool LLAppViewer::frame() gGLActive = TRUE; static U64 last_call = 0; - if (LLStartUp::getStartupState() == STATE_STARTED - && !gTeleportDisplay) + if (!gTeleportDisplay) { // Frame/draw throttling U64 elapsed_time = LLTimer::getTotalTime() - last_call; -- cgit v1.2.3 From 31ff6baf68f62997f608938535fe3192ab4ff270 Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Thu, 13 Jul 2017 19:17:07 +0300 Subject: MAINT-7326 Increased default texture and vfs cache size --- indra/newview/llappviewer.cpp | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) (limited to 'indra/newview/llappviewer.cpp') diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 6a9d22dd07..f72eb48f81 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -4397,23 +4397,15 @@ bool LLAppViewer::initCache() // Init the texture cache // Allocate 80% of the cache size for textures const S32 MB = 1024 * 1024; - const S64 MIN_CACHE_SIZE = 64 * MB; + const S64 MIN_CACHE_SIZE = 256 * MB; const S64 MAX_CACHE_SIZE = 9984ll * MB; const S64 MAX_VFS_SIZE = 1024 * MB; // 1 GB S64 cache_size = (S64)(gSavedSettings.getU32("CacheSize")) * MB; cache_size = llclamp(cache_size, MIN_CACHE_SIZE, MAX_CACHE_SIZE); - S64 texture_cache_size = ((cache_size * 8) / 10); - S64 vfs_size = cache_size - texture_cache_size; - - if (vfs_size > MAX_VFS_SIZE) - { - // Give the texture cache more space, since the VFS can't be bigger than 1GB. - // This happens when the user's CacheSize setting is greater than 5GB. - vfs_size = MAX_VFS_SIZE; - texture_cache_size = cache_size - MAX_VFS_SIZE; - } + S64 vfs_size = llmin((S64)((cache_size * 2) / 10), MAX_VFS_SIZE); + S64 texture_cache_size = cache_size - vfs_size; S64 extra = LLAppViewer::getTextureCache()->initCache(LL_PATH_CACHE, texture_cache_size, texture_cache_mismatch); texture_cache_size -= extra; -- cgit v1.2.3 From 4cd7e3e2f1c5cb278c6c4dfa22ed3f00c5cdcbc8 Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Thu, 10 Aug 2017 17:52:29 +0300 Subject: MAINT-7596 FIXED System information is truncated in JIRA issues filed through "Report bug" viewer option --- indra/newview/llappviewer.cpp | 66 ++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 65 insertions(+), 1 deletion(-) (limited to 'indra/newview/llappviewer.cpp') diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index f72eb48f81..ee4eed347d 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -3382,7 +3382,7 @@ LLSD LLAppViewer::getViewerInfo() const info["J2C_VERSION"] = LLImageJ2C::getEngineInfo(); bool want_fullname = true; - info["AUDIO_DRIVER_VERSION"] = gAudiop ? LLSD(gAudiop->getDriverName(want_fullname)) : LLSD(); + info["AUDIO_DRIVER_VERSION"] = gAudiop ? LLSD(gAudiop->getDriverName(want_fullname)) : "Undefined"; if(LLVoiceClient::getInstance()->voiceEnabled()) { LLVoiceVersionInfo version = LLVoiceClient::getInstance()->getVersion(); @@ -3519,6 +3519,70 @@ std::string LLAppViewer::getViewerInfoString() const return support.str(); } +std::string LLAppViewer::getShortViewerInfoString() const +{ + std::ostringstream support; + LLSD info(getViewerInfo()); + + support << LLTrans::getString("APP_NAME") << " " << info["VIEWER_VERSION_STR"].asString(); + support << " (" << info["CHANNEL"].asString() << ")"; + if (info.has("BUILD_CONFIG")) + { + support << "\n" << "Build Configuration " << info["BUILD_CONFIG"].asString(); + } + if (info.has("REGION")) + { + support << "\n\n" << "You are at " << ll_vector3_from_sd(info["POSITION_LOCAL"]) << " in " << info["REGION"].asString(); + support << " located at " << info["HOSTNAME"].asString() << " (" << info["HOSTIP"].asString() << ")"; + support << "\n" << "SLURL: " << info["SLURL"].asString(); + support << "\n" << "(Global coordinates " << ll_vector3_from_sd(info["POSITION"]) << ")"; + support << "\n" << info["SERVER_VERSION"].asString(); + } + + support << "\n\n" << "CPU: " << info["CPU"].asString(); + support << "\n" << "Memory: " << info["MEMORY_MB"].asString() << " MB"; + support << "\n" << "OS: " << info["OS_VERSION"].asString(); + support << "\n" << "Graphics Card: " << info["GRAPHICS_CARD"].asString() << " (" << info["GRAPHICS_CARD_VENDOR"].asString() << ")"; + + if (info.has("GRAPHICS_DRIVER_VERSION")) + { + support << "\n" << "Windows Graphics Driver Version: " << info["GRAPHICS_DRIVER_VERSION"].asString(); + } + + support << "\n" << "OpenGL Version: " << info["OPENGL_VERSION"].asString(); + + support << "\n\n" << "Window size:" << info["WINDOW_WIDTH"].asString() << "x" << info["WINDOW_HEIGHT"].asString(); + support << "\n" << "Language: " << LLUI::getLanguage(); + support << "\n" << "Font Size Adjustment: " << info["FONT_SIZE_ADJUSTMENT"].asString() << "pt"; + support << "\n" << "UI Scaling: " << info["UI_SCALE"].asString(); + support << "\n" << "Draw distance: " << info["DRAW_DISTANCE"].asString(); + support << "\n" << "Bandwidth: " << info["NET_BANDWITH"].asString() << "kbit/s"; + support << "\n" << "LOD factor: " << info["LOD_FACTOR"].asString(); + support << "\n" << "Render quality: " << info["RENDER_QUALITY"].asString() << " / 7"; + support << "\n" << "ALM: " << info["GPU_SHADERS"].asString(); + support << "\n" << "Texture memory: " << info["TEXTURE_MEMORY"].asString() << "MB"; + support << "\n" << "VFS (cache) creation time: " << info["VFS_TIME"].asString(); + + support << "\n\n" << "J2C Decoder: " << info["J2C_VERSION"].asString(); + support << "\n" << "Audio Driver: " << info["AUDIO_DRIVER_VERSION"].asString(); + support << "\n" << "LLCEFLib/CEF: " << info["LLCEFLIB_VERSION"].asString(); + support << "\n" << "LibVLC: " << info["LIBVLC_VERSION"].asString(); + support << "\n" << "Voice Server: " << info["VOICE_VERSION"].asString(); + + if (info.has("PACKETS_IN")) + { + support << "\n" << "Packets Lost: " << info["PACKETS_LOST"].asInteger() << "/" << info["PACKETS_IN"].asInteger(); + F32 packets_pct = info["PACKETS_PCT"].asReal(); + support << " (" << ll_round(packets_pct, 0.001f) << "%)"; + } + + LLSD substitution; + substitution["datetime"] = (S32)time(NULL); + support << "\n" << LLTrans::getString("AboutTime", substitution); + + return support.str(); +} + void LLAppViewer::cleanupSavedSettings() { gSavedSettings.setBOOL("MouseSun", FALSE); -- cgit v1.2.3 From d290f2c512a3bdbb526fc0fc00e17a9c8bdc0693 Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Mon, 21 Aug 2017 17:41:41 +0300 Subject: BUG-134134 Additional logging --- indra/newview/llappviewer.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'indra/newview/llappviewer.cpp') diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index ee4eed347d..958876fb0a 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -4422,6 +4422,7 @@ bool LLAppViewer::initCache() if (gSavedSettings.getBOOL("PurgeCacheOnStartup") || gSavedSettings.getBOOL("PurgeCacheOnNextStartup")) { + LL_INFOS("AppCache") << "Startup cache purge requested: " << (gSavedSettings.getBOOL("PurgeCacheOnStartup") ? "ALWAYS" : "ONCE") << LL_ENDL; gSavedSettings.setBOOL("PurgeCacheOnNextStartup", false); mPurgeCache = true; // STORM-1141 force purgeAllTextures to get called to prevent a crash here. -brad @@ -4436,6 +4437,7 @@ bool LLAppViewer::initCache() std::string new_cache_location = gSavedSettings.getString("NewCacheLocation"); if (new_cache_location != cache_location) { + LL_INFOS("AppCache") << "Cache location changed, cache needs purging" << LL_ENDL; gDirUtilp->setCacheDir(gSavedSettings.getString("CacheLocation")); purgeCache(); // purge old cache gSavedSettings.setString("CacheLocation", new_cache_location); -- cgit v1.2.3 From b3ceeb6d9cf92613a06337b5985e225c612e53d5 Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Thu, 24 Aug 2017 10:37:59 -0400 Subject: MAINT-7594: add platform name string and address size to login request for crash stats (and add request parameter logging at DEBUG) --- 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 37340a42b6..069b79bb50 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -734,7 +734,7 @@ LLAppViewer::LLAppViewer() // LLLoginInstance::instance().setUpdaterService(mUpdater.get()); - LLLoginInstance::instance().setPlatformInfo(gPlatform, getOSInfo().getOSVersionString()); + LLLoginInstance::instance().setPlatformInfo(gPlatform, getOSInfo().getOSVersionString(), getOSInfo().getOSStringSimple()); } LLAppViewer::~LLAppViewer() -- cgit v1.2.3 From c21b3bbaccdad847611c5af78f612a3db2f47cc1 Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Fri, 25 Aug 2017 20:26:25 +0300 Subject: MAINT-7739 Make LLOSInfo a Singleton --- indra/newview/llappviewer.cpp | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) (limited to 'indra/newview/llappviewer.cpp') diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 958876fb0a..51d7ad1138 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -733,7 +733,7 @@ LLAppViewer::LLAppViewer() // LLLoginInstance::instance().setUpdaterService(mUpdater.get()); - LLLoginInstance::instance().setPlatformInfo(gPlatform, getOSInfo().getOSVersionString()); + LLLoginInstance::instance().setPlatformInfo(gPlatform, LLOSInfo::instance().getOSVersionString()); } LLAppViewer::~LLAppViewer() @@ -3110,7 +3110,7 @@ void LLAppViewer::initUpdater() mUpdater->initialize(channel, version, gPlatform, - getOSInfo().getOSVersionString(), + LLOSInfo::instance().getOSVersionString(), unique_id, willing_to_test ); @@ -3192,10 +3192,13 @@ bool LLAppViewer::initWindow() #ifdef LL_DARWIN - //Satisfy both MAINT-3135 (OSX 10.6 and earlier) MAINT-3288 (OSX 10.7 and later) - if (getOSInfo().mMajorVer == 10 && getOSInfo().mMinorVer < 7) - if ( getOSInfo().mMinorVer == 6 && getOSInfo().mBuild < 8 ) - gViewerWindow->getWindow()->setOldResize(true); + //Satisfy both MAINT-3135 (OSX 10.6 and earlier) MAINT-3288 (OSX 10.7 and later) + LLOSInfo& os_info = LLOSInfo::instance(); + if (os_info.mMajorVer == 10 && os_info.mMinorVer < 7) + { + if ( os_info.mMinorVer == 6 && os_info.mBuild < 8 ) + gViewerWindow->getWindow()->setOldResize(true); + } #endif if (gSavedSettings.getBOOL("WindowMaximized")) @@ -3337,7 +3340,7 @@ LLSD LLAppViewer::getViewerInfo() const info["CPU"] = gSysCPU.getCPUString(); info["MEMORY_MB"] = LLSD::Integer(gSysMemory.getPhysicalMemoryKB().valueInUnits()); // Moved hack adjustment to Windows memory size into llsys.cpp - info["OS_VERSION"] = LLAppViewer::instance()->getOSInfo().getOSString(); + info["OS_VERSION"] = LLOSInfo::instance().getOSString(); info["GRAPHICS_CARD_VENDOR"] = (const char*)(glGetString(GL_VENDOR)); info["GRAPHICS_CARD"] = (const char*)(glGetString(GL_RENDERER)); @@ -3659,7 +3662,7 @@ void LLAppViewer::writeSystemInfo() gDebugInfo["RAMInfo"]["Physical"] = (LLSD::Integer)(gSysMemory.getPhysicalMemoryKB().value()); gDebugInfo["RAMInfo"]["Allocated"] = (LLSD::Integer)(gMemoryAllocated.valueInUnits()); - gDebugInfo["OSInfo"] = getOSInfo().getOSStringSimple(); + gDebugInfo["OSInfo"] = LLOSInfo::instance().getOSStringSimple(); // The user is not logged on yet, but record the current grid choice login url // which may have been the intended grid. @@ -3701,8 +3704,8 @@ void LLAppViewer::writeSystemInfo() // query some system information LL_INFOS("SystemInfo") << "CPU info:\n" << gSysCPU << LL_ENDL; LL_INFOS("SystemInfo") << "Memory info:\n" << gSysMemory << LL_ENDL; - LL_INFOS("SystemInfo") << "OS: " << getOSInfo().getOSStringSimple() << LL_ENDL; - LL_INFOS("SystemInfo") << "OS info: " << getOSInfo() << LL_ENDL; + LL_INFOS("SystemInfo") << "OS: " << LLOSInfo::instance().getOSStringSimple() << LL_ENDL; + LL_INFOS("SystemInfo") << "OS info: " << LLOSInfo::instance() << LL_ENDL; gDebugInfo["SettingsFilename"] = gSavedSettings.getString("ClientSettingsFile"); gDebugInfo["ViewerExePath"] = gDirUtilp->getExecutablePathAndName(); -- cgit v1.2.3 From f8254a9d787ab6235c8fb076bd65dc7cd978dce9 Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Wed, 30 Aug 2017 19:57:02 +0300 Subject: MAINT-7758 Fixed freeze on loading lsl scripts from unicode named windows folder. --- 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 98d622acf9..b7267fbdfe 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -639,7 +639,7 @@ public: void run() { - std::ofstream os(mFile.c_str()); + llofstream os(mFile.c_str()); while (!LLAppViewer::instance()->isQuitting()) { @@ -3737,7 +3737,7 @@ void getFileList() if ( ( iter->length() > 30 ) && (iter->rfind(".dmp") == (iter->length()-4) ) ) { std::string fullname = pathname + *iter; - std::ifstream fdat( fullname.c_str(), std::ifstream::binary); + llifstream fdat( fullname.c_str(), std::ifstream::binary); if (fdat) { char buf[5]; -- cgit v1.2.3 From 6ab816cc6841c3a10838820a588ec548373e080a Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Wed, 11 Oct 2017 16:50:51 -0400 Subject: DRTVWR-418: Fix glitch from merging from today's viewer-release --- 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 af27c587af..c320c9c0be 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -723,7 +723,7 @@ LLAppViewer::LLAppViewer() // OK to write stuff to logs now, we've now crash reported if necessary // - LLLoginInstance::instance().setPlatformInfo(gPlatform, getOSInfo().getOSVersionString(), getOSInfo().getOSStringSimple()); + LLLoginInstance::instance().setPlatformInfo(gPlatform, LLOSInfo::instance().getOSVersionString(), LLOSInfo::instance().getOSStringSimple()); } LLAppViewer::~LLAppViewer() -- cgit v1.2.3