diff options
author | Bartosz Taudul <wolf@nereid.pl> | 2022-10-15 01:35:51 +0300 |
---|---|---|
committer | Bartosz Taudul <wolf@nereid.pl> | 2022-10-15 01:35:51 +0300 |
commit | e7da2efdd1bdbf221a63c43897a0a695c86bc454 (patch) | |
tree | 4f4c4b4f5d88db0ac7a83a7b24ddb1f369c9d51f /server | |
parent | 5db18087f538f2c25a0faed0212698dfffc6929b (diff) |
Include hardware samples in inline propagation.
Diffstat (limited to 'server')
-rw-r--r-- | server/TracySourceView.cpp | 39 |
1 files changed, 23 insertions, 16 deletions
diff --git a/server/TracySourceView.cpp b/server/TracySourceView.cpp index caeb3f40..69000440 100644 --- a/server/TracySourceView.cpp +++ b/server/TracySourceView.cpp @@ -4876,26 +4876,33 @@ void SourceView::GatherIpHwStats( AddrStatData& as, Worker& worker, const View& 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.ipCountSrc.find( line ); - if( it == as.ipCountSrc.end() ) + auto ffn = worker.GetString( frame->data[i].file ); + if( strcmp( ffn, filename ) == 0 ) { - as.ipCountSrc.emplace( line, AddrStat{ stat, 0 } ); - if( as.ipMaxSrc.local < stat ) as.ipMaxSrc.local = stat; - } - else - { - const auto sum = it->second.local + stat; - it->second.local = sum; - if( as.ipMaxSrc.local < sum ) as.ipMaxSrc.local = sum; + const auto line = frame->data[i].line; + if( line != 0 ) + { + auto it = as.ipCountSrc.find( line ); + if( it == as.ipCountSrc.end() ) + { + as.ipCountSrc.emplace( line, AddrStat{ stat, 0 } ); + if( as.ipMaxSrc.local < stat ) as.ipMaxSrc.local = stat; + } + else + { + const auto sum = it->second.local + stat; + it->second.local = sum; + if( as.ipMaxSrc.local < sum ) as.ipMaxSrc.local = sum; + } + as.ipTotalSrc.local += stat; + } } - as.ipTotalSrc.local += stat; } } } |