Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/wolfpld/tracy.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBartosz Taudul <wolf@nereid.pl>2021-03-26 02:17:46 +0300
committerBartosz Taudul <wolf@nereid.pl>2021-03-26 02:17:46 +0300
commit29133431bcf55e760a427d35168d00f3e2ba16e7 (patch)
treec73767d3798462c4f69cc042fedc7d3df51e470d
parentec16182887fd12822e1c937fe0753fb68ae2f825 (diff)
Calculate symbol address for parents earlier.
While currently this makes no sense, it will be also used in common code path.
-rw-r--r--server/TracySourceView.cpp51
1 files changed, 22 insertions, 29 deletions
diff --git a/server/TracySourceView.cpp b/server/TracySourceView.cpp
index cda275e0..526c9501 100644
--- a/server/TracySourceView.cpp
+++ b/server/TracySourceView.cpp
@@ -2463,6 +2463,27 @@ void SourceView::RenderAsmLine( AsmLine& line, uint32_t ipcnt, uint32_t iptotal,
auto sit = m_asmSampleSelect.find( idx );
if( PrintPercentage( 100.f * ipcnt / iptotal, sit == m_asmSampleSelect.end() ? 0xFFFFFFFF : 0xFF8888FF ) )
{
+ uint64_t symAddrParents = m_baseAddr;
+ auto inlineList = worker.GetInlineSymbolList( m_baseAddr, m_codeLen );
+ if( inlineList )
+ {
+ const auto cfi = worker.PackPointer( line.addr );
+ const auto symEnd = m_baseAddr + m_codeLen;
+ while( *inlineList < symEnd )
+ {
+ auto ipmap = worker.GetSymbolInstructionPointers( *inlineList );
+ if( ipmap )
+ {
+ if( ipmap->find( cfi ) != ipmap->end() )
+ {
+ symAddrParents = *inlineList;
+ break;
+ }
+ }
+ inlineList++;
+ }
+ }
+
if( m_font ) ImGui::PopFont();
ImGui::BeginTooltip();
TextFocused( "Time:", TimeToString( ipcnt * worker.GetSamplingPeriod() ) );
@@ -2525,35 +2546,7 @@ void SourceView::RenderAsmLine( AsmLine& line, uint32_t ipcnt, uint32_t iptotal,
}
else if( ImGui::IsMouseClicked( 2 ) )
{
- auto inlineList = worker.GetInlineSymbolList( m_baseAddr, m_codeLen );
- if( inlineList )
- {
- const auto cfi = worker.PackPointer( line.addr );
- bool found = false;
- const auto symEnd = m_baseAddr + m_codeLen;
- while( *inlineList < symEnd )
- {
- auto ipmap = worker.GetSymbolInstructionPointers( *inlineList );
- if( ipmap )
- {
- if( ipmap->find( cfi ) != ipmap->end() )
- {
- view.ShowSampleParents( *inlineList );
- found = true;
- break;
- }
- }
- inlineList++;
- }
- if( !found )
- {
- view.ShowSampleParents( m_baseAddr );
- }
- }
- else
- {
- view.ShowSampleParents( m_baseAddr );
- }
+ view.ShowSampleParents( symAddrParents );
}
}
draw->AddLine( wpos + ImVec2( 0, 1 ), wpos + ImVec2( 0, ty-2 ), GetHotnessColor( ipcnt, ipmax ) );