COR_PRF_HIGH_MONITOR_DYNAMIC_FUNCTION_UNLOADS = 0x00000004,
+ COR_PRF_HIGH_DISABLE_TIERED_COMPILATION = 0x00000008,
+
COR_PRF_HIGH_REQUIRE_PROFILE_IMAGE = 0,
COR_PRF_HIGH_ALLOWABLE_AFTER_ATTACH = COR_PRF_HIGH_IN_MEMORY_SYMBOLS_UPDATED | COR_PRF_HIGH_MONITOR_DYNAMIC_FUNCTION_UNLOADS,
// MONITOR_IMMUTABLE represents all flags that may only be set during initialization.
// Trying to change any of these flags elsewhere will result in a
// failed HRESULT.
- COR_PRF_HIGH_MONITOR_IMMUTABLE = 0,
+ COR_PRF_HIGH_MONITOR_IMMUTABLE = COR_PRF_HIGH_DISABLE_TIERED_COMPILATION,
} COR_PRF_HIGH_MONITOR;
((&g_profControlBlock)->dwEventMaskHigh & COR_PRF_HIGH_MONITOR_DYNAMIC_FUNCTION_UNLOADS));
}
+inline BOOL CORProfilerDisableTieredCompilation()
+{
+ CONTRACTL
+ {
+ NOTHROW;
+ GC_NOTRIGGER;
+ CANNOT_TAKE_LOCK;
+ SO_NOT_MAINLINE;
+ }
+ CONTRACTL_END;
+
+
+ return (CORProfilerPresent() &&
+ ((&g_profControlBlock)->dwEventMaskHigh & COR_PRF_HIGH_DISABLE_TIERED_COMPILATION));
+}
+
#if defined(PROFILING_SUPPORTED) && !defined(CROSSGEN_COMPILE)
#if defined(FEATURE_PROFAPI_ATTACH_DETACH)
COR_PRF_HIGH_ADD_ASSEMBLY_REFERENCES = 0x1,
COR_PRF_HIGH_IN_MEMORY_SYMBOLS_UPDATED = 0x2,
COR_PRF_HIGH_MONITOR_DYNAMIC_FUNCTION_UNLOADS = 0x4,
+ COR_PRF_HIGH_DISABLE_TIERED_COMPILATION = 0x8,
COR_PRF_HIGH_REQUIRE_PROFILE_IMAGE = 0,
COR_PRF_HIGH_ALLOWABLE_AFTER_ATTACH = ( COR_PRF_HIGH_IN_MEMORY_SYMBOLS_UPDATED | COR_PRF_HIGH_MONITOR_DYNAMIC_FUNCTION_UNLOADS ) ,
- COR_PRF_HIGH_MONITOR_IMMUTABLE = 0
+ COR_PRF_HIGH_MONITOR_IMMUTABLE = ( COR_PRF_HIGH_DISABLE_TIERED_COMPILATION )
} COR_PRF_HIGH_MONITOR;
typedef /* [public] */
{
LIMITED_METHOD_CONTRACT;
- if ((g_profControlBlock.dwEventMask & COR_PRF_MONITOR_IMMUTABLE) != 0)
+ if (((g_profControlBlock.dwEventMask & COR_PRF_MONITOR_IMMUTABLE) != 0) ||
+ ((g_profControlBlock.dwEventMaskHigh & COR_PRF_HIGH_MONITOR_IMMUTABLE) != 0))
{
LOG((
LF_CORPROF,
if (g_profControlBlock.curProfStatus.Get() != kProfStatusInitializingForStartupLoad)
{
#ifdef _DEBUG
- if ((dwEventMask & dwImmutableEventFlags) !=
- (g_profControlBlock.dwEventMask & dwImmutableEventFlags))
+ if (((dwEventMask & dwImmutableEventFlags) !=
+ (g_profControlBlock.dwEventMask & dwImmutableEventFlags)) ||
#else //!_DEBUG
- if ((dwEventMask & COR_PRF_MONITOR_IMMUTABLE) !=
- (g_profControlBlock.dwEventMask & COR_PRF_MONITOR_IMMUTABLE))
+ if (((dwEventMask & COR_PRF_MONITOR_IMMUTABLE) !=
+ (g_profControlBlock.dwEventMask & COR_PRF_MONITOR_IMMUTABLE)) ||
#endif //_DEBUG
+ ((dwEventMaskHigh & COR_PRF_HIGH_MONITOR_IMMUTABLE) !=
+ (g_profControlBlock.dwEventMaskHigh & COR_PRF_HIGH_MONITOR_IMMUTABLE)))
{
// FUTURE: Should we have a dedicated HRESULT for setting immutable flag?
return E_FAIL;
// allowable after an attach
if (m_fLoadedViaAttach &&
#ifdef _DEBUG
- ((dwEventMask & (~dwAllowableAfterAttachEventFlags)) != 0))
+ (((dwEventMask & (~dwAllowableAfterAttachEventFlags)) != 0) ||
#else //!_DEBUG
- ((dwEventMask & (~COR_PRF_ALLOWABLE_AFTER_ATTACH)) != 0))
+ (((dwEventMask & (~COR_PRF_ALLOWABLE_AFTER_ATTACH)) != 0) ||
#endif //_DEBUG
+ (dwEventMaskHigh & (~COR_PRF_HIGH_ALLOWABLE_AFTER_ATTACH))))
{
return CORPROF_E_UNSUPPORTED_FOR_ATTACHING_PROFILER;
}
!IsUnboxingStub() &&
!IsInstantiatingStub() &&
!IsDynamicMethod() &&
- !CORDisableJITOptimizations(GetModule()->GetDebuggerInfoBits());
+ !CORDisableJITOptimizations(GetModule()->GetDebuggerInfoBits()) &&
+ !CORProfilerDisableTieredCompilation();
}
#endif