Core: Add Apple Instruments support

This commit is contained in:
Stuart Carnie 2025-11-30 08:59:13 +11:00
parent 25203e24c4
commit 93b6348cfe
5 changed files with 131 additions and 19 deletions

View file

@ -210,6 +210,32 @@ void godot_cleanup_profiler() {
// Stub
}
#elif defined(GODOT_USE_INSTRUMENTS)
namespace apple::instruments {
os_log_t LOG;
os_log_t LOG_TRACING;
} // namespace apple::instruments
void godot_init_profiler() {
static bool initialized = false;
if (initialized) {
return;
}
initialized = true;
apple::instruments::LOG = os_log_create("org.godotengine.godot", OS_LOG_CATEGORY_POINTS_OF_INTEREST);
#ifdef INSTRUMENTS_SAMPLE_CALLSTACKS
apple::instruments::LOG_TRACING = os_log_create("org.godotengine.godot", OS_LOG_CATEGORY_DYNAMIC_STACK_TRACING);
#else
apple::instruments::LOG_TRACING = os_log_create("org.godotengine.godot", "tracing");
#endif
}
void godot_cleanup_profiler() {
}
#else
void godot_init_profiler() {
// Stub