mirror of
https://github.com/wolfpld/tracy.git
synced 2025-03-20 07:40:02 +08:00
Add ability to hide uncontended locks.
This commit is contained in:
parent
92a38a43d5
commit
caec31731f
@ -71,6 +71,7 @@ View::View( const char* addr )
|
|||||||
, m_drawZones( true )
|
, m_drawZones( true )
|
||||||
, m_drawLocks( true )
|
, m_drawLocks( true )
|
||||||
, m_drawPlots( true )
|
, m_drawPlots( true )
|
||||||
|
, m_onlyContendedLocks( false )
|
||||||
, m_terminate( false )
|
, m_terminate( false )
|
||||||
{
|
{
|
||||||
assert( s_instance == nullptr );
|
assert( s_instance == nullptr );
|
||||||
@ -105,6 +106,7 @@ View::View( FileRead& f )
|
|||||||
, m_drawZones( true )
|
, m_drawZones( true )
|
||||||
, m_drawLocks( true )
|
, m_drawLocks( true )
|
||||||
, m_drawPlots( true )
|
, m_drawPlots( true )
|
||||||
|
, m_onlyContendedLocks( false )
|
||||||
, m_terminate( false )
|
, m_terminate( false )
|
||||||
{
|
{
|
||||||
assert( s_instance == nullptr );
|
assert( s_instance == nullptr );
|
||||||
@ -2263,7 +2265,7 @@ int View::DrawLocks( uint64_t tid, bool hover, double pxns, const ImVec2& wpos,
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( state != State::Nothing )
|
if( state != State::Nothing && ( !m_onlyContendedLocks || state != State::HasLock ) )
|
||||||
{
|
{
|
||||||
drawn = true;
|
drawn = true;
|
||||||
const auto t0 = (*vbegin)->time;
|
const auto t0 = (*vbegin)->time;
|
||||||
@ -2751,6 +2753,8 @@ void View::DrawOptions()
|
|||||||
ImGui::Checkbox( "Draw zones", &m_drawZones );
|
ImGui::Checkbox( "Draw zones", &m_drawZones );
|
||||||
ImGui::Separator();
|
ImGui::Separator();
|
||||||
ImGui::Checkbox( "Draw locks", &m_drawLocks );
|
ImGui::Checkbox( "Draw locks", &m_drawLocks );
|
||||||
|
ImGui::SameLine();
|
||||||
|
ImGui::Checkbox( "Only contended", &m_onlyContendedLocks );
|
||||||
ImGui::Indent( tw );
|
ImGui::Indent( tw );
|
||||||
for( auto& l : m_lockMap )
|
for( auto& l : m_lockMap )
|
||||||
{
|
{
|
||||||
|
|||||||
@ -274,6 +274,7 @@ private:
|
|||||||
bool m_drawZones;
|
bool m_drawZones;
|
||||||
bool m_drawLocks;
|
bool m_drawLocks;
|
||||||
bool m_drawPlots;
|
bool m_drawPlots;
|
||||||
|
bool m_onlyContendedLocks;
|
||||||
|
|
||||||
bool m_terminate;
|
bool m_terminate;
|
||||||
};
|
};
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user