From ba8bcf6520eb4cbcdf93393ecdeda4e6c0bc5846 Mon Sep 17 00:00:00 2001 From: Alexander Gavriliuk Date: Mon, 3 Apr 2023 22:19:33 +0200 Subject: SL-19042: Replace FMOD with VLC for parcel audio --- indra/newview/app_settings/cmd_line.xml | 6 ++++++ indra/newview/app_settings/settings.xml | 11 +++++++++++ 2 files changed, 17 insertions(+) (limited to 'indra/newview/app_settings') diff --git a/indra/newview/app_settings/cmd_line.xml b/indra/newview/app_settings/cmd_line.xml index e16a5c7e76..340334aee8 100644 --- a/indra/newview/app_settings/cmd_line.xml +++ b/indra/newview/app_settings/cmd_line.xml @@ -209,6 +209,12 @@ NoAudio + nofmod + + map-to + UseMediaPluginsForStreamingAudio + + noninteractive desc diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 411f77e6a7..c6dca39c99 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -7077,6 +7077,17 @@ Value 0 + UseMediaPluginsForStreamingAudio + + Comment + Use media plugins (VLC) for streaming audio. + Persist + 1 + Type + Boolean + Value + 0 + NoHardwareProbe Comment -- cgit v1.3 From eaccee37f2875c4d2378cf0ce562f382b88487d7 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Sat, 15 Apr 2023 02:23:38 +0300 Subject: SL-19549 Add option to show ban lines on collision --- indra/newview/app_settings/settings.xml | 4 +-- indra/newview/llglsandbox.cpp | 6 ++++ indra/newview/llviewermenu.cpp | 21 ++++++++++++++ indra/newview/llviewermessage.cpp | 6 ++++ indra/newview/llviewerparcelmgr.cpp | 24 ++++++++++++---- indra/newview/llviewerparcelmgr.h | 3 +- indra/newview/skins/default/xui/en/menu_viewer.xml | 32 ++++++++++++++++++---- 7 files changed, 82 insertions(+), 14 deletions(-) (limited to 'indra/newview/app_settings') diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index deeca494c3..5b465864cc 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -11316,11 +11316,11 @@ ShowBanLines Comment - Show in-world ban/access borders + Show in-world ban/access borders, 0 - do not show, 1 - show on collision, 2 - show on proximity Persist 1 Type - Boolean + S32 Value 1 diff --git a/indra/newview/llglsandbox.cpp b/indra/newview/llglsandbox.cpp index 175f1849cf..25e9ade7df 100644 --- a/indra/newview/llglsandbox.cpp +++ b/indra/newview/llglsandbox.cpp @@ -741,6 +741,12 @@ void LLViewerParcelMgr::renderCollisionSegments(U8* segments, BOOL use_pass, LLV gGL.end(); } +void LLViewerParcelMgr::resetCollisionTimer() +{ + mCollisionTimer.reset(); + mRenderCollision = TRUE; +} + void draw_line_cube(F32 width, const LLVector3& center) { width = 0.5f * width; diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index a0223a5dbb..111e70bfe9 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -9060,6 +9060,25 @@ class LLWorldPostProcess : public view_listener_t } }; +class LLWorldCheckBanLines : public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + S32 callback_data = userdata.asInteger(); + return gSavedSettings.getS32("ShowBanLines") == callback_data; + } +}; + +class LLWorldShowBanLines : public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + S32 callback_data = userdata.asInteger(); + gSavedSettings.setS32("ShowBanLines", callback_data); + return true; + } +}; + void handle_flush_name_caches() { if (gCacheName) gCacheName->clear(); @@ -9349,6 +9368,8 @@ void initialize_menus() view_listener_t::addMenu(new LLWorldEnvPreset(), "World.EnvPreset"); view_listener_t::addMenu(new LLWorldEnableEnvPreset(), "World.EnableEnvPreset"); view_listener_t::addMenu(new LLWorldPostProcess(), "World.PostProcess"); + view_listener_t::addMenu(new LLWorldCheckBanLines() , "World.CheckBanLines"); + view_listener_t::addMenu(new LLWorldShowBanLines() , "World.ShowBanLines"); // Tools menu view_listener_t::addMenu(new LLToolsSelectTool(), "Tools.SelectTool"); diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index c1a9b6be80..a535433b5b 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -5151,6 +5151,7 @@ bool attempt_standard_notification(LLMessageSystem* msgsystem) LandBuyAccessBlocked_AdultsOnlyContent -----------------------------------------------------------------------*/ + LLViewerParcelMgr::getInstance()->resetCollisionTimer(); if (handle_special_notification(notificationID, llsdBlock)) { return true; @@ -5319,6 +5320,11 @@ void process_alert_message(LLMessageSystem *msgsystem, void **user_data) { BOOL modal = FALSE; process_alert_core(message, modal); + + if (message.find("Cannot enter parcel") != std::string::npos) + { + LLViewerParcelMgr::getInstance()->resetCollisionTimer(); + } } } diff --git a/indra/newview/llviewerparcelmgr.cpp b/indra/newview/llviewerparcelmgr.cpp index 97dc916bfe..bb68278555 100644 --- a/indra/newview/llviewerparcelmgr.cpp +++ b/indra/newview/llviewerparcelmgr.cpp @@ -72,7 +72,11 @@ #include "llenvironment.h" -const F32 PARCEL_COLLISION_DRAW_SECS = 1.f; +const F32 PARCEL_BAN_LINES_DRAW_SECS_ON_COLLISION = 10.f; +const F32 PARCEL_COLLISION_DRAW_SECS_ON_PROXIMITY = 1.f; +const S32 PARCEL_BAN_LINES_HIDE = 0; +const S32 PARCEL_BAN_LINES_ON_COLLISION = 1; +const S32 PARCEL_BAN_LINES_ON_PROXIMITY = 2; // Globals @@ -892,13 +896,18 @@ void LLViewerParcelMgr::render() void LLViewerParcelMgr::renderParcelCollision() { + static LLCachedControl ban_lines_mode(gSavedSettings , "ShowBanLines" , PARCEL_BAN_LINES_DRAW_SECS_ON_COLLISION); + // check for expiration - if (mCollisionTimer.getElapsedTimeF32() > PARCEL_COLLISION_DRAW_SECS) + F32 expiration = (ban_lines_mode == PARCEL_BAN_LINES_ON_PROXIMITY) + ? PARCEL_COLLISION_DRAW_SECS_ON_PROXIMITY + : PARCEL_BAN_LINES_DRAW_SECS_ON_COLLISION; + if (mCollisionTimer.getElapsedTimeF32() > expiration) { - mRenderCollision = FALSE; + mRenderCollision = false; } - if (mRenderCollision && gSavedSettings.getBOOL("ShowBanLines")) + if (mRenderCollision && ban_lines_mode != PARCEL_BAN_LINES_HIDE) { LLViewerRegion* regionp = gAgent.getRegion(); if (regionp) @@ -1842,8 +1851,11 @@ void LLViewerParcelMgr::processParcelProperties(LLMessageSystem *msg, void **use sequence_id == COLLISION_BANNED_PARCEL_SEQ_ID) { // We're about to collide with this parcel - parcel_mgr.mRenderCollision = TRUE; - parcel_mgr.mCollisionTimer.reset(); + static LLCachedControl ban_lines_mode(gSavedSettings , "ShowBanLines" , PARCEL_BAN_LINES_DRAW_SECS_ON_COLLISION); + if (ban_lines_mode == PARCEL_BAN_LINES_ON_PROXIMITY) + { + parcel_mgr.resetCollisionTimer(); + } // Differentiate this parcel if we are banned from it. if (sequence_id == COLLISION_BANNED_PARCEL_SEQ_ID) diff --git a/indra/newview/llviewerparcelmgr.h b/indra/newview/llviewerparcelmgr.h index 6ce389ab88..d45ff674af 100644 --- a/indra/newview/llviewerparcelmgr.h +++ b/indra/newview/llviewerparcelmgr.h @@ -204,6 +204,7 @@ public: void renderOneSegment(F32 x1, F32 y1, F32 x2, F32 y2, F32 height, U8 direction, LLViewerRegion* regionp); void renderHighlightSegments(const U8* segments, LLViewerRegion* regionp); void renderCollisionSegments(U8* segments, BOOL use_pass, LLViewerRegion* regionp); + void resetCollisionTimer(); void sendParcelGodForceOwner(const LLUUID& owner_id); @@ -361,7 +362,7 @@ private: // If it's coming, draw the parcel's boundaries. LLParcel* mCollisionParcel; U8* mCollisionSegments; - BOOL mRenderCollision; + bool mRenderCollision; BOOL mRenderSelection; S32 mCollisionBanned; LLFrameTimer mCollisionTimer; diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml index 58584345a9..64167a9a5d 100644 --- a/indra/newview/skins/default/xui/en/menu_viewer.xml +++ b/indra/newview/skins/default/xui/en/menu_viewer.xml @@ -794,14 +794,36 @@ name="LandShow" tear_off="true"> + label="Hide Ban Lines" + name="Hide Ban Lines"> + function="World.CheckBanLines" + parameter="0" /> + function="World.ShowBanLines" + parameter="0" /> + + + + + + + + + Date: Thu, 4 May 2023 16:52:35 +0100 Subject: First work on sl-19676 - Stats on updates --- indra/newview/app_settings/settings.xml | 33 +++ indra/newview/llappviewer.cpp | 7 +- indra/newview/llfloater360capture.cpp | 18 +- indra/newview/lltexturefetch.cpp | 5 - indra/newview/llviewermenu.cpp | 143 ++++++----- indra/newview/llviewerobjectlist.cpp | 42 ++-- indra/newview/llviewerregion.cpp | 17 +- indra/newview/llviewerregion.h | 12 +- indra/newview/llviewerstatsrecorder.cpp | 267 +++++++++++++-------- indra/newview/llviewerstatsrecorder.h | 117 +++++---- indra/newview/skins/default/xui/en/menu_viewer.xml | 24 +- 11 files changed, 409 insertions(+), 276 deletions(-) (limited to 'indra/newview/app_settings') diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 9fffab70f4..3d1a384793 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -17085,5 +17085,38 @@ Value 0 + StatsReportMaxDuration + + Comment + Maximum seconds for viewer stats file data, prevents huge file + Persist + 1 + Type + F32 + Value + 300 + + StatsReportFileInterval + + Comment + Interval to save viewer stats file data + Persist + 1 + Type + F32 + Value + 0.2 + + StatsReportSkipZeroDataSaves + + Comment + In viewer stats data file, skip saving entry if there is no data + Persist + 0 + Type + Boolean + Value + 0 + diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 8d77a39c74..9c194562f9 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -1536,7 +1536,12 @@ bool LLAppViewer::doFrame() LLFloaterSimpleOutfitSnapshot::update(); gGLActive = FALSE; } - } + + if (LLViewerStatsRecorder::instanceExists()) + { + LLViewerStatsRecorder::instance().idle(); + } + } } { diff --git a/indra/newview/llfloater360capture.cpp b/indra/newview/llfloater360capture.cpp index 23f86e2361..9c25cdbc7d 100644 --- a/indra/newview/llfloater360capture.cpp +++ b/indra/newview/llfloater360capture.cpp @@ -197,21 +197,18 @@ void LLFloater360Capture::changeInterestListMode(bool send_everything) if (gAgent.requestPostCapability("InterestList", body, [](const LLSD & response) { - LL_INFOS("360Capture") << - "InterestList capability responded: \n" << + LL_DEBUGS("360Capture") << "InterestList capability responded: \n" << ll_pretty_print_sd(response) << LL_ENDL; })) { - LL_INFOS("360Capture") << - "Successfully posted an InterestList capability request with payload: \n" << + LL_DEBUGS("360Capture") << "Successfully posted an InterestList capability request with payload: \n" << ll_pretty_print_sd(body) << LL_ENDL; } else { - LL_INFOS("360Capture") << - "Unable to post an InterestList capability request with payload: \n" << + LL_WARNS("360Capture") << "Unable to post an InterestList capability request with payload: \n" << ll_pretty_print_sd(body) << LL_ENDL; } @@ -632,11 +629,8 @@ void LLFloater360Capture::capture360Images() // display time to encode all 6 images. It tends to be a fairly linear // time for each so we don't need to worry about displaying the time // for each - this gives us plenty to use for optimizing - LL_INFOS("360Capture") << - "Time to encode and save 6 images was " << - encode_time_total << - " seconds" << - LL_ENDL; + LL_INFOS("360Capture") << "Time to encode and save 6 images was " << + encode_time_total << " seconds" << LL_ENDL; // Write the JavaScript file footer (the bottom of the file after the // declarations of the actual data URLs array). The footer comprises of @@ -668,7 +662,7 @@ void LLFloater360Capture::capture360Images() // as a change - only the subsequent 5 are if (camera_changed_times < 5) { - LL_INFOS("360Capture") << "Warning: we only captured " << camera_changed_times << " images." << LL_ENDL; + LL_WARNS("360Capture") << "360 image capture expected 5 or more images, only captured " << camera_changed_times << " images." << LL_ENDL; } // now we have the 6 shots saved in a well specified location, diff --git a/indra/newview/lltexturefetch.cpp b/indra/newview/lltexturefetch.cpp index a7dcb1a9bb..b0d6a5d466 100644 --- a/indra/newview/lltexturefetch.cpp +++ b/indra/newview/lltexturefetch.cpp @@ -2258,11 +2258,6 @@ S32 LLTextureFetchWorker::callbackHttpGet(LLCore::HttpResponse * response, mLoaded = TRUE; setPriority(LLWorkerThread::PRIORITY_HIGH | mWorkPriority); - if (LLViewerStatsRecorder::instanceExists()) - { - // Do not create this instance inside thread - LLViewerStatsRecorder::instance().log(0.2f); - } return data_size ; } diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 998f5c020e..77cb5f86af 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -119,6 +119,7 @@ #include "llviewerobjectlist.h" #include "llviewerparcelmgr.h" #include "llviewerstats.h" +#include "llviewerstatsrecorder.h" #include "llvoavatarself.h" #include "llvoicevivox.h" #include "llworldmap.h" @@ -1295,49 +1296,99 @@ class LLAdvancedDumpRegionObjectCache : public view_listener_t } }; -class LLAdvancedInterestListFullUpdate : public view_listener_t +class LLAdvancedToggleInterestList360Mode : public view_listener_t { - bool handleEvent(const LLSD& userdata) - { - LLSD request; - LLSD body; - static bool using_360 = false; - - if (using_360) - { - body["mode"] = LLSD::String("default"); - } - else - { - body["mode"] = LLSD::String("360"); - } - using_360 = !using_360; +public: + bool handleEvent(const LLSD &userdata) + { + LLSD request; + LLSD body; + + // First do a GET to report on current mode and update stats + if (gAgent.requestGetCapability("InterestList", + [](const LLSD &response) { + LL_DEBUGS("360Capture") << "InterestList capability GET responded: \n" + << ll_pretty_print_sd(response) << LL_ENDL; + })) + { + LL_DEBUGS("360Capture") << "Successful GET InterestList capability request with return body: \n" + << ll_pretty_print_sd(body) << LL_ENDL; + } + else + { + LL_WARNS("360Capture") << "Unable to GET InterestList capability request with return body: \n" + << ll_pretty_print_sd(body) << LL_ENDL; + } - if (gAgent.requestPostCapability("InterestList", body, [](const LLSD& response) + // Now do a POST to change the mode + if (sUsing360) { - LL_INFOS("360Capture") << - "InterestList capability responded: \n" << - ll_pretty_print_sd(response) << - LL_ENDL; - })) + body["mode"] = LLSD::String("default"); + } + else { - LL_INFOS("360Capture") << - "Successfully posted an InterestList capability request with payload: \n" << - ll_pretty_print_sd(body) << - LL_ENDL; + body["mode"] = LLSD::String("360"); + } + sUsing360 = !sUsing360; + LL_INFOS("360Capture") << "Setting InterestList capability mode to " << body["mode"].asString() << LL_ENDL; + + if (gAgent.requestPostCapability("InterestList", body, + [](const LLSD &response) { + LL_DEBUGS("360Capture") << "InterestList capability responded: \n" + << ll_pretty_print_sd(response) << LL_ENDL; + })) + { + LL_DEBUGS("360Capture") << "Successfully posted an InterestList capability request with payload: \n" + << ll_pretty_print_sd(body) << LL_ENDL; return true; } else { - LL_INFOS("360Capture") << - "Unable to post an InterestList capability request with payload: \n" << - ll_pretty_print_sd(body) << - LL_ENDL; + LL_DEBUGS("360Capture") << "Unable to post an InterestList capability request with payload: \n" + << ll_pretty_print_sd(body) << LL_ENDL; return false; } + }; + + static bool sUsing360; +}; + +bool LLAdvancedToggleInterestList360Mode::sUsing360 = false; + +class LLAdvancedCheckInterestList360Mode : public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + return LLAdvancedToggleInterestList360Mode::sUsing360; } }; +class LLAdvancedToggleStatsRecorder : public view_listener_t +{ + bool handleEvent(const LLSD &userdata) + { + if (LLViewerStatsRecorder::instance().isEnabled()) + { // Turn off both recording and logging + LLViewerStatsRecorder::instance().enableObjectStatsRecording(false); + } + else + { // Turn on both recording and logging + LLViewerStatsRecorder::instance().enableObjectStatsRecording(true, true); + } + return true; + } +}; + +class LLAdvancedCheckStatsRecorder : public view_listener_t +{ + bool handleEvent(const LLSD &userdata) + { // Use the logging state as the indicator of whether the stats recorder is on + return LLViewerStatsRecorder::instance().isLogging(); + } +}; + + + class LLAdvancedBuyCurrencyTest : public view_listener_t { bool handleEvent(const LLSD& userdata) @@ -4492,33 +4543,6 @@ void handle_duplicate_in_place(void*) LLSelectMgr::getInstance()->selectDuplicate(offset, TRUE); } -/* dead code 30-apr-2008 -void handle_deed_object_to_group(void*) -{ - LLUUID group_id; - - LLSelectMgr::getInstance()->selectGetGroup(group_id); - LLSelectMgr::getInstance()->sendOwner(LLUUID::null, group_id, FALSE); - LLViewerStats::getInstance()->incStat(LLViewerStats::ST_RELEASE_COUNT); -} - -BOOL enable_deed_object_to_group(void*) -{ - if(LLSelectMgr::getInstance()->getSelection()->isEmpty()) return FALSE; - LLPermissions perm; - LLUUID group_id; - - if (LLSelectMgr::getInstance()->selectGetGroup(group_id) && - gAgent.hasPowerInGroup(group_id, GP_OBJECT_DEED) && - LLSelectMgr::getInstance()->selectGetPermissions(perm) && - perm.deedToGroup(gAgent.getID(), group_id)) - { - return TRUE; - } - return FALSE; -} - -*/ /* @@ -9448,7 +9472,10 @@ void initialize_menus() // Advanced > World view_listener_t::addMenu(new LLAdvancedDumpScriptedCamera(), "Advanced.DumpScriptedCamera"); view_listener_t::addMenu(new LLAdvancedDumpRegionObjectCache(), "Advanced.DumpRegionObjectCache"); - view_listener_t::addMenu(new LLAdvancedInterestListFullUpdate(), "Advanced.InterestListFullUpdate"); + view_listener_t::addMenu(new LLAdvancedToggleInterestList360Mode(), "Advanced.ToggleInterestList360Mode"); + view_listener_t::addMenu(new LLAdvancedCheckInterestList360Mode(), "Advanced.CheckInterestList360Mode"); + view_listener_t::addMenu(new LLAdvancedToggleStatsRecorder(), "Advanced.ToggleStatsRecorder"); + view_listener_t::addMenu(new LLAdvancedCheckStatsRecorder(), "Advanced.CheckStatsRecorder"); // Advanced > UI commit.add("Advanced.WebBrowserTest", boost::bind(&handle_web_browser_test, _2)); // sigh! this one opens the MEDIA browser diff --git a/indra/newview/llviewerobjectlist.cpp b/indra/newview/llviewerobjectlist.cpp index efc4ded79e..0c9e929cf3 100644 --- a/indra/newview/llviewerobjectlist.cpp +++ b/indra/newview/llviewerobjectlist.cpp @@ -369,7 +369,7 @@ LLViewerObject* LLViewerObjectList::processObjectUpdateFromCache(LLVOCacheEntry* if (!objectp) { LL_INFOS() << "createObject failure for object: " << fullid << LL_ENDL; - recorder.objectUpdateFailure(entry->getLocalID(), OUT_FULL_CACHED, 0); + recorder.objectUpdateFailure(0); return NULL; } justCreated = true; @@ -393,7 +393,6 @@ LLViewerObject* LLViewerObjectList::processObjectUpdateFromCache(LLVOCacheEntry* objectp->setLastUpdateType(OUT_FULL_COMPRESSED); //newly cached objectp->setLastUpdateCached(TRUE); } - recorder.log(0.2f); LLVOAvatar::cullAvatarsByPixelArea(); return objectp; @@ -472,18 +471,15 @@ void LLViewerObjectList::processObjectUpdate(LLMessageSystem *mesgsys, for (i = 0; i < num_objects; i++) { - // timer is unused? - LLTimer update_timer; BOOL justCreated = FALSE; S32 msg_size = 0; bool update_cache = false; //update object cache if it is a full-update or terse update if (compressed) { - S32 uncompressed_length = 2048; compressed_dp.reset(); - uncompressed_length = mesgsys->getSizeFast(_PREHASH_ObjectData, i, _PREHASH_Data); + S32 uncompressed_length = mesgsys->getSizeFast(_PREHASH_ObjectData, i, _PREHASH_Data); LL_DEBUGS("ObjectUpdate") << "got binary data from message to compressed_dpbuffer" << LL_ENDL; mesgsys->getBinaryDataFast(_PREHASH_ObjectData, _PREHASH_Data, compressed_dpbuffer, 0, i, 2048); compressed_dp.assignBuffer(compressed_dpbuffer, uncompressed_length); @@ -505,7 +501,7 @@ void LLViewerObjectList::processObjectUpdate(LLMessageSystem *mesgsys, << " Flags: " << flags << " Region: " << regionp->getName() << " Region id: " << regionp->getRegionID() << LL_ENDL; - recorder.objectUpdateFailure(local_id, update_type, msg_size); + recorder.objectUpdateFailure(msg_size); continue; } else if ((flags & FLAGS_TEMPORARY_ON_REZ) == 0) @@ -616,7 +612,7 @@ void LLViewerObjectList::processObjectUpdate(LLMessageSystem *mesgsys, if (update_type == OUT_TERSE_IMPROVED) { // LL_INFOS() << "terse update for an unknown object (compressed):" << fullid << LL_ENDL; - recorder.objectUpdateFailure(local_id, update_type, msg_size); + recorder.objectUpdateFailure(msg_size); continue; } } @@ -625,7 +621,7 @@ void LLViewerObjectList::processObjectUpdate(LLMessageSystem *mesgsys, if (update_type != OUT_FULL) { //LL_INFOS() << "terse update for an unknown object:" << fullid << LL_ENDL; - recorder.objectUpdateFailure(local_id, update_type, msg_size); + recorder.objectUpdateFailure(msg_size); continue; } @@ -638,7 +634,7 @@ void LLViewerObjectList::processObjectUpdate(LLMessageSystem *mesgsys, { mNumDeadObjectUpdates++; //LL_INFOS() << "update for a dead object:" << fullid << LL_ENDL; - recorder.objectUpdateFailure(local_id, update_type, msg_size); + recorder.objectUpdateFailure(msg_size); continue; } #endif @@ -651,7 +647,7 @@ void LLViewerObjectList::processObjectUpdate(LLMessageSystem *mesgsys, if (!objectp) { LL_INFOS() << "createObject failure for object: " << fullid << LL_ENDL; - recorder.objectUpdateFailure(local_id, update_type, msg_size); + recorder.objectUpdateFailure(msg_size); continue; } @@ -681,11 +677,11 @@ void LLViewerObjectList::processObjectUpdate(LLMessageSystem *mesgsys, if(!(flags & FLAGS_TEMPORARY_ON_REZ)) { - bCached = true; + bCached = true; LLViewerRegion::eCacheUpdateResult result = objectp->mRegionp->cacheFullUpdate(objectp, compressed_dp, flags); - recorder.cacheFullUpdate(local_id, update_type, result, objectp, msg_size); + recorder.cacheFullUpdate(result); + } } - } #endif } else @@ -696,12 +692,10 @@ void LLViewerObjectList::processObjectUpdate(LLMessageSystem *mesgsys, } processUpdateCore(objectp, user_data, i, update_type, NULL, justCreated); } - recorder.objectUpdateEvent(local_id, update_type, objectp, msg_size); + recorder.objectUpdateEvent(update_type); objectp->setLastUpdateType(update_type); } - recorder.log(0.2f); - LLVOAvatar::cullAvatarsByPixelArea(); } @@ -748,14 +742,14 @@ void LLViewerObjectList::processCachedObjectUpdate(LLMessageSystem *mesgsys, // Lookup data packer and add this id to cache miss lists if necessary. U8 cache_miss_type = LLViewerRegion::CACHE_MISS_TYPE_NONE; - if(!regionp->probeCache(id, crc, flags, cache_miss_type)) - { - // Cache Miss. + if (regionp->probeCache(id, crc, flags, cache_miss_type)) + { // Cache Hit + recorder.cacheHitEvent(); + } + else + { // Cache Miss LL_DEBUGS("ObjectUpdate") << "cache miss for id " << id << " crc " << crc << " miss type " << (S32) cache_miss_type << LL_ENDL; - - recorder.cacheMissEvent(id, update_type, cache_miss_type, msg_size); - - continue; // no data packer, skip this object + recorder.cacheMissEvent(cache_miss_type); } } diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp index ad7321ca4b..3d1a81694a 100755 --- a/indra/newview/llviewerregion.cpp +++ b/indra/newview/llviewerregion.cpp @@ -2618,14 +2618,10 @@ LLVOCacheEntry* LLViewerRegion::getCacheEntry(U32 local_id, bool valid) return NULL; } -void LLViewerRegion::addCacheMiss(U32 id, LLViewerRegion::eCacheMissType miss_type) +void LLViewerRegion::addCacheMiss(U32 id, LLViewerRegion::eCacheMissType cache_miss_type) { mRegionCacheMissCount++; -#if 0 - mCacheMissList.insert(CacheMissItem(id, miss_type)); -#else - mCacheMissList.push_back(CacheMissItem(id, miss_type)); -#endif + mCacheMissList.push_back(CacheMissItem(id, cache_miss_type)); } //check if a non-cacheable object is already created. @@ -2701,10 +2697,10 @@ bool LLViewerRegion::probeCache(U32 local_id, U32 crc, U32 flags, U8 &cache_miss } } else - { + { // Total miss, don't have the object in cache // LL_INFOS() << "Cache miss for " << local_id << LL_ENDL; - addCacheMiss(local_id, CACHE_MISS_TYPE_FULL); - cache_miss_type = CACHE_MISS_TYPE_FULL; + addCacheMiss(local_id, CACHE_MISS_TYPE_TOTAL); + cache_miss_type = CACHE_MISS_TYPE_TOTAL; } return false; @@ -2712,7 +2708,7 @@ bool LLViewerRegion::probeCache(U32 local_id, U32 crc, U32 flags, U8 &cache_miss void LLViewerRegion::addCacheMissFull(const U32 local_id) { - addCacheMiss(local_id, CACHE_MISS_TYPE_FULL); + addCacheMiss(local_id, CACHE_MISS_TYPE_TOTAL); } void LLViewerRegion::requestCacheMisses() @@ -2763,7 +2759,6 @@ void LLViewerRegion::requestCacheMisses() mCacheDirty = TRUE ; // LL_INFOS() << "KILLDEBUG Sent cache miss full " << full_count << " crc " << crc_count << LL_ENDL; LLViewerStatsRecorder::instance().requestCacheMissesEvent(mCacheMissList.size()); - LLViewerStatsRecorder::instance().log(0.2f); mCacheMissList.clear(); } diff --git a/indra/newview/llviewerregion.h b/indra/newview/llviewerregion.h index 6548e8d372..81371b7f30 100644 --- a/indra/newview/llviewerregion.h +++ b/indra/newview/llviewerregion.h @@ -332,9 +332,9 @@ public: typedef enum { - CACHE_MISS_TYPE_FULL = 0, - CACHE_MISS_TYPE_CRC, - CACHE_MISS_TYPE_NONE + CACHE_MISS_TYPE_TOTAL = 0, // total cache miss - object not in cache + CACHE_MISS_TYPE_CRC, // object in cache, but CRC doesn't match + CACHE_MISS_TYPE_NONE // not a miss: cache hit } eCacheMissType; typedef enum @@ -551,10 +551,10 @@ private: class CacheMissItem { public: - CacheMissItem(U32 id, LLViewerRegion::eCacheMissType miss_type) : mID(id), mType(miss_type){} + CacheMissItem(U32 id, LLViewerRegion::eCacheMissType miss_type) : mID(id), mType(miss_type) {} - U32 mID; //local object id - LLViewerRegion::eCacheMissType mType; //cache miss type + U32 mID; //local object id + LLViewerRegion::eCacheMissType mType; // cache miss type typedef std::list cache_miss_list_t; }; diff --git a/indra/newview/llviewerstatsrecorder.cpp b/indra/newview/llviewerstatsrecorder.cpp index b5ccf4ffa0..64167135ac 100644 --- a/indra/newview/llviewerstatsrecorder.cpp +++ b/indra/newview/llviewerstatsrecorder.cpp @@ -28,24 +28,25 @@ #include "llviewerstatsrecorder.h" +#include "llcontrol.h" #include "llfile.h" #include "llviewerregion.h" #include "llviewerobject.h" +#include "llworld.h" - -// To do - something using region name or global position -#if LL_WINDOWS - static const std::string STATS_FILE_NAME("C:\\ViewerObjectCacheStats.csv"); -#else - static const std::string STATS_FILE_NAME("/tmp/viewerstats.csv"); -#endif +extern LLControlGroup gSavedSettings; LLViewerStatsRecorder* LLViewerStatsRecorder::sInstance = NULL; LLViewerStatsRecorder::LLViewerStatsRecorder() : - mObjectCacheFile(NULL), + mStatsFile(NULL), mTimer(), - mStartTime(0.0), - mLastSnapshotTime(0.0) + mFileOpenTime(0.0), + mLastSnapshotTime(0.0), + mEnableStatsRecording(false), + mEnableStatsLogging(false), + mInterval(0.2), + mMaxDuration(300.f), + mSkipSaveIfZeros(false) { if (NULL != sInstance) { @@ -57,30 +58,22 @@ LLViewerStatsRecorder::LLViewerStatsRecorder() : LLViewerStatsRecorder::~LLViewerStatsRecorder() { - if (mObjectCacheFile != NULL) + if (mStatsFile) { - // last chance snapshot - writeToLog(0.f); - LLFile::close(mObjectCacheFile); - mObjectCacheFile = NULL; + writeToLog(0.f); // Save last data + closeStatsFile(); } } void LLViewerStatsRecorder::clearStats() { mObjectCacheHitCount = 0; - mObjectCacheHitSize = 0; mObjectCacheMissFullCount = 0; - mObjectCacheMissFullSize = 0; mObjectCacheMissCrcCount = 0; - mObjectCacheMissCrcSize = 0; mObjectFullUpdates = 0; - mObjectFullUpdatesSize = 0; mObjectTerseUpdates = 0; - mObjectTerseUpdatesSize = 0; mObjectCacheMissRequests = 0; mObjectCacheMissResponses = 0; - mObjectCacheMissResponsesSize = 0; mObjectCacheUpdateDupes = 0; mObjectCacheUpdateChanges = 0; mObjectCacheUpdateAdds = 0; @@ -91,45 +84,57 @@ void LLViewerStatsRecorder::clearStats() } -void LLViewerStatsRecorder::recordObjectUpdateFailure(U32 local_id, const EObjectUpdateType update_type, S32 msg_size) +void LLViewerStatsRecorder::enableObjectStatsRecording(bool enable, bool logging /* false */) +{ + mEnableStatsRecording = enable; + + // if logging is stopping, close the file + if (mStatsFile && !logging) + { + writeToLog(0.f); // Save last data + closeStatsFile(); + } + mEnableStatsLogging = logging; +} + + + +void LLViewerStatsRecorder::recordObjectUpdateFailure(S32 msg_size) { mObjectUpdateFailures++; mObjectUpdateFailuresSize += msg_size; } -void LLViewerStatsRecorder::recordCacheMissEvent(U32 local_id, const EObjectUpdateType update_type, U8 cache_miss_type, S32 msg_size) +void LLViewerStatsRecorder::recordCacheMissEvent(U8 cache_miss_type) { - if (LLViewerRegion::CACHE_MISS_TYPE_FULL == cache_miss_type) + if (LLViewerRegion::CACHE_MISS_TYPE_TOTAL == cache_miss_type) { mObjectCacheMissFullCount++; - mObjectCacheMissFullSize += msg_size; } else { mObjectCacheMissCrcCount++; - mObjectCacheMissCrcSize += msg_size; } } -void LLViewerStatsRecorder::recordObjectUpdateEvent(U32 local_id, const EObjectUpdateType update_type, LLViewerObject * objectp, S32 msg_size) + +void LLViewerStatsRecorder::recordCacheHitEvent() +{ + mObjectCacheHitCount++; +} + +void LLViewerStatsRecorder::recordObjectUpdateEvent(const EObjectUpdateType update_type) { - switch (update_type) + switch (update_type) { case OUT_FULL: mObjectFullUpdates++; - mObjectFullUpdatesSize += msg_size; break; case OUT_TERSE_IMPROVED: mObjectTerseUpdates++; - mObjectTerseUpdatesSize += msg_size; break; case OUT_FULL_COMPRESSED: mObjectCacheMissResponses++; - mObjectCacheMissResponsesSize += msg_size; - break; - case OUT_FULL_CACHED: - mObjectCacheHitCount++; - mObjectCacheHitSize += msg_size; break; default: LL_WARNS() << "Unknown update_type" << LL_ENDL; @@ -137,9 +142,9 @@ void LLViewerStatsRecorder::recordObjectUpdateEvent(U32 local_id, const EObjectU }; } -void LLViewerStatsRecorder::recordCacheFullUpdate(U32 local_id, const EObjectUpdateType update_type, LLViewerRegion::eCacheUpdateResult update_result, LLViewerObject* objectp, S32 msg_size) +void LLViewerStatsRecorder::recordCacheFullUpdate(LLViewerRegion::eCacheUpdateResult update_result) { - switch (update_result) + switch (update_result) { case LLViewerRegion::CACHE_UPDATE_DUPE: mObjectCacheUpdateDupes++; @@ -154,7 +159,7 @@ void LLViewerStatsRecorder::recordCacheFullUpdate(U32 local_id, const EObjectUpd mObjectCacheUpdateReplacements++; break; default: - LL_WARNS() << "Unknown update_result type" << LL_ENDL; + LL_WARNS() << "Unknown update_result type " << (S32) update_result << LL_ENDL; break; }; } @@ -166,14 +171,30 @@ void LLViewerStatsRecorder::recordRequestCacheMissesEvent(S32 count) void LLViewerStatsRecorder::writeToLog( F32 interval ) { + if (!mEnableStatsLogging || !mEnableStatsRecording) + { + return; + } + size_t data_size = 0; - F64 delta_time = LLTimer::getTotalSeconds() - mLastSnapshotTime; - S32 total_objects = mObjectCacheHitCount + mObjectCacheMissCrcCount + mObjectCacheMissFullCount + mObjectFullUpdates + mObjectTerseUpdates + mObjectCacheMissRequests + mObjectCacheMissResponses + mObjectCacheUpdateDupes + mObjectCacheUpdateChanges + mObjectCacheUpdateAdds + mObjectCacheUpdateReplacements + mObjectUpdateFailures; + F64 delta_time = LLFrameTimer::getTotalSeconds() - mLastSnapshotTime; + if (delta_time < interval) + return; - if ( delta_time < interval || total_objects == 0) return; + if (mSkipSaveIfZeros) + { + S32 total_events = mObjectCacheHitCount + mObjectCacheMissCrcCount + mObjectCacheMissFullCount + mObjectFullUpdates + + mObjectTerseUpdates + mObjectCacheMissRequests + mObjectCacheMissResponses + mObjectCacheUpdateDupes + + mObjectCacheUpdateChanges + mObjectCacheUpdateAdds + mObjectCacheUpdateReplacements + mObjectUpdateFailures; + if (total_events == 0) + { + LL_DEBUGS("ILXZeroData") << "ILX: not saving zero data" << LL_ENDL; + return; + } + } - mLastSnapshotTime = LLTimer::getTotalSeconds(); - LL_DEBUGS() << "ILX: " + mLastSnapshotTime = LLFrameTimer::getTotalSeconds(); + LL_DEBUGS("ILX") << "ILX: " << mObjectCacheHitCount << " hits, " << mObjectCacheMissFullCount << " full misses, " << mObjectCacheMissCrcCount << " crc misses, " @@ -188,84 +209,124 @@ void LLViewerStatsRecorder::writeToLog( F32 interval ) << mObjectUpdateFailures << " update failures" << LL_ENDL; - if (mObjectCacheFile == NULL) + if (mStatsFile == NULL) { - mStartTime = LLTimer::getTotalSeconds(); - mObjectCacheFile = LLFile::fopen(STATS_FILE_NAME, "wb"); - if (mObjectCacheFile) - { // Write column headers - std::ostringstream data_msg; - data_msg << "EventTime(ms)\t" - << "Cache Hits\t" - << "Cache Full Misses\t" - << "Cache Crc Misses\t" - << "Full Updates\t" - << "Terse Updates\t" - << "Cache Miss Requests\t" - << "Cache Miss Responses\t" - << "Cache Update Dupes\t" - << "Cache Update Changes\t" - << "Cache Update Adds\t" - << "Cache Update Replacements\t" - << "Update Failures\t" - << "Cache Hits bps\t" - << "Cache Full Misses bps\t" - << "Cache Crc Misses bps\t" - << "Full Updates bps\t" - << "Terse Updates bps\t" - << "Cache Miss Responses bps\t" - << "Texture Fetch bps\t" - << "\n"; - - data_size = data_msg.str().size(); - if (fwrite(data_msg.str().c_str(), 1, data_size, mObjectCacheFile ) != data_size) + // Refresh settings + mInterval = gSavedSettings.getF32("StatsReportFileInterval"); + mSkipSaveIfZeros = gSavedSettings.getBOOL("StatsReportSkipZeroDataSaves"); + mMaxDuration = gSavedSettings.getF32("StatsReportMaxDuration"); + + // Open the data file + makeStatsFileName(); + mStatsFile = LLFile::fopen(mStatsFileName, "wb"); + + if (mStatsFile) + { + LL_INFOS("ILX") << "ILX: Writing update information to " << mStatsFileName << LL_ENDL; + + mFileOpenTime = LLFrameTimer::getTotalSeconds(); + + // Write column headers + std::ostringstream col_headers; + col_headers << "Time (sec)," + << "Regions," + << "Active Cached Objects," + << "Cache Hits," + << "Cache Full Misses," + << "Cache Crc Misses," + << "Full Updates," + << "Terse Updates," + << "Cache Miss Requests," + << "Cache Miss Responses," + << "Cache Update Dupes," + << "Cache Update Changes," + << "Cache Update Adds," + << "Cache Update Replacements," + << "Update Failures," + << "Texture Fetch bps," + << "\n"; + + data_size = col_headers.str().size(); + if (fwrite(col_headers.str().c_str(), 1, data_size, mStatsFile ) != data_size) { - LL_WARNS() << "failed to write full headers to " << STATS_FILE_NAME << LL_ENDL; + LL_WARNS() << "failed to write full headers to " << mStatsFileName << LL_ENDL; } } else - { - //LL_WARNS() << "Couldn't open " << STATS_FILE_NAME << " for logging." << LL_ENDL; + { // Failed to open file + LL_WARNS() << "Couldn't open " << mStatsFileName << " for logging, turning off stats recording." << LL_ENDL; + mEnableStatsLogging = false; return; } } - std::ostringstream data_msg; - - data_msg << getTimeSinceStart() - << "\t " << mObjectCacheHitCount - << "\t" << mObjectCacheMissFullCount - << "\t" << mObjectCacheMissCrcCount - << "\t" << mObjectFullUpdates - << "\t" << mObjectTerseUpdates - << "\t" << mObjectCacheMissRequests - << "\t" << mObjectCacheMissResponses - << "\t" << mObjectCacheUpdateDupes - << "\t" << mObjectCacheUpdateChanges - << "\t" << mObjectCacheUpdateAdds - << "\t" << mObjectCacheUpdateReplacements - << "\t" << mObjectUpdateFailures - << "\t" << (mObjectCacheHitSize * 8 / delta_time) - << "\t" << (mObjectCacheMissFullSize * 8 / delta_time) - << "\t" << (mObjectCacheMissCrcSize * 8 / delta_time) - << "\t" << (mObjectFullUpdatesSize * 8 / delta_time) - << "\t" << (mObjectTerseUpdatesSize * 8 / delta_time) - << "\t" << (mObjectCacheMissResponsesSize * 8 / delta_time) - << "\t" << (mTextureFetchSize * 8 / delta_time) + std::ostringstream stats_data; + + stats_data << getTimeSinceStart() + << "," << LLWorld::getInstance()->getRegionList().size() + << "," << LLWorld::getInstance()->getNumOfActiveCachedObjects() + << "," << mObjectCacheHitCount + << "," << mObjectCacheMissFullCount + << "," << mObjectCacheMissCrcCount + << "," << mObjectFullUpdates + << "," << mObjectTerseUpdates + << "," << mObjectCacheMissRequests + << "," << mObjectCacheMissResponses + << "," << mObjectCacheUpdateDupes + << "," << mObjectCacheUpdateChanges + << "," << mObjectCacheUpdateAdds + << "," << mObjectCacheUpdateReplacements + << "," << mObjectUpdateFailures + << "," << (mTextureFetchSize * 8 / delta_time) << "\n"; - data_size = data_msg.str().size(); - if ( data_size != fwrite(data_msg.str().c_str(), 1, data_size, mObjectCacheFile )) + data_size = stats_data.str().size(); + if ( data_size != fwrite(stats_data.str().c_str(), 1, data_size, mStatsFile )) { - LL_WARNS() << "Unable to write complete column data to " << STATS_FILE_NAME << LL_ENDL; - } + LL_WARNS() << "Unable to write complete column data to " << mStatsFileName << LL_ENDL; + closeStatsFile(); + } clearStats(); + + if (getTimeSinceStart() >= mMaxDuration) + { // If file recording has been running for too long, stop it. + closeStatsFile(); + } +} + +void LLViewerStatsRecorder::closeStatsFile() +{ + if (mStatsFile) + { + LL_INFOS("ILX") << "ILX: Stopped writing update information to " << mStatsFileName << " after " << getTimeSinceStart() + << " seconds." << LL_ENDL; + LLFile::close(mStatsFile); + mStatsFile = NULL; + } + mEnableStatsLogging = false; +} + +void LLViewerStatsRecorder::makeStatsFileName() +{ + // Create filename - tbd: use pid? +#if LL_WINDOWS + std::string stats_file_name("SLViewerStats-"); +#else + std::string stats_file_name("slviewerstats-"); +#endif + + F64 now = LLFrameTimer::getTotalSeconds(); + std::string date_str = LLDate(now).asString(); + std::replace(date_str.begin(), date_str.end(), ':', '-'); // Make it valid for a filename + stats_file_name.append(date_str); + stats_file_name.append(".csv"); + mStatsFileName = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, stats_file_name); } F32 LLViewerStatsRecorder::getTimeSinceStart() { - return (F32) (LLTimer::getTotalSeconds() - mStartTime); + return (F32) (LLFrameTimer::getTotalSeconds() - mFileOpenTime); } void LLViewerStatsRecorder::recordTextureFetch( S32 msg_size ) diff --git a/indra/newview/llviewerstatsrecorder.h b/indra/newview/llviewerstatsrecorder.h index c974bea49d..90f8ca8742 100644 --- a/indra/newview/llviewerstatsrecorder.h +++ b/indra/newview/llviewerstatsrecorder.h @@ -31,10 +31,6 @@ // This is a diagnostic class used to record information from the viewer // for analysis. -// This is normally 0. Set to 1 to enable viewer stats recording -#define LL_RECORD_VIEWER_STATS 0 - - #include "llframetimer.h" #include "llviewerobject.h" #include "llviewerregion.h" @@ -49,86 +45,111 @@ class LLViewerStatsRecorder : public LLSingleton ~LLViewerStatsRecorder(); public: - void objectUpdateFailure(U32 local_id, const EObjectUpdateType update_type, S32 msg_size) - { -#if LL_RECORD_VIEWER_STATS - recordObjectUpdateFailure(local_id, update_type, msg_size); -#endif + // Enable/disable stats recording. This is broken down into two + // flags so we can record stats without writing them to the log + // file. This is useful to analyzing updates for scene loading. + void enableObjectStatsRecording(bool enable, bool logging = false); + + bool isEnabled() const { return mEnableStatsRecording; } + bool isLogging() const { return mEnableStatsLogging; } + + void objectUpdateFailure(S32 msg_size) + { + if (mEnableStatsRecording) + { + recordObjectUpdateFailure(msg_size); + } } - void cacheMissEvent(U32 local_id, const EObjectUpdateType update_type, U8 cache_miss_type, S32 msg_size) + void cacheMissEvent(U8 cache_miss_type) { -#if LL_RECORD_VIEWER_STATS - recordCacheMissEvent(local_id, update_type, cache_miss_type, msg_size); -#endif + if (mEnableStatsRecording) + { + recordCacheMissEvent(cache_miss_type); + } + } + + void cacheHitEvent() + { + if (mEnableStatsRecording) + { + recordCacheHitEvent(); + } + } + + void objectUpdateEvent(const EObjectUpdateType update_type) + { + if (mEnableStatsRecording) + { + recordObjectUpdateEvent(update_type); + } } - void objectUpdateEvent(U32 local_id, const EObjectUpdateType update_type, LLViewerObject * objectp, S32 msg_size) - { -#if LL_RECORD_VIEWER_STATS - recordObjectUpdateEvent(local_id, update_type, objectp, msg_size); -#endif - } - - void cacheFullUpdate(U32 local_id, const EObjectUpdateType update_type, LLViewerRegion::eCacheUpdateResult update_result, LLViewerObject* objectp, S32 msg_size) - { -#if LL_RECORD_VIEWER_STATS - recordCacheFullUpdate(local_id, update_type, update_result, objectp, msg_size); -#endif + void cacheFullUpdate(LLViewerRegion::eCacheUpdateResult update_result) + { + if (mEnableStatsRecording) + { + recordCacheFullUpdate(update_result); + } } void requestCacheMissesEvent(S32 count) { -#if LL_RECORD_VIEWER_STATS - recordRequestCacheMissesEvent(count); -#endif + if (mEnableStatsRecording) + { + recordRequestCacheMissesEvent(count); + } } void textureFetch(S32 msg_size) { -#if LL_RECORD_VIEWER_STATS - recordTextureFetch(msg_size); -#endif + if (mEnableStatsRecording) + { + recordTextureFetch(msg_size); + } } - void log(F32 interval) + void idle() { -#if LL_RECORD_VIEWER_STATS - writeToLog(interval); -#endif + writeToLog(mInterval); } F32 getTimeSinceStart(); private: - void recordObjectUpdateFailure(U32 local_id, const EObjectUpdateType update_type, S32 msg_size); - void recordCacheMissEvent(U32 local_id, const EObjectUpdateType update_type, U8 cache_miss_type, S32 msg_size); - void recordObjectUpdateEvent(U32 local_id, const EObjectUpdateType update_type, LLViewerObject * objectp, S32 msg_size); - void recordCacheFullUpdate(U32 local_id, const EObjectUpdateType update_type, LLViewerRegion::eCacheUpdateResult update_result, LLViewerObject* objectp, S32 msg_size); + void recordObjectUpdateFailure(S32 msg_size); + void recordCacheMissEvent(U8 cache_miss_type); + void recordCacheHitEvent(); + void recordObjectUpdateEvent(const EObjectUpdateType update_type); + void recordCacheFullUpdate(LLViewerRegion::eCacheUpdateResult update_result); void recordRequestCacheMissesEvent(S32 count); void recordTextureFetch(S32 msg_size); void writeToLog(F32 interval); + void closeStatsFile(); + void makeStatsFileName(); static LLViewerStatsRecorder* sInstance; - LLFILE * mObjectCacheFile; // File to write data into + LLFILE * mStatsFile; // File to write data into + std::string mStatsFileName; + LLFrameTimer mTimer; - F64 mStartTime; + F64 mFileOpenTime; F64 mLastSnapshotTime; + F32 mInterval; // Interval between data log writes + F32 mMaxDuration; // Time limit on file + + bool mEnableStatsRecording; // Set to true to enable recording stats data + bool mEnableStatsLogging; // Set true to write stats to log file + bool mSkipSaveIfZeros; // Set true to skip saving stats if all values are zero S32 mObjectCacheHitCount; - S32 mObjectCacheHitSize; S32 mObjectCacheMissFullCount; - S32 mObjectCacheMissFullSize; S32 mObjectCacheMissCrcCount; - S32 mObjectCacheMissCrcSize; S32 mObjectFullUpdates; - S32 mObjectFullUpdatesSize; S32 mObjectTerseUpdates; - S32 mObjectTerseUpdatesSize; S32 mObjectCacheMissRequests; S32 mObjectCacheMissResponses; - S32 mObjectCacheMissResponsesSize; S32 mObjectCacheUpdateDupes; S32 mObjectCacheUpdateChanges; S32 mObjectCacheUpdateAdds; @@ -137,9 +158,7 @@ private: S32 mObjectUpdateFailuresSize; S32 mTextureFetchSize; - void clearStats(); }; #endif // LLVIEWERSTATSRECORDER_H - diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml index f72d1f0bf9..d78ebf17e3 100644 --- a/indra/newview/skins/default/xui/en/menu_viewer.xml +++ b/indra/newview/skins/default/xui/en/menu_viewer.xml @@ -3463,14 +3463,24 @@ function="World.EnvPreset" - - - - + + + + + + + Date: Thu, 11 May 2023 01:16:42 +0100 Subject: sl-19676 - more loading stats and 360 Interest List mode work --- indra/newview/app_settings/settings.xml | 11 ----- indra/newview/llagent.cpp | 76 +++++++++++++++++++----------- indra/newview/llagent.h | 5 ++ indra/newview/llfloater360capture.cpp | 66 +++++--------------------- indra/newview/llfloater360capture.h | 4 +- indra/newview/llviewermenu.cpp | 59 +++--------------------- indra/newview/llviewermessage.cpp | 36 ++++++++------- indra/newview/llviewerobjectlist.cpp | 12 ++--- indra/newview/llviewerregion.cpp | 82 ++++++++++++++++++++++++++++++++- indra/newview/llviewerregion.h | 18 ++++++++ indra/newview/llviewerstatsrecorder.cpp | 56 +++++++--------------- indra/newview/llviewerstatsrecorder.h | 28 +++++------ 12 files changed, 231 insertions(+), 222 deletions(-) (limited to 'indra/newview/app_settings') diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 9f2d6f746d..775ddb0571 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -16964,17 +16964,6 @@ Value 0 - 360CaptureUseInterestListCap - - Comment - Flag if set, uses the new InterestList cap to ask the simulator for full content - Persist - 1 - Type - Boolean - Value - 1 - 360CaptureJPEGEncodeQuality Comment diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index 8cc9be7244..89d4df7caa 100644 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -401,6 +401,7 @@ LLAgent::LLAgent() : mHttpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID), mTeleportState(TELEPORT_NONE), mRegionp(NULL), + mUse360Mode(false), mAgentOriginGlobal(), mPositionGlobal(), @@ -894,11 +895,20 @@ boost::signals2::connection LLAgent::addParcelChangedCallback(parcel_changed_cal // static void LLAgent::capabilityReceivedCallback(const LLUUID ®ion_id, LLViewerRegion *regionp) -{ - if (regionp && regionp->getRegionID() == region_id) +{ // Changed regions and now have the region capabilities + if (regionp) { - regionp->requestSimulatorFeatures(); - LLAppViewer::instance()->updateNameLookupUrl(regionp); + if (regionp->getRegionID() == region_id) + { + regionp->requestSimulatorFeatures(); + LLAppViewer::instance()->updateNameLookupUrl(regionp); + } + + if (gAgent.getInterestList360Mode()) + { + const bool use_360_mode = true; + gAgent.changeInterestListMode(use_360_mode); + } } } @@ -2910,39 +2920,53 @@ void LLAgent::processMaturityPreferenceFromServer(const LLSD &result, U8 perferr handlePreferredMaturityResult(maturity); } - -bool LLAgent::requestPostCapability(const std::string &capName, LLSD &postData, httpCallback_t cbSuccess, httpCallback_t cbFailure) -{ - if (!getRegion()) +// Using a new capability, tell the simulator that we want it to send everything +// it knows about and not just what is in front of the camera, in its view +// frustum. We need this feature so that the contents of the region that appears +// in the 6 snapshots which we cannot see and is normally not "considered", is +// also rendered. Typically, this is turned on when the 360 capture floater is +// opened and turned off when it is closed. +// Note: for this version, we do not have a way to determine when "everything" +// has arrived and has been rendered so for now, the proposal is that users +// will need to experiment with the low resolution version and wait for some +// (hopefully) small period of time while the full contents resolves. +// Pass in a flag to ask the simulator/interest list to "send everything" or +// not (the default mode) +void LLAgent::changeInterestListMode(bool use_360_mode) +{ + mUse360Mode = use_360_mode; + + // Change interest list mode for all regions. If they are already set for the current mode, + // the setting will have no effect. + for (LLWorld::region_list_t::const_iterator iter = LLWorld::getInstance()->getRegionList().begin(); + iter != LLWorld::getInstance()->getRegionList().end(); + ++iter) { - return false; + LLViewerRegion *regionp = *iter; + if (regionp && regionp->isAlive() && regionp->capabilitiesReceived()) + { + regionp->setInterestList360Mode(mUse360Mode); + } } - std::string url = getRegion()->getCapability(capName); +} - if (url.empty()) + +bool LLAgent::requestPostCapability(const std::string &capName, LLSD &postData, httpCallback_t cbSuccess, httpCallback_t cbFailure) +{ + if (getRegion()) { - LL_WARNS("Agent") << "Could not retrieve region capability \"" << capName << "\"" << LL_ENDL; - return false; + return getRegion()->requestPostCapability(capName, postData, cbSuccess, cbFailure); } - - LLCoreHttpUtil::HttpCoroutineAdapter::callbackHttpPost(url, mHttpPolicy, postData, cbSuccess, cbFailure); - return true; + return false; } bool LLAgent::requestGetCapability(const std::string &capName, httpCallback_t cbSuccess, httpCallback_t cbFailure) { - std::string url; - - url = getRegionCapability(capName); - - if (url.empty()) + if (getRegion()) { - LL_WARNS("Agent") << "Could not retrieve region capability \"" << capName << "\"" << LL_ENDL; - return false; + return getRegion()->requestGetCapability(capName, cbSuccess, cbFailure); } - - LLCoreHttpUtil::HttpCoroutineAdapter::callbackHttpGet(url, mHttpPolicy, cbSuccess, cbFailure); - return true; + return false; } BOOL LLAgent::getAdminOverride() const diff --git a/indra/newview/llagent.h b/indra/newview/llagent.h index 498bea3c07..ef8df13fc6 100644 --- a/indra/newview/llagent.h +++ b/indra/newview/llagent.h @@ -294,9 +294,14 @@ public: boost::signals2::connection addRegionChangedCallback(const region_changed_signal_t::slot_type& cb); void removeRegionChangedCallback(boost::signals2::connection callback); + + void changeInterestListMode(bool use_360_mode); + bool getInterestList360Mode() const { return mUse360Mode; } + private: LLViewerRegion *mRegionp; region_changed_signal_t mRegionChangedSignal; + bool mUse360Mode; //-------------------------------------------------------------------- // History diff --git a/indra/newview/llfloater360capture.cpp b/indra/newview/llfloater360capture.cpp index 9c25cdbc7d..a0889abe2d 100644 --- a/indra/newview/llfloater360capture.cpp +++ b/indra/newview/llfloater360capture.cpp @@ -64,12 +64,11 @@ LLFloater360Capture::LLFloater360Capture(const LLSD& key) // such time as we ask it not to (the dtor). If we crash or // otherwise, exit before this is turned off, the Simulator // will take care of cleaning up for us. - if (gSavedSettings.getBOOL("360CaptureUseInterestListCap")) - { - // send everything to us for as long as this floater is open - const bool send_everything = true; - changeInterestListMode(send_everything); - } + mWasIn360Mode = gAgent.getInterestList360Mode(); + + // send everything to us for as long as this floater is open + const bool use_360_mode = true; + gAgent.changeInterestListMode(use_360_mode); } LLFloater360Capture::~LLFloater360Capture() @@ -81,13 +80,15 @@ LLFloater360Capture::~LLFloater360Capture() mWebBrowser->unloadMediaSource(); } - // Tell the Simulator not to send us everything anymore - // and revert to the regular "keyhole" frustum of interest + // Restore interest list mode to the state when started + // Normally LLFloater360Capture tells the Simulator send everything + // and now reverts to the regular "keyhole" frustum of interest // list updates. - if (!LLApp::isExiting() && gSavedSettings.getBOOL("360CaptureUseInterestListCap")) + if (!LLApp::isExiting() && + gSavedSettings.getBOOL("360CaptureUseInterestListCap") && + mWasIn360Mode != gAgent.getInterestList360Mode()) { - const bool send_everything = false; - changeInterestListMode(send_everything); + gAgent.changeInterestListMode(mWasIn360Mode); } } @@ -170,49 +171,6 @@ void LLFloater360Capture::onChooseQualityRadioGroup() setSourceImageSize(); } -// Using a new capability, tell the simulator that we want it to send everything -// it knows about and not just what is in front of the camera, in its view -// frustum. We need this feature so that the contents of the region that appears -// in the 6 snapshots which we cannot see and is normally not "considered", is -// also rendered. Typically, this is turned on when the 360 capture floater is -// opened and turned off when it is closed. -// Note: for this version, we do not have a way to determine when "everything" -// has arrived and has been rendered so for now, the proposal is that users -// will need to experiment with the low resolution version and wait for some -// (hopefully) small period of time while the full contents resolves. -// Pass in a flag to ask the simulator/interest list to "send everything" or -// not (the default mode) -void LLFloater360Capture::changeInterestListMode(bool send_everything) -{ - LLSD body; - - if (send_everything) - { - body["mode"] = LLSD::String("360"); - } - else - { - body["mode"] = LLSD::String("default"); - } - - if (gAgent.requestPostCapability("InterestList", body, [](const LLSD & response) - { - LL_DEBUGS("360Capture") << "InterestList capability responded: \n" << - ll_pretty_print_sd(response) << - LL_ENDL; - })) - { - LL_DEBUGS("360Capture") << "Successfully posted an InterestList capability request with payload: \n" << - ll_pretty_print_sd(body) << - LL_ENDL; - } - else - { - LL_WARNS("360Capture") << "Unable to post an InterestList capability request with payload: \n" << - ll_pretty_print_sd(body) << - LL_ENDL; - } -} // There is is a setting (360CaptureSourceImageSize) that holds the size // (width == height since it's a square) of each of the 6 source snapshots. diff --git a/indra/newview/llfloater360capture.h b/indra/newview/llfloater360capture.h index 8f765c0b1b..61316c65f3 100644 --- a/indra/newview/llfloater360capture.h +++ b/indra/newview/llfloater360capture.h @@ -50,8 +50,6 @@ class LLFloater360Capture: void onOpen(const LLSD& key) override; void handleMediaEvent(LLPluginClassMedia* self, EMediaEvent event) override; - void changeInterestListMode(bool send_everything); - const std::string getHTMLBaseFolder(); void capture360Images(); @@ -93,6 +91,8 @@ class LLFloater360Capture: std::string mImageSaveDir; LLPointer mRawImages[6]; + + bool mWasIn360Mode; }; #endif // LL_FLOATER_360CAPTURE_H diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index d1b240d2c4..23abd0fe16 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -1301,65 +1301,18 @@ class LLAdvancedToggleInterestList360Mode : public view_listener_t public: bool handleEvent(const LLSD &userdata) { - LLSD request; - LLSD body; - - // First do a GET to report on current mode and update stats - if (gAgent.requestGetCapability("InterestList", - [](const LLSD &response) { - LL_DEBUGS("360Capture") << "InterestList capability GET responded: \n" - << ll_pretty_print_sd(response) << LL_ENDL; - })) - { - LL_DEBUGS("360Capture") << "Successful GET InterestList capability request with return body: \n" - << ll_pretty_print_sd(body) << LL_ENDL; - } - else - { - LL_WARNS("360Capture") << "Unable to GET InterestList capability request with return body: \n" - << ll_pretty_print_sd(body) << LL_ENDL; - } - - // Now do a POST to change the mode - if (sUsing360) - { - body["mode"] = LLSD::String("default"); - } - else - { - body["mode"] = LLSD::String("360"); - } - sUsing360 = !sUsing360; - LL_INFOS("360Capture") << "Setting InterestList capability mode to " << body["mode"].asString() << LL_ENDL; - - if (gAgent.requestPostCapability("InterestList", body, - [](const LLSD &response) { - LL_DEBUGS("360Capture") << "InterestList capability responded: \n" - << ll_pretty_print_sd(response) << LL_ENDL; - })) - { - LL_DEBUGS("360Capture") << "Successfully posted an InterestList capability request with payload: \n" - << ll_pretty_print_sd(body) << LL_ENDL; - return true; - } - else - { - LL_DEBUGS("360Capture") << "Unable to post an InterestList capability request with payload: \n" - << ll_pretty_print_sd(body) << LL_ENDL; - return false; - } - }; - - static bool sUsing360; + // Toggle the mode - regions will get updated + bool new_mode = !gAgent.getInterestList360Mode(); + gAgent.changeInterestListMode(new_mode); + return true; + } }; -bool LLAdvancedToggleInterestList360Mode::sUsing360 = false; - class LLAdvancedCheckInterestList360Mode : public view_listener_t { bool handleEvent(const LLSD& userdata) { - return LLAdvancedToggleInterestList360Mode::sUsing360; + return gAgent.getInterestList360Mode(); } }; diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index a60f11d97b..ef83fa161b 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -99,6 +99,7 @@ #include "llviewerobjectlist.h" #include "llviewerparcelmgr.h" #include "llviewerstats.h" +#include "llviewerstatsrecorder.h" #include "llviewertexteditor.h" #include "llviewerthrottle.h" #include "llviewerwindow.h" @@ -3759,31 +3760,34 @@ void process_kill_object(LLMessageSystem *mesgsys, void **user_data) continue; } - LLViewerObject *objectp = gObjectList.findObject(id); - if (objectp) + LLViewerObject *objectp = gObjectList.findObject(id); + if (objectp) + { + // Display green bubble on kill + if ( gShowObjectUpdates ) { - // Display green bubble on kill - if ( gShowObjectUpdates ) - { - LLColor4 color(0.f,1.f,0.f,1.f); - gPipeline.addDebugBlip(objectp->getPositionAgent(), color); - LL_DEBUGS("MessageBlip") << "Kill blip for local " << local_id << " at " << objectp->getPositionAgent() << LL_ENDL; - } - - // Do the kill - gObjectList.killObject(objectp); + LLColor4 color(0.f,1.f,0.f,1.f); + gPipeline.addDebugBlip(objectp->getPositionAgent(), color); + LL_DEBUGS("MessageBlip") << "Kill blip for local " << local_id << " at " << objectp->getPositionAgent() << LL_ENDL; } - if(delete_object) - { - regionp->killCacheEntry(local_id); + // Do the kill + gObjectList.killObject(objectp); + } + + if(delete_object) + { + regionp->killCacheEntry(local_id); } // We should remove the object from selection after it is marked dead by gObjectList to make LLToolGrab, // which is using the object, release the mouse capture correctly when the object dies. // See LLToolGrab::handleHoverActive() and LLToolGrab::handleHoverNonPhysical(). LLSelectMgr::getInstance()->removeObjectFromSelections(id); - } + + } // end for loop + + LLViewerStatsRecorder::instance().recordObjectKills(num_objects); } void process_time_synch(LLMessageSystem *mesgsys, void **user_data) diff --git a/indra/newview/llviewerobjectlist.cpp b/indra/newview/llviewerobjectlist.cpp index 0c9e929cf3..5f0e331baa 100644 --- a/indra/newview/llviewerobjectlist.cpp +++ b/indra/newview/llviewerobjectlist.cpp @@ -369,7 +369,7 @@ LLViewerObject* LLViewerObjectList::processObjectUpdateFromCache(LLVOCacheEntry* if (!objectp) { LL_INFOS() << "createObject failure for object: " << fullid << LL_ENDL; - recorder.objectUpdateFailure(0); + recorder.objectUpdateFailure(); return NULL; } justCreated = true; @@ -501,7 +501,7 @@ void LLViewerObjectList::processObjectUpdate(LLMessageSystem *mesgsys, << " Flags: " << flags << " Region: " << regionp->getName() << " Region id: " << regionp->getRegionID() << LL_ENDL; - recorder.objectUpdateFailure(msg_size); + recorder.objectUpdateFailure(); continue; } else if ((flags & FLAGS_TEMPORARY_ON_REZ) == 0) @@ -612,7 +612,7 @@ void LLViewerObjectList::processObjectUpdate(LLMessageSystem *mesgsys, if (update_type == OUT_TERSE_IMPROVED) { // LL_INFOS() << "terse update for an unknown object (compressed):" << fullid << LL_ENDL; - recorder.objectUpdateFailure(msg_size); + recorder.objectUpdateFailure(); continue; } } @@ -621,7 +621,7 @@ void LLViewerObjectList::processObjectUpdate(LLMessageSystem *mesgsys, if (update_type != OUT_FULL) { //LL_INFOS() << "terse update for an unknown object:" << fullid << LL_ENDL; - recorder.objectUpdateFailure(msg_size); + recorder.objectUpdateFailure(); continue; } @@ -634,7 +634,7 @@ void LLViewerObjectList::processObjectUpdate(LLMessageSystem *mesgsys, { mNumDeadObjectUpdates++; //LL_INFOS() << "update for a dead object:" << fullid << LL_ENDL; - recorder.objectUpdateFailure(msg_size); + recorder.objectUpdateFailure(); continue; } #endif @@ -647,7 +647,7 @@ void LLViewerObjectList::processObjectUpdate(LLMessageSystem *mesgsys, if (!objectp) { LL_INFOS() << "createObject failure for object: " << fullid << LL_ENDL; - recorder.objectUpdateFailure(msg_size); + recorder.objectUpdateFailure(); continue; } diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp index 54d787366f..7abd77505d 100755 --- a/indra/newview/llviewerregion.cpp +++ b/indra/newview/llviewerregion.cpp @@ -646,7 +646,8 @@ LLViewerRegion::LLViewerRegion(const U64 &handle, mInvisibilityCheckHistory(-1), mPaused(FALSE), mRegionCacheHitCount(0), - mRegionCacheMissCount(0) + mRegionCacheMissCount(0), + mUse360Mode(false) { mWidth = region_width_meters; mImpl->mOriginGlobal = from_region_handle(handle); @@ -3283,6 +3284,9 @@ void LLViewerRegion::setCapabilitiesReceived(bool received) // This is a single-shot signal. Forget callbacks to save resources. mCapabilitiesReceivedSignal.disconnect_all_slots(); + + // Set the region to the desired interest list mode + setInterestList360Mode(gAgent.getInterestList360Mode()); } } @@ -3301,6 +3305,82 @@ void LLViewerRegion::logActiveCapabilities() const log_capabilities(mImpl->mCapabilities); } + +bool LLViewerRegion::requestPostCapability(const std::string &capName, LLSD &postData, httpCallback_t cbSuccess, httpCallback_t cbFailure) +{ + std::string url = getCapability(capName); + + if (url.empty()) + { + LL_WARNS("Region") << "Could not retrieve region " << getRegionID() + << " POST capability \"" << capName << "\"" << LL_ENDL; + return false; + } + + LLCoreHttpUtil::HttpCoroutineAdapter::callbackHttpPost(url, gAgent.getAgentPolicy(), postData, cbSuccess, cbFailure); + return true; +} + +bool LLViewerRegion::requestGetCapability(const std::string &capName, httpCallback_t cbSuccess, httpCallback_t cbFailure) +{ + std::string url; + + url = getCapability(capName); + + if (url.empty()) + { + LL_WARNS("Region") << "Could not retrieve region " << getRegionID() + << " GET capability \"" << capName << "\"" << LL_ENDL; + return false; + } + + LLCoreHttpUtil::HttpCoroutineAdapter::callbackHttpGet(url, gAgent.getAgentPolicy(), cbSuccess, cbFailure); + return true; +} + + +void LLViewerRegion::setInterestList360Mode(bool use_360_mode) +{ + if (use_360_mode != mUse360Mode) + { + LLSD body; + mUse360Mode = use_360_mode; + + if (mUse360Mode) + { + body["mode"] = LLSD::String("360"); + } + else + { + body["mode"] = LLSD::String("default"); + } + + if (requestPostCapability("InterestList", body, + [](const LLSD &response) { + LL_DEBUGS("360Capture") << "InterestList capability responded: \n" + << ll_pretty_print_sd(response) << LL_ENDL; + })) + { + LL_DEBUGS("360Capture") << "Region " << getRegionID() + << " Successfully posted an InterestList capability request with payload: \n" + << ll_pretty_print_sd(body) << LL_ENDL; + } + else + { + LL_WARNS("360Capture") << "Region " << getRegionID() + << " Unable to post an InterestList capability request with payload: \n" + << ll_pretty_print_sd(body) << LL_ENDL; + } + } + else + { + LL_DEBUGS("360Capture") << "Region " << getRegionID() << "No change, skipping Interest List mode POST to " + << (use_360_mode ? "360" : "default") << " mode" << LL_ENDL; + } +} + + + LLSpatialPartition* LLViewerRegion::getSpatialPartition(U32 type) { if (type < mImpl->mObjectPartition.size() && type < PARTITION_VO_CACHE) diff --git a/indra/newview/llviewerregion.h b/indra/newview/llviewerregion.h index 81371b7f30..3da0c376d3 100644 --- a/indra/newview/llviewerregion.h +++ b/indra/newview/llviewerregion.h @@ -32,6 +32,7 @@ #include #include +#include "llcorehttputil.h" #include "llwind.h" #include "v3dmath.h" #include "llstring.h" @@ -278,6 +279,15 @@ public: static bool isSpecialCapabilityName(const std::string &name); void logActiveCapabilities() const; + // Utilities to post and get via + // HTTP using the agent's policy settings and headers. + typedef LLCoreHttpUtil::HttpCoroutineAdapter::completionCallback_t httpCallback_t; + bool requestPostCapability(const std::string &capName, + LLSD &postData, + httpCallback_t cbSuccess = NULL, + httpCallback_t cbFailure = NULL); + bool requestGetCapability(const std::string &capName, httpCallback_t cbSuccess = NULL, httpCallback_t cbFailure = NULL); + /// implements LLCapabilityProvider /*virtual*/ const LLHost& getHost() const; const U64 &getHandle() const { return mHandle; } @@ -477,6 +487,11 @@ public: }; typedef std::set region_priority_list_t; + void setInterestList360Mode(bool use_360_mode); + bool getInterestList360Mode() const { return mUse360Mode; } + + + private: static S32 sNewObjectCreationThrottle; LLViewerRegionImpl * mImpl; @@ -574,6 +589,9 @@ private: LLFrameTimer mMaterialsCapThrottleTimer; LLFrameTimer mRenderInfoRequestTimer; LLFrameTimer mRenderInfoReportTimer; + + // how the server interest list works + bool mUse360Mode; }; inline BOOL LLViewerRegion::getRegionProtocol(U64 protocol) const diff --git a/indra/newview/llviewerstatsrecorder.cpp b/indra/newview/llviewerstatsrecorder.cpp index f95a960186..6372679a07 100644 --- a/indra/newview/llviewerstatsrecorder.cpp +++ b/indra/newview/llviewerstatsrecorder.cpp @@ -73,15 +73,14 @@ void LLViewerStatsRecorder::clearStats() mObjectFullUpdates = 0; mObjectTerseUpdates = 0; mObjectCacheMissRequests = 0; - mObjectCacheMissResponses = 0; mObjectCacheUpdateDupes = 0; mObjectCacheUpdateChanges = 0; mObjectCacheUpdateAdds = 0; mObjectCacheUpdateReplacements = 0; mObjectUpdateFailures = 0; - mObjectUpdateFailuresSize = 0; mTextureFetchCount = 0; mMeshLoadedCount = 0; + mObjectKills = 0; } @@ -100,12 +99,6 @@ void LLViewerStatsRecorder::enableObjectStatsRecording(bool enable, bool logging -void LLViewerStatsRecorder::recordObjectUpdateFailure(S32 msg_size) -{ - mObjectUpdateFailures++; - mObjectUpdateFailuresSize += msg_size; -} - void LLViewerStatsRecorder::recordCacheMissEvent(U8 cache_miss_type) { if (LLViewerRegion::CACHE_MISS_TYPE_TOTAL == cache_miss_type) @@ -119,24 +112,17 @@ void LLViewerStatsRecorder::recordCacheMissEvent(U8 cache_miss_type) } -void LLViewerStatsRecorder::recordCacheHitEvent() -{ - mObjectCacheHitCount++; -} - void LLViewerStatsRecorder::recordObjectUpdateEvent(const EObjectUpdateType update_type) { switch (update_type) { case OUT_FULL: - mObjectFullUpdates++; + case OUT_FULL_COMPRESSED: + mObjectFullUpdates++; break; case OUT_TERSE_IMPROVED: mObjectTerseUpdates++; break; - case OUT_FULL_COMPRESSED: - mObjectCacheMissResponses++; - break; default: LL_WARNS() << "Unknown update_type" << LL_ENDL; break; @@ -165,11 +151,6 @@ void LLViewerStatsRecorder::recordCacheFullUpdate(LLViewerRegion::eCacheUpdateRe }; } -void LLViewerStatsRecorder::recordRequestCacheMissesEvent(S32 count) -{ - mObjectCacheMissRequests += count; -} - void LLViewerStatsRecorder::writeToLog( F32 interval ) { if (!mEnableStatsLogging || !mEnableStatsRecording) @@ -185,7 +166,7 @@ void LLViewerStatsRecorder::writeToLog( F32 interval ) if (mSkipSaveIfZeros) { S32 total_events = mObjectCacheHitCount + mObjectCacheMissCrcCount + mObjectCacheMissFullCount + mObjectFullUpdates + - mObjectTerseUpdates + mObjectCacheMissRequests + mObjectCacheMissResponses + mObjectCacheUpdateDupes + + mObjectTerseUpdates + mObjectCacheMissRequests + mObjectCacheUpdateDupes + mObjectCacheUpdateChanges + mObjectCacheUpdateAdds + mObjectCacheUpdateReplacements + mObjectUpdateFailures; if (total_events == 0) { @@ -202,14 +183,16 @@ void LLViewerStatsRecorder::writeToLog( F32 interval ) << mObjectFullUpdates << " full updates, " << mObjectTerseUpdates << " terse updates, " << mObjectCacheMissRequests << " cache miss requests, " - << mObjectCacheMissResponses << " cache miss responses, " << mObjectCacheUpdateDupes << " cache update dupes, " << mObjectCacheUpdateChanges << " cache update changes, " << mObjectCacheUpdateAdds << " cache update adds, " - << mObjectCacheUpdateReplacements << " cache update replacements, " - << mObjectUpdateFailures << " update failures" + << mObjectCacheUpdateReplacements << " cache update replacements," + << mObjectUpdateFailures << " update failures," + << mTextureFetchCount << " texture fetches, " + << mMeshLoadedCount << " mesh loads, " + << mObjectKills << " object kills" << LL_ENDL; - + if (mStatsFile == NULL) { // Refresh settings @@ -237,8 +220,7 @@ void LLViewerStatsRecorder::writeToLog( F32 interval ) << "Cache Crc Misses," << "Full Updates," << "Terse Updates," - << "Cache Miss Requests," - << "Cache Miss Responses," + << "Cache Miss Requests," // Normally results in a Full Update from simulator << "Cache Update Dupes," << "Cache Update Changes," << "Cache Update Adds," @@ -246,12 +228,16 @@ void LLViewerStatsRecorder::writeToLog( F32 interval ) << "Update Failures," << "Texture Count," << "Mesh Load Count," + << "Object Kills" << "\n"; data_size = col_headers.str().size(); if (fwrite(col_headers.str().c_str(), 1, data_size, mStatsFile ) != data_size) { LL_WARNS() << "failed to write full headers to " << mStatsFileName << LL_ENDL; + // Close the file and turn off stats logging + closeStatsFile(); + return; } } else @@ -273,7 +259,6 @@ void LLViewerStatsRecorder::writeToLog( F32 interval ) << "," << mObjectFullUpdates << "," << mObjectTerseUpdates << "," << mObjectCacheMissRequests - << "," << mObjectCacheMissResponses << "," << mObjectCacheUpdateDupes << "," << mObjectCacheUpdateChanges << "," << mObjectCacheUpdateAdds @@ -281,6 +266,7 @@ void LLViewerStatsRecorder::writeToLog( F32 interval ) << "," << mObjectUpdateFailures << "," << mTextureFetchCount << "," << mMeshLoadedCount + << "," << mObjectKills << "\n"; data_size = stats_data.str().size(); @@ -332,14 +318,4 @@ F32 LLViewerStatsRecorder::getTimeSinceStart() return (F32) (LLFrameTimer::getTotalSeconds() - mFileOpenTime); } -void LLViewerStatsRecorder::recordTextureFetch() -{ - mTextureFetchCount += 1; -} - -void LLViewerStatsRecorder::recordMeshLoaded() -{ - mMeshLoadedCount += 1; -} - diff --git a/indra/newview/llviewerstatsrecorder.h b/indra/newview/llviewerstatsrecorder.h index 37c08a51cf..b9fe02e54d 100644 --- a/indra/newview/llviewerstatsrecorder.h +++ b/indra/newview/llviewerstatsrecorder.h @@ -53,11 +53,11 @@ class LLViewerStatsRecorder : public LLSingleton bool isEnabled() const { return mEnableStatsRecording; } bool isLogging() const { return mEnableStatsLogging; } - void objectUpdateFailure(S32 msg_size) + void objectUpdateFailure() { if (mEnableStatsRecording) { - recordObjectUpdateFailure(msg_size); + mObjectUpdateFailures++; } } @@ -73,7 +73,7 @@ class LLViewerStatsRecorder : public LLSingleton { if (mEnableStatsRecording) { - recordCacheHitEvent(); + mObjectCacheHitCount++; } } @@ -97,7 +97,7 @@ class LLViewerStatsRecorder : public LLSingleton { if (mEnableStatsRecording) { - recordRequestCacheMissesEvent(count); + mObjectCacheMissRequests += count; } } @@ -105,7 +105,7 @@ class LLViewerStatsRecorder : public LLSingleton { if (mEnableStatsRecording) { - recordTextureFetch(); + mTextureFetchCount += 1; } } @@ -113,10 +113,18 @@ class LLViewerStatsRecorder : public LLSingleton { if (mEnableStatsRecording) { - recordMeshLoaded(); + mMeshLoadedCount += 1; } } + void recordObjectKills(S32 num_objects) + { + if (mEnableStatsRecording) + { + mObjectKills += num_objects; + } + } + void idle() { writeToLog(mInterval); @@ -125,14 +133,9 @@ class LLViewerStatsRecorder : public LLSingleton F32 getTimeSinceStart(); private: - void recordObjectUpdateFailure(S32 msg_size); void recordCacheMissEvent(U8 cache_miss_type); - void recordCacheHitEvent(); void recordObjectUpdateEvent(const EObjectUpdateType update_type); void recordCacheFullUpdate(LLViewerRegion::eCacheUpdateResult update_result); - void recordRequestCacheMissesEvent(S32 count); - void recordTextureFetch(); - void recordMeshLoaded(); void writeToLog(F32 interval); void closeStatsFile(); void makeStatsFileName(); @@ -158,15 +161,14 @@ private: S32 mObjectFullUpdates; S32 mObjectTerseUpdates; S32 mObjectCacheMissRequests; - S32 mObjectCacheMissResponses; S32 mObjectCacheUpdateDupes; S32 mObjectCacheUpdateChanges; S32 mObjectCacheUpdateAdds; S32 mObjectCacheUpdateReplacements; S32 mObjectUpdateFailures; - S32 mObjectUpdateFailuresSize; S32 mTextureFetchCount; S32 mMeshLoadedCount; + S32 mObjectKills; void clearStats(); }; -- cgit v1.3