Additional profiling scopes and remove some superfluous ones.

meow-7.2.2
Beq 2024-05-29 20:46:34 +01:00
parent a91ba82c41
commit 5f190b112e
12 changed files with 50 additions and 5 deletions

View File

@ -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)

View File

@ -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;

View File

@ -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)

View File

@ -213,6 +213,7 @@ void HttpPolicy::retryOp(const HttpOpRequest::ptr_t &op)
//
HttpService::ELoopSpeed HttpPolicy::processReadyQueue()
{
LL_PROFILE_ZONE_SCOPED_CATEGORY_NETWORK;// <FS:Beq/> missing http trace
const HttpTime now(totalTime());
HttpService::ELoopSpeed result(HttpService::REQUEST_SLEEP);
HttpLibcurl & transport(mService->getTransport());

View File

@ -365,6 +365,7 @@ public:
BOOL callHandlerFunc(LLMessageSystem *msgsystem) const
{
LL_PROFILE_ZONE_SCOPED_CATEGORY_NETWORK;
if (mHandlerFunc)
{

View File

@ -541,6 +541,11 @@ BOOL LLTemplateMessageReader::decodeData(const U8* buffer, const LLHost& sender
llassert( mCurrentRMessageTemplate);
llassert( !mCurrentRMessageData );
delete mCurrentRMessageData; // just to make sure
// <FS:Beq> storage for Tracy tag
#ifdef TRACY_ENABLE
static char msgstr[36];
#endif
// </FS:Beq>
// 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;
// <FS:Beq> 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
// </FS:Beq>
// 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
}
{
// <FS:Beq> Tracy Message processing
LL_PROFILE_ZONE_NAMED_CATEGORY_NETWORK("ProcessMessage");
#ifdef TRACY_ENABLE
LL_PROFILE_ZONE_TEXT(msgstr, 35);
#endif
// </FS:Beq>
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;
}

View File

@ -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);

View File

@ -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);

View File

@ -1686,6 +1686,7 @@ const S32 max_format = (S32)num_formats - 1;
close();
return FALSE;
}
//LL_PROFILER_GPU_CONTEXT; <FS:Beq/> 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)

View File

@ -283,7 +283,6 @@ namespace LLPerfStats
auto val {upd.time};
// <FS:Beq> 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);

View File

@ -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;

View File

@ -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)
// </FS:Beq>
{
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; // <FS:Beq/> 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));
// <FS:Beq> 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
// </FS:Beq>
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;
// <FS:Beq/> 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;
// <FS:Beq> 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;