diff --git a/client/TracyRingBuffer.hpp b/client/TracyRingBuffer.hpp index 29d93559..32532bae 100644 --- a/client/TracyRingBuffer.hpp +++ b/client/TracyRingBuffer.hpp @@ -5,8 +5,9 @@ template 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; }; } diff --git a/client/TracySysTrace.cpp b/client/TracySysTrace.cpp index 7c4df83d..a99a5588 100644 --- a/client/TracySysTrace.cpp +++ b/client/TracySysTrace.cpp @@ -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( fd ); + new( s_ring+i ) RingBuffer( fd, EventCallstack ); } s_threadSampling = (Thread*)tracy_malloc( sizeof( Thread ) );