diff options
author | Koundinya Veluri <kouvel@users.noreply.github.com> | 2019-05-23 10:49:10 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-05-23 10:49:10 -0700 |
commit | 61a02edb7fb443b92f0682a00c42200def2bd33a (patch) | |
tree | 7a40753df7c7935d0bddb05688d1c96b498d26d1 /src/vm/method.cpp | |
parent | 9271757d2c917c5650c459a4c3fa648c2968a591 (diff) | |
download | coreclr-61a02edb7fb443b92f0682a00c42200def2bd33a.tar.gz coreclr-61a02edb7fb443b92f0682a00c42200def2bd33a.tar.bz2 coreclr-61a02edb7fb443b92f0682a00c42200def2bd33a.zip |
Add some perf events/data for tiered compilation (#24607)
Add some perf events/data for tiered compilation
New events:
- `Settings` - Sent when TC is enabled
- `Flags` - Currently indicates whether QuickJit and QuickJitForLoops are enabled
- `Pause` - Sent when TC is paused (due to a new method being called for the first time)
- `Resume` - Sent when TC resumes
- `NewMethodCount` - Number of methods called for the first time while tiering was paused
- `BackgroundJitStart` - Sent when starting to JIT methods in the background
- `PendingMethodCount` - Number of methods currently scheduled for background JIT
- `BackgroundJitStop` - Sent when background jitting stops
- `PendingMethodCount` - Same as above. When 0, background jitting has completed.
- `JittedMethodCount` - Number of methods jitted in the background since the previous BackgroundJitStart event on the same thread
Miscellaneous:
- Updated method JIT events to include the optimization tier
- Added a couple more cases where tiered compilation is disabled for methods that have JIT optimization disabled for some reason
- Renamed `Duration` field of the new version of the `ContentionEnd` to `DurationNs` to indicate the units of time
- Added `OptimizationTierOptimized` to `NativeCodeVersion::OptimizationTier` to distinguish it from `OptimizationTier1`. `OptimizationTierOptimized` is now used for methods that QuickJit is disabled for, and does not send the tier 1 flag.
- For info about the code being generated by the JIT, added info to `PrepareCodeConfig` and stored a pointer to it on the thread object for the current JIT invocation. Info is updated in `PrepareCodeConfig` and used for updating the tier on the code version and for sending the ETL event.
- If the JIT decides to use MinOpt when `MethodDesc::IsJitOptimizationDisabled()` is false, the info is not stored. The runtime method event will reflect the JIT's choice, the rundown event will not.
- Updated to show optimization tiers in SOS similarly to PerfView
Diffstat (limited to 'src/vm/method.cpp')
-rw-r--r-- | src/vm/method.cpp | 28 |
1 files changed, 23 insertions, 5 deletions
diff --git a/src/vm/method.cpp b/src/vm/method.cpp index d8688e14a4..06cdc06c00 100644 --- a/src/vm/method.cpp +++ b/src/vm/method.cpp @@ -4802,12 +4802,12 @@ bool MethodDesc::DetermineAndSetIsEligibleForTieredCompilation() // Functional requirement CodeVersionManager::IsMethodSupported(this) && - // Policy - If quick JIT is disabled for the startup tier and the module is not ReadyToRun, the method would effectively - // not be tiered currently, so make the method ineligible for tiering to avoid some unnecessary overhead - (g_pConfig->TieredCompilation_QuickJit() || GetModule()->IsReadyToRun()) && + // Policy - If QuickJit is disabled and the module does not have any pregenerated code, the method would effectively not + // be tiered currently, so make the method ineligible for tiering to avoid some unnecessary overhead + (g_pConfig->TieredCompilation_QuickJit() || GetModule()->HasNativeOrReadyToRunImage()) && - // Policy - Debugging works much better with unoptimized code - !CORDisableJITOptimizations(GetModule()->GetDebuggerInfoBits()) && + // Policy - Generating optimized code is not disabled + !IsJitOptimizationDisabled() && // Policy - Tiered compilation is not disabled by the profiler !CORProfilerDisableTieredCompilation()) @@ -4821,6 +4821,24 @@ bool MethodDesc::DetermineAndSetIsEligibleForTieredCompilation() return false; } +#endif // !DACCESS_COMPILE + +#ifndef CROSSGEN_COMPILE +bool MethodDesc::IsJitOptimizationDisabled() +{ + WRAPPER_NO_CONTRACT; + + return + g_pConfig->JitMinOpts() || +#ifdef _DEBUG + g_pConfig->GenDebuggableCode() || +#endif + CORDisableJITOptimizations(GetModule()->GetDebuggerInfoBits()) || + (!IsNoMetadata() && IsMiNoOptimization(GetImplAttrs())); +} +#endif + +#ifndef DACCESS_COMPILE #ifndef CROSSGEN_COMPILE void MethodDesc::RecordAndBackpatchEntryPointSlot( |