@@ -46,8 +46,10 @@ def find_tracy_path(path: pathlib.Path) -> pathlib.Path:
4646
4747if env ["profiler" ]:
4848 if env ["profiler" ] == "instruments" :
49- # Nothing else to do for Instruments.
50- pass
49+ if env ["profiler_sample_callstack" ]:
50+ print ("profiler_sample_callstack ignored. Please configure callstack sampling in Instruments instead." )
51+ if env ["profiler_track_memory" ]:
52+ print ("profiler_track_memory ignored. Please configure memory tracking in Instruments instead." )
5153 elif env ["profiler" ] == "tracy" :
5254 if not env ["profiler_path" ]:
5355 print ("profiler_path must be set when using the tracy profiler. Aborting." )
@@ -65,6 +67,8 @@ if env["profiler"]:
6567
6668 # 62 is the maximum supported callstack depth reported by the tracy docs.
6769 env_tracy .Append (CPPDEFINES = [("TRACY_CALLSTACK" , 62 )])
70+ if env ["profiler_track_memory" ]:
71+ env_tracy .Append (CPPDEFINES = ["GODOT_PROFILER_TRACK_MEMORY" ])
6872 env_tracy .disable_warnings ()
6973 env_tracy .add_source_files (env .core_sources , str ((profiler_path / "TracyClient.cpp" ).absolute ()))
7074 elif env ["profiler" ] == "perfetto" :
@@ -78,11 +82,18 @@ if env["profiler"]:
7882 if env ["profiler_sample_callstack" ]:
7983 print ("Perfetto does not support call stack sampling. Aborting." )
8084 Exit (255 )
85+ if env ["profiler_track_memory" ]:
86+ print ("Perfetto does not support memory tracking. Aborting." )
87+ Exit (255 )
8188 env_perfetto .disable_warnings ()
8289 env_perfetto .Prepend (CPPPATH = [str (profiler_path .absolute ())])
8390 env_perfetto .add_source_files (env .core_sources , str ((profiler_path / "perfetto.cc" ).absolute ()))
8491elif env ["profiler_path" ]:
8592 print ("profiler is required if profiler_path is set. Aborting." )
8693 Exit (255 )
8794
88- env .CommandNoCache ("profiling.gen.h" , [env .Value (env ["profiler" ])], env .Run (profiling_builders .profiler_gen_builder ))
95+ env .CommandNoCache (
96+ "profiling.gen.h" ,
97+ [env .Value (env ["profiler" ]), env .Value (env ["profiler_sample_callstack" ]), env .Value (env ["profiler_track_memory" ])],
98+ env .Run (profiling_builders .profiler_gen_builder ),
99+ )
0 commit comments