diff --git a/indra/llcommon/llprofiler.h b/indra/llcommon/llprofiler.h index 9229479ae7..631f0434a0 100644 --- a/indra/llcommon/llprofiler.h +++ b/indra/llcommon/llprofiler.h @@ -225,6 +225,7 @@ namespace LLProfiler #define LL_PROFILE_GPU_ZONEC(name,color) TracyGpuZoneC(name,color) #define LL_PROFILER_GPU_COLLECT TracyGpuCollect #define LL_PROFILER_GPU_CONTEXT TracyGpuContext +#define LL_PROFILER_GPU_CONTEXT_NS(name, size) TracyGpuContext;TracyGpuContextName(name,size); // disable memory tracking (incompatible with GPU tracing #define LL_PROFILE_ALLOC(ptr, size) (void)(ptr); (void)(size); @@ -234,6 +235,7 @@ namespace LLProfiler #define LL_PROFILE_GPU_ZONEC(name,color) (void)name;(void)color; #define LL_PROFILER_GPU_COLLECT #define LL_PROFILER_GPU_CONTEXT +#define LL_PROFILER_GPU_CONTEXT_NS(name, size) (void)name;(void)size; #define LL_LABEL_OBJECT_GL(type, name, length, label) diff --git a/indra/llcommon/llsdserialize.cpp b/indra/llcommon/llsdserialize.cpp index c854e30060..389dc2c39e 100644 --- a/indra/llcommon/llsdserialize.cpp +++ b/indra/llcommon/llsdserialize.cpp @@ -122,6 +122,7 @@ void LLSDSerialize::serialize(const LLSD& sd, std::ostream& str, ELLSD_Serialize // static bool LLSDSerialize::deserialize(LLSD& sd, std::istream& str, llssize max_bytes) { + LL_PROFILE_ZONE_SCOPED_CATEGORY_LLSD; char hdr_buf[MAX_HDR_LEN + 1] = ""; /* Flawfinder: ignore */ bool fail_if_not_legacy = false; diff --git a/indra/llcommon/lltimer.cpp b/indra/llcommon/lltimer.cpp index 6f74bf3fc8..a34b8f1024 100644 --- a/indra/llcommon/lltimer.cpp +++ b/indra/llcommon/lltimer.cpp @@ -70,7 +70,7 @@ LLTimer* LLTimer::sTimer = NULL; #if 0 void ms_sleep(U32 ms) { - LL_PROFILE_ZONE_SCOPED; + // LL_PROFILE_ZONE_SCOPED; using TimePoint = std::chrono::steady_clock::time_point; auto resume_time = TimePoint::clock::now() + std::chrono::milliseconds(ms); while (TimePoint::clock::now() < resume_time) diff --git a/indra/llcorehttp/_httppolicy.cpp b/indra/llcorehttp/_httppolicy.cpp index 704c8abb93..03ac521b87 100644 --- a/indra/llcorehttp/_httppolicy.cpp +++ b/indra/llcorehttp/_httppolicy.cpp @@ -213,6 +213,7 @@ void HttpPolicy::retryOp(const HttpOpRequest::ptr_t &op) // HttpService::ELoopSpeed HttpPolicy::processReadyQueue() { + LL_PROFILE_ZONE_SCOPED_CATEGORY_NETWORK;// missing http trace const HttpTime now(totalTime()); HttpService::ELoopSpeed result(HttpService::REQUEST_SLEEP); HttpLibcurl & transport(mService->getTransport()); diff --git a/indra/llmessage/llmessagetemplate.h b/indra/llmessage/llmessagetemplate.h index 85a765b085..e949d2b395 100644 --- a/indra/llmessage/llmessagetemplate.h +++ b/indra/llmessage/llmessagetemplate.h @@ -365,6 +365,7 @@ public: BOOL callHandlerFunc(LLMessageSystem *msgsystem) const { + LL_PROFILE_ZONE_SCOPED_CATEGORY_NETWORK; if (mHandlerFunc) { diff --git a/indra/llmessage/lltemplatemessagereader.cpp b/indra/llmessage/lltemplatemessagereader.cpp index 0fd8ee875c..1eec975d46 100644 --- a/indra/llmessage/lltemplatemessagereader.cpp +++ b/indra/llmessage/lltemplatemessagereader.cpp @@ -541,6 +541,11 @@ BOOL LLTemplateMessageReader::decodeData(const U8* buffer, const LLHost& sender llassert( mCurrentRMessageTemplate); llassert( !mCurrentRMessageData ); delete mCurrentRMessageData; // just to make sure + // storage for Tracy tag + #ifdef TRACY_ENABLE + static char msgstr[36]; + #endif + // // The offset tells us how may bytes to skip after the end of the // message name. @@ -556,6 +561,7 @@ BOOL LLTemplateMessageReader::decodeData(const U8* buffer, const LLHost& sender iter != mCurrentRMessageTemplate->mMemberBlocks.end(); ++iter) { + LL_PROFILE_ZONE_NAMED_CATEGORY_NETWORK("BuildFromTemplate"); LLMessageBlock* mbci = *iter; U8 repeat_number; S32 i; @@ -598,6 +604,13 @@ BOOL LLTemplateMessageReader::decodeData(const U8* buffer, const LLHost& sender } LLMsgBlkData* cur_data_block = NULL; + // Tracy Message processing + LL_DEBUGS("LLMessage") << "Processing " << mbci->mName << " with " << repeat_number << " repetitions" << LL_ENDL; + #ifdef TRACY_ENABLE + strncpy(msgstr, mbci->mName, 35); + LL_PROFILE_ZONE_TEXT(msgstr, 35); + #endif + // // now loop through the block for (i = 0; i < repeat_number; i++) @@ -622,6 +635,7 @@ BOOL LLTemplateMessageReader::decodeData(const U8* buffer, const LLHost& sender mbci->mMemberVariables.begin(); iter != mbci->mMemberVariables.end(); iter++) { + LL_PROFILE_ZONE_NAMED_CATEGORY_NETWORK("AddVariables"); const LLMessageVariable& mvci = **iter; // ok, build out the variables @@ -704,6 +718,12 @@ BOOL LLTemplateMessageReader::decodeData(const U8* buffer, const LLHost& sender } { + // Tracy Message processing + LL_PROFILE_ZONE_NAMED_CATEGORY_NETWORK("ProcessMessage"); + #ifdef TRACY_ENABLE + LL_PROFILE_ZONE_TEXT(msgstr, 35); + #endif + // static LLTimer decode_timer; if(LLMessageReader::getTimeDecodes() || gMessageSystem->getTimingCallback()) @@ -742,7 +762,7 @@ BOOL LLTemplateMessageReader::decodeData(const U8* buffer, const LLHost& sender if(decode_time > LLMessageReader::getTimeDecodesSpamThreshold()) { - LL_DEBUGS() << "--------- Message " << mCurrentRMessageTemplate->mName << " decode took " << decode_time << " seconds. (" << + LL_DEBUGS("LLMessage") << "--------- Message " << mCurrentRMessageTemplate->mName << " decode took " << decode_time << " seconds. (" << mCurrentRMessageTemplate->mMaxDecodeTimePerMsg << " max, " << (mCurrentRMessageTemplate->mTotalDecodeTime / mCurrentRMessageTemplate->mTotalDecoded) << " avg)" << LL_ENDL; } diff --git a/indra/llrender/llimagegl.cpp b/indra/llrender/llimagegl.cpp index 6d41a5a22d..5a83c6e68f 100644 --- a/indra/llrender/llimagegl.cpp +++ b/indra/llrender/llimagegl.cpp @@ -2547,6 +2547,7 @@ void LLImageGLThread::run() // WorkQueue, likewise cleanup afterwards. mWindow->makeContextCurrent(mContext); gGL.init(false); + LL_PROFILER_GPU_CONTEXT_NS("LLImageGL Context", 17); LL::ThreadPool::run(); gGL.shutdown(); mWindow->destroySharedContext(mContext); diff --git a/indra/llrender/llvertexbuffer.cpp b/indra/llrender/llvertexbuffer.cpp index 78227a7207..548ce6c308 100644 --- a/indra/llrender/llvertexbuffer.cpp +++ b/indra/llrender/llvertexbuffer.cpp @@ -237,6 +237,7 @@ public: { mWindow->makeContextCurrent(mContext); gGL.init(false); + LL_PROFILER_GPU_CONTEXT_NS("LLGLWorker Context", 18); mQueue->runUntilClose(); gGL.shutdown(); mWindow->destroySharedContext(mContext); diff --git a/indra/llwindow/llwindowwin32.cpp b/indra/llwindow/llwindowwin32.cpp index 2f2d2cca88..2573b8be5b 100644 --- a/indra/llwindow/llwindowwin32.cpp +++ b/indra/llwindow/llwindowwin32.cpp @@ -1686,6 +1686,7 @@ const S32 max_format = (S32)num_formats - 1; close(); return FALSE; } + //LL_PROFILER_GPU_CONTEXT; TODO(Beq) review this LL_PROFILER_GPU_CONTEXT @@ -1720,7 +1721,7 @@ const S32 max_format = (S32)num_formats - 1; swapBuffers(); } - LL_PROFILER_GPU_CONTEXT; + LL_PROFILER_GPU_CONTEXT_NS("MainGL Context", 14); return TRUE; } @@ -1890,7 +1891,7 @@ void* LLWindowWin32::createSharedContext() void LLWindowWin32::makeContextCurrent(void* contextPtr) { wglMakeCurrent(mhDC, (HGLRC) contextPtr); - LL_PROFILER_GPU_CONTEXT; + } void LLWindowWin32::destroySharedContext(void* contextPtr) diff --git a/indra/newview/llperfstats.h b/indra/newview/llperfstats.h index 457d4458f6..06626f428a 100644 --- a/indra/newview/llperfstats.h +++ b/indra/newview/llperfstats.h @@ -283,7 +283,6 @@ namespace LLPerfStats auto val {upd.time}; // markup to support coverage testing on stats collection #ifdef TRACY_ENABLE - auto& avKey{upd.avID}; static char obstr[36]; static char avstr[36]; LL_PROFILE_ZONE_TEXT(key.toStringFast(obstr), 36); diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp index 381a773e9e..0f98d9c548 100755 --- a/indra/newview/llviewerregion.cpp +++ b/indra/newview/llviewerregion.cpp @@ -834,6 +834,7 @@ void LLViewerRegion::setRegionID(const LLUUID& region_id) void LLViewerRegion::loadObjectCache() { + LL_PROFILE_ZONE_SCOPED_CATEGORY_NETWORK; if (mCacheLoaded) { return; @@ -3126,6 +3127,7 @@ void LLViewerRegion::clearVOCacheFromMemory() void LLViewerRegion::unpackRegionHandshake() { + LL_PROFILE_ZONE_SCOPED_CATEGORY_NETWORK; LLMessageSystem *msg = gMessageSystem; U64 region_flags = 0; diff --git a/indra/newview/llvocache.cpp b/indra/newview/llvocache.cpp index 32b614d596..f0d51199ab 100644 --- a/indra/newview/llvocache.cpp +++ b/indra/newview/llvocache.cpp @@ -1541,6 +1541,7 @@ BOOL LLVOCache::updateEntry(const HeaderEntryInfo* entry) bool LLVOCache::readFromCache(U64 handle, const LLUUID& id, LLVOCacheEntry::vocache_entry_map_t& cache_entry_map) // { + LL_PROFILE_ZONE_SCOPED_CATEGORY_NETWORK; if(!mEnabled) { LL_WARNS() << "Not reading cache for handle " << handle << "): Cache is currently disabled." << LL_ENDL; @@ -1559,6 +1560,7 @@ bool LLVOCache::readFromCache(U64 handle, const LLUUID& id, LLVOCacheEntry::voca S32 num_entries=0; // FIRE-33808 - Material Override Cache causes long delays std::string filename; { + LL_PROFILE_ZONE_NAMED_CATEGORY_NETWORK("VOCache:loadRegionObjectCache"); LLUUID cache_id; getObjectCacheFilename(handle, filename); LLAPRFile apr_file(filename, APR_READ|APR_BINARY, mLocalAPRFilePoolp); @@ -1567,6 +1569,7 @@ bool LLVOCache::readFromCache(U64 handle, const LLUUID& id, LLVOCacheEntry::voca if(success) { + LL_PROFILE_ZONE_NAMED_CATEGORY_NETWORK("VOCache:loadCacheForRegion"); if(cache_id != id) { LL_INFOS() << "Cache ID doesn't match for this region, discarding"<< LL_ENDL; @@ -1615,6 +1618,7 @@ bool LLVOCache::readFromCache(U64 handle, const LLUUID& id, LLVOCacheEntry::voca // void LLVOCache::readGenericExtrasFromCache(U64 handle, const LLUUID& id, LLVOCacheEntry::vocache_gltf_overrides_map_t& cache_extras_entry_map) void LLVOCache::readGenericExtrasFromCache(U64 handle, const LLUUID& id, LLVOCacheEntry::vocache_gltf_overrides_map_t& cache_extras_entry_map, const LLVOCacheEntry::vocache_entry_map_t& cache_entry_map) { + LL_PROFILE_ZONE_SCOPED_CATEGORY_NETWORK; int loaded= 0; int discarded = 0; // get ViewerRegion pointer from handle @@ -1635,6 +1639,13 @@ void LLVOCache::readGenericExtrasFromCache(U64 handle, const LLUUID& id, LLVOCac } std::string filename(getObjectCacheExtrasFilename(handle)); + // Material Override Cache caused long delays + #ifdef TRACY_ENABLE + static char extra_filename[256]; + strncpy(extra_filename, filename.c_str(), 256); + LL_PROFILE_ZONE_TEXT(extra_filename,256); + #endif + // llifstream in(filename, std::ios::in | std::ios::binary); std::string line; @@ -1714,8 +1725,10 @@ void LLVOCache::readGenericExtrasFromCache(U64 handle, const LLUUID& id, LLVOCac LL_DEBUGS("GLTF") << "Beginning reading extras cache for handle " << handle << " from " << getObjectCacheExtrasFilename(handle) << LL_ENDL; LLSD entry_llsd; + LL_PROFILE_ZONE_NUM(num_entries); for (U32 i = 0; i < num_entries && !in.eof(); i++) { + LL_PROFILE_ZONE_NAMED_CATEGORY_NETWORK("RegionExtrasReadEntries"); static const U32 max_size = 4096; bool success = LLSDSerialize::deserialize(entry_llsd, in, max_size); // check bool(in) this time since eof is not a failure condition here @@ -1756,6 +1769,7 @@ void LLVOCache::readGenericExtrasFromCache(U64 handle, const LLUUID& id, LLVOCac void LLVOCache::purgeEntries(U32 size) { + LL_PROFILE_ZONE_SCOPED_CATEGORY_NETWORK; // FIRE-33808 - Material Override Cache causes long delays LL_DEBUGS("VOCache","GLTF") << "Purging " << size << " entries from cache" << LL_ENDL; while(mHeaderEntryQueue.size() > size) @@ -1775,6 +1789,7 @@ void LLVOCache::purgeEntries(U32 size) void LLVOCache::writeToCache(U64 handle, const LLUUID& id, const LLVOCacheEntry::vocache_entry_map_t& cache_entry_map, BOOL dirty_cache, bool removal_enabled) { + LL_PROFILE_ZONE_SCOPED_CATEGORY_NETWORK; // FIRE-33808 - Material Override Cache causes long delays std::string filename; getObjectCacheFilename(handle, filename); @@ -1942,6 +1957,7 @@ void LLVOCache::removeGenericExtrasForHandle(U64 handle) void LLVOCache::writeGenericExtrasToCache(U64 handle, const LLUUID& id, const LLVOCacheEntry::vocache_gltf_overrides_map_t& cache_extras_entry_map, BOOL dirty_cache, bool removal_enabled) { + LL_PROFILE_ZONE_SCOPED_CATEGORY_NETWORK; if(!mEnabled) { LL_WARNS() << "Not writing extras cache for handle " << handle << "): Cache is currently disabled." << LL_ENDL;