VR-Vantage 2.7 API Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
TracyProfiler.hpp
Go to the documentation of this file.
1 #ifndef __TRACYPROFILER_HPP__
2 #define __TRACYPROFILER_HPP__
3 
4 #include <assert.h>
5 #include <atomic>
6 #include <stdint.h>
7 #include <string.h>
8 #include <time.h>
9 
10 #include "tracy_concurrentqueue.h"
11 #include "TracyCallstack.hpp"
12 #include "TracySysTime.hpp"
13 #include "TracyFastVector.hpp"
14 #include "../common/TracyQueue.hpp"
15 #include "../common/TracyAlign.hpp"
16 #include "../common/TracyAlloc.hpp"
17 #include "../common/TracyMutex.hpp"
18 #include "../common/TracyProtocol.hpp"
19 
20 #if defined _WIN32 || defined __CYGWIN__
21 # include <intrin.h>
22 #endif
23 #ifdef __APPLE__
24 # include <TargetConditionals.h>
25 # include <mach/mach_time.h>
26 #endif
27 
28 #if defined _WIN32 || defined __CYGWIN__ || ( defined __i386 || defined _M_IX86 || defined __x86_64__ || defined _M_X64 ) || ( defined TARGET_OS_IOS && TARGET_OS_IOS == 1 )
29 # define TRACY_HW_TIMER
30 #endif
31 
32 #if !defined TRACY_HW_TIMER
33  #include <chrono>
34 #endif
35 
36 #ifndef TracyConcat
37 # define TracyConcat(x,y) TracyConcatIndirect(x,y)
38 #endif
39 #ifndef TracyConcatIndirect
40 # define TracyConcatIndirect(x,y) x##y
41 #endif
42 
43 namespace tracy
44 {
45 #if defined(TRACY_DELAYED_INIT) && defined(TRACY_MANUAL_LIFETIME)
46 void StartupProfiler();
47 void ShutdownProfiler();
48 #endif
49 
50 class GpuCtx;
51 class Profiler;
52 class Socket;
53 class UdpBroadcast;
54 
56 {
57  GpuCtx* ptr;
58 };
59 
62 TRACY_API std::atomic<uint32_t>& GetLockCounter();
63 TRACY_API std::atomic<uint8_t>& GetGpuCtxCounter();
69 
71 {
72  const char* name;
73  const char* function;
74  const char* file;
77 };
78 
79 #ifdef TRACY_ON_DEMAND
80 struct LuaZoneState
81 {
83  bool active;
84 };
85 #endif
86 
87 
88 #define TracyLfqPrepare( _type ) \
89  moodycamel::ConcurrentQueueDefaultTraits::index_t __magic; \
90  auto __token = GetToken(); \
91  auto& __tail = __token->get_tail_index(); \
92  auto item = __token->enqueue_begin( __magic ); \
93  MemWrite( &item->hdr.type, _type );
94 
95 #define TracyLfqCommit \
96  __tail.store( __magic + 1, std::memory_order_release );
97 
98 #define TracyLfqPrepareC( _type ) \
99  tracy::moodycamel::ConcurrentQueueDefaultTraits::index_t __magic; \
100  auto __token = tracy::GetToken(); \
101  auto& __tail = __token->get_tail_index(); \
102  auto item = __token->enqueue_begin( __magic ); \
103  tracy::MemWrite( &item->hdr.type, _type );
104 
105 #define TracyLfqCommitC \
106  __tail.store( __magic + 1, std::memory_order_release );
107 
108 
110 
111 class Profiler
112 {
114  {
115  void* image;
120  bool flip;
121  };
122 
123 public:
124  Profiler();
125  ~Profiler();
126 
127  void SpawnWorkerThreads();
128 
130  {
131 #ifdef TRACY_HW_TIMER
132 # if defined TARGET_OS_IOS && TARGET_OS_IOS == 1
133  return mach_absolute_time();
134 # elif defined _WIN32 || defined __CYGWIN__
135 # ifdef TRACY_TIMER_QPC
136  return GetTimeQpc();
137 # else
138  return int64_t( __rdtsc() );
139 # endif
140 # elif defined __i386 || defined _M_IX86
141  uint32_t eax, edx;
142  asm volatile ( "rdtsc" : "=a" (eax), "=d" (edx) );
143  return ( uint64_t( edx ) << 32 ) + uint64_t( eax );
144 # elif defined __x86_64__ || defined _M_X64
145  uint64_t rax, rdx;
146  asm volatile ( "rdtsc" : "=a" (rax), "=d" (rdx) );
147  return ( rdx << 32 ) + rax;
148 # else
149 # error "TRACY_HW_TIMER detection logic needs fixing"
150 # endif
151 #else
152 # if defined __linux__ && defined CLOCK_MONOTONIC_RAW
153  struct timespec ts;
154  clock_gettime( CLOCK_MONOTONIC_RAW, &ts );
155  return int64_t( ts.tv_sec ) * 1000000000ll + int64_t( ts.tv_nsec );
156 # else
157  return std::chrono::duration_cast<std::chrono::nanoseconds>( std::chrono::high_resolution_clock::now().time_since_epoch() ).count();
158 # endif
159 #endif
160  }
161 
163  {
164  return m_zoneId.fetch_add( 1, std::memory_order_relaxed );
165  }
166 
168  {
169  auto& p = GetProfiler();
170  p.m_serialLock.lock();
171  return p.m_serialQueue.prepare_next();
172  }
173 
175  {
176  auto& p = GetProfiler();
177  p.m_serialQueue.commit_next();
178  p.m_serialLock.unlock();
179  }
180 
181  static tracy_force_inline void SendFrameMark( const char* name )
182  {
183  if( !name ) GetProfiler().m_frameCount.fetch_add( 1, std::memory_order_relaxed );
184 #ifdef TRACY_ON_DEMAND
185  if( !GetProfiler().IsConnected() ) return;
186 #endif
187  TracyLfqPrepare( QueueType::FrameMarkMsg );
188  MemWrite( &item->frameMark.time, GetTime() );
189  MemWrite( &item->frameMark.name, uint64_t( name ) );
191  }
192 
193  static tracy_force_inline void SendFrameMark( const char* name, QueueType type )
194  {
195  assert( type == QueueType::FrameMarkMsgStart || type == QueueType::FrameMarkMsgEnd );
196 #ifdef TRACY_ON_DEMAND
197  if( !GetProfiler().IsConnected() ) return;
198 #endif
199  auto item = QueueSerial();
200  MemWrite( &item->hdr.type, type );
201  MemWrite( &item->frameMark.time, GetTime() );
202  MemWrite( &item->frameMark.name, uint64_t( name ) );
204  }
205 
206  static tracy_force_inline void SendFrameImage( const void* image, uint16_t w, uint16_t h, uint8_t offset, bool flip )
207  {
208  auto& profiler = GetProfiler();
209  assert( profiler.m_frameCount.load( std::memory_order_relaxed ) < std::numeric_limits<uint32_t>::max() );
210 #ifdef TRACY_ON_DEMAND
211  if( !profiler.IsConnected() ) return;
212 #endif
213  const auto sz = size_t( w ) * size_t( h ) * 4;
214  auto ptr = (char*)tracy_malloc( sz );
215  memcpy( ptr, image, sz );
216 
217  profiler.m_fiLock.lock();
218  auto fi = profiler.m_fiQueue.prepare_next();
219  fi->image = ptr;
220  fi->frame = uint32_t( profiler.m_frameCount.load( std::memory_order_relaxed ) - offset );
221  fi->w = w;
222  fi->h = h;
223  fi->flip = flip;
224  profiler.m_fiQueue.commit_next();
225  profiler.m_fiLock.unlock();
226  }
227 
228  static tracy_force_inline void PlotData( const char* name, int64_t val )
229  {
230 #ifdef TRACY_ON_DEMAND
231  if( !GetProfiler().IsConnected() ) return;
232 #endif
233  TracyLfqPrepare( QueueType::PlotData );
234  MemWrite( &item->plotData.name, (uint64_t)name );
235  MemWrite( &item->plotData.time, GetTime() );
236  MemWrite( &item->plotData.type, PlotDataType::Int );
237  MemWrite( &item->plotData.data.i, val );
239  }
240 
241  static tracy_force_inline void PlotData( const char* name, float val )
242  {
243 #ifdef TRACY_ON_DEMAND
244  if( !GetProfiler().IsConnected() ) return;
245 #endif
246  TracyLfqPrepare( QueueType::PlotData );
247  MemWrite( &item->plotData.name, (uint64_t)name );
248  MemWrite( &item->plotData.time, GetTime() );
249  MemWrite( &item->plotData.type, PlotDataType::Float );
250  MemWrite( &item->plotData.data.f, val );
252  }
253 
254  static tracy_force_inline void PlotData( const char* name, double val )
255  {
256 #ifdef TRACY_ON_DEMAND
257  if( !GetProfiler().IsConnected() ) return;
258 #endif
259  TracyLfqPrepare( QueueType::PlotData );
260  MemWrite( &item->plotData.name, (uint64_t)name );
261  MemWrite( &item->plotData.time, GetTime() );
262  MemWrite( &item->plotData.type, PlotDataType::Double );
263  MemWrite( &item->plotData.data.d, val );
265  }
266 
268  {
269  TracyLfqPrepare( QueueType::PlotConfig );
270  MemWrite( &item->plotConfig.name, (uint64_t)name );
271  MemWrite( &item->plotConfig.type, (uint8_t)type );
272 
273 #ifdef TRACY_ON_DEMAND
274  GetProfiler().DeferItem( *item );
275 #endif
276 
278  }
279 
280  static tracy_force_inline void Message( const char* txt, size_t size, int callstack )
281  {
282  assert( size < std::numeric_limits<uint16_t>::max() );
283 #ifdef TRACY_ON_DEMAND
284  if( !GetProfiler().IsConnected() ) return;
285 #endif
286  TracyLfqPrepare( callstack == 0 ? QueueType::Message : QueueType::MessageCallstack );
287  auto ptr = (char*)tracy_malloc( size );
288  memcpy( ptr, txt, size );
289  MemWrite( &item->messageFat.time, GetTime() );
290  MemWrite( &item->messageFat.text, (uint64_t)ptr );
291  MemWrite( &item->messageFat.size, (uint16_t)size );
293 
294  if( callstack != 0 ) tracy::GetProfiler().SendCallstack( callstack );
295  }
296 
297  static tracy_force_inline void Message( const char* txt, int callstack )
298  {
299 #ifdef TRACY_ON_DEMAND
300  if( !GetProfiler().IsConnected() ) return;
301 #endif
302  TracyLfqPrepare( callstack == 0 ? QueueType::MessageLiteral : QueueType::MessageLiteralCallstack );
303  MemWrite( &item->messageLiteral.time, GetTime() );
304  MemWrite( &item->messageLiteral.text, (uint64_t)txt );
306 
307  if( callstack != 0 ) tracy::GetProfiler().SendCallstack( callstack );
308  }
309 
310  static tracy_force_inline void MessageColor( const char* txt, size_t size, uint32_t color, int callstack )
311  {
312  assert( size < std::numeric_limits<uint16_t>::max() );
313 #ifdef TRACY_ON_DEMAND
314  if( !GetProfiler().IsConnected() ) return;
315 #endif
316  TracyLfqPrepare( callstack == 0 ? QueueType::MessageColor : QueueType::MessageColorCallstack );
317  auto ptr = (char*)tracy_malloc( size );
318  memcpy( ptr, txt, size );
319  MemWrite( &item->messageColorFat.time, GetTime() );
320  MemWrite( &item->messageColorFat.text, (uint64_t)ptr );
321  MemWrite( &item->messageColorFat.r, uint8_t( ( color ) & 0xFF ) );
322  MemWrite( &item->messageColorFat.g, uint8_t( ( color >> 8 ) & 0xFF ) );
323  MemWrite( &item->messageColorFat.b, uint8_t( ( color >> 16 ) & 0xFF ) );
324  MemWrite( &item->messageColorFat.size, (uint16_t)size );
326 
327  if( callstack != 0 ) tracy::GetProfiler().SendCallstack( callstack );
328  }
329 
330  static tracy_force_inline void MessageColor( const char* txt, uint32_t color, int callstack )
331  {
332 #ifdef TRACY_ON_DEMAND
333  if( !GetProfiler().IsConnected() ) return;
334 #endif
335  TracyLfqPrepare( callstack == 0 ? QueueType::MessageLiteralColor : QueueType::MessageLiteralColorCallstack );
336  MemWrite( &item->messageColorLiteral.time, GetTime() );
337  MemWrite( &item->messageColorLiteral.text, (uint64_t)txt );
338  MemWrite( &item->messageColorLiteral.r, uint8_t( ( color ) & 0xFF ) );
339  MemWrite( &item->messageColorLiteral.g, uint8_t( ( color >> 8 ) & 0xFF ) );
340  MemWrite( &item->messageColorLiteral.b, uint8_t( ( color >> 16 ) & 0xFF ) );
342 
343  if( callstack != 0 ) tracy::GetProfiler().SendCallstack( callstack );
344  }
345 
346  static tracy_force_inline void MessageAppInfo( const char* txt, size_t size )
347  {
348  assert( size < std::numeric_limits<uint16_t>::max() );
350  auto ptr = (char*)tracy_malloc( size );
351  memcpy( ptr, txt, size );
352  TracyLfqPrepare( QueueType::MessageAppInfo );
353  MemWrite( &item->messageFat.time, GetTime() );
354  MemWrite( &item->messageFat.text, (uint64_t)ptr );
355  MemWrite( &item->messageFat.size, (uint16_t)size );
356 
357 #ifdef TRACY_ON_DEMAND
358  GetProfiler().DeferItem( *item );
359 #endif
360 
362  }
363 
364  static tracy_force_inline void MemAlloc( const void* ptr, size_t size, bool secure )
365  {
366  if( secure && !ProfilerAvailable() ) return;
367 #ifdef TRACY_ON_DEMAND
368  if( !GetProfiler().IsConnected() ) return;
369 #endif
370  const auto thread = GetThreadHandle();
371 
372  GetProfiler().m_serialLock.lock();
373  SendMemAlloc( QueueType::MemAlloc, thread, ptr, size );
374  GetProfiler().m_serialLock.unlock();
375  }
376 
377  static tracy_force_inline void MemFree( const void* ptr, bool secure )
378  {
379  if( secure && !ProfilerAvailable() ) return;
380 #ifdef TRACY_ON_DEMAND
381  if( !GetProfiler().IsConnected() ) return;
382 #endif
383  const auto thread = GetThreadHandle();
384 
385  GetProfiler().m_serialLock.lock();
386  SendMemFree( QueueType::MemFree, thread, ptr );
387  GetProfiler().m_serialLock.unlock();
388  }
389 
390  static tracy_force_inline void MemAllocCallstack( const void* ptr, size_t size, int depth, bool secure )
391  {
392  if( secure && !ProfilerAvailable() ) return;
393 #ifdef TRACY_HAS_CALLSTACK
394  auto& profiler = GetProfiler();
395 # ifdef TRACY_ON_DEMAND
396  if( !profiler.IsConnected() ) return;
397 # endif
398  const auto thread = GetThreadHandle();
399 
401  auto callstack = Callstack( depth );
402 
403  profiler.m_serialLock.lock();
404  SendMemAlloc( QueueType::MemAllocCallstack, thread, ptr, size );
405  SendCallstackMemory( callstack );
406  profiler.m_serialLock.unlock();
407 #else
408  MemAlloc( ptr, size, secure );
409 #endif
410  }
411 
412  static tracy_force_inline void MemFreeCallstack( const void* ptr, int depth, bool secure )
413  {
414  if( secure && !ProfilerAvailable() ) return;
415 #ifdef TRACY_HAS_CALLSTACK
416  auto& profiler = GetProfiler();
417 # ifdef TRACY_ON_DEMAND
418  if( !profiler.IsConnected() ) return;
419 # endif
420  const auto thread = GetThreadHandle();
421 
423  auto callstack = Callstack( depth );
424 
425  profiler.m_serialLock.lock();
426  SendMemFree( QueueType::MemFreeCallstack, thread, ptr );
427  SendCallstackMemory( callstack );
428  profiler.m_serialLock.unlock();
429 #else
430  MemFree( ptr, secure );
431 #endif
432  }
433 
435  {
436 #ifdef TRACY_HAS_CALLSTACK
437  auto ptr = Callstack( depth );
438  TracyLfqPrepare( QueueType::Callstack );
439  MemWrite( &item->callstackFat.ptr, (uint64_t)ptr );
441 #endif
442  }
443 
445  static tracy_force_inline void ParameterSetup( uint32_t idx, const char* name, bool isBool, int32_t val )
446  {
447  TracyLfqPrepare( QueueType::ParamSetup );
448  tracy::MemWrite( &item->paramSetup.idx, idx );
449  tracy::MemWrite( &item->paramSetup.name, (uint64_t)name );
450  tracy::MemWrite( &item->paramSetup.isBool, (uint8_t)isBool );
451  tracy::MemWrite( &item->paramSetup.val, val );
452 
453 #ifdef TRACY_ON_DEMAND
454  GetProfiler().DeferItem( *item );
455 #endif
456 
458  }
459 
460  void SendCallstack( int depth, const char* skipBefore );
461  static void CutCallstack( void* callstack, const char* skipBefore );
462 
463  static bool ShouldExit();
464 
466  {
467  return m_isConnected.load( std::memory_order_acquire );
468  }
469 
470 #ifdef TRACY_ON_DEMAND
471  tracy_force_inline uint64_t ConnectionId() const
472  {
473  return m_connectionId.load( std::memory_order_acquire );
474  }
475 
476  tracy_force_inline void DeferItem( const QueueItem& item )
477  {
478  m_deferredLock.lock();
479  auto dst = m_deferredQueue.push_next();
480  memcpy( dst, &item, sizeof( item ) );
481  m_deferredLock.unlock();
482  }
483 #endif
484 
485  void RequestShutdown() { m_shutdown.store( true, std::memory_order_relaxed ); m_shutdownManual.store( true, std::memory_order_relaxed ); }
486  bool HasShutdownFinished() const { return m_shutdownFinished.load( std::memory_order_relaxed ); }
487 
488  void SendString( uint64_t str, const char* ptr, QueueType type ) { SendString( str, ptr, strlen( ptr ), type ); }
489  void SendString( uint64_t str, const char* ptr, size_t len, QueueType type );
490  void SendSingleString( const char* ptr ) { SendSingleString( ptr, strlen( ptr ) ); }
491  void SendSingleString( const char* ptr, size_t len );
492  void SendSecondString( const char* ptr ) { SendSecondString( ptr, strlen( ptr ) ); }
493  void SendSecondString( const char* ptr, size_t len );
494 
495 
496  // Allocated source location data layout:
497  // 2b payload size
498  // 4b color
499  // 4b source line
500  // fsz function name
501  // 1b null terminator
502  // ssz source file name
503  // 1b null terminator
504  // nsz zone name (optional)
505 
506  static tracy_force_inline uint64_t AllocSourceLocation( uint32_t line, const char* source, const char* function )
507  {
508  return AllocSourceLocation( line, source, function, nullptr, 0 );
509  }
510 
511  static tracy_force_inline uint64_t AllocSourceLocation( uint32_t line, const char* source, const char* function, const char* name, size_t nameSz )
512  {
513  return AllocSourceLocation( line, source, strlen(source), function, strlen(function), name, nameSz );
514  }
515 
516  static tracy_force_inline uint64_t AllocSourceLocation( uint32_t line, const char* source, size_t sourceSz, const char* function, size_t functionSz )
517  {
518  return AllocSourceLocation( line, source, sourceSz, function, functionSz, nullptr, 0 );
519  }
520 
521  static tracy_force_inline uint64_t AllocSourceLocation( uint32_t line, const char* source, size_t sourceSz, const char* function, size_t functionSz, const char* name, size_t nameSz )
522  {
523  const auto sz32 = uint32_t( 2 + 4 + 4 + functionSz + 1 + sourceSz + 1 + nameSz );
524  assert( sz32 <= std::numeric_limits<uint16_t>::max() );
525  const auto sz = uint16_t( sz32 );
526  auto ptr = (char*)tracy_malloc( sz );
527  memcpy( ptr, &sz, 2 );
528  memset( ptr + 2, 0, 4 );
529  memcpy( ptr + 6, &line, 4 );
530  memcpy( ptr + 10, function, functionSz );
531  ptr[10 + functionSz] = '\0';
532  memcpy( ptr + 10 + functionSz + 1, source, sourceSz );
533  ptr[10 + functionSz + 1 + sourceSz] = '\0';
534  if( nameSz != 0 )
535  {
536  memcpy( ptr + 10 + functionSz + 1 + sourceSz + 1, name, nameSz );
537  }
538  return uint64_t( ptr );
539  }
540 
541 private:
542  enum class DequeueStatus { DataDequeued, ConnectionLost, QueueEmpty };
543 
544  static void LaunchWorker( void* ptr ) { ((Profiler*)ptr)->Worker(); }
545  void Worker();
546 
547  static void LaunchCompressWorker( void* ptr ) { ((Profiler*)ptr)->CompressWorker(); }
548  void CompressWorker();
549 
551  void ClearSerial();
555  bool CommitData();
556 
557  tracy_force_inline bool AppendData( const void* data, size_t len )
558  {
559  const auto ret = NeedDataSize( len );
560  AppendDataUnsafe( data, len );
561  return ret;
562  }
563 
565  {
566  assert( len <= TargetFrameSize );
567  bool ret = true;
569  {
570  ret = CommitData();
571  }
572  return ret;
573  }
574 
575  tracy_force_inline void AppendDataUnsafe( const void* data, size_t len )
576  {
577  memcpy( m_buffer + m_bufferOffset, data, len );
578  m_bufferOffset += int( len );
579  }
580 
581  bool SendData( const char* data, size_t len );
582  void SendLongString( uint64_t ptr, const char* str, size_t len, QueueType type );
583  void SendSourceLocation( uint64_t ptr );
585  void SendCallstackPayload( uint64_t ptr );
586  void SendCallstackPayload64( uint64_t ptr );
587  void SendCallstackAlloc( uint64_t ptr );
588  void SendCallstackFrame( uint64_t ptr );
589  void SendCodeLocation( uint64_t ptr );
590 
591  bool HandleServerQuery();
592  void HandleDisconnect();
593  void HandleParameter( uint64_t payload );
594  void HandleSymbolQuery( uint64_t symbol );
596 
597  void CalibrateTimer();
598  void CalibrateDelay();
599  void ReportTopology();
600 
601  static tracy_force_inline void SendCallstackMemory( void* ptr )
602  {
603 #ifdef TRACY_HAS_CALLSTACK
604  auto item = GetProfiler().m_serialQueue.prepare_next();
605  MemWrite( &item->hdr.type, QueueType::CallstackMemory );
606  MemWrite( &item->callstackFat.ptr, (uint64_t)ptr );
608 #endif
609  }
610 
611  static tracy_force_inline void SendMemAlloc( QueueType type, const uint64_t thread, const void* ptr, size_t size )
612  {
613  assert( type == QueueType::MemAlloc || type == QueueType::MemAllocCallstack );
614 
615  auto item = GetProfiler().m_serialQueue.prepare_next();
616  MemWrite( &item->hdr.type, type );
617  MemWrite( &item->memAlloc.time, GetTime() );
618  MemWrite( &item->memAlloc.thread, thread );
619  MemWrite( &item->memAlloc.ptr, (uint64_t)ptr );
620  if( compile_time_condition<sizeof( size ) == 4>::value )
621  {
622  memcpy( &item->memAlloc.size, &size, 4 );
623  memset( &item->memAlloc.size + 4, 0, 2 );
624  }
625  else
626  {
627  assert( sizeof( size ) == 8 );
628  memcpy( &item->memAlloc.size, &size, 4 );
629  memcpy( ((char*)&item->memAlloc.size)+4, ((char*)&size)+4, 2 );
630  }
632  }
633 
634  static tracy_force_inline void SendMemFree( QueueType type, const uint64_t thread, const void* ptr )
635  {
636  assert( type == QueueType::MemFree || type == QueueType::MemFreeCallstack );
637 
638  auto item = GetProfiler().m_serialQueue.prepare_next();
639  MemWrite( &item->hdr.type, type );
640  MemWrite( &item->memFree.time, GetTime() );
641  MemWrite( &item->memFree.thread, thread );
642  MemWrite( &item->memFree.ptr, (uint64_t)ptr );
644  }
645 
646 #if ( defined _WIN32 || defined __CYGWIN__ ) && defined TRACY_TIMER_QPC
647  static int64_t GetTimeQpc();
648 #endif
649 
650  double m_timerMul;
653  std::atomic<int64_t> m_timeBegin;
656  std::atomic<bool> m_shutdown;
657  std::atomic<bool> m_shutdownManual;
658  std::atomic<bool> m_shutdownFinished;
661  bool m_noExit;
663  std::atomic<uint32_t> m_zoneId;
665 
671 
672  void* m_stream; // LZ4_stream_t*
673  char* m_buffer;
676 
677  char* m_lz4Buf;
678 
680  TracyMutex m_serialLock;
681 
683  TracyMutex m_fiLock;
684 
685  std::atomic<uint64_t> m_frameCount;
686  std::atomic<bool> m_isConnected;
687 #ifdef TRACY_ON_DEMAND
688  std::atomic<uint64_t> m_connectionId;
689 
690  TracyMutex m_deferredLock;
691  FastVector<QueueItem> m_deferredQueue;
692 #endif
693 
694 #ifdef TRACY_HAS_SYSTIME
695  void ProcessSysTime();
696 
697  SysTime m_sysTime;
698  uint64_t m_sysTimeLast = 0;
699 #else
700  void ProcessSysTime() {}
701 #endif
702 
704 };
705 
706 }
707 
708 #endif


Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)