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 TracyCZoneColor(c,x)
31 #define TracyCZoneValue(c,x)
33 #define TracyCAlloc(x,y)
35 #define TracyCSecureAlloc(x,y)
36 #define TracyCSecureFree(x)
38 #define TracyCAllocN(x,y,z)
39 #define TracyCFreeN(x,y)
40 #define TracyCSecureAllocN(x,y,z)
41 #define TracyCSecureFreeN(x,y)
43 #define TracyCFrameMark
44 #define TracyCFrameMarkNamed(x)
45 #define TracyCFrameMarkStart(x)
46 #define TracyCFrameMarkEnd(x)
47 #define TracyCFrameImage(x,y,z,w,a)
49 #define TracyCPlot(x,y)
50 #define TracyCMessage(x,y)
51 #define TracyCMessageL(x)
52 #define TracyCMessageC(x,y,z)
53 #define TracyCMessageLC(x,y)
54 #define TracyCAppInfo(x,y)
56 #define TracyCZoneS(x,y,z)
57 #define TracyCZoneNS(x,y,z,w)
58 #define TracyCZoneCS(x,y,z,w)
59 #define TracyCZoneNCS(x,y,z,w,a)
61 #define TracyCAllocS(x,y,z)
62 #define TracyCFreeS(x,y)
63 #define TracyCSecureAllocS(x,y,z)
64 #define TracyCSecureFreeS(x,y)
66 #define TracyCAllocNS(x,y,z,w)
67 #define TracyCFreeNS(x,y,z)
68 #define TracyCSecureAllocNS(x,y,z,w)
69 #define TracyCSecureFreeNS(x,y,z)
71 #define TracyCMessageS(x,y,z)
72 #define TracyCMessageLS(x,y)
73 #define TracyCMessageCS(x,y,z,w)
74 #define TracyCMessageLCS(x,y,z)
79 # define TracyConcat(x,y) TracyConcatIndirect(x,y)
81 #ifndef TracyConcatIndirect
82 # define TracyConcatIndirect(x,y) x##y
85 struct ___tracy_source_location_data
94 struct ___tracy_c_zone_context
102 typedef struct ___tracy_c_zone_context TracyCZoneCtx;
104 TRACY_API void ___tracy_init_thread(
void);
106 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 );
108 TRACY_API TracyCZoneCtx ___tracy_emit_zone_begin(
const struct ___tracy_source_location_data* srcloc,
int active );
109 TRACY_API TracyCZoneCtx ___tracy_emit_zone_begin_callstack(
const struct ___tracy_source_location_data* srcloc,
int depth,
int active );
110 TRACY_API TracyCZoneCtx ___tracy_emit_zone_begin_alloc(
uint64_t srcloc,
int active );
111 TRACY_API TracyCZoneCtx ___tracy_emit_zone_begin_alloc_callstack(
uint64_t srcloc,
int depth,
int active );
112 TRACY_API void ___tracy_emit_zone_end( TracyCZoneCtx ctx );
113 TRACY_API void ___tracy_emit_zone_text( TracyCZoneCtx ctx,
const char* txt,
size_t size );
114 TRACY_API void ___tracy_emit_zone_name( TracyCZoneCtx ctx,
const char* txt,
size_t size );
118 #if defined TRACY_HAS_CALLSTACK && defined TRACY_CALLSTACK
119 # define TracyCZone( ctx, active ) static const struct ___tracy_source_location_data TracyConcat(__tracy_source_location,__LINE__) = { NULL, __func__, __FILE__, (uint32_t)__LINE__, 0 }; TracyCZoneCtx ctx = ___tracy_emit_zone_begin_callstack( &TracyConcat(__tracy_source_location,__LINE__), TRACY_CALLSTACK, active );
120 # define TracyCZoneN( ctx, name, active ) static const struct ___tracy_source_location_data TracyConcat(__tracy_source_location,__LINE__) = { name, __func__, __FILE__, (uint32_t)__LINE__, 0 }; TracyCZoneCtx ctx = ___tracy_emit_zone_begin_callstack( &TracyConcat(__tracy_source_location,__LINE__), TRACY_CALLSTACK, active );
121 # define TracyCZoneC( ctx, color, active ) static const struct ___tracy_source_location_data TracyConcat(__tracy_source_location,__LINE__) = { NULL, __func__, __FILE__, (uint32_t)__LINE__, color }; TracyCZoneCtx ctx = ___tracy_emit_zone_begin_callstack( &TracyConcat(__tracy_source_location,__LINE__), TRACY_CALLSTACK, active );
122 # define TracyCZoneNC( ctx, name, color, active ) static const struct ___tracy_source_location_data TracyConcat(__tracy_source_location,__LINE__) = { name, __func__, __FILE__, (uint32_t)__LINE__, color }; TracyCZoneCtx ctx = ___tracy_emit_zone_begin_callstack( &TracyConcat(__tracy_source_location,__LINE__), TRACY_CALLSTACK, active );
124 # define TracyCZone( ctx, active ) static const struct ___tracy_source_location_data TracyConcat(__tracy_source_location,__LINE__) = { NULL, __func__, __FILE__, (uint32_t)__LINE__, 0 }; TracyCZoneCtx ctx = ___tracy_emit_zone_begin( &TracyConcat(__tracy_source_location,__LINE__), active );
125 # define TracyCZoneN( ctx, name, active ) static const struct ___tracy_source_location_data TracyConcat(__tracy_source_location,__LINE__) = { name, __func__, __FILE__, (uint32_t)__LINE__, 0 }; TracyCZoneCtx ctx = ___tracy_emit_zone_begin( &TracyConcat(__tracy_source_location,__LINE__), active );
126 # define TracyCZoneC( ctx, color, active ) static const struct ___tracy_source_location_data TracyConcat(__tracy_source_location,__LINE__) = { NULL, __func__, __FILE__, (uint32_t)__LINE__, color }; TracyCZoneCtx ctx = ___tracy_emit_zone_begin( &TracyConcat(__tracy_source_location,__LINE__), active );
127 # define TracyCZoneNC( ctx, name, color, active ) static const struct ___tracy_source_location_data TracyConcat(__tracy_source_location,__LINE__) = { name, __func__, __FILE__, (uint32_t)__LINE__, color }; TracyCZoneCtx ctx = ___tracy_emit_zone_begin( &TracyConcat(__tracy_source_location,__LINE__), active );
130 #define TracyCZoneEnd( ctx ) ___tracy_emit_zone_end( ctx );
132 #define TracyCZoneText( ctx, txt, size ) ___tracy_emit_zone_text( ctx, txt, size );
133 #define TracyCZoneName( ctx, txt, size ) ___tracy_emit_zone_name( ctx, txt, size );
134 #define TracyCZoneColor( ctx, color ) ___tracy_emit_zone_color( ctx, color );
135 #define TracyCZoneValue( ctx, value ) ___tracy_emit_zone_value( ctx, value );
138 TRACY_API void ___tracy_emit_memory_alloc(
const void* ptr,
size_t size,
int secure );
139 TRACY_API void ___tracy_emit_memory_alloc_callstack(
const void* ptr,
size_t size,
int depth,
int secure );
140 TRACY_API void ___tracy_emit_memory_free(
const void* ptr,
int secure );
141 TRACY_API void ___tracy_emit_memory_free_callstack(
const void* ptr,
int depth,
int secure );
143 TRACY_API void ___tracy_emit_message(
const char* txt,
size_t size,
int callstack );
144 TRACY_API void ___tracy_emit_messageL(
const char* txt,
int callstack );
148 #if defined TRACY_HAS_CALLSTACK && defined TRACY_CALLSTACK
149 # define TracyCAlloc( ptr, size ) ___tracy_emit_memory_alloc_callstack( ptr, size, TRACY_CALLSTACK, 0 )
150 # define TracyCFree( ptr ) ___tracy_emit_memory_free_callstack( ptr, TRACY_CALLSTACK, 0 )
151 # define TracyCSecureAlloc( ptr, size ) ___tracy_emit_memory_alloc_callstack( ptr, size, TRACY_CALLSTACK, 1 )
152 # define TracyCSecureFree( ptr ) ___tracy_emit_memory_free_callstack( ptr, TRACY_CALLSTACK, 1 )
154 # define TracyCAllocN( ptr, size, name ) ___tracy_emit_memory_alloc_callstack_named( ptr, size, TRACY_CALLSTACK, 0, name )
155 # define TracyCFreeN( ptr, name ) ___tracy_emit_memory_free_callstack_named( ptr, TRACY_CALLSTACK, 0, name )
156 # define TracyCSecureAllocN( ptr, size, name ) ___tracy_emit_memory_alloc_callstack_named( ptr, size, TRACY_CALLSTACK, 1, name )
157 # define TracyCSecureFreeN( ptr, name ) ___tracy_emit_memory_free_callstack_named( ptr, TRACY_CALLSTACK, 1, name )
159 # define TracyCMessage( txt, size ) ___tracy_emit_message( txt, size, TRACY_CALLSTACK );
160 # define TracyCMessageL( txt ) ___tracy_emit_messageL( txt, TRACY_CALLSTACK );
161 # define TracyCMessageC( txt, size, color ) ___tracy_emit_messageC( txt, size, color, TRACY_CALLSTACK );
162 # define TracyCMessageLC( txt, color ) ___tracy_emit_messageLC( txt, color, TRACY_CALLSTACK );
164 # define TracyCAlloc( ptr, size ) ___tracy_emit_memory_alloc( ptr, size, 0 );
165 # define TracyCFree( ptr ) ___tracy_emit_memory_free( ptr, 0 );
166 # define TracyCSecureAlloc( ptr, size ) ___tracy_emit_memory_alloc( ptr, size, 1 );
167 # define TracyCSecureFree( ptr ) ___tracy_emit_memory_free( ptr, 1 );
169 # define TracyCAllocN( ptr, size, name ) ___tracy_emit_memory_alloc_named( ptr, size, 0, name );
170 # define TracyCFreeN( ptr, name ) ___tracy_emit_memory_free_named( ptr, 0, name );
171 # define TracyCSecureAllocN( ptr, size, name ) ___tracy_emit_memory_alloc_named( ptr, size, 1, name );
172 # define TracyCSecureFreeN( ptr, name ) ___tracy_emit_memory_free_named( ptr, 1, name );
174 # define TracyCMessage( txt, size ) ___tracy_emit_message( txt, size, 0 );
175 # define TracyCMessageL( txt ) ___tracy_emit_messageL( txt, 0 );
176 # define TracyCMessageC( txt, size, color ) ___tracy_emit_messageC( txt, size, color, 0 );
177 # define TracyCMessageLC( txt, color ) ___tracy_emit_messageLC( txt, color, 0 );
182 TRACY_API void ___tracy_emit_frame_mark_start(
const char*
name );
183 TRACY_API void ___tracy_emit_frame_mark_end(
const char*
name );
186 #define TracyCFrameMark ___tracy_emit_frame_mark( 0 );
187 #define TracyCFrameMarkNamed( name ) ___tracy_emit_frame_mark( name );
188 #define TracyCFrameMarkStart( name ) ___tracy_emit_frame_mark_start( name );
189 #define TracyCFrameMarkEnd( name ) ___tracy_emit_frame_mark_end( name );
190 #define TracyCFrameImage( image, width, height, offset, flip ) ___tracy_emit_frame_image( image, width, height, offset, flip );
194 TRACY_API void ___tracy_emit_message_appinfo(
const char* txt,
size_t size );
196 #define TracyCPlot( name, val ) ___tracy_emit_plot( name, val );
197 #define TracyCAppInfo( txt, color ) ___tracy_emit_message_appinfo( txt, color );
200 #ifdef TRACY_HAS_CALLSTACK
201 # define TracyCZoneS( ctx, depth, active ) static const struct ___tracy_source_location_data TracyConcat(__tracy_source_location,__LINE__) = { NULL, __func__, __FILE__, (uint32_t)__LINE__, 0 }; TracyCZoneCtx ctx = ___tracy_emit_zone_begin_callstack( &TracyConcat(__tracy_source_location,__LINE__), depth, active );
202 # define TracyCZoneNS( ctx, name, depth, active ) static const struct ___tracy_source_location_data TracyConcat(__tracy_source_location,__LINE__) = { name, __func__, __FILE__, (uint32_t)__LINE__, 0 }; TracyCZoneCtx ctx = ___tracy_emit_zone_begin_callstack( &TracyConcat(__tracy_source_location,__LINE__), depth, active );
203 # define TracyCZoneCS( ctx, color, depth, active ) static const struct ___tracy_source_location_data TracyConcat(__tracy_source_location,__LINE__) = { NULL, __func__, __FILE__, (uint32_t)__LINE__, color }; TracyCZoneCtx ctx = ___tracy_emit_zone_begin_callstack( &TracyConcat(__tracy_source_location,__LINE__), depth, active );
204 # define TracyCZoneNCS( ctx, name, color, depth, active ) static const struct ___tracy_source_location_data TracyConcat(__tracy_source_location,__LINE__) = { name, __func__, __FILE__, (uint32_t)__LINE__, color }; TracyCZoneCtx ctx = ___tracy_emit_zone_begin_callstack( &TracyConcat(__tracy_source_location,__LINE__), depth, active );
206 # define TracyCAllocS( ptr, size, depth ) ___tracy_emit_memory_alloc_callstack( ptr, size, depth, 0 )
207 # define TracyCFreeS( ptr, depth ) ___tracy_emit_memory_free_callstack( ptr, depth, 0 )
208 # define TracyCSecureAllocS( ptr, size, depth ) ___tracy_emit_memory_alloc_callstack( ptr, size, depth, 1 )
209 # define TracyCSecureFreeS( ptr, depth ) ___tracy_emit_memory_free_callstack( ptr, depth, 1 )
211 # define TracyCAllocNS( ptr, size, depth, name ) ___tracy_emit_memory_alloc_callstack_named( ptr, size, depth, 0, name )
212 # define TracyCFreeNS( ptr, depth, name ) ___tracy_emit_memory_free_callstack_named( ptr, depth, 0, name )
213 # define TracyCSecureAllocNS( ptr, size, depth, name ) ___tracy_emit_memory_alloc_callstack_named( ptr, size, depth, 1, name )
214 # define TracyCSecureFreeNS( ptr, depth, name ) ___tracy_emit_memory_free_callstack_named( ptr, depth, 1, name )
216 # define TracyCMessageS( txt, size, depth ) ___tracy_emit_message( txt, size, depth );
217 # define TracyCMessageLS( txt, depth ) ___tracy_emit_messageL( txt, depth );
218 # define TracyCMessageCS( txt, size, color, depth ) ___tracy_emit_messageC( txt, size, color, depth );
219 # define TracyCMessageLCS( txt, color, depth ) ___tracy_emit_messageLC( txt, color, depth );
221 # define TracyCZoneS( ctx, depth, active ) TracyCZone( ctx, active )
222 # define TracyCZoneNS( ctx, name, depth, active ) TracyCZoneN( ctx, name, active )
223 # define TracyCZoneCS( ctx, color, depth, active ) TracyCZoneC( ctx, color, active )
224 # define TracyCZoneNCS( ctx, name, color, depth, active ) TracyCZoneNC( ctx, name, color, active )
226 # define TracyCAllocS( ptr, size, depth ) TracyCAlloc( ptr, size )
227 # define TracyCFreeS( ptr, depth ) TracyCFree( ptr )
228 # define TracyCSecureAllocS( ptr, size, depth ) TracyCSecureAlloc( ptr, size )
229 # define TracyCSecureFreeS( ptr, depth ) TracyCSecureFree( ptr )
231 # define TracyCAllocNS( ptr, size, depth, name ) TracyCAllocN( ptr, size, name )
232 # define TracyCFreeNS( ptr, depth, name ) TracyCFreeN( ptr, name )
233 # define TracyCSecureAllocNS( ptr, size, depth, name ) TracyCSecureAllocN( ptr, size, name )
234 # define TracyCSecureFreeNS( ptr, depth, name ) TracyCSecureFreeN( ptr, name )
236 # define TracyCMessageS( txt, size, depth ) TracyCMessage( txt, size )
237 # define TracyCMessageLS( txt, depth ) TracyCMessageL( txt )
238 # define TracyCMessageCS( txt, size, color, depth ) TracyCMessageC( txt, size, color )
239 # define TracyCMessageLCS( txt, color, depth ) TracyCMessageLC( txt, color )