Add some perf events/data for tiered compilation (dotnet/coreclr#24607)
authorKoundinya Veluri <kouvel@users.noreply.github.com>
Thu, 23 May 2019 17:49:10 +0000 (10:49 -0700)
committerGitHub <noreply@github.com>
Thu, 23 May 2019 17:49:10 +0000 (10:49 -0700)
commit3f57fb2ce080cd365e3423acbb0b17929a18c015
tree707e9b566c89064f517eaef3b502b73e1caeff98
parent71583aa9c14947bae483c924ed55b3f6963af02f
Add some perf events/data for tiered compilation (dotnet/coreclr#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

Commit migrated from https://github.com/dotnet/coreclr/commit/61a02edb7fb443b92f0682a00c42200def2bd33a
27 files changed:
src/coreclr/src/ToolBox/SOS/Strike/util.cpp
src/coreclr/src/debug/daccess/request.cpp
src/coreclr/src/inc/corinfo.h
src/coreclr/src/inc/dacprivate.h
src/coreclr/src/inc/eventtracebase.h
src/coreclr/src/jit/compiler.cpp
src/coreclr/src/jit/compiler.h
src/coreclr/src/jit/flowgraph.cpp
src/coreclr/src/vm/ClrEtwAll.man
src/coreclr/src/vm/ClrEtwAllMeta.lst
src/coreclr/src/vm/callcounter.cpp
src/coreclr/src/vm/callcounter.h
src/coreclr/src/vm/codeversion.h
src/coreclr/src/vm/common.h
src/coreclr/src/vm/eeconfig.cpp
src/coreclr/src/vm/eventtrace.cpp
src/coreclr/src/vm/eventtrace.inl [new file with mode: 0644]
src/coreclr/src/vm/jitinterface.cpp
src/coreclr/src/vm/method.cpp
src/coreclr/src/vm/method.hpp
src/coreclr/src/vm/methodtablebuilder.cpp
src/coreclr/src/vm/prestub.cpp
src/coreclr/src/vm/threads.cpp
src/coreclr/src/vm/threads.h
src/coreclr/src/vm/threads.inl
src/coreclr/src/vm/tieredcompilation.cpp
src/coreclr/src/vm/tieredcompilation.h