From e6f44577f469e891ed8dab1492a4c53224e0b765 Mon Sep 17 00:00:00 2001 From: Stefan Boberg Date: Mon, 2 Dec 2024 12:21:53 +0100 Subject: added support for dynamic LLM tags (#245) * added FLLMTag which can be used to register memory tags outside of core * changed `UE_MEMSCOPE` -> `ZEN_MEMSCOPE` for consistency * instrumented some subsystems with dynamic tags --- src/zenutil/openprocesscache.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/zenutil/openprocesscache.cpp') diff --git a/src/zenutil/openprocesscache.cpp b/src/zenutil/openprocesscache.cpp index 256d5fb4a..88bbce8a6 100644 --- a/src/zenutil/openprocesscache.cpp +++ b/src/zenutil/openprocesscache.cpp @@ -3,6 +3,7 @@ #include "zenutil/openprocesscache.h" #include #include +#include #if ZEN_PLATFORM_WINDOWS # include @@ -14,6 +15,14 @@ namespace zen { +const FLLMTag& +GetProcCacheTag() +{ + static FLLMTag CacheHttpTag("proccache"); + + return CacheHttpTag; +} + OpenProcessCache::OpenProcessCache() #if ZEN_PLATFORM_WINDOWS : m_GcThread(&OpenProcessCache::GcWorker, this) @@ -60,6 +69,9 @@ OpenProcessCache::GetProcessHandle(Oid SessionId, int ProcessPid) { return nullptr; } + + ZEN_MEMSCOPE(GetProcCacheTag()); + #if ZEN_PLATFORM_WINDOWS ZEN_ASSERT(ProcessPid != 0); { @@ -171,6 +183,8 @@ OpenProcessCache::GCHandles() void OpenProcessCache::GcWorker() { + ZEN_MEMSCOPE(GetProcCacheTag()); + SetCurrentThreadName("ProcessCache_GC"); while (!m_GcExitEvent.Wait(500)) -- cgit v1.2.3