mirror of
https://github.com/wolfpld/tracy.git
synced 2025-03-20 07:40:02 +08:00
Add minimal trace info window.
This commit is contained in:
parent
a51da71fa4
commit
29c6498890
@ -241,6 +241,7 @@ View::View( const char* addr )
|
|||||||
, m_showOptions( false )
|
, m_showOptions( false )
|
||||||
, m_showMessages( false )
|
, m_showMessages( false )
|
||||||
, m_showStatistics( false )
|
, m_showStatistics( false )
|
||||||
|
, m_showInfo( false )
|
||||||
, m_drawGpuZones( true )
|
, m_drawGpuZones( true )
|
||||||
, m_drawZones( true )
|
, m_drawZones( true )
|
||||||
, m_drawLocks( true )
|
, m_drawLocks( true )
|
||||||
@ -283,6 +284,7 @@ View::View( FileRead& f )
|
|||||||
, m_showOptions( false )
|
, m_showOptions( false )
|
||||||
, m_showMessages( false )
|
, m_showMessages( false )
|
||||||
, m_showStatistics( false )
|
, m_showStatistics( false )
|
||||||
|
, m_showInfo( false )
|
||||||
, m_drawGpuZones( true )
|
, m_drawGpuZones( true )
|
||||||
, m_drawZones( true )
|
, m_drawZones( true )
|
||||||
, m_drawLocks( true )
|
, m_drawLocks( true )
|
||||||
@ -422,6 +424,8 @@ bool View::DrawImpl()
|
|||||||
ImGui::SameLine();
|
ImGui::SameLine();
|
||||||
if( ImGui::Button( "Compare" ) ) m_compare.show = true;
|
if( ImGui::Button( "Compare" ) ) m_compare.show = true;
|
||||||
ImGui::SameLine();
|
ImGui::SameLine();
|
||||||
|
if( ImGui::Button( "Info" ) ) m_showInfo = true;
|
||||||
|
ImGui::SameLine();
|
||||||
if( ImGui::SmallButton( "<" ) ) ZoomToPrevFrame();
|
if( ImGui::SmallButton( "<" ) ) ZoomToPrevFrame();
|
||||||
ImGui::SameLine();
|
ImGui::SameLine();
|
||||||
{
|
{
|
||||||
@ -475,6 +479,7 @@ bool View::DrawImpl()
|
|||||||
if( m_compare.show ) DrawCompare();
|
if( m_compare.show ) DrawCompare();
|
||||||
if( m_callstackInfoWindow != 0 ) DrawCallstackWindow();
|
if( m_callstackInfoWindow != 0 ) DrawCallstackWindow();
|
||||||
if( m_memoryAllocInfoWindow >= 0 ) DrawMemoryAllocWindow();
|
if( m_memoryAllocInfoWindow >= 0 ) DrawMemoryAllocWindow();
|
||||||
|
if( m_showInfo ) DrawInfo();
|
||||||
|
|
||||||
if( m_zoomAnim.active )
|
if( m_zoomAnim.active )
|
||||||
{
|
{
|
||||||
@ -5655,6 +5660,22 @@ void View::DrawMemoryAllocWindow()
|
|||||||
if( !show ) m_memoryAllocInfoWindow = -1;
|
if( !show ) m_memoryAllocInfoWindow = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void View::DrawInfo()
|
||||||
|
{
|
||||||
|
ImGui::Begin( "Trace information", &m_showInfo );
|
||||||
|
TextFocused( "Queue delay:", TimeToString( m_worker.GetDelay() ) );
|
||||||
|
TextFocused( "Timer resolution:", TimeToString( m_worker.GetResolution() ) );
|
||||||
|
ImGui::Separator();
|
||||||
|
TextFocused( "Zones:", RealToString( m_worker.GetZoneCount(), true ) );
|
||||||
|
TextFocused( "Lock events:", RealToString( m_worker.GetLockCount(), true ) );
|
||||||
|
TextFocused( "Plot data points:", RealToString( m_worker.GetPlotCount(), true ) );
|
||||||
|
TextFocused( "Memory allocations:", RealToString( m_worker.GetMemData().data.size(), true ) );
|
||||||
|
ImGui::Separator();
|
||||||
|
TextFocused( "Frame set:", m_frames->name == 0 ? "Frames" : m_worker.GetString( m_frames->name ) );
|
||||||
|
TextFocused( "Count:", RealToString( m_frames->frames.size(), true ) );
|
||||||
|
ImGui::End();
|
||||||
|
}
|
||||||
|
|
||||||
template<class T>
|
template<class T>
|
||||||
void View::ListMemData( T ptr, T end, std::function<void(T&)> DrawAddress, const char* id )
|
void View::ListMemData( T ptr, T end, std::function<void(T&)> DrawAddress, const char* id )
|
||||||
{
|
{
|
||||||
|
|||||||
@ -85,6 +85,7 @@ private:
|
|||||||
void DrawCompare();
|
void DrawCompare();
|
||||||
void DrawCallstackWindow();
|
void DrawCallstackWindow();
|
||||||
void DrawMemoryAllocWindow();
|
void DrawMemoryAllocWindow();
|
||||||
|
void DrawInfo();
|
||||||
|
|
||||||
template<class T>
|
template<class T>
|
||||||
void ListMemData( T ptr, T end, std::function<void(T&)> DrawAddress, const char* id = nullptr );
|
void ListMemData( T ptr, T end, std::function<void(T&)> DrawAddress, const char* id = nullptr );
|
||||||
@ -209,6 +210,7 @@ private:
|
|||||||
bool m_showOptions;
|
bool m_showOptions;
|
||||||
bool m_showMessages;
|
bool m_showMessages;
|
||||||
bool m_showStatistics;
|
bool m_showStatistics;
|
||||||
|
bool m_showInfo;
|
||||||
bool m_drawGpuZones;
|
bool m_drawGpuZones;
|
||||||
bool m_drawZones;
|
bool m_drawZones;
|
||||||
bool m_drawLocks;
|
bool m_drawLocks;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user