14 #ifndef __UT_Tracing_h__
15 #define __UT_Tracing_h__
28 #define TRACY_ON_DEMAND
30 #define TRACY_DELAYED_INIT
31 #define TRACY_MANUAL_LIFETIME
34 #if !defined(MAKING_STATIC)
42 #include <tracy/tracy/Tracy.hpp>
44 class UT_API ut_TraceControl
70 static ut_TraceControl &
get();
72 bool flag(Flag
f)
const
74 return myFlags & (1u <<
f);
77 uint32_t setFlag(uint32_t idx, uint32_t
val)
79 uint32_t bflag = (1u << idx);
80 myFlags = val ? (myFlags | bflag) : (myFlags & ~bflag);
93 #define utTraceFlag(F) ut_TraceControl::get().flag(ut_TraceControl::F)
102 #define utZoneScopedFlag(F) ZoneNamed( ___tracy_scoped_zone, utTraceFlag(F) )
103 #define utZoneScopedFlagN(F, name) ZoneNamedN( ___tracy_scoped_zone, name, utTraceFlag(F) )
104 #define utZoneScopedFlagS(F, depth) ZoneNamedS( ___tracy_scoped_zone, depth, utTraceFlag(F) )
105 #define utZoneScopedFlagNS(F, name, depth) ZoneNamedNS( ___tracy_scoped_zone, name, depth, utTraceFlag(F) )
106 #define utZoneScopedBool(b) ZoneNamed( ___tracy_scoped_zone, b )
109 #define utZoneScoped utZoneScopedFlag(GENERIC)
110 #define utZoneScopedN(name) utZoneScopedFlagN(GENERIC, name)
114 #define utZoneScopedS(depth) utZoneScopedFlagS(GENERIC, depth)
115 #define utZoneScopedNS(name,depth) utZoneScopedFlagNS(GENERIC, name,depth)
122 #define utZoneText(txt,size) ZoneText(txt,size)
123 #define utZoneTextSH(sh) ZoneText((sh).c_str(),(sh).length())
124 #define utZoneName(name,size) ZoneName(name,size)
125 #define utZoneNameSH(sh) ZoneName((sh).c_str(),(sh).length())
126 #define utZoneColor(color) ZoneColor(color)
127 #define utZoneValue(value) ZoneValue(value)
128 #define utZoneIsActive ZoneIsActive
131 #define utFrameMark FrameMark
132 #define utFrameMarkNamed(x) FrameMarkNamed(x)
134 #define utTracePlot(name,val) TracyPlot(name,val)
136 #define utTracePlotConfigNum(name) TracyPlotConfig(name,tracy::PlotFormatType::Number)
137 #define utTracePlotConfigMem(name) TracyPlotConfig(name,tracy::PlotFormatType::Memory)
138 #define utTracePlotConfigPct(name) TracyPlotConfig(name,tracy::PlotFormatType::Percentage)
143 #define utTraceMessage(txt,size) TracyMessage(txt,size)
144 #define utTraceMessageSH(sh) TracyMessage((sh).c_str(),(sh).length())
145 #define utTraceMessageL(txt) TracyMessageL(txt)
146 #define utTraceMessageC(txt,size,color) TracyMessageC(txt,size,color)
147 #define utTraceMessageSHC(sh,color) TracyMessageC((sh).c_str(),(sh).length(),color)
148 #define utTraceMessageLC(txt,color) TracyMessageLC(txt,color)
150 #define utTraceMessageS(txt,size,depth) TracyMessageS(txt,size,depth)
151 #define utTraceMessageSHS(sh,depth) TracyMessageS((sh).c_str(),(sh).length(),depth)
152 #define utTraceMessageLS(txt,depth) TracyMessageLS(txt,depth)
153 #define utTraceMessageCS(txt,size,color,d) TracyMessageCS(txt,size,color,d)
154 #define utTraceMessageSHCS(sh,color,d) TracyMessageCS((sh).c_str(),(sh).length(),color,d)
155 #define utTraceMessageLCS(txt,color,depth) TracyMessageLCS(txt,color,depth)
157 #define utTraceMessageFlag(F,txt,size) if(utTraceFlag(F)) TracyMessage(txt,size)
158 #define utTraceMessageFlagSH(F,sh) if(utTraceFlag(F)) TracyMessage((sh).c_str(),(sh).length())
159 #define utTraceMessageFlagL(F,txt) if(utTraceFlag(F)) TracyMessageL(txt)
160 #define utTraceMessageFlagLC(F,txt,color) if(utTraceFlag(F)) TracyMessageLC(txt,color)
161 #define utTraceMessageFlagC(F,txt,size,color) if(utTraceFlag(F)) TracyMessageC(txt,size,color)
162 #define utTraceMessageFlagSHC(F,sh,color) if(utTraceFlag(F)) TracyMessageC((sh).c_str(),(sh).length(),color)
164 #define utTraceMessageFlagS(F,txt,size,depth) if(utTraceFlag(F)) TracyMessageS(txt,size,depth)
165 #define utTraceMessageFlagSHS(F,sh,depth) if(utTraceFlag(F)) TracyMessageS((sh).c_str(),(sh).length(),depth)
166 #define utTraceMessageFlagLS(F,txt,depth) if(utTraceFlag(F)) TracyMessageLS(txt,depth)
167 #define utTraceMessageFlagLCS(F,txt,color,depth) if(utTraceFlag(F)) TracyMessageLCS(txt,color,depth)
168 #define utTraceMessageFlagCS(F,txt,size,color,d) if(utTraceFlag(F)) TracyMessageCS(txt,size,color,d)
169 #define utTraceMessageFlagSHCS(F,sh,color,d) if(utTraceFlag(F)) TracyMessageCS((sh).c_str(),(sh).length(),color,d)
172 #define utTraceAlloc(ptr,size) TracyAlloc(ptr,size)
173 #define utTraceFree(ptr) TracyFree(ptr)
174 #define utTraceAllocN(ptr,size,name) TracyAllocN(ptr,size,name)
175 #define utTraceFreeN(ptr,name) TracyFreeN(ptr,name)
177 #define utTraceAllocS(ptr,size,depth) TracyAllocS(ptr, size, depth)
178 #define utTraceFreeS(ptr,depth) TracyFreeS(ptr, depth)
179 #define utTraceAllocNS(ptr,size,depth,name) TracyAllocNS(ptr, size, depth, name)
180 #define utTraceFreeNS(ptr,depth,name) TracyFreeNS(ptr, depth, name)
183 #define utTraceIsConnected TracyIsConnected
193 #define utTraceIsStarted TracyIsStarted
196 #define utZoneScopedNodeFlag(F, node) ZoneNamed( ___tracy_scoped_zone, utTraceFlag(F) ); \
197 if (node) utZoneNameSH(node->getName());
200 #define utZoneScopedNodeFlagP(F, node) utZoneScopedNodeFlag(F, node) \
201 if (utZoneIsActive && node && utTraceFlag(NODE_PATHS)) { \
202 UT_StringHolder ___zonetext = node->getFullPath(); \
203 utZoneTextSH(___zonetext);}
205 #define utTraceViewportDrawEvent(viewport, event) utZoneScopedFlag(VIEWPORT); \
206 if (utZoneIsActive) { \
207 utZoneNameSH(UT_StringHolder(viewport)); \
208 utZoneTextSH(UT_StringHolder(event)); }
213 #define utTraceFlag(F) false
215 #define utZoneScopedFlag(F)
216 #define utZoneScopedFlagN(F, name)
217 #define utZoneScopedFlagS(F, depth)
218 #define utZoneScopedFlagNS(F, name, depth)
219 #define utZoneScopedBool(b)
222 #define utZoneScopedN(name)
223 #define utZoneScopedC(color)
224 #define utZoneScopedNC(name,color)
226 #define utZoneScopedS(depth)
227 #define utZoneScopedNS(name,depth)
228 #define utZoneScopedCS(color,depth)
229 #define utZoneScopedNCS(name,color,depth)
231 #define utZoneText(txt,size)
232 #define utZoneTextSH(sh)
233 #define utZoneName(name,size)
234 #define utZoneNameSH(sh)
235 #define utZoneColor(color)
236 #define utZoneValue(value)
237 #define utZoneIsActive false
240 #define utFrameMarkNamed(x)
242 #define utTracePlot(name,val)
243 #define utTracePlotConfigNum(name)
244 #define utTracePlotConfigMem(name)
245 #define utTracePlotConfigPct(name)
247 #define utTraceMessage(txt,size)
248 #define utTraceMessageSH(sh)
249 #define utTraceMessageL(txt)
250 #define utTraceMessageC(txt,size,color)
251 #define utTraceMessageSHC(sh,color)
252 #define utTraceMessageLC(txt,color)
254 #define utTraceMessageS(txt,size,depth)
255 #define utTraceMessageSHS(sh,depth)
256 #define utTraceMessageLS(txt,depth)
257 #define utTraceMessageCS(txt,size,color,d)
258 #define utTraceMessageSHCS(sh,color,d)
259 #define utTraceMessageLCS(txt,color,depth)
261 #define utTraceMessageFlag(F,txt,size)
262 #define utTraceMessageFlagSH(F,sh)
263 #define utTraceMessageFlagL(F,txt)
264 #define utTraceMessageFlagLC(F,txt,color)
265 #define utTraceMessageFlagC(F,txt,size,color)
266 #define utTraceMessageFlagSHC(F,sh,color)
268 #define utTraceMessageFlagS(F,txt,size,depth)
269 #define utTraceMessageFlagSHS(F,sh,depth)
270 #define utTraceMessageFlagLS(F,txt,depth)
271 #define utTraceMessageFlagLCS(F,txt,color,depth)
272 #define utTraceMessageFlagCS(F,txt,size,color,d)
273 #define utTraceMessageFlagSHCS(F,sh,color,d)
275 #define utTraceAlloc(ptr,size)
276 #define utTraceFree(ptr)
277 #define utTraceAllocN(ptr,size,name)
278 #define utTraceFreeN(ptr,name)
280 #define utTraceAllocS(ptr,size,depth)
281 #define utTraceFreeS(ptr,depth)
282 #define utTraceAllocNS(ptr,size,depth,name)
283 #define utTraceFreeNS(ptr,depth,name)
285 #define utTraceIsConnected false
286 #define utTraceIsStarted false
288 #define utZoneScopedNodeFlag(F, node)
289 #define utZoneScopedNodeFlagP(F, node)
291 #define utTraceViewportDrawEvent(viewport, event)
295 #endif // UT_ASSERT_H_INCLUDED
#define UT_NON_COPYABLE(CLASS)
Define deleted copy constructor and assignment operator inside a class.
auto get(const UT_ARTIterator< T > &it) -> decltype(it.key())