mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-22 22:44:34 +00:00
Use last range mode if no frames are available.
If during the first 5 seconds of the trace there are no frames being reported, the profiler will switch to following last 5 seconds of the trace, instead of displaying three last frames.
This commit is contained in:
parent
d75503047c
commit
00c9dd24dc
@ -116,6 +116,7 @@ View::View( void(*cbMainThread)(std::function<void()>), const char* addr, uint16
|
|||||||
: m_worker( addr, port )
|
: m_worker( addr, port )
|
||||||
, m_staticView( false )
|
, m_staticView( false )
|
||||||
, m_viewMode( ViewMode::LastFrames )
|
, m_viewMode( ViewMode::LastFrames )
|
||||||
|
, m_viewModeHeuristicTry( true )
|
||||||
, m_forceConnectionPopup( true, true )
|
, m_forceConnectionPopup( true, true )
|
||||||
, m_frames( nullptr )
|
, m_frames( nullptr )
|
||||||
, m_messagesScrollBottom( true )
|
, m_messagesScrollBottom( true )
|
||||||
@ -694,6 +695,7 @@ bool View::DrawImpl()
|
|||||||
if( m_viewMode != ViewMode::Paused )
|
if( m_viewMode != ViewMode::Paused )
|
||||||
{
|
{
|
||||||
m_viewMode = ViewMode::Paused;
|
m_viewMode = ViewMode::Paused;
|
||||||
|
m_viewModeHeuristicTry = false;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -719,6 +721,22 @@ bool View::DrawImpl()
|
|||||||
}
|
}
|
||||||
ImGui::EndPopup();
|
ImGui::EndPopup();
|
||||||
}
|
}
|
||||||
|
else if( m_viewModeHeuristicTry )
|
||||||
|
{
|
||||||
|
const auto lastTime = m_worker.GetLastTime();
|
||||||
|
if( lastTime > 5*1000*1000*1000ll )
|
||||||
|
{
|
||||||
|
if( m_viewMode == ViewMode::LastFrames && m_worker.GetFrameCount( *m_worker.GetFramesBase() ) <= 2 )
|
||||||
|
{
|
||||||
|
m_viewMode = ViewMode::LastRange;
|
||||||
|
ZoomToRange( lastTime - 5*1000*1000*1000ll, lastTime, false );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
m_viewModeHeuristicTry = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -1582,6 +1600,7 @@ void View::DrawFrames()
|
|||||||
if( IsMouseDragging( 1 ) )
|
if( IsMouseDragging( 1 ) )
|
||||||
{
|
{
|
||||||
m_viewMode = ViewMode::Paused;
|
m_viewMode = ViewMode::Paused;
|
||||||
|
m_viewModeHeuristicTry = false;
|
||||||
const auto delta = GetMouseDragDelta( 1 ).x;
|
const auto delta = GetMouseDragDelta( 1 ).x;
|
||||||
if( abs( delta ) >= fwidth )
|
if( abs( delta ) >= fwidth )
|
||||||
{
|
{
|
||||||
@ -1710,6 +1729,7 @@ void View::DrawFrames()
|
|||||||
if( IsMouseClicked( 0 ) )
|
if( IsMouseClicked( 0 ) )
|
||||||
{
|
{
|
||||||
m_viewMode = ViewMode::Paused;
|
m_viewMode = ViewMode::Paused;
|
||||||
|
m_viewModeHeuristicTry = false;
|
||||||
m_zoomAnim.active = false;
|
m_zoomAnim.active = false;
|
||||||
if( !m_playback.pause && m_playback.sync ) m_playback.pause = true;
|
if( !m_playback.pause && m_playback.sync ) m_playback.pause = true;
|
||||||
m_vd.zvStart = m_worker.GetFrameBegin( *m_frames, sel );
|
m_vd.zvStart = m_worker.GetFrameBegin( *m_frames, sel );
|
||||||
@ -2083,6 +2103,7 @@ void View::HandleZoneViewMouse( int64_t timespan, const ImVec2& wpos, float w, d
|
|||||||
if( IsMouseDragging( 1 ) || hwheel_delta != 0 )
|
if( IsMouseDragging( 1 ) || hwheel_delta != 0 )
|
||||||
{
|
{
|
||||||
m_viewMode = ViewMode::Paused;
|
m_viewMode = ViewMode::Paused;
|
||||||
|
m_viewModeHeuristicTry = false;
|
||||||
m_zoomAnim.active = false;
|
m_zoomAnim.active = false;
|
||||||
if( !m_playback.pause && m_playback.sync ) m_playback.pause = true;
|
if( !m_playback.pause && m_playback.sync ) m_playback.pause = true;
|
||||||
const auto delta = GetMouseDragDelta( 1 );
|
const auto delta = GetMouseDragDelta( 1 );
|
||||||
@ -14416,6 +14437,7 @@ void View::DrawPlayback()
|
|||||||
m_vd.zvStart = tstart;
|
m_vd.zvStart = tstart;
|
||||||
m_vd.zvEnd = end;
|
m_vd.zvEnd = end;
|
||||||
m_viewMode = ViewMode::Paused;
|
m_viewMode = ViewMode::Paused;
|
||||||
|
m_viewModeHeuristicTry = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -14519,6 +14541,7 @@ void View::DrawPlayback()
|
|||||||
m_vd.zvEnd = m_worker.GetFrameEnd( *frameSet, fi->frameRef );
|
m_vd.zvEnd = m_worker.GetFrameEnd( *frameSet, fi->frameRef );
|
||||||
m_zoomAnim.active = false;
|
m_zoomAnim.active = false;
|
||||||
m_viewMode = ViewMode::Paused;
|
m_viewMode = ViewMode::Paused;
|
||||||
|
m_viewModeHeuristicTry = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ImGui::SameLine();
|
ImGui::SameLine();
|
||||||
@ -16449,7 +16472,11 @@ void View::ZoomToRange( int64_t start, int64_t end, bool pause )
|
|||||||
end = start + 1;
|
end = start + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( pause ) m_viewMode = ViewMode::Paused;
|
if( pause )
|
||||||
|
{
|
||||||
|
m_viewMode = ViewMode::Paused;
|
||||||
|
m_viewModeHeuristicTry = false;
|
||||||
|
}
|
||||||
m_highlightZoom.active = false;
|
m_highlightZoom.active = false;
|
||||||
if( !m_playback.pause && m_playback.sync ) m_playback.pause = true;
|
if( !m_playback.pause && m_playback.sync ) m_playback.pause = true;
|
||||||
|
|
||||||
|
@ -317,6 +317,7 @@ private:
|
|||||||
std::string m_filename;
|
std::string m_filename;
|
||||||
bool m_staticView;
|
bool m_staticView;
|
||||||
ViewMode m_viewMode;
|
ViewMode m_viewMode;
|
||||||
|
bool m_viewModeHeuristicTry = false;
|
||||||
DecayValue<bool> m_forceConnectionPopup = false;
|
DecayValue<bool> m_forceConnectionPopup = false;
|
||||||
|
|
||||||
ViewData m_vd;
|
ViewData m_vd;
|
||||||
|
Loading…
Reference in New Issue
Block a user