From 04d30fb48733988a26036e867d3a2df7822cdbc1 Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Mon, 27 Apr 2026 22:20:58 +0200 Subject: [PATCH] Add manual chunk retrieval function. --- profiler/src/profiler/TracyView.hpp | 3 +++ profiler/src/profiler/TracyView_Manual.cpp | 11 +++++++++++ 2 files changed, 14 insertions(+) diff --git a/profiler/src/profiler/TracyView.hpp b/profiler/src/profiler/TracyView.hpp index 63beb8d5..b2e6134a 100644 --- a/profiler/src/profiler/TracyView.hpp +++ b/profiler/src/profiler/TracyView.hpp @@ -18,6 +18,7 @@ #include "TracyBuzzAnim.hpp" #include "TracyConfig.hpp" #include "TracyDecayValue.hpp" +#include "TracyManualData.hpp" #include "TracyMarkdown.hpp" #include "TracySourceContents.hpp" #include "TracyTimelineController.hpp" @@ -138,6 +139,8 @@ public: void ViewSymbol( const char* fileName, int line, uint64_t baseAddr, uint64_t symAddr ); bool ViewDispatch( const char* fileName, int line, uint64_t symAddr ); + const TracyManualData::ManualChunk* GetManualChunk( const char* anchor ) const; + bool ReconnectRequested() const { return m_reconnectRequested; } std::string GetAddress() const { return m_worker.GetAddr(); } uint16_t GetPort() const { return m_worker.GetPort(); } diff --git a/profiler/src/profiler/TracyView_Manual.cpp b/profiler/src/profiler/TracyView_Manual.cpp index 19222fab..e8b740ce 100644 --- a/profiler/src/profiler/TracyView_Manual.cpp +++ b/profiler/src/profiler/TracyView_Manual.cpp @@ -87,4 +87,15 @@ void View::DrawManual() ImGui::End(); } +const TracyManualData::ManualChunk* View::GetManualChunk( const char* anchor ) const +{ + assert( anchor && *anchor ); + assert( m_manualData ); + + auto& chunks = m_manualData->GetChunks(); + auto it = std::ranges::find_if( chunks, [anchor]( const auto& chunk ) { return chunk.link == anchor; } ); + if( it != chunks.end() ) return &*it; + return nullptr; +} + }