diff options
-rw-r--r-- | src/jit/ee_il_dll.cpp | 15 | ||||
-rw-r--r-- | src/jit/jitconfigvalues.h | 1 |
2 files changed, 12 insertions, 4 deletions
diff --git a/src/jit/ee_il_dll.cpp b/src/jit/ee_il_dll.cpp index cf65bdbc52..85f9606d5e 100644 --- a/src/jit/ee_il_dll.cpp +++ b/src/jit/ee_il_dll.cpp @@ -80,9 +80,16 @@ extern "C" void __stdcall jitStartup(ICorJitHost* jitHost) assert(!JitConfig.isInitialized()); JitConfig.initialize(jitHost); -#if defined(_HOST_UNIX_) - jitstdout = procstdout(); -#else // !_HOST_UNIX_ +#ifdef DEBUG + const wchar_t* jitStdOutFile = JitConfig.JitStdOutFile(); + if (jitStdOutFile != nullptr) + { + jitstdout = _wfopen(jitStdOutFile, W("a")); + assert(jitstdout != nullptr); + } +#endif // DEBUG + +#if !defined(_HOST_UNIX_) if (jitstdout == nullptr) { int stdoutFd = _fileno(procstdout()); @@ -106,6 +113,7 @@ extern "C" void __stdcall jitStartup(ICorJitHost* jitHost) } } } +#endif // !_HOST_UNIX_ // If jitstdout is still null, fallback to whatever procstdout() was // initially set to. @@ -113,7 +121,6 @@ extern "C" void __stdcall jitStartup(ICorJitHost* jitHost) { jitstdout = procstdout(); } -#endif // !_HOST_UNIX_ #ifdef FEATURE_TRACELOGGING JitTelemetry::NotifyDllProcessAttach(); diff --git a/src/jit/jitconfigvalues.h b/src/jit/jitconfigvalues.h index 26c5ccc5f8..49b8c7a8ea 100644 --- a/src/jit/jitconfigvalues.h +++ b/src/jit/jitconfigvalues.h @@ -113,6 +113,7 @@ CONFIG_INTEGER(JitSplitFunctionSize, W("JitSplitFunctionSize"), 0) // On ARM, us CONFIG_INTEGER(JitSsaStress, W("JitSsaStress"), 0) // Perturb order of processing of blocks in SSA; 0 = no stress; 1 = // use method hash; * = supplied value as random hash CONFIG_INTEGER(JitStackChecks, W("JitStackChecks"), 0) +CONFIG_STRING(JitStdOutFile, W("JitStdOutFile")) // If set, sends JIT's stdout output to this file. CONFIG_INTEGER(JitStress, W("JitStress"), 0) // Internal Jit stress mode: 0 = no stress, 2 = all stress, other = vary // stress based on a hash of the method and this value CONFIG_INTEGER(JitStressBBProf, W("JitStressBBProf"), 0) // Internal Jit stress mode |