Add hardware samples accessors.

This commit is contained in:
Bartosz Taudul 2021-05-19 23:05:50 +02:00
parent 373a2b66c6
commit 3228e20c2e
No known key found for this signature in database
GPG Key ID: B7FE2008B7575DF3
2 changed files with 9 additions and 0 deletions

View File

@ -7680,4 +7680,11 @@ Worker::MemoryBlock Worker::GetSourceFileFromCache( const char* file ) const
return it->second; return it->second;
} }
const HwSampleData* Worker::GetHwSampleData( uint64_t addr ) const
{
auto it = m_data.hwSamples.find( addr );
if( it == m_data.hwSamples.end() ) return nullptr;
return &it->second;
}
} }

View File

@ -449,6 +449,7 @@ public:
uint64_t GetGhostZonesCount() const { return m_data.ghostCnt; } uint64_t GetGhostZonesCount() const { return m_data.ghostCnt; }
uint32_t GetFrameImageCount() const { return (uint32_t)m_data.frameImage.size(); } uint32_t GetFrameImageCount() const { return (uint32_t)m_data.frameImage.size(); }
uint64_t GetStringsCount() const { return m_data.strings.size() + m_data.stringData.size(); } uint64_t GetStringsCount() const { return m_data.strings.size() + m_data.stringData.size(); }
uint64_t GetHwSampleCount() const { return m_data.hwSamples.size(); }
#ifndef TRACY_NO_STATISTICS #ifndef TRACY_NO_STATISTICS
uint64_t GetChildSamplesCountSyms() const { return m_data.childSamples.size(); } uint64_t GetChildSamplesCountSyms() const { return m_data.childSamples.size(); }
uint64_t GetChildSamplesCountFull() const; uint64_t GetChildSamplesCountFull() const;
@ -470,6 +471,7 @@ public:
uint64_t GetSourceFileCacheCount() const { return m_data.sourceFileCache.size(); } uint64_t GetSourceFileCacheCount() const { return m_data.sourceFileCache.size(); }
uint64_t GetSourceFileCacheSize() const; uint64_t GetSourceFileCacheSize() const;
MemoryBlock GetSourceFileFromCache( const char* file ) const; MemoryBlock GetSourceFileFromCache( const char* file ) const;
const HwSampleData* GetHwSampleData( uint64_t addr ) const;
int64_t GetFrameTime( const FrameData& fd, size_t idx ) const; int64_t GetFrameTime( const FrameData& fd, size_t idx ) const;
int64_t GetFrameBegin( const FrameData& fd, size_t idx ) const; int64_t GetFrameBegin( const FrameData& fd, size_t idx ) const;