mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-10 10:41:50 +00:00
Implement asm ip stats counter.
This commit is contained in:
parent
7aa8e408df
commit
46163a1989
@ -3156,6 +3156,31 @@ void SourceView::GatherIpStats( uint64_t addr, uint32_t& iptotalSrc, uint32_t& i
|
||||
}
|
||||
}
|
||||
|
||||
uint32_t SourceView::CountAsmIpStats( uint64_t addr, const Worker& worker, bool limitView, const View& view )
|
||||
{
|
||||
if( limitView )
|
||||
{
|
||||
auto vec = worker.GetSamplesForSymbol( addr );
|
||||
if( !vec ) return 0;
|
||||
auto it = std::lower_bound( vec->begin(), vec->end(), view.m_statRange.min, [] ( const auto& lhs, const auto& rhs ) { return lhs.time.Val() < rhs; } );
|
||||
if( it == vec->end() ) return 0;
|
||||
auto end = std::lower_bound( it, vec->end(), view.m_statRange.max, [] ( const auto& lhs, const auto& rhs ) { return lhs.time.Val() < rhs; } );
|
||||
return end - it;
|
||||
}
|
||||
else
|
||||
{
|
||||
uint32_t cnt = 0;
|
||||
auto ipmap = worker.GetSymbolInstructionPointers( addr );
|
||||
if( !ipmap ) return 0;
|
||||
for( auto& ip : *ipmap )
|
||||
{
|
||||
auto addr = worker.GetCanonicalPointer( ip.first );
|
||||
cnt += ip.second;
|
||||
}
|
||||
return cnt;
|
||||
}
|
||||
}
|
||||
|
||||
namespace {
|
||||
static unordered_flat_set<const char*, charutil::Hasher, charutil::Comparator> GetKeywords()
|
||||
{
|
||||
|
@ -159,6 +159,7 @@ private:
|
||||
void SelectAsmLinesHover( uint32_t file, uint32_t line, const Worker& worker );
|
||||
|
||||
void GatherIpStats( uint64_t addr, uint32_t& iptotalSrc, uint32_t& iptotalAsm, unordered_flat_map<uint64_t, uint32_t>& ipcountSrc, unordered_flat_map<uint64_t, uint32_t>& ipcountAsm, uint32_t& ipmaxSrc, uint32_t& ipmaxAsm, const Worker& worker, bool limitView, const View& view );
|
||||
uint32_t CountAsmIpStats( uint64_t addr, const Worker& worker, bool limitView, const View& view );
|
||||
|
||||
void SelectMicroArchitecture( const char* moniker );
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user