mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-25 23:44:35 +00:00
Draw kernel functions red in flame graph.
This commit is contained in:
parent
346d8a45c6
commit
9f4d7fa5ad
@ -272,6 +272,8 @@ void View::DrawFlameGraphItem( const FlameGraphItem& item, FlameGraphContext& ct
|
|||||||
const char* name;
|
const char* name;
|
||||||
const char* slName;
|
const char* slName;
|
||||||
|
|
||||||
|
uint32_t textColor = 0xFFFFFFFF;
|
||||||
|
|
||||||
if( !samples )
|
if( !samples )
|
||||||
{
|
{
|
||||||
srcloc = &m_worker.GetSourceLocation( item.srcloc );
|
srcloc = &m_worker.GetSourceLocation( item.srcloc );
|
||||||
@ -280,7 +282,8 @@ void View::DrawFlameGraphItem( const FlameGraphItem& item, FlameGraphContext& ct
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
auto sym = m_worker.GetSymbolData( (uint64_t)item.srcloc );
|
const auto symAddr = (uint64_t)item.srcloc;
|
||||||
|
auto sym = m_worker.GetSymbolData( symAddr );
|
||||||
if( sym )
|
if( sym )
|
||||||
{
|
{
|
||||||
name = m_worker.GetString( sym->name );
|
name = m_worker.GetString( sym->name );
|
||||||
@ -297,6 +300,10 @@ void View::DrawFlameGraphItem( const FlameGraphItem& item, FlameGraphContext& ct
|
|||||||
name = "???";
|
name = "???";
|
||||||
color = 0xFF888888;
|
color = 0xFF888888;
|
||||||
}
|
}
|
||||||
|
if( symAddr >> 63 != 0 )
|
||||||
|
{
|
||||||
|
textColor = 0xFF8888FF;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const auto hiColor = HighlightColor( color );
|
const auto hiColor = HighlightColor( color );
|
||||||
@ -326,12 +333,12 @@ void View::DrawFlameGraphItem( const FlameGraphItem& item, FlameGraphContext& ct
|
|||||||
if( tsz.x < zsz )
|
if( tsz.x < zsz )
|
||||||
{
|
{
|
||||||
const auto x = ( x1 + x0 - tsz.x ) * 0.5;
|
const auto x = ( x1 + x0 - tsz.x ) * 0.5;
|
||||||
DrawTextContrast( ctx.draw, ImVec2( x, y0 ), 0xFFFFFFFF, name );
|
DrawTextContrast( ctx.draw, ImVec2( x, y0 ), textColor, name );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ImGui::PushClipRect( ImVec2( x0, y0 ), ImVec2( x1, y1 ), true );
|
ImGui::PushClipRect( ImVec2( x0, y0 ), ImVec2( x1, y1 ), true );
|
||||||
DrawTextContrast( ctx.draw, ImVec2( x0, y0 ), 0xFFFFFFFF, name );
|
DrawTextContrast( ctx.draw, ImVec2( x0, y0 ), textColor, name );
|
||||||
ImGui::PopClipRect();
|
ImGui::PopClipRect();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user