diff options
author | Jiyoung Yun <jy910.yun@samsung.com> | 2016-11-23 19:09:09 +0900 |
---|---|---|
committer | Jiyoung Yun <jy910.yun@samsung.com> | 2016-11-23 19:09:09 +0900 |
commit | 4b4aad7217d3292650e77eec2cf4c198ea9c3b4b (patch) | |
tree | 98110734c91668dfdbb126fcc0e15ddbd93738ca /src/jit/jittelemetry.h | |
parent | fa45f57ed55137c75ac870356a1b8f76c84b229c (diff) | |
download | coreclr-4b4aad7217d3292650e77eec2cf4c198ea9c3b4b.tar.gz coreclr-4b4aad7217d3292650e77eec2cf4c198ea9c3b4b.tar.bz2 coreclr-4b4aad7217d3292650e77eec2cf4c198ea9c3b4b.zip |
Imported Upstream version 1.1.0upstream/1.1.0
Diffstat (limited to 'src/jit/jittelemetry.h')
-rw-r--r-- | src/jit/jittelemetry.h | 78 |
1 files changed, 78 insertions, 0 deletions
diff --git a/src/jit/jittelemetry.h b/src/jit/jittelemetry.h new file mode 100644 index 0000000000..24a0ce7b5d --- /dev/null +++ b/src/jit/jittelemetry.h @@ -0,0 +1,78 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +/*****************************************************************************/ +// <OWNER>clrjit</OWNER> +#pragma once + +#ifdef FEATURE_TRACELOGGING + +class Compiler; + +class JitTelemetry +{ +public: + // Notify DLL load. + static void NotifyDllProcessAttach(); + + // Notify DLL unload. + static void NotifyDllProcessDetach(); + + // Constructor + JitTelemetry(); + + // Initialize with compiler instance + void Initialize(Compiler* comp); + + // Notification of end of compilation of the current method. + void NotifyEndOfCompilation(); + + // Notification of noway_assert. + void NotifyNowayAssert(const char* filename, unsigned line); + + // Is telemetry enabled through COMPlus_JitTelemetry? + static bool IsTelemetryEnabled(); + +private: + // Obtain current method information from VM and cache for + // future uses. + void CacheCurrentMethodInfo(); + + // + //-------------------------------------------------------------------------------- + // The below per process counters are updated without synchronization or + // thread-safety to avoid interfering with the JIT throughput. Accuracy + // of these counters will be traded-off for throughput. + // + + // Methods compiled per DLL unload + static volatile UINT32 s_uMethodsCompiled; + + // Methods compiled per DLL unload that hit noway assert (per process) + static volatile UINT32 s_uMethodsHitNowayAssert; + //-------------------------------------------------------------------------------- + + // Has the provider been registered already (per process) + static volatile bool s_fProviderRegistered; + + // Cached value of current method hash. + unsigned m_uMethodHash; + + // Cached value of current assembly name. + const char* m_pszAssemblyName; + + // Cached value of current scope name, i.e., "Program.Foo" in "Program.Foo:Main" + const char* m_pszScopeName; + + // Cached value of current method name, i.e., "Main" in "Program.Foo:Main" + const char* m_pszMethodName; + + // Have we already cached the method/scope/assembly names? + bool m_fMethodInfoCached; + + // Compiler instance. + Compiler* comp; +}; + +#endif // FEATURE_TRACELOGGING |