aboutsummaryrefslogtreecommitdiff
path: root/src/zenstore/cas.cpp
diff options
context:
space:
mode:
authorStefan Boberg <[email protected]>2024-12-02 12:21:53 +0100
committerGitHub Enterprise <[email protected]>2024-12-02 12:21:53 +0100
commite6f44577f469e891ed8dab1492a4c53224e0b765 (patch)
tree47334606ce62fb6bf1975cdc09276ced335599f4 /src/zenstore/cas.cpp
parent5.5.15-pre0 (diff)
downloadzen-e6f44577f469e891ed8dab1492a4c53224e0b765.tar.xz
zen-e6f44577f469e891ed8dab1492a4c53224e0b765.zip
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
Diffstat (limited to 'src/zenstore/cas.cpp')
-rw-r--r--src/zenstore/cas.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/zenstore/cas.cpp b/src/zenstore/cas.cpp
index 4c1836cf7..7beac31e1 100644
--- a/src/zenstore/cas.cpp
+++ b/src/zenstore/cas.cpp
@@ -33,8 +33,20 @@
//////////////////////////////////////////////////////////////////////////
+#include <zencore/memory/llm.h>
+
+//////////////////////////////////////////////////////////////////////////
+
namespace zen {
+const FLLMTag&
+GetCasTag()
+{
+ static FLLMTag _("cas");
+
+ return _;
+}
+
/**
* CAS store implementation
*
@@ -97,6 +109,8 @@ CasImpl::~CasImpl()
void
CasImpl::Initialize(const CidStoreConfiguration& InConfig)
{
+ ZEN_MEMSCOPE(GetCasTag());
+
ZEN_TRACE_CPU("CAS::Initialize");
m_Config = InConfig;
@@ -226,6 +240,7 @@ CasImpl::UpdateManifest()
CasStore::InsertResult
CasImpl::InsertChunk(IoBuffer Chunk, const IoHash& ChunkHash, InsertMode Mode)
{
+ ZEN_MEMSCOPE(GetCasTag());
ZEN_TRACE_CPU("CAS::InsertChunk");
const uint64_t ChunkSize = Chunk.Size();
@@ -294,6 +309,7 @@ GetFileCasResults(FileCasStrategy& Strategy,
std::vector<CasStore::InsertResult>
CasImpl::InsertChunks(std::span<IoBuffer> Data, std::span<IoHash> ChunkHashes, CasStore::InsertMode Mode)
{
+ ZEN_MEMSCOPE(GetCasTag());
ZEN_TRACE_CPU("CAS::InsertChunks");
ZEN_ASSERT(Data.size() == ChunkHashes.size());
@@ -448,6 +464,8 @@ CasImpl::Flush()
void
CasImpl::ScrubStorage(ScrubContext& Ctx)
{
+ ZEN_MEMSCOPE(GetCasTag());
+
ZEN_TRACE_CPU("Cas::ScrubStorage");
if (m_LastScrubTime == Ctx.ScrubTimestamp())
@@ -477,6 +495,8 @@ CasImpl::TotalSize() const
std::unique_ptr<CasStore>
CreateCasStore(GcManager& Gc)
{
+ ZEN_MEMSCOPE(GetCasTag());
+
return std::make_unique<CasImpl>(Gc);
}