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>2022-10-15 01:39:25 +0300
committerBartosz Taudul <wolf@nereid.pl>2022-10-15 01:39:25 +0300
commit47ec7de47904706034b4351cf0ebafe4b412eb7e (patch)
tree005065558938b72faa9b63277b4db1baaf57dbae
parente7da2efdd1bdbf221a63c43897a0a695c86bc454 (diff)
Propagate inlines for hw sample impact.
-rw-r--r--server/TracySourceView.cpp45
1 files changed, 26 insertions, 19 deletions
diff --git a/server/TracySourceView.cpp b/server/TracySourceView.cpp
index 69000440..abe1fb99 100644
--- a/server/TracySourceView.cpp
+++ b/server/TracySourceView.cpp
@@ -4951,28 +4951,35 @@ void SourceView::CountHwStats( AddrStatData& as, Worker& worker, const View& vie
if( filename )
{
- uint32_t line;
- const auto fref = worker.GetLocationForAddress( addr, line );
- if( line != 0 )
+ auto frame = worker.GetCallstackFrame( worker.PackPointer( addr ) );
+ if( frame )
{
- auto ffn = worker.GetString( fref );
- if( strcmp( ffn, filename ) == 0 )
+ const auto end = m_propagateInlines ? frame->size : 1;
+ for( uint8_t i=0; i<end; i++ )
{
- auto it = as.hwCountSrc.find( line );
- if( it == as.hwCountSrc.end() )
- {
- as.hwCountSrc.emplace( line, AddrStat{ branch, cache } );
- if( as.hwMaxSrc.local < branch ) as.hwMaxSrc.local = branch;
- if( as.hwMaxSrc.ext < cache ) as.hwMaxSrc.ext = cache;
- }
- else
+ auto ffn = worker.GetString( frame->data[i].file );
+ if( strcmp( ffn, filename ) == 0 )
{
- const auto branchSum = it->second.local + branch;
- const auto cacheSum = it->second.ext + cache;
- it->second.local = branchSum;
- it->second.ext = cacheSum;
- if( as.hwMaxSrc.local < branchSum ) as.hwMaxSrc.local = branchSum;
- if( as.hwMaxSrc.ext < cacheSum ) as.hwMaxSrc.ext = cacheSum;
+ const auto line = frame->data[i].line;
+ if( line != 0 )
+ {
+ auto it = as.hwCountSrc.find( line );
+ if( it == as.hwCountSrc.end() )
+ {
+ as.hwCountSrc.emplace( line, AddrStat{ branch, cache } );
+ if( as.hwMaxSrc.local < branch ) as.hwMaxSrc.local = branch;
+ if( as.hwMaxSrc.ext < cache ) as.hwMaxSrc.ext = cache;
+ }
+ else
+ {
+ const auto branchSum = it->second.local + branch;
+ const auto cacheSum = it->second.ext + cache;
+ it->second.local = branchSum;
+ it->second.ext = cacheSum;
+ if( as.hwMaxSrc.local < branchSum ) as.hwMaxSrc.local = branchSum;
+ if( as.hwMaxSrc.ext < cacheSum ) as.hwMaxSrc.ext = cacheSum;
+ }
+ }
}
}
}