mirror of
https://github.com/wolfpld/tracy.git
synced 2026-06-08 08:33:48 +00:00
Change GetCallstackJson interface to data ptr + size.
This commit is contained in:
@@ -388,7 +388,7 @@ private:
|
||||
void SmallCallstackButton( const char* name, uint32_t callstack, int& idx, bool tooltip = true );
|
||||
void DrawCallstackCalls( uint32_t callstack, uint16_t limit ) const;
|
||||
void DrawCallstackCalls( const CallstackFrameId* data, size_t size, uint16_t limit ) const;
|
||||
nlohmann::json GetCallstackJson( const VarArray<CallstackFrameId>& cs );
|
||||
nlohmann::json GetCallstackJson( const CallstackFrameId* data, size_t size ) const;
|
||||
void SetViewToLastFrames();
|
||||
int64_t GetZoneChildTime( const ZoneEvent& zone );
|
||||
int64_t GetZoneChildTime( const GpuEvent& zone );
|
||||
|
||||
@@ -108,7 +108,7 @@ void View::DrawCallstackTable( uint32_t callstack, bool globalEntriesButton )
|
||||
if( s_config.llm )
|
||||
{
|
||||
auto Attach = [&]() {
|
||||
auto json = GetCallstackJson( cs );
|
||||
auto json = GetCallstackJson( cs.data(), cs.size() );
|
||||
if( hasCrashed )
|
||||
{
|
||||
json["crashed"] = true;
|
||||
@@ -214,7 +214,7 @@ void View::DrawCallstackTable( uint32_t callstack, bool globalEntriesButton )
|
||||
},
|
||||
{
|
||||
{ "role", "user" },
|
||||
{ "content", GetCallstackJson( cs )["frames"].dump() }
|
||||
{ "content", GetCallstackJson( cs.data(), cs.size() )["frames"].dump() }
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -964,7 +964,7 @@ void View::DrawSampleParents()
|
||||
ImGui::SameLine();
|
||||
if( ImGui::SmallButton( ICON_FA_ROBOT ) )
|
||||
{
|
||||
AddLlmAttachment( GetCallstackJson( cs ) );
|
||||
AddLlmAttachment( GetCallstackJson( cs.data(), cs.size() ) );
|
||||
}
|
||||
}
|
||||
ImGui::SameLine();
|
||||
|
||||
@@ -926,7 +926,7 @@ void View::UpdateTitle()
|
||||
}
|
||||
}
|
||||
|
||||
nlohmann::json View::GetCallstackJson( const VarArray<CallstackFrameId>& cs )
|
||||
nlohmann::json View::GetCallstackJson( const CallstackFrameId* data, size_t size ) const
|
||||
{
|
||||
nlohmann::json json = {
|
||||
{ "type", "callstack" },
|
||||
@@ -934,9 +934,11 @@ nlohmann::json View::GetCallstackJson( const VarArray<CallstackFrameId>& cs )
|
||||
};
|
||||
auto& frames = json["frames"];
|
||||
|
||||
auto end = data + size;
|
||||
int fidx = 0;
|
||||
for( auto& entry : cs )
|
||||
while( data < end )
|
||||
{
|
||||
auto& entry = *data++;
|
||||
auto frameData = m_worker.GetCallstackFrame( entry );
|
||||
if( !frameData )
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user