diff --git a/src/coreclr/vm/ClrEtwAll.man b/src/coreclr/vm/ClrEtwAll.man index cc2bf3cfa8db67..cb7694234b5f0f 100644 --- a/src/coreclr/vm/ClrEtwAll.man +++ b/src/coreclr/vm/ClrEtwAll.man @@ -680,6 +680,8 @@ + + @@ -4365,6 +4367,8 @@ + + @@ -8865,6 +8869,8 @@ + + @@ -8934,6 +8940,8 @@ + + diff --git a/src/coreclr/vm/eeconfig.cpp b/src/coreclr/vm/eeconfig.cpp index ce8e2691940bc1..883d602b1f2309 100644 --- a/src/coreclr/vm/eeconfig.cpp +++ b/src/coreclr/vm/eeconfig.cpp @@ -241,6 +241,10 @@ HRESULT EEConfig::Init() fTieredPGO = false; #endif +#if defined(FEATURE_READYTORUN) + fReadyToRun = false; +#endif + #if defined(FEATURE_ON_STACK_REPLACEMENT) dwOSR_HitLimit = 10; dwOSR_CounterBump = 5000; @@ -476,8 +480,11 @@ HRESULT EEConfig::sync() } pReadyToRunExcludeList = NULL; + #if defined(FEATURE_READYTORUN) - if (ReadyToRunInfo::IsReadyToRunEnabled()) + fReadyToRun = CLRConfig::GetConfigValue(CLRConfig::EXTERNAL_ReadyToRun); + + if (fReadyToRun) { NewArrayHolder wszReadyToRunExcludeList; IfFailRet(CLRConfig::GetConfigValue(CLRConfig::EXTERNAL_ReadyToRunExcludeList, &wszReadyToRunExcludeList)); @@ -692,6 +699,10 @@ HRESULT EEConfig::sync() dwSleepOnExit = CLRConfig::GetConfigValue(CLRConfig::UNSUPPORTED_SleepOnExit); +#if defined(FEATURE_PGO) + fTieredPGO = Configuration::GetKnobBooleanValue(W("System.Runtime.TieredPGO"), CLRConfig::EXTERNAL_TieredPGO); +#endif + #if defined(FEATURE_TIERED_COMPILATION) fTieredCompilation = Configuration::GetKnobBooleanValue(W("System.Runtime.TieredCompilation"), CLRConfig::EXTERNAL_TieredCompilation); if (fTieredCompilation) @@ -773,10 +784,6 @@ HRESULT EEConfig::sync() } #endif -#if defined(FEATURE_PGO) - fTieredPGO = Configuration::GetKnobBooleanValue(W("System.Runtime.TieredPGO"), CLRConfig::EXTERNAL_TieredPGO); -#endif - #if defined(FEATURE_ON_STACK_REPLACEMENT) dwOSR_HitLimit = CLRConfig::GetConfigValue(CLRConfig::INTERNAL_OSR_HitLimit); dwOSR_CounterBump = CLRConfig::GetConfigValue(CLRConfig::INTERNAL_OSR_CounterBump); diff --git a/src/coreclr/vm/eeconfig.h b/src/coreclr/vm/eeconfig.h index 0cb79d7f85fdcf..4651cf1bc84e0f 100644 --- a/src/coreclr/vm/eeconfig.h +++ b/src/coreclr/vm/eeconfig.h @@ -94,6 +94,10 @@ class EEConfig bool TieredPGO(void) const { LIMITED_METHOD_CONTRACT; return fTieredPGO; } #endif +#if defined(FEATURE_READYTORUN) + bool ReadyToRun(void) const { LIMITED_METHOD_CONTRACT; return fReadyToRun; } +#endif + #if defined(FEATURE_ON_STACK_REPLACEMENT) // OSR Config DWORD OSR_CounterBump() const { LIMITED_METHOD_CONTRACT; return dwOSR_CounterBump; } @@ -656,6 +660,10 @@ class EEConfig bool fTieredPGO; #endif +#if defined(FEATURE_READYTORUN) + bool fReadyToRun; +#endif + #if defined(FEATURE_ON_STACK_REPLACEMENT) DWORD dwOSR_HitLimit; DWORD dwOSR_CounterBump; diff --git a/src/coreclr/vm/eventtrace.cpp b/src/coreclr/vm/eventtrace.cpp index 17d31229ccdd57..26602a6831c3c1 100644 --- a/src/coreclr/vm/eventtrace.cpp +++ b/src/coreclr/vm/eventtrace.cpp @@ -7636,6 +7636,8 @@ void ETW::CompilationLog::TieredCompilation::GetSettings(UINT32 *flagsRef) None = 0x0, QuickJit = 0x1, QuickJitForLoops = 0x2, + TieredPGO = 0x4, + ReadyToRun = 0x8, }; UINT32 flags = (UINT32)Flags::None; @@ -7647,6 +7649,18 @@ void ETW::CompilationLog::TieredCompilation::GetSettings(UINT32 *flagsRef) flags |= (UINT32)Flags::QuickJitForLoops; } } +#ifdef FEATURE_PGO + if (g_pConfig->TieredPGO()) + { + flags |= (UINT32)Flags::TieredPGO; + } +#endif +#ifdef FEATURE_READYTORUN + if (g_pConfig->ReadyToRun()) + { + flags |= (UINT32)Flags::ReadyToRun; + } +#endif *flagsRef = flags; } diff --git a/src/coreclr/vm/readytoruninfo.cpp b/src/coreclr/vm/readytoruninfo.cpp index 353fd931c80c65..44535080cbf018 100644 --- a/src/coreclr/vm/readytoruninfo.cpp +++ b/src/coreclr/vm/readytoruninfo.cpp @@ -380,14 +380,6 @@ void ReadyToRunInfo::SetMethodDescForEntryPointInNativeImage(PCODE entryPoint, M } } -BOOL ReadyToRunInfo::IsReadyToRunEnabled() -{ - WRAPPER_NO_CONTRACT; - - static ConfigDWORD configReadyToRun; - return configReadyToRun.val(CLRConfig::EXTERNAL_ReadyToRun); -} - // A log file to record success/failure of R2R loads. s_r2rLogFile can have the following values: // -1: Logging not yet initialized. // NULL: Logging disabled. @@ -414,7 +406,7 @@ static void LogR2r(const char *msg, PEAssembly *pPEAssembly) else r2rLogFile = NULL; - if (r2rLogFile != NULL && !ReadyToRunInfo::IsReadyToRunEnabled()) + if (r2rLogFile != NULL && !g_pConfig->ReadyToRun()) { fputs("Ready to Run not enabled.\n", r2rLogFile); fclose(r2rLogFile); @@ -518,7 +510,7 @@ PTR_ReadyToRunInfo ReadyToRunInfo::Initialize(Module * pModule, AllocMemTracker PEAssembly * pFile = pModule->GetPEAssembly(); - if (!IsReadyToRunEnabled()) + if (!g_pConfig->ReadyToRun()) { // Log message is ignored in this case. DoLog(NULL); diff --git a/src/coreclr/vm/readytoruninfo.h b/src/coreclr/vm/readytoruninfo.h index 0d9a0097858cce..ca5950a530f26d 100644 --- a/src/coreclr/vm/readytoruninfo.h +++ b/src/coreclr/vm/readytoruninfo.h @@ -92,8 +92,6 @@ class ReadyToRunInfo public: ReadyToRunInfo(Module * pModule, LoaderAllocator* pLoaderAllocator, PEImageLayout * pLayout, READYTORUN_HEADER * pHeader, NativeImage * pNativeImage, AllocMemTracker *pamTracker); - static BOOL IsReadyToRunEnabled(); - static PTR_ReadyToRunInfo ComputeAlternateGenericLocationForR2RCode(MethodDesc *pMethod); static PTR_ReadyToRunInfo GetUnrelatedR2RModules(); PTR_ReadyToRunInfo GetNextUnrelatedR2RModule() { LIMITED_METHOD_CONTRACT; return m_pNextR2RForUnrelatedCode; }