diff --git a/FEXCore/Source/Interface/Config/Config.json.in b/FEXCore/Source/Interface/Config/Config.json.in index b214a9efb..4ebfaee71 100644 --- a/FEXCore/Source/Interface/Config/Config.json.in +++ b/FEXCore/Source/Interface/Config/Config.json.in @@ -327,6 +327,13 @@ "Enables FEX's low-overhead sampling profile statistics.", "Requires a supported version of Mangohud to see the results" ] + }, + "TraceProfiler": { + "Type": "bool", + "Default": "false", + "Desc": [ + "Enables FEX's trace profiler. Using gpuvis or tracy" + ] } }, "Hacks": { diff --git a/Source/Tools/FEXInterpreter/FEXInterpreter.cpp b/Source/Tools/FEXInterpreter/FEXInterpreter.cpp index aca9e103c..ae57306a1 100644 --- a/Source/Tools/FEXInterpreter/FEXInterpreter.cpp +++ b/Source/Tools/FEXInterpreter/FEXInterpreter.cpp @@ -480,7 +480,12 @@ int main(int argc, char** argv, char** const envp) { free(data); } - FEXCore::Profiler::Init(Program.ProgramName, Program.ProgramPath); + { + FEX_CONFIG_OPT(TraceProfiler, TRACEPROFILER); + if (TraceProfiler()) { + FEXCore::Profiler::Init(Program.ProgramName, Program.ProgramPath); + } + } bool SupportsAVX {}; fextl::unique_ptr CTX; diff --git a/Source/Windows/ARM64EC/Module.cpp b/Source/Windows/ARM64EC/Module.cpp index 33b7538bd..1cf6720cf 100644 --- a/Source/Windows/ARM64EC/Module.cpp +++ b/Source/Windows/ARM64EC/Module.cpp @@ -640,7 +640,12 @@ NTSTATUS ProcessInit() { FEXCore::Config::Set(FEXCore::Config::CONFIG_IS64BIT_MODE, "1"); - FEXCore::Profiler::Init("", ""); + { + FEX_CONFIG_OPT(TraceProfiler, TRACEPROFILER); + if (TraceProfiler()) { + FEXCore::Profiler::Init("", ""); + } + } FEX_CONFIG_OPT(ExtendedVolatileMetadataConfig, EXTENDEDVOLATILEMETADATA); ExtendedMetaData = FEX::VolatileMetadata::ParseExtendedVolatileMetadata(ExtendedVolatileMetadataConfig()); diff --git a/Source/Windows/WOW64/Module.cpp b/Source/Windows/WOW64/Module.cpp index c5bd24721..b26bdfb03 100644 --- a/Source/Windows/WOW64/Module.cpp +++ b/Source/Windows/WOW64/Module.cpp @@ -516,7 +516,12 @@ void BTCpuProcessInit() { FEXCore::Config::Set(FEXCore::Config::CONFIG_INTERPRETER_INSTALLED, "0"); FEXCore::Config::Set(FEXCore::Config::CONFIG_IS64BIT_MODE, "0"); - FEXCore::Profiler::Init("", ""); + { + FEX_CONFIG_OPT(TraceProfiler, TRACEPROFILER); + if (TraceProfiler()) { + FEXCore::Profiler::Init("", ""); + } + } FEX_CONFIG_OPT(ExtendedVolatileMetadataConfig, EXTENDEDVOLATILEMETADATA); ExtendedMetaData = FEX::VolatileMetadata::ParseExtendedVolatileMetadata(ExtendedVolatileMetadataConfig());