16 #define TracyCSetThreadName( name ) ___tracy_set_thread_name( name );
23 #define TracyCZone(c,x)
24 #define TracyCZoneN(c,x,y)
25 #define TracyCZoneC(c,x,y)
26 #define TracyCZoneNC(c,x,y,z)
27 #define TracyCZoneEnd(c)
28 #define TracyCZoneText(c,x,y)
29 #define TracyCZoneName(c,x,y)
30 #define TracyCZoneValue(c,x)
32 #define TracyCAlloc(x,y)
34 #define TracyCSecureAlloc(x,y)
35 #define TracyCSecureFree(x)
37 #define TracyCFrameMark
38 #define TracyCFrameMarkNamed(x)
39 #define TracyCFrameMarkStart(x)
40 #define TracyCFrameMarkEnd(x)
41 #define TracyCFrameImage(x,y,z,w,a)
43 #define TracyCPlot(x,y)
44 #define TracyCMessage(x,y)
45 #define TracyCMessageL(x)
46 #define TracyCMessageC(x,y,z)
47 #define TracyCMessageLC(x,y)
48 #define TracyCAppInfo(x,y)
50 #define TracyCZoneS(x,y,z)
51 #define TracyCZoneNS(x,y,z,w)
52 #define TracyCZoneCS(x,y,z,w)
53 #define TracyCZoneNCS(x,y,z,w,a)
55 #define TracyCAllocS(x,y,z)
56 #define TracyCFreeS(x,y)
57 #define TracyCSecureAllocS(x,y,z)
58 #define TracyCSecureFreeS(x,y)
60 #define TracyCMessageS(x,y,z)
61 #define TracyCMessageLS(x,y)
62 #define TracyCMessageCS(x,y,z,w)
63 #define TracyCMessageLCS(x,y,z)
68 # define TracyConcat(x,y) TracyConcatIndirect(x,y)
70 #ifndef TracyConcatIndirect
71 # define TracyConcatIndirect(x,y) x##y
74 struct ___tracy_source_location_data
83 struct ___tracy_c_zone_context
91 typedef struct ___tracy_c_zone_context TracyCZoneCtx;
93 TRACY_API void ___tracy_init_thread(
void);
95 TRACY_API uint64_t ___tracy_alloc_srcloc_name(
uint32_t line,
const char*
source,
size_t sourceSz,
const char*
function,
size_t functionSz,
const char*
name,
size_t nameSz );
97 TRACY_API TracyCZoneCtx ___tracy_emit_zone_begin(
const struct ___tracy_source_location_data* srcloc,
int active );
98 TRACY_API TracyCZoneCtx ___tracy_emit_zone_begin_callstack(
const struct ___tracy_source_location_data* srcloc,
int depth,
int active );
99 TRACY_API TracyCZoneCtx ___tracy_emit_zone_begin_alloc(
uint64_t srcloc,
int active );
100 TRACY_API TracyCZoneCtx ___tracy_emit_zone_begin_alloc_callstack(
uint64_t srcloc,
int depth,
int active );
101 TRACY_API void ___tracy_emit_zone_end( TracyCZoneCtx ctx );
102 TRACY_API void ___tracy_emit_zone_text( TracyCZoneCtx ctx,
const char* txt,
size_t size );
103 TRACY_API void ___tracy_emit_zone_name( TracyCZoneCtx ctx,
const char* txt,
size_t size );
106 #if defined TRACY_HAS_CALLSTACK && defined TRACY_CALLSTACK
107 # define TracyCZone( ctx, active ) static const struct ___tracy_source_location_data TracyConcat(__tracy_source_location,__LINE__) = { NULL, __FUNCTION__, __FILE__, (uint32_t)__LINE__, 0 }; TracyCZoneCtx ctx = ___tracy_emit_zone_begin_callstack( &TracyConcat(__tracy_source_location,__LINE__), TRACY_CALLSTACK, active );
108 # define TracyCZoneN( ctx, name, active ) static const struct ___tracy_source_location_data TracyConcat(__tracy_source_location,__LINE__) = { name, __FUNCTION__, __FILE__, (uint32_t)__LINE__, 0 }; TracyCZoneCtx ctx = ___tracy_emit_zone_begin_callstack( &TracyConcat(__tracy_source_location,__LINE__), TRACY_CALLSTACK, active );
109 # define TracyCZoneC( ctx, color, active ) static const struct ___tracy_source_location_data TracyConcat(__tracy_source_location,__LINE__) = { NULL, __FUNCTION__, __FILE__, (uint32_t)__LINE__, color }; TracyCZoneCtx ctx = ___tracy_emit_zone_begin_callstack( &TracyConcat(__tracy_source_location,__LINE__), TRACY_CALLSTACK, active );
110 # define TracyCZoneNC( ctx, name, color, active ) static const struct ___tracy_source_location_data TracyConcat(__tracy_source_location,__LINE__) = { name, __FUNCTION__, __FILE__, (uint32_t)__LINE__, color }; TracyCZoneCtx ctx = ___tracy_emit_zone_begin_callstack( &TracyConcat(__tracy_source_location,__LINE__), TRACY_CALLSTACK, active );
112 # define TracyCZone( ctx, active ) static const struct ___tracy_source_location_data TracyConcat(__tracy_source_location,__LINE__) = { NULL, __FUNCTION__, __FILE__, (uint32_t)__LINE__, 0 }; TracyCZoneCtx ctx = ___tracy_emit_zone_begin( &TracyConcat(__tracy_source_location,__LINE__), active );
113 # define TracyCZoneN( ctx, name, active ) static const struct ___tracy_source_location_data TracyConcat(__tracy_source_location,__LINE__) = { name, __FUNCTION__, __FILE__, (uint32_t)__LINE__, 0 }; TracyCZoneCtx ctx = ___tracy_emit_zone_begin( &TracyConcat(__tracy_source_location,__LINE__), active );
114 # define TracyCZoneC( ctx, color, active ) static const struct ___tracy_source_location_data TracyConcat(__tracy_source_location,__LINE__) = { NULL, __FUNCTION__, __FILE__, (uint32_t)__LINE__, color }; TracyCZoneCtx ctx = ___tracy_emit_zone_begin( &TracyConcat(__tracy_source_location,__LINE__), active );
115 # define TracyCZoneNC( ctx, name, color, active ) static const struct ___tracy_source_location_data TracyConcat(__tracy_source_location,__LINE__) = { name, __FUNCTION__, __FILE__, (uint32_t)__LINE__, color }; TracyCZoneCtx ctx = ___tracy_emit_zone_begin( &TracyConcat(__tracy_source_location,__LINE__), active );
118 #define TracyCZoneEnd( ctx ) ___tracy_emit_zone_end( ctx );
120 #define TracyCZoneText( ctx, txt, size ) ___tracy_emit_zone_text( ctx, txt, size );
121 #define TracyCZoneName( ctx, txt, size ) ___tracy_emit_zone_name( ctx, txt, size );
122 #define TracyCZoneValue( ctx, value ) ___tracy_emit_zone_value( ctx, value );
125 TRACY_API void ___tracy_emit_memory_alloc(
const void* ptr,
size_t size,
int secure );
126 TRACY_API void ___tracy_emit_memory_alloc_callstack(
const void* ptr,
size_t size,
int depth,
int secure );
127 TRACY_API void ___tracy_emit_memory_free(
const void* ptr,
int secure );
128 TRACY_API void ___tracy_emit_memory_free_callstack(
const void* ptr,
int depth,
int secure );
130 TRACY_API void ___tracy_emit_message(
const char* txt,
size_t size,
int callstack );
131 TRACY_API void ___tracy_emit_messageL(
const char* txt,
int callstack );
135 #if defined TRACY_HAS_CALLSTACK && defined TRACY_CALLSTACK
136 # define TracyCAlloc( ptr, size ) ___tracy_emit_memory_alloc_callstack( ptr, size, TRACY_CALLSTACK, 0 )
137 # define TracyCFree( ptr ) ___tracy_emit_memory_free_callstack( ptr, TRACY_CALLSTACK, 0 )
138 # define TracyCSecureAlloc( ptr, size ) ___tracy_emit_memory_alloc_callstack( ptr, size, TRACY_CALLSTACK, 1 )
139 # define TracyCSecureFree( ptr ) ___tracy_emit_memory_free_callstack( ptr, TRACY_CALLSTACK, 1 )
141 # define TracyCMessage( txt, size ) ___tracy_emit_message( txt, size, TRACY_CALLSTACK );
142 # define TracyCMessageL( txt ) ___tracy_emit_messageL( txt, TRACY_CALLSTACK );
143 # define TracyCMessageC( txt, size, color ) ___tracy_emit_messageC( txt, size, color, TRACY_CALLSTACK );
144 # define TracyCMessageLC( txt, color ) ___tracy_emit_messageLC( txt, color, TRACY_CALLSTACK );
146 # define TracyCAlloc( ptr, size ) ___tracy_emit_memory_alloc( ptr, size, 0 );
147 # define TracyCFree( ptr ) ___tracy_emit_memory_free( ptr, 0 );
148 # define TracyCSecureAlloc( ptr, size ) ___tracy_emit_memory_alloc( ptr, size, 1 );
149 # define TracyCSecureFree( ptr ) ___tracy_emit_memory_free( ptr, 1 );
151 # define TracyCMessage( txt, size ) ___tracy_emit_message( txt, size, 0 );
152 # define TracyCMessageL( txt ) ___tracy_emit_messageL( txt, 0 );
153 # define TracyCMessageC( txt, size, color ) ___tracy_emit_messageC( txt, size, color, 0 );
154 # define TracyCMessageLC( txt, color ) ___tracy_emit_messageLC( txt, color, 0 );
159 TRACY_API void ___tracy_emit_frame_mark_start(
const char*
name );
160 TRACY_API void ___tracy_emit_frame_mark_end(
const char*
name );
163 #define TracyCFrameMark ___tracy_emit_frame_mark( 0 );
164 #define TracyCFrameMarkNamed( name ) ___tracy_emit_frame_mark( name );
165 #define TracyCFrameMarkStart( name ) ___tracy_emit_frame_mark_start( name );
166 #define TracyCFrameMarkEnd( name ) ___tracy_emit_frame_mark_end( name );
167 #define TracyCFrameImage( image, width, height, offset, flip ) ___tracy_emit_frame_image( image, width, height, offset, flip );
171 TRACY_API void ___tracy_emit_message_appinfo(
const char* txt,
size_t size );
173 #define TracyCPlot( name, val ) ___tracy_emit_plot( name, val );
174 #define TracyCAppInfo( txt, color ) ___tracy_emit_message_appinfo( txt, color );
177 #ifdef TRACY_HAS_CALLSTACK
178 # define TracyCZoneS( ctx, depth, active ) static const struct ___tracy_source_location_data TracyConcat(__tracy_source_location,__LINE__) = { NULL, __FUNCTION__, __FILE__, (uint32_t)__LINE__, 0 }; TracyCZoneCtx ctx = ___tracy_emit_zone_begin_callstack( &TracyConcat(__tracy_source_location,__LINE__), depth, active );
179 # define TracyCZoneNS( ctx, name, depth, active ) static const struct ___tracy_source_location_data TracyConcat(__tracy_source_location,__LINE__) = { name, __FUNCTION__, __FILE__, (uint32_t)__LINE__, 0 }; TracyCZoneCtx ctx = ___tracy_emit_zone_begin_callstack( &TracyConcat(__tracy_source_location,__LINE__), depth, active );
180 # define TracyCZoneCS( ctx, color, depth, active ) static const struct ___tracy_source_location_data TracyConcat(__tracy_source_location,__LINE__) = { NULL, __FUNCTION__, __FILE__, (uint32_t)__LINE__, color }; TracyCZoneCtx ctx = ___tracy_emit_zone_begin_callstack( &TracyConcat(__tracy_source_location,__LINE__), depth, active );
181 # define TracyCZoneNCS( ctx, name, color, depth, active ) static const struct ___tracy_source_location_data TracyConcat(__tracy_source_location,__LINE__) = { name, __FUNCTION__, __FILE__, (uint32_t)__LINE__, color }; TracyCZoneCtx ctx = ___tracy_emit_zone_begin_callstack( &TracyConcat(__tracy_source_location,__LINE__), depth, active );
183 # define TracyCAllocS( ptr, size, depth ) ___tracy_emit_memory_alloc_callstack( ptr, size, depth, 0 )
184 # define TracyCFreeS( ptr, depth ) ___tracy_emit_memory_free_callstack( ptr, depth, 0 )
185 # define TracyCSecureAllocS( ptr, size, depth ) ___tracy_emit_memory_alloc_callstack( ptr, size, depth, 1 )
186 # define TracyCSecureFreeS( ptr, depth ) ___tracy_emit_memory_free_callstack( ptr, depth, 1 )
188 # define TracyCMessageS( txt, size, depth ) ___tracy_emit_message( txt, size, depth );
189 # define TracyCMessageLS( txt, depth ) ___tracy_emit_messageL( txt, depth );
190 # define TracyCMessageCS( txt, size, color, depth ) ___tracy_emit_messageC( txt, size, color, depth );
191 # define TracyCMessageLCS( txt, color, depth ) ___tracy_emit_messageLC( txt, color, depth );
193 # define TracyCZoneS( ctx, depth, active ) TracyCZone( ctx, active )
194 # define TracyCZoneNS( ctx, name, depth, active ) TracyCZoneN( ctx, name, active )
195 # define TracyCZoneCS( ctx, color, depth, active ) TracyCZoneC( ctx, color, active )
196 # define TracyCZoneNCS( ctx, name, color, depth, active ) TracyCZoneNC( ctx, name, color, active )
198 # define TracyCAllocS( ptr, size, depth ) TracyCAlloc( ptr, size )
199 # define TracyCFreeS( ptr, depth ) TracyCFree( ptr )
200 # define TracyCSecureAllocS( ptr, size, depth ) TracyCSecureAlloc( ptr, size )
201 # define TracyCSecureFreeS( ptr, depth ) TracyCSecureFree( ptr )
203 # define TracyCMessageS( txt, size, depth ) TracyCMessage( txt, size )
204 # define TracyCMessageLS( txt, depth ) TracyCMessageL( txt )
205 # define TracyCMessageCS( txt, size, color, depth ) TracyCMessageC( txt, size, color )
206 # define TracyCMessageLCS( txt, color, depth ) TracyCMessageLC( txt, color )