mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-10 10:41:50 +00:00
Store RingBuffer identifier.
This commit is contained in:
parent
07778badcc
commit
b7d52d2eab
@ -5,8 +5,9 @@ template<size_t Size>
|
||||
class RingBuffer
|
||||
{
|
||||
public:
|
||||
RingBuffer( int fd )
|
||||
RingBuffer( int fd, int id )
|
||||
: m_fd( fd )
|
||||
, m_id( id )
|
||||
{
|
||||
const auto pageSize = uint32_t( getpagesize() );
|
||||
assert( Size >= pageSize );
|
||||
@ -49,6 +50,7 @@ public:
|
||||
}
|
||||
|
||||
bool IsValid() const { return m_metadata != nullptr; }
|
||||
int GetId() const { return m_id; }
|
||||
|
||||
void Enable()
|
||||
{
|
||||
@ -111,6 +113,7 @@ private:
|
||||
|
||||
size_t m_mapSize;
|
||||
int m_fd;
|
||||
int m_id;
|
||||
};
|
||||
|
||||
}
|
||||
|
@ -675,6 +675,11 @@ static int perf_event_open( struct perf_event_attr* hw_event, pid_t pid, int cpu
|
||||
return syscall( __NR_perf_event_open, hw_event, pid, cpu, group_fd, flags );
|
||||
}
|
||||
|
||||
enum TraceEventId
|
||||
{
|
||||
EventCallstack
|
||||
};
|
||||
|
||||
static void SetupSampling( int64_t& samplingPeriod )
|
||||
{
|
||||
#ifndef CLOCK_MONOTONIC_RAW
|
||||
@ -715,7 +720,7 @@ static void SetupSampling( int64_t& samplingPeriod )
|
||||
tracy_free( s_ring );
|
||||
return;
|
||||
}
|
||||
new( s_ring+i ) RingBuffer<RingBufSize>( fd );
|
||||
new( s_ring+i ) RingBuffer<RingBufSize>( fd, EventCallstack );
|
||||
}
|
||||
|
||||
s_threadSampling = (Thread*)tracy_malloc( sizeof( Thread ) );
|
||||
|
Loading…
Reference in New Issue
Block a user