diff --git a/profiler/src/profiler/TracyLlmChat.cpp b/profiler/src/profiler/TracyLlmChat.cpp index 7f7a34f8..d654bfa5 100644 --- a/profiler/src/profiler/TracyLlmChat.cpp +++ b/profiler/src/profiler/TracyLlmChat.cpp @@ -9,6 +9,7 @@ #include "TracyLlmChat.hpp" #include "TracyMouse.hpp" #include "TracyPrint.hpp" +#include "TracyView.hpp" #include "../Fonts.hpp" #include "../../public/common/TracyForceInline.hpp" @@ -144,6 +145,7 @@ TracyLlmChat::TracyLlmChat( View& view, Worker& worker, const std::vector::iterator it const bool expand = ImGui::TreeNode( "Attachment" ); ImGui::SameLine(); ImGui::TextDisabled( "(%s)", type.c_str() ); + if( type == "callstack" ) + { + if( j.contains( "id" ) ) + { + const auto id = j["id"].get(); + assert( id >= 0 ); + const auto thread = j.contains( "thread" ) ? j["thread"].get() : 0; + ImGui::SameLine(); + if( ImGui::SmallButton( ICON_FA_EYE ) ) + { + m_view.ViewCallstack( id, thread ); + } + } + } if( expand ) { ImGui::PushFont( g_fonts.mono, FontNormal ); diff --git a/profiler/src/profiler/TracyLlmChat.hpp b/profiler/src/profiler/TracyLlmChat.hpp index 9c3674c6..81d3bdd4 100644 --- a/profiler/src/profiler/TracyLlmChat.hpp +++ b/profiler/src/profiler/TracyLlmChat.hpp @@ -67,6 +67,7 @@ private: std::string m_label; const std::vector& m_skills; + View& m_view; }; } diff --git a/profiler/src/profiler/TracyView_Callstack.cpp b/profiler/src/profiler/TracyView_Callstack.cpp index bb68f865..1c1bbdd0 100644 --- a/profiler/src/profiler/TracyView_Callstack.cpp +++ b/profiler/src/profiler/TracyView_Callstack.cpp @@ -113,7 +113,7 @@ void View::DrawCallstackTable( const CallstackFrameId* data, size_t size, uint64 } if( s_config.llm ) { - auto Attach = [this, data, size, hasCrashed, thread]() { + auto Attach = [this, data, size, hasCrashed, thread, callstack]() { auto json = GetCallstackJson( data, size ); if( hasCrashed ) { @@ -130,6 +130,7 @@ void View::DrawCallstackTable( const CallstackFrameId* data, size_t size, uint64 if( strcmp( threadName, "???" ) != 0 ) json["thread_name"] = threadName; json["thread_id"] = thread; } + if( callstack >= 0 ) json["id"] = callstack; AddLlmAttachment( json ); };