mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-10 02:31:48 +00:00
Collect hardware sample data.
This commit is contained in:
parent
101cdd9b4b
commit
373a2b66c6
@ -251,6 +251,15 @@ struct SampleDataRange
|
||||
enum { SampleDataRangeSize = sizeof( SampleDataRange ) };
|
||||
|
||||
|
||||
struct HwSampleData
|
||||
{
|
||||
uint32_t cycles;
|
||||
uint32_t retired;
|
||||
};
|
||||
|
||||
enum { HwSampleDataSize = sizeof( HwSampleData ) };
|
||||
|
||||
|
||||
struct LockEvent
|
||||
{
|
||||
enum class Type : uint8_t
|
||||
|
@ -6276,10 +6276,16 @@ void Worker::ProcessTidToPid( const QueueTidToPid& ev )
|
||||
|
||||
void Worker::ProcessHwSampleCpuCycle( const QueueHwSample& ev )
|
||||
{
|
||||
auto it = m_data.hwSamples.find( ev.ip );
|
||||
if( it == m_data.hwSamples.end() ) it = m_data.hwSamples.emplace( ev.ip, HwSampleData {} ).first;
|
||||
it->second.cycles++;
|
||||
}
|
||||
|
||||
void Worker::ProcessHwSampleInstructionRetired( const QueueHwSample& ev )
|
||||
{
|
||||
auto it = m_data.hwSamples.find( ev.ip );
|
||||
if( it == m_data.hwSamples.end() ) it = m_data.hwSamples.emplace( ev.ip, HwSampleData {} ).first;
|
||||
it->second.retired++;
|
||||
}
|
||||
|
||||
void Worker::ProcessParamSetup( const QueueParamSetup& ev )
|
||||
|
@ -356,6 +356,8 @@ private:
|
||||
unordered_flat_map<uint64_t, Vector<uint64_t>> locationCodeAddressList;
|
||||
|
||||
unordered_flat_map<const char*, MemoryBlock, charutil::Hasher, charutil::Comparator> sourceFileCache;
|
||||
|
||||
unordered_flat_map<uint64_t, HwSampleData> hwSamples;
|
||||
};
|
||||
|
||||
struct MbpsBlock
|
||||
|
Loading…
Reference in New Issue
Block a user