mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-22 22:44:34 +00:00
Optional CPU idx storage in RingBuffer.
This commit is contained in:
parent
d7dc2d6127
commit
0a3da9efdb
@ -7,8 +7,9 @@ template<size_t Size>
|
||||
class RingBuffer
|
||||
{
|
||||
public:
|
||||
RingBuffer( int fd, int id )
|
||||
RingBuffer( int fd, int id, int cpu = -1 )
|
||||
: m_id( id )
|
||||
, m_cpu( cpu )
|
||||
, m_fd( fd )
|
||||
{
|
||||
const auto pageSize = uint32_t( getpagesize() );
|
||||
@ -56,6 +57,7 @@ public:
|
||||
|
||||
bool IsValid() const { return m_metadata != nullptr; }
|
||||
int GetId() const { return m_id; }
|
||||
int GetCpu() const { return m_cpu; }
|
||||
|
||||
void Enable()
|
||||
{
|
||||
@ -116,6 +118,7 @@ private:
|
||||
uint64_t m_tail;
|
||||
char* m_buffer;
|
||||
int m_id;
|
||||
int m_cpu;
|
||||
perf_event_mmap_page* m_metadata;
|
||||
|
||||
size_t m_mapSize;
|
||||
|
Loading…
Reference in New Issue
Block a user