diff options
author | Sung Yoon Whang <suwhang@microsoft.com> | 2019-06-20 16:33:51 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-06-20 16:33:51 -0700 |
commit | 9bd2787a9dd2aa4d2b7d4f72afebc3dbe896e896 (patch) | |
tree | 712b8829d3aa9d9d9ac936c8f4b914503bdcdae7 /src | |
parent | 05a557349f6c60f014f708282762168a8ba093e0 (diff) | |
download | coreclr-9bd2787a9dd2aa4d2b7d4f72afebc3dbe896e896.tar.gz coreclr-9bd2787a9dd2aa4d2b7d4f72afebc3dbe896e896.tar.bz2 coreclr-9bd2787a9dd2aa4d2b7d4f72afebc3dbe896e896.zip |
Fix eventpipe filtering (#25221)
* Add DOTNET_TRACE_CONTEXT and change macros to use DOTNET_TRACE_CONTEXT instead of MCGEN_TRACE_CONTEXT
* Fixing macro definitions
* eventing codegen scripts now generates EventPipe trace contexts
* Fix macros to use the EVENTPIPE_TRACE_Context
* Fix linux build
* Fix windows build
* Update Eventpipe provider context at EtwCallbackComon
* break in switch
* Update rundown provider context manually
* PR feedback
* Eventpipe->EventPipe
* cleanup in codegen script
Diffstat (limited to 'src')
-rw-r--r-- | src/inc/eventtracebase.h | 64 | ||||
-rw-r--r-- | src/scripts/genEventing.py | 137 | ||||
-rw-r--r-- | src/vm/ceeload.cpp | 2 | ||||
-rw-r--r-- | src/vm/comcallablewrapper.cpp | 2 | ||||
-rw-r--r-- | src/vm/comsynchronizable.cpp | 4 | ||||
-rw-r--r-- | src/vm/comthreadpool.cpp | 2 | ||||
-rw-r--r-- | src/vm/dllimport.cpp | 2 | ||||
-rw-r--r-- | src/vm/eepolicy.cpp | 4 | ||||
-rw-r--r-- | src/vm/eventpipesession.cpp | 5 | ||||
-rw-r--r-- | src/vm/eventtrace.cpp | 236 | ||||
-rw-r--r-- | src/vm/eventtrace.inl | 4 | ||||
-rw-r--r-- | src/vm/excep.cpp | 2 | ||||
-rw-r--r-- | src/vm/jithelpers.cpp | 2 | ||||
-rw-r--r-- | src/vm/jitinterface.cpp | 4 | ||||
-rw-r--r-- | src/vm/multicorejitplayer.cpp | 8 | ||||
-rw-r--r-- | src/vm/nativeoverlapped.cpp | 4 | ||||
-rw-r--r-- | src/vm/prestub.cpp | 2 | ||||
-rw-r--r-- | src/vm/proftoeeinterfaceimpl.cpp | 4 | ||||
-rw-r--r-- | src/vm/readytoruninfo.cpp | 2 | ||||
-rw-r--r-- | src/vm/syncblk.cpp | 2 | ||||
-rw-r--r-- | src/vm/threadpoolrequest.cpp | 4 | ||||
-rw-r--r-- | src/vm/win32threadpool.cpp | 6 |
22 files changed, 359 insertions, 143 deletions
diff --git a/src/inc/eventtracebase.h b/src/inc/eventtracebase.h index c38abe2b77..aad69b9b41 100644 --- a/src/inc/eventtracebase.h +++ b/src/inc/eventtracebase.h @@ -79,14 +79,14 @@ enum EtwThreadFlags // if the fields in the event are not cheap to calculate // #define ETW_EVENT_ENABLED(Context, EventDescriptor) \ - ((MCGEN_ENABLE_CHECK(Context, EventDescriptor)) || EVENT_PIPE_ENABLED()) + ((MCGEN_ENABLE_CHECK(Context.EtwProvider, EventDescriptor)) || EventPipeHelper::IsEnabled(Context, EventDescriptor.Level, EventDescriptor.Keyword)) // // Use this macro to check if a category of events is enabled // #define ETW_CATEGORY_ENABLED(Context, Level, Keyword) \ - ((Context.IsEnabled && McGenEventProviderEnabled(&Context, Level, Keyword)) || EVENT_PIPE_ENABLED()) + ((Context.EtwProvider.IsEnabled && McGenEventProviderEnabled(&(Context.EtwProvider), Level, Keyword)) || EventPipeHelper::IsEnabled(Context, Level, Keyword)) // This macro only checks if a provider is enabled @@ -95,17 +95,20 @@ enum EtwThreadFlags ((ProviderSymbol##_Context.IsEnabled) || EVENT_PIPE_ENABLED()) -#else //defined(FEATURE_PAL) +#else //!defined(FEATURE_PAL) #if defined(FEATURE_PERFTRACING) #define ETW_INLINE #define ETWOnStartup(StartEventName, EndEventName) #define ETWFireEvent(EventName) #define ETW_TRACING_INITIALIZED(RegHandle) (TRUE) -#define ETW_EVENT_ENABLED(Context, EventDescriptor) (EventPipeHelper::Enabled() || XplatEventLogger::IsEventLoggingEnabled()) -#define ETW_CATEGORY_ENABLED(Context, Level, Keyword) (EventPipeHelper::Enabled() || XplatEventLogger::IsEventLoggingEnabled()) +#define ETW_EVENT_ENABLED(Context, EventDescriptor) (EventPipeHelper::IsEnabled(Context, EventDescriptor.Level, EventDescriptor.Keyword) || \ + (XplatEventLogger::IsEventLoggingEnabled())) +#define ETW_CATEGORY_ENABLED(Context, Level, Keyword) (EventPipeHelper::IsEnabled(Context, Level, Keyword) || \ + (XplatEventLogger::IsEventLoggingEnabled()) #define ETW_TRACING_ENABLED(Context, EventDescriptor) (EventEnabled##EventDescriptor()) -#define ETW_TRACING_CATEGORY_ENABLED(Context, Level, Keyword) (EventPipeHelper::Enabled() || XplatEventLogger::IsEventLoggingEnabled()) +#define ETW_TRACING_CATEGORY_ENABLED(Context, Level, Keyword) (EventPipeHelper::IsEnabled(Context, Level, Keyword) || \ + (XplatEventLogger::IsEventLoggingEnabled())) #define ETW_PROVIDER_ENABLED(ProviderSymbol) (TRUE) #else //defined(FEATURE_PERFTRACING) #define ETW_INLINE @@ -113,8 +116,8 @@ enum EtwThreadFlags #define ETWFireEvent(EventName) #define ETW_TRACING_INITIALIZED(RegHandle) (TRUE) -#define ETW_EVENT_ENABLED(Context, EventDescriptor) (XplatEventLogger::IsEventLoggingEnabled()) #define ETW_CATEGORY_ENABLED(Context, Level, Keyword) (XplatEventLogger::IsEventLoggingEnabled()) +#define ETW_EVENT_ENABLED(Context, EventDescriptor) (XplatEventLogger::IsEventLoggingEnabled()) #define ETW_TRACING_ENABLED(Context, EventDescriptor) (EventEnabled##EventDescriptor()) #define ETW_TRACING_CATEGORY_ENABLED(Context, Level, Keyword) (XplatEventLogger::IsEventLoggingEnabled()) #define ETW_PROVIDER_ENABLED(ProviderSymbol) (TRUE) @@ -175,7 +178,8 @@ struct ProfilingScanContext; // Use this macro to check if ETW is initialized and the event is enabled // #define ETW_TRACING_ENABLED(Context, EventDescriptor) \ - ((Context.IsEnabled && ETW_TRACING_INITIALIZED(Context.RegistrationHandle) && ETW_EVENT_ENABLED(Context, EventDescriptor)) || EVENT_PIPE_ENABLED()) + ((Context.EtwProvider.IsEnabled && ETW_TRACING_INITIALIZED(Context.EtwProvider.RegistrationHandle) && ETW_EVENT_ENABLED(Context, EventDescriptor))|| \ + EventPipeHelper::IsEnabled(Context, EventDescriptor.Level, EventDescriptor.Keyword)) // // Using KEYWORDZERO means when checking the events category ignore the keyword @@ -186,12 +190,12 @@ struct ProfilingScanContext; // Use this macro to check if ETW is initialized and the category is enabled // #define ETW_TRACING_CATEGORY_ENABLED(Context, Level, Keyword) \ - ((ETW_TRACING_INITIALIZED(Context.RegistrationHandle) && ETW_CATEGORY_ENABLED(Context, Level, Keyword)) || EVENT_PIPE_ENABLED()) + (ETW_TRACING_INITIALIZED(Context.EtwProvider.RegistrationHandle) && ETW_CATEGORY_ENABLED(Context, Level, Keyword)) - #define ETWOnStartup(StartEventName, EndEventName) \ - ETWTraceStartup trace##StartEventName##(Microsoft_Windows_DotNETRuntimePrivateHandle, &StartEventName, &StartupId, &EndEventName, &StartupId); - #define ETWFireEvent(EventName) \ - ETWTraceStartup::StartupTraceEvent(Microsoft_Windows_DotNETRuntimePrivateHandle, &EventName, &StartupId); +#define ETWOnStartup(StartEventName, EndEventName) \ + ETWTraceStartup trace##StartEventName##(Microsoft_Windows_DotNETRuntimePrivateHandle, &StartEventName, &StartupId, &EndEventName, &StartupId); +#define ETWFireEvent(EventName) \ + ETWTraceStartup::StartupTraceEvent(Microsoft_Windows_DotNETRuntimePrivateHandle, &EventName, &StartupId); #ifndef FEATURE_REDHAWK // Headers @@ -217,14 +221,24 @@ struct ProfilingScanContext; extern UINT32 g_nClrInstanceId; #define GetClrInstanceId() (static_cast<UINT16>(g_nClrInstanceId)) +#if defined(FEATURE_PAL) && (defined(FEATURE_EVENT_TRACE) || defined(FEATURE_EVENTSOURCE_XPLAT)) +#define KEYWORDZERO 0x0 + +/***************************************/ +/* Tracing levels supported by CLR ETW */ +/***************************************/ +#define MAX_TRACE_LEVEL 6 // Maximum Number of Trace Levels supported +#define TRACE_LEVEL_FATAL 1 // Abnormal exit or termination +#define TRACE_LEVEL_ERROR 2 // Severe errors that need logging +#define TRACE_LEVEL_WARNING 3 // Warnings such as allocation failure +#define TRACE_LEVEL_INFORMATION 4 // Includes non-error cases such as Entry-Exit +#define TRACE_LEVEL_VERBOSE 5 // Detailed traces from intermediate steps + +#define DEF_LTTNG_KEYWORD_ENABLED 1 +#include "clrproviders.h" +#include "clrconfig.h" +#endif // defined(FEATURE_PAL) && (defined(FEATURE_EVENT_TRACE) || defined(FEATURE_EVENTSOURCE_XPLAT)) -#if defined(FEATURE_PERFTRACING) -class EventPipeHelper -{ -public: - static bool Enabled(); -}; -#endif // defined(FEATURE_PERFTRACING) #if defined(FEATURE_EVENT_TRACE) || defined(FEATURE_EVENTSOURCE_XPLAT) @@ -334,6 +348,14 @@ extern "C" { #endif //!FEATURE_PAL #include "clretwallmain.h" +#if defined(FEATURE_PERFTRACING) +class EventPipeHelper +{ +public: + static bool Enabled(); + static bool IsEnabled(DOTNET_TRACE_CONTEXT Context, UCHAR Level, ULONGLONG Keyword); +}; +#endif // defined(FEATURE_PERFTRACING) #endif // FEATURE_EVENT_TRACE @@ -1043,7 +1065,7 @@ public: } static void StartupTraceEvent(REGHANDLE _TraceHandle, PCEVENT_DESCRIPTOR _EventDescriptor, LPCGUID _EventGuid) { EVENT_DESCRIPTOR desc = *_EventDescriptor; - if(ETW_TRACING_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_PRIVATE_PROVIDER_Context, desc)) + if(ETW_TRACING_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_PRIVATE_PROVIDER_DOTNET_Context, desc)) { CoMofTemplate_h(MICROSOFT_WINDOWS_DOTNETRUNTIME_PRIVATE_PROVIDER_Context.RegistrationHandle, _EventDescriptor, _EventGuid, GetClrInstanceId()); } diff --git a/src/scripts/genEventing.py b/src/scripts/genEventing.py index f3c9ad1ce9..83109a5341 100644 --- a/src/scripts/genEventing.py +++ b/src/scripts/genEventing.py @@ -502,6 +502,30 @@ def generateEtmDummyHeader(sClrEtwAllMan,clretwdummy): #pal: create etmdummy.h Clretwdummy.write(generateclrEtwDummy(eventNodes, allTemplates) + "\n") +def convertToLevelId(level): + if level == "win:LogAlways": + return 0 + if level == "win:Critical": + return 1 + if level == "win:Error": + return 2 + if level == "win:Warning": + return 3 + if level == "win:Informational": + return 4 + if level == "win:Verbose": + return 5 + raise Exception("unknown level " + level) + +def getKeywordsMaskCombined(keywords, keywordsToMask): + mask = 0 + for keyword in keywords.split(" "): + if keyword == "": + continue + mask |= keywordsToMask[keyword] + + return mask + def generatePlatformIndependentFiles(sClrEtwAllMan, incDir, etmDummyFile, extern, write_xplatheader): generateEtmDummyHeader(sClrEtwAllMan,etmDummyFile) @@ -513,8 +537,63 @@ def generatePlatformIndependentFiles(sClrEtwAllMan, incDir, etmDummyFile, extern if not os.path.exists(incDir): os.makedirs(incDir) + eventpipe_trace_context_typedef = """ +#if !defined(EVENTPIPE_TRACE_CONTEXT_DEF) +#define EVENTPIPE_TRACE_CONTEXT_DEF +typedef struct _EVENTPIPE_TRACE_CONTEXT +{ + WCHAR const * Name; + UCHAR Level; + bool IsEnabled; + ULONGLONG EnabledKeywordsBitmask; +} EVENTPIPE_TRACE_CONTEXT, *PEVENTPIPE_TRACE_CONTEXT; +#endif // EVENTPIPE_TRACE_CONTEXT_DEF +""" + + dotnet_trace_context_typedef_windows = """ +#if !defined(DOTNET_TRACE_CONTEXT_DEF) +#define DOTNET_TRACE_CONTEXT_DEF +typedef struct _DOTNET_TRACE_CONTEXT +{ + MCGEN_TRACE_CONTEXT EtwProvider; + EVENTPIPE_TRACE_CONTEXT EventPipeProvider; +} DOTNET_TRACE_CONTEXT, *PDOTNET_TRACE_CONTEXT; +#endif // DOTNET_TRACE_CONTEXT_DEF +""" + + dotnet_trace_context_typedef_unix = """ +#if !defined(DOTNET_TRACE_CONTEXT_DEF) +#define DOTNET_TRACE_CONTEXT_DEF +typedef struct _DOTNET_TRACE_CONTEXT +{ + EVENTPIPE_TRACE_CONTEXT EventPipeProvider; +} DOTNET_TRACE_CONTEXT, *PDOTNET_TRACE_CONTEXT; +#endif // DOTNET_TRACE_CONTEXT_DEF +""" + + trace_context_instdef_windows = """ +EXTERN_C __declspec(selectany) DOTNET_TRACE_CONTEXT MICROSOFT_WINDOWS_DOTNETRUNTIME_PROVIDER_DOTNET_Context = { MICROSOFT_WINDOWS_DOTNETRUNTIME_PROVIDER_Context, MICROSOFT_WINDOWS_DOTNETRUNTIME_PROVIDER_EVENTPIPE_Context }; + +EXTERN_C __declspec(selectany) DOTNET_TRACE_CONTEXT MICROSOFT_WINDOWS_DOTNETRUNTIME_PRIVATE_PROVIDER_DOTNET_Context = { MICROSOFT_WINDOWS_DOTNETRUNTIME_PRIVATE_PROVIDER_Context, MICROSOFT_WINDOWS_DOTNETRUNTIME_PRIVATE_PROVIDER_EVENTPIPE_Context }; + +EXTERN_C __declspec(selectany) DOTNET_TRACE_CONTEXT MICROSOFT_WINDOWS_DOTNETRUNTIME_RUNDOWN_PROVIDER_DOTNET_Context = { MICROSOFT_WINDOWS_DOTNETRUNTIME_RUNDOWN_PROVIDER_Context, MICROSOFT_WINDOWS_DOTNETRUNTIME_RUNDOWN_PROVIDER_EVENTPIPE_Context }; + +EXTERN_C __declspec(selectany) DOTNET_TRACE_CONTEXT MICROSOFT_WINDOWS_DOTNETRUNTIME_STRESS_PROVIDER_DOTNET_Context = { MICROSOFT_WINDOWS_DOTNETRUNTIME_STRESS_PROVIDER_Context, MICROSOFT_WINDOWS_DOTNETRUNTIME_STRESS_PROVIDER_EVENTPIPE_Context }; +""" + + trace_context_instdef_unix = """ +EXTERN_C __declspec(selectany) DOTNET_TRACE_CONTEXT MICROSOFT_WINDOWS_DOTNETRUNTIME_PROVIDER_DOTNET_Context = { MICROSOFT_WINDOWS_DOTNETRUNTIME_PROVIDER_EVENTPIPE_Context }; + +EXTERN_C __declspec(selectany) DOTNET_TRACE_CONTEXT MICROSOFT_WINDOWS_DOTNETRUNTIME_PRIVATE_PROVIDER_DOTNET_Context = { MICROSOFT_WINDOWS_DOTNETRUNTIME_PRIVATE_PROVIDER_EVENTPIPE_Context }; + +EXTERN_C __declspec(selectany) DOTNET_TRACE_CONTEXT MICROSOFT_WINDOWS_DOTNETRUNTIME_RUNDOWN_PROVIDER_DOTNET_Context = { MICROSOFT_WINDOWS_DOTNETRUNTIME_RUNDOWN_PROVIDER_EVENTPIPE_Context }; + +EXTERN_C __declspec(selectany) DOTNET_TRACE_CONTEXT MICROSOFT_WINDOWS_DOTNETRUNTIME_STRESS_PROVIDER_DOTNET_Context = { MICROSOFT_WINDOWS_DOTNETRUNTIME_STRESS_PROVIDER_EVENTPIPE_Context }; +""" + # Write the main header for FireETW* functions clrallevents = os.path.join(incDir, "clretwallmain.h") + is_windows = os.name == 'nt' with open_for_update(clrallevents) as Clrallevents: Clrallevents.write(stdprolog) Clrallevents.write(""" @@ -522,6 +601,14 @@ def generatePlatformIndependentFiles(sClrEtwAllMan, incDir, etmDummyFile, extern #include "clreventpipewriteevents.h" """) + Clrallevents.write(eventpipe_trace_context_typedef) # define EVENTPIPE_TRACE_CONTEXT + + # define DOTNET_TRACE_CONTEXT depending on the platform + if is_windows: + Clrallevents.write(dotnet_trace_context_typedef_windows) + else: + Clrallevents.write(dotnet_trace_context_typedef_unix) + for providerNode in tree.getElementsByTagName('provider'): templateNodes = providerNode.getElementsByTagName('template') allTemplates = parseTemplateNodes(templateNodes) @@ -530,6 +617,56 @@ def generatePlatformIndependentFiles(sClrEtwAllMan, incDir, etmDummyFile, extern #vm header: Clrallevents.write(generateClrallEvents(eventNodes, allTemplates) + "\n") + providerName = providerNode.getAttribute('name') + providerSymbol = providerNode.getAttribute('symbol') + + eventpipeProviderCtxName = providerSymbol + "_EVENTPIPE_Context" + Clrallevents.write('EXTERN_C __declspec(selectany) EVENTPIPE_TRACE_CONTEXT ' + eventpipeProviderCtxName + ' = { W("' + providerName + '"), 0, false, 0 };\n') + + # define and initialize runtime providers' DOTNET_TRACE_CONTEXT depending on the platform + if is_windows: + Clrallevents.write(trace_context_instdef_windows) + else: + Clrallevents.write(trace_context_instdef_unix) + + if write_xplatheader: + clrproviders = os.path.join(incDir, "clrproviders.h") + with open_for_update(clrproviders) as Clrproviders: + Clrproviders.write(""" + typedef struct _EVENT_DESCRIPTOR + { + int const Level; + ULONGLONG const Keyword; + } EVENT_DESCRIPTOR; + """) + allProviders = [] + for providerNode in tree.getElementsByTagName('provider'): + keywords = [] + keywordsToMask = {} + providerName = str(providerNode.getAttribute('name')) + providerSymbol = str(providerNode.getAttribute('symbol')) + nbKeywords = 0 + + Clrproviders.write("// Keywords\n"); + for keywordNode in providerNode.getElementsByTagName('keyword'): + keywordName = keywordNode.getAttribute('name') + keywordMask = keywordNode.getAttribute('mask') + keywordSymbol = keywordNode.getAttribute('symbol') + Clrproviders.write("#define " + keywordSymbol + " " + keywordMask + "\n") + + keywords.append("{ \"" + keywordName + "\", " + keywordMask + " }") + keywordsToMask[keywordName] = int(keywordMask, 16) + nbKeywords += 1 + + for eventNode in providerNode.getElementsByTagName('event'): + levelName = eventNode.getAttribute('level') + symbolName = eventNode.getAttribute('symbol') + keywords = eventNode.getAttribute('keywords') + level = convertToLevelId(levelName) + Clrproviders.write("EXTERN_C __declspec(selectany) EVENT_DESCRIPTOR const " + symbolName + " = { " + str(level) + ", " + hex(getKeywordsMaskCombined(keywords, keywordsToMask)) + " };\n") + + allProviders.append("&" + providerSymbol + "_Context") + clreventpipewriteevents = os.path.join(incDir, "clreventpipewriteevents.h") with open_for_update(clreventpipewriteevents) as Clreventpipewriteevents: diff --git a/src/vm/ceeload.cpp b/src/vm/ceeload.cpp index b1ee606f03..ae92074952 100644 --- a/src/vm/ceeload.cpp +++ b/src/vm/ceeload.cpp @@ -368,7 +368,7 @@ void Module::NotifyEtwLoadFinished(HRESULT hr) // we report only successful loads if (SUCCEEDED(hr) && - ETW_TRACING_CATEGORY_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_PROVIDER_Context, + ETW_TRACING_CATEGORY_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_PROVIDER_DOTNET_Context, TRACE_LEVEL_INFORMATION, KEYWORDZERO)) { diff --git a/src/vm/comcallablewrapper.cpp b/src/vm/comcallablewrapper.cpp index 7addbfda9c..17c0edabd0 100644 --- a/src/vm/comcallablewrapper.cpp +++ b/src/vm/comcallablewrapper.cpp @@ -911,7 +911,7 @@ void SimpleComCallWrapper::BuildRefCountLogMessage(LPCWSTR wszOperation, StackSS if (handle != NULL) obj = *((_UNCHECKED_OBJECTREF *)(handle)); - if (ETW_EVENT_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_PRIVATE_PROVIDER_Context, CCWRefCountChange)) + if (ETW_EVENT_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_PRIVATE_PROVIDER_DOTNET_Context, CCWRefCountChange)) { EX_TRY { diff --git a/src/vm/comsynchronizable.cpp b/src/vm/comsynchronizable.cpp index 84c65f273c..ca706f788a 100644 --- a/src/vm/comsynchronizable.cpp +++ b/src/vm/comsynchronizable.cpp @@ -341,7 +341,7 @@ ULONG WINAPI ThreadNative::KickOffThread(void* pass) // // Fire ETW event to correlate with the thread that created current thread - if (ETW_EVENT_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_PROVIDER_Context, ThreadRunning)) + if (ETW_EVENT_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_PROVIDER_DOTNET_Context, ThreadRunning)) FireEtwThreadRunning(pThread, GetClrInstanceId()); // We have a sticky problem here. @@ -445,7 +445,7 @@ void ThreadNative::StartInner(ThreadBaseObject* pThisUNSAFE) pNewThread->IncExternalCount(); // Fire an ETW event to mark the current thread as the launcher of the new thread - if (ETW_EVENT_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_PROVIDER_Context, ThreadCreating)) + if (ETW_EVENT_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_PROVIDER_DOTNET_Context, ThreadCreating)) FireEtwThreadCreating(pNewThread, GetClrInstanceId()); // copy out the managed name into a buffer that will not move if a GC happens diff --git a/src/vm/comthreadpool.cpp b/src/vm/comthreadpool.cpp index 8a1f887086..f5c77465e5 100644 --- a/src/vm/comthreadpool.cpp +++ b/src/vm/comthreadpool.cpp @@ -747,7 +747,7 @@ FCIMPL1(FC_BOOL_RET, ThreadPoolNative::CorPostQueuedCompletionStatus, LPOVERLAPP // OS doesn't signal handle, so do it here lpOverlapped->Internal = 0; - if (ETW_EVENT_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_PROVIDER_Context, ThreadPoolIOEnqueue)) + if (ETW_EVENT_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_PROVIDER_DOTNET_Context, ThreadPoolIOEnqueue)) FireEtwThreadPoolIOEnqueue(lpOverlapped, OBJECTREFToObject(overlapped), false, GetClrInstanceId()); res = ThreadpoolMgr::PostQueuedCompletionStatus(lpOverlapped, diff --git a/src/vm/dllimport.cpp b/src/vm/dllimport.cpp index 314ae46cc6..eed690454d 100644 --- a/src/vm/dllimport.cpp +++ b/src/vm/dllimport.cpp @@ -1048,7 +1048,7 @@ public: // // If the category and the event is enabled... - if (ETW_EVENT_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_PROVIDER_Context, ILStubGenerated)) + if (ETW_EVENT_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_PROVIDER_DOTNET_Context, ILStubGenerated)) { EtwOnILStubGenerated( pStubMD, diff --git a/src/vm/eepolicy.cpp b/src/vm/eepolicy.cpp index b4d6e1beae..99677e3cec 100644 --- a/src/vm/eepolicy.cpp +++ b/src/vm/eepolicy.cpp @@ -878,7 +878,7 @@ void EEPolicy::LogFatalError(UINT exitCode, UINT_PTR address, LPCWSTR pszMessage // Log exception to StdErr LogInfoForFatalError(exitCode, pszMessage, errorSource, argExceptionString); - if(ETW_EVENT_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_PRIVATE_PROVIDER_Context, FailFast)) + if(ETW_EVENT_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_PRIVATE_PROVIDER_DOTNET_Context, FailFast)) { // Fire an ETW FailFast event FireEtwFailFast(pszMessage, @@ -1058,7 +1058,7 @@ void DECLSPEC_NORETURN EEPolicy::HandleFatalStackOverflow(EXCEPTION_POINTERS *pE DisplayStackOverflowException(); - if(ETW_EVENT_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_PRIVATE_PROVIDER_Context, FailFast)) + if(ETW_EVENT_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_PRIVATE_PROVIDER_DOTNET_Context, FailFast)) { // Fire an ETW FailFast event FireEtwFailFast(W("StackOverflowException"), diff --git a/src/vm/eventpipesession.cpp b/src/vm/eventpipesession.cpp index b91d9b1ee2..cb0140763c 100644 --- a/src/vm/eventpipesession.cpp +++ b/src/vm/eventpipesession.cpp @@ -429,6 +429,11 @@ void EventPipeSession::EnableRundown() }; const uint32_t RundownProvidersSize = sizeof(RundownProviders) / sizeof(EventPipeProviderConfiguration); + // update the provider context here since the callback doesn't happen till we actually try to do rundown. + MICROSOFT_WINDOWS_DOTNETRUNTIME_RUNDOWN_PROVIDER_DOTNET_Context.EventPipeProvider.Level = VerboseLoggingLevel; + MICROSOFT_WINDOWS_DOTNETRUNTIME_RUNDOWN_PROVIDER_DOTNET_Context.EventPipeProvider.EnabledKeywordsBitmask = Keywords; + MICROSOFT_WINDOWS_DOTNETRUNTIME_RUNDOWN_PROVIDER_DOTNET_Context.EventPipeProvider.IsEnabled = true; + // Update provider list with rundown configuration. for (uint32_t i = 0; i < RundownProvidersSize; ++i) { diff --git a/src/vm/eventtrace.cpp b/src/vm/eventtrace.cpp index 7042be1781..f757dc734d 100644 --- a/src/vm/eventtrace.cpp +++ b/src/vm/eventtrace.cpp @@ -182,11 +182,11 @@ BOOL IsRuntimeNgenKeywordEnabledAndNotSuppressed() return ( ETW_TRACING_CATEGORY_ENABLED( - MICROSOFT_WINDOWS_DOTNETRUNTIME_PROVIDER_Context, + MICROSOFT_WINDOWS_DOTNETRUNTIME_PROVIDER_DOTNET_Context, TRACE_LEVEL_INFORMATION, CLR_NGEN_KEYWORD) && ! ( ETW_TRACING_CATEGORY_ENABLED( - MICROSOFT_WINDOWS_DOTNETRUNTIME_PROVIDER_Context, + MICROSOFT_WINDOWS_DOTNETRUNTIME_PROVIDER_DOTNET_Context, TRACE_LEVEL_INFORMATION, CLR_OVERRIDEANDSUPPRESSNGENEVENTS_KEYWORD) ) ); @@ -203,11 +203,11 @@ BOOL IsRundownNgenKeywordEnabledAndNotSuppressed() #endif // FEATURE_PERFTRACING ( ETW_TRACING_CATEGORY_ENABLED( - MICROSOFT_WINDOWS_DOTNETRUNTIME_RUNDOWN_PROVIDER_Context, + MICROSOFT_WINDOWS_DOTNETRUNTIME_RUNDOWN_PROVIDER_DOTNET_Context, TRACE_LEVEL_INFORMATION, CLR_RUNDOWNNGEN_KEYWORD) && ! ( ETW_TRACING_CATEGORY_ENABLED( - MICROSOFT_WINDOWS_DOTNETRUNTIME_RUNDOWN_PROVIDER_Context, + MICROSOFT_WINDOWS_DOTNETRUNTIME_RUNDOWN_PROVIDER_DOTNET_Context, TRACE_LEVEL_INFORMATION, CLR_RUNDOWNOVERRIDEANDSUPPRESSNGENEVENTS_KEYWORD) ) ); @@ -434,7 +434,7 @@ VOID ETW::GCLog::GCSettingsEvent() { if (GCHeapUtilities::IsGCHeapInitialized()) { - if (ETW_TRACING_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_PRIVATE_PROVIDER_Context, + if (ETW_TRACING_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_PRIVATE_PROVIDER_DOTNET_Context, GCSettings)) { ETW::GCLog::ETW_GC_INFO Info; @@ -469,7 +469,7 @@ BOOL ETW::GCLog::ShouldWalkStaticsAndCOMForEtw() LIMITED_METHOD_CONTRACT; return s_forcedGCInProgress && - ETW_TRACING_CATEGORY_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_PROVIDER_Context, + ETW_TRACING_CATEGORY_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_PROVIDER_DOTNET_Context, TRACE_LEVEL_INFORMATION, CLR_GCHEAPDUMP_KEYWORD); } @@ -481,7 +481,7 @@ BOOL ETW::GCLog::ShouldWalkHeapObjectsForEtw() { LIMITED_METHOD_CONTRACT; return s_forcedGCInProgress && - ETW_TRACING_CATEGORY_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_PROVIDER_Context, + ETW_TRACING_CATEGORY_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_PROVIDER_DOTNET_Context, TRACE_LEVEL_INFORMATION, CLR_GCHEAPDUMP_KEYWORD); } @@ -490,7 +490,7 @@ BOOL ETW::GCLog::ShouldWalkHeapRootsForEtw() { LIMITED_METHOD_CONTRACT; return s_forcedGCInProgress && - ETW_TRACING_CATEGORY_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_PROVIDER_Context, + ETW_TRACING_CATEGORY_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_PROVIDER_DOTNET_Context, TRACE_LEVEL_INFORMATION, CLR_GCHEAPDUMP_KEYWORD); } @@ -499,7 +499,7 @@ BOOL ETW::GCLog::ShouldTrackMovementForEtw() { LIMITED_METHOD_CONTRACT; return ETW_TRACING_CATEGORY_ENABLED( - MICROSOFT_WINDOWS_DOTNETRUNTIME_PROVIDER_Context, + MICROSOFT_WINDOWS_DOTNETRUNTIME_PROVIDER_DOTNET_Context, TRACE_LEVEL_INFORMATION, CLR_GCHEAPSURVIVALANDMOVEMENT_KEYWORD); } @@ -884,7 +884,7 @@ VOID ETW::GCLog::FireGcStart(ETW_GC_INFO * pGcInfo) LIMITED_METHOD_CONTRACT; if (ETW_TRACING_CATEGORY_ENABLED( - MICROSOFT_WINDOWS_DOTNETRUNTIME_PROVIDER_Context, + MICROSOFT_WINDOWS_DOTNETRUNTIME_PROVIDER_DOTNET_Context, TRACE_LEVEL_INFORMATION, CLR_GC_KEYWORD)) { @@ -1858,7 +1858,7 @@ int BulkTypeEventLogger::LogSingleType(TypeHandle th) EX_TRY { if (ETW_TRACING_CATEGORY_ENABLED( - MICROSOFT_WINDOWS_DOTNETRUNTIME_PROVIDER_Context, + MICROSOFT_WINDOWS_DOTNETRUNTIME_PROVIDER_DOTNET_Context, TRACE_LEVEL_INFORMATION, CLR_GCHEAPANDTYPENAMES_KEYWORD)) { @@ -2414,7 +2414,7 @@ VOID ETW::GCLog::EndHeapDump(ProfilerWalkHeapContext * profilerWalkHeapContext) // If the GC events are enabled, flush any remaining root, node, and / or edge data if (s_forcedGCInProgress && - ETW_TRACING_CATEGORY_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_PROVIDER_Context, + ETW_TRACING_CATEGORY_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_PROVIDER_DOTNET_Context, TRACE_LEVEL_INFORMATION, CLR_GCHEAPDUMP_KEYWORD)) { @@ -2461,7 +2461,7 @@ VOID ETW::GCLog::EndHeapDump(ProfilerWalkHeapContext * profilerWalkHeapContext) // Ditto for type events if (ETW_TRACING_CATEGORY_ENABLED( - MICROSOFT_WINDOWS_DOTNETRUNTIME_PROVIDER_Context, + MICROSOFT_WINDOWS_DOTNETRUNTIME_PROVIDER_DOTNET_Context, TRACE_LEVEL_INFORMATION, CLR_TYPE_KEYWORD)) { @@ -2502,7 +2502,7 @@ VOID ETW::GCLog::SendFinalizeObjectEvent(MethodTable * pMT, Object * pObj) CONTRACTL_END; // Send public finalize object event, if it's enabled - if (ETW_EVENT_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_PROVIDER_Context, FinalizeObject)) + if (ETW_EVENT_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_PROVIDER_DOTNET_Context, FinalizeObject)) { FireEtwFinalizeObject(pMT, pObj, GetClrInstanceId()); @@ -2519,7 +2519,7 @@ VOID ETW::GCLog::SendFinalizeObjectEvent(MethodTable * pMT, Object * pObj) } // Send private finalize object event, if it's enabled - if (ETW_EVENT_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_PRIVATE_PROVIDER_Context, PrvFinalizeObject)) + if (ETW_EVENT_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_PRIVATE_PROVIDER_DOTNET_Context, PrvFinalizeObject)) { EX_TRY { @@ -2794,8 +2794,8 @@ void ETW::TypeSystemLog::PostRegistrationInit() // Initialize our "current state" BOOLs that remember if low or high allocation // sampling is turned on - s_fHeapAllocLowEventEnabledNow = ETW_TRACING_CATEGORY_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_PROVIDER_Context, TRACE_LEVEL_INFORMATION, CLR_GCHEAPALLOCLOW_KEYWORD); - s_fHeapAllocHighEventEnabledNow = ETW_TRACING_CATEGORY_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_PROVIDER_Context, TRACE_LEVEL_INFORMATION, CLR_GCHEAPALLOCHIGH_KEYWORD); + s_fHeapAllocLowEventEnabledNow = ETW_TRACING_CATEGORY_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_PROVIDER_DOTNET_Context, TRACE_LEVEL_INFORMATION, CLR_GCHEAPALLOCLOW_KEYWORD); + s_fHeapAllocHighEventEnabledNow = ETW_TRACING_CATEGORY_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_PROVIDER_DOTNET_Context, TRACE_LEVEL_INFORMATION, CLR_GCHEAPALLOCHIGH_KEYWORD); // Snapshot the current state of the object allocated keyword (on startup), and rely // on this snapshot for the rest of the process run. Since these events require the @@ -2853,8 +2853,8 @@ void ETW::TypeSystemLog::OnKeywordsChanged() // If the desired frequencey for the GCSampledObjectAllocation events has changed, // update our state. - s_fHeapAllocLowEventEnabledNow = ETW_TRACING_CATEGORY_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_PROVIDER_Context, TRACE_LEVEL_INFORMATION, CLR_GCHEAPALLOCLOW_KEYWORD); - s_fHeapAllocHighEventEnabledNow = ETW_TRACING_CATEGORY_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_PROVIDER_Context, TRACE_LEVEL_INFORMATION, CLR_GCHEAPALLOCHIGH_KEYWORD); + s_fHeapAllocLowEventEnabledNow = ETW_TRACING_CATEGORY_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_PROVIDER_DOTNET_Context, TRACE_LEVEL_INFORMATION, CLR_GCHEAPALLOCLOW_KEYWORD); + s_fHeapAllocHighEventEnabledNow = ETW_TRACING_CATEGORY_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_PROVIDER_DOTNET_Context, TRACE_LEVEL_INFORMATION, CLR_GCHEAPALLOCHIGH_KEYWORD); // FUTURE: Would be nice here to log an error event if (s_fHeapAllocLowEventEnabledNow || // s_fHeapAllocHighEventEnabledNow), but !s_fHeapAllocEventEnabledOnStartup @@ -2865,7 +2865,7 @@ void ETW::TypeSystemLog::OnKeywordsChanged() // Types keyword on the runtime provider is off. Not necessarily that it was on and // was just turned off with this request. But either way, TypeSystemLog can handle it // because it is extremely smart. - if (!ETW_TRACING_CATEGORY_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_PROVIDER_Context, TRACE_LEVEL_INFORMATION, CLR_TYPE_KEYWORD)) + if (!ETW_TRACING_CATEGORY_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_PROVIDER_DOTNET_Context, TRACE_LEVEL_INFORMATION, CLR_TYPE_KEYWORD)) OnTypesKeywordTurnedOff(); } @@ -3170,7 +3170,7 @@ VOID ETW::TypeSystemLog::LogTypeAndParametersIfNecessary(BulkTypeEventLogger * p CONTRACTL_END; if (!ETW_TRACING_CATEGORY_ENABLED( - MICROSOFT_WINDOWS_DOTNETRUNTIME_PROVIDER_Context, + MICROSOFT_WINDOWS_DOTNETRUNTIME_PROVIDER_DOTNET_Context, TRACE_LEVEL_INFORMATION, CLR_TYPE_KEYWORD)) { @@ -3452,7 +3452,7 @@ BOOL ETW::TypeSystemLog::AddTypeToGlobalCacheIfNotExists(TypeHandle th, BOOL * p // We do this inside of the lock to ensure that we don't immediately // re-allocate the global type hash after it has been cleaned up. if (!ETW_TRACING_CATEGORY_ENABLED( - MICROSOFT_WINDOWS_DOTNETRUNTIME_PROVIDER_Context, + MICROSOFT_WINDOWS_DOTNETRUNTIME_PROVIDER_DOTNET_Context, TRACE_LEVEL_INFORMATION, CLR_TYPE_KEYWORD)) { @@ -3564,7 +3564,7 @@ VOID ETW::TypeSystemLog::OnModuleUnload(Module * pModule) // We don't need to do anything if allocation sampling is disabled. if (!ETW_TRACING_CATEGORY_ENABLED( - MICROSOFT_WINDOWS_DOTNETRUNTIME_PROVIDER_Context, + MICROSOFT_WINDOWS_DOTNETRUNTIME_PROVIDER_DOTNET_Context, TRACE_LEVEL_INFORMATION, CLR_TYPE_KEYWORD)) { @@ -3774,7 +3774,7 @@ VOID ETW::TypeSystemLog::Cleanup() // If allocation sampling is enabled, bail here so that we don't delete // any of the thread local state. if (ETW_TRACING_CATEGORY_ENABLED( - MICROSOFT_WINDOWS_DOTNETRUNTIME_PROVIDER_Context, + MICROSOFT_WINDOWS_DOTNETRUNTIME_PROVIDER_DOTNET_Context, TRACE_LEVEL_INFORMATION, CLR_TYPE_KEYWORD)) { @@ -3822,7 +3822,7 @@ VOID ETW::EnumerationLog::ModuleRangeRundown() EX_TRY { - if (ETW_TRACING_CATEGORY_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_PRIVATE_PROVIDER_Context, + if (ETW_TRACING_CATEGORY_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_PRIVATE_PROVIDER_DOTNET_Context, TRACE_LEVEL_INFORMATION, CLR_PERFTRACK_PRIVATE_KEYWORD)) { @@ -3867,25 +3867,25 @@ VOID ETW::EnumerationLog::StartRundown() { SendOneTimeRundownEvents(); - BOOL bIsPerfTrackRundownEnabled = ETW_TRACING_CATEGORY_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_RUNDOWN_PROVIDER_Context, + BOOL bIsPerfTrackRundownEnabled = ETW_TRACING_CATEGORY_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_RUNDOWN_PROVIDER_DOTNET_Context, TRACE_LEVEL_INFORMATION, CLR_RUNDOWNPERFTRACK_KEYWORD); BOOL bIsThreadingRundownEnabled = ETW_TRACING_CATEGORY_ENABLED( - MICROSOFT_WINDOWS_DOTNETRUNTIME_RUNDOWN_PROVIDER_Context, + MICROSOFT_WINDOWS_DOTNETRUNTIME_RUNDOWN_PROVIDER_DOTNET_Context, TRACE_LEVEL_INFORMATION, CLR_RUNDOWNTHREADING_KEYWORD); - if(ETW_TRACING_CATEGORY_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_RUNDOWN_PROVIDER_Context, + if(ETW_TRACING_CATEGORY_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_RUNDOWN_PROVIDER_DOTNET_Context, TRACE_LEVEL_INFORMATION, CLR_RUNDOWNJIT_KEYWORD) || - ETW_TRACING_CATEGORY_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_RUNDOWN_PROVIDER_Context, + ETW_TRACING_CATEGORY_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_RUNDOWN_PROVIDER_DOTNET_Context, TRACE_LEVEL_INFORMATION, CLR_RUNDOWNLOADER_KEYWORD) || IsRundownNgenKeywordEnabledAndNotSuppressed() || - ETW_TRACING_CATEGORY_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_RUNDOWN_PROVIDER_Context, + ETW_TRACING_CATEGORY_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_RUNDOWN_PROVIDER_DOTNET_Context, TRACE_LEVEL_INFORMATION, CLR_RUNDOWNJITTEDMETHODILTONATIVEMAP_KEYWORD) || @@ -3898,13 +3898,13 @@ VOID ETW::EnumerationLog::StartRundown() // The rundown flag is expected to be checked in the caller, so no need to check here again DWORD enumerationOptions=ETW::EnumerationLog::EnumerationStructs::None; - if(ETW_TRACING_CATEGORY_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_RUNDOWN_PROVIDER_Context, + if(ETW_TRACING_CATEGORY_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_RUNDOWN_PROVIDER_DOTNET_Context, TRACE_LEVEL_INFORMATION, CLR_RUNDOWNLOADER_KEYWORD)) { enumerationOptions |= ETW::EnumerationLog::EnumerationStructs::DomainAssemblyModuleDCStart; } - if(ETW_TRACING_CATEGORY_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_RUNDOWN_PROVIDER_Context, + if(ETW_TRACING_CATEGORY_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_RUNDOWN_PROVIDER_DOTNET_Context, TRACE_LEVEL_INFORMATION, CLR_RUNDOWNJIT_KEYWORD)) { @@ -3914,7 +3914,7 @@ VOID ETW::EnumerationLog::StartRundown() { enumerationOptions |= ETW::EnumerationLog::EnumerationStructs::NgenMethodDCStart; } - if(ETW_TRACING_CATEGORY_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_RUNDOWN_PROVIDER_Context, + if(ETW_TRACING_CATEGORY_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_RUNDOWN_PROVIDER_DOTNET_Context, TRACE_LEVEL_INFORMATION, CLR_RUNDOWNJITTEDMETHODILTONATIVEMAP_KEYWORD)) { @@ -3954,23 +3954,23 @@ DWORD ETW::EnumerationLog::GetEnumerationOptionsFromRuntimeKeywords() LIMITED_METHOD_CONTRACT; DWORD enumerationOptions=ETW::EnumerationLog::EnumerationStructs::None; - if(ETW_TRACING_CATEGORY_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_PROVIDER_Context, + if(ETW_TRACING_CATEGORY_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_PROVIDER_DOTNET_Context, TRACE_LEVEL_INFORMATION, CLR_LOADER_KEYWORD)) { enumerationOptions |= ETW::EnumerationLog::EnumerationStructs::DomainAssemblyModuleUnload; } - if(ETW_TRACING_CATEGORY_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_PROVIDER_Context, + if(ETW_TRACING_CATEGORY_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_PROVIDER_DOTNET_Context, TRACE_LEVEL_INFORMATION, CLR_JIT_KEYWORD) && - ETW_TRACING_CATEGORY_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_PROVIDER_Context, + ETW_TRACING_CATEGORY_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_PROVIDER_DOTNET_Context, TRACE_LEVEL_INFORMATION, CLR_ENDENUMERATION_KEYWORD)) { enumerationOptions |= ETW::EnumerationLog::EnumerationStructs::JitMethodUnload; } if(IsRuntimeNgenKeywordEnabledAndNotSuppressed() && - ETW_TRACING_CATEGORY_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_PROVIDER_Context, + ETW_TRACING_CATEGORY_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_PROVIDER_DOTNET_Context, TRACE_LEVEL_INFORMATION, CLR_ENDENUMERATION_KEYWORD)) { @@ -4008,7 +4008,7 @@ VOID ETW::EnumerationLog::EnumerateForCaptureState() EX_TRY { - if(ETW_TRACING_CATEGORY_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_PROVIDER_Context, TRACE_LEVEL_INFORMATION, KEYWORDZERO)) + if(ETW_TRACING_CATEGORY_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_PROVIDER_DOTNET_Context, TRACE_LEVEL_INFORMATION, KEYWORDZERO)) { DWORD enumerationOptions = GetEnumerationOptionsFromRuntimeKeywords(); @@ -4017,7 +4017,7 @@ VOID ETW::EnumerationLog::EnumerateForCaptureState() ETW::EnumerationLog::EnumerationHelper(NULL /* module filter */, NULL /* domain filter */, enumerationOptions); // Send thread created events for all currently active threads, if requested - if (ETW_TRACING_CATEGORY_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_PROVIDER_Context, + if (ETW_TRACING_CATEGORY_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_PROVIDER_DOTNET_Context, TRACE_LEVEL_INFORMATION, CLR_THREADING_KEYWORD)) { @@ -4041,24 +4041,24 @@ VOID ETW::EnumerationLog::EndRundown() { SendOneTimeRundownEvents(); - BOOL bIsPerfTrackRundownEnabled = ETW_TRACING_CATEGORY_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_RUNDOWN_PROVIDER_Context, + BOOL bIsPerfTrackRundownEnabled = ETW_TRACING_CATEGORY_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_RUNDOWN_PROVIDER_DOTNET_Context, TRACE_LEVEL_INFORMATION, CLR_RUNDOWNPERFTRACK_KEYWORD); BOOL bIsThreadingRundownEnabled = ETW_TRACING_CATEGORY_ENABLED( - MICROSOFT_WINDOWS_DOTNETRUNTIME_RUNDOWN_PROVIDER_Context, + MICROSOFT_WINDOWS_DOTNETRUNTIME_RUNDOWN_PROVIDER_DOTNET_Context, TRACE_LEVEL_INFORMATION, CLR_RUNDOWNTHREADING_KEYWORD); - if(ETW_TRACING_CATEGORY_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_RUNDOWN_PROVIDER_Context, + if(ETW_TRACING_CATEGORY_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_RUNDOWN_PROVIDER_DOTNET_Context, TRACE_LEVEL_INFORMATION, CLR_RUNDOWNJIT_KEYWORD) || - ETW_TRACING_CATEGORY_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_RUNDOWN_PROVIDER_Context, + ETW_TRACING_CATEGORY_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_RUNDOWN_PROVIDER_DOTNET_Context, TRACE_LEVEL_INFORMATION, CLR_RUNDOWNLOADER_KEYWORD) || IsRundownNgenKeywordEnabledAndNotSuppressed() || - ETW_TRACING_CATEGORY_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_RUNDOWN_PROVIDER_Context, + ETW_TRACING_CATEGORY_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_RUNDOWN_PROVIDER_DOTNET_Context, TRACE_LEVEL_INFORMATION, CLR_RUNDOWNJITTEDMETHODILTONATIVEMAP_KEYWORD) || @@ -4072,13 +4072,13 @@ VOID ETW::EnumerationLog::EndRundown() // The rundown flag is expected to be checked in the caller, so no need to check here again DWORD enumerationOptions=ETW::EnumerationLog::EnumerationStructs::None; - if(ETW_TRACING_CATEGORY_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_RUNDOWN_PROVIDER_Context, + if(ETW_TRACING_CATEGORY_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_RUNDOWN_PROVIDER_DOTNET_Context, TRACE_LEVEL_INFORMATION, CLR_RUNDOWNLOADER_KEYWORD)) { enumerationOptions |= ETW::EnumerationLog::EnumerationStructs::DomainAssemblyModuleDCEnd; } - if(ETW_TRACING_CATEGORY_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_RUNDOWN_PROVIDER_Context, + if(ETW_TRACING_CATEGORY_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_RUNDOWN_PROVIDER_DOTNET_Context, TRACE_LEVEL_INFORMATION, CLR_RUNDOWNJIT_KEYWORD)) { @@ -4088,7 +4088,7 @@ VOID ETW::EnumerationLog::EndRundown() { enumerationOptions |= ETW::EnumerationLog::EnumerationStructs::NgenMethodDCEnd; } - if(ETW_TRACING_CATEGORY_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_RUNDOWN_PROVIDER_Context, + if(ETW_TRACING_CATEGORY_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_RUNDOWN_PROVIDER_DOTNET_Context, TRACE_LEVEL_INFORMATION, CLR_RUNDOWNJITTEDMETHODILTONATIVEMAP_KEYWORD)) { @@ -4200,7 +4200,8 @@ VOID EtwCallbackCommon( ULONG ControlCode, UCHAR Level, ULONGLONG MatchAnyKeyword, - PVOID pFilterData) + PVOID pFilterData, + BOOL isEventPipeCallback) { LIMITED_METHOD_CONTRACT; @@ -4216,6 +4217,35 @@ VOID EtwCallbackCommon( GCEventLevel level = static_cast<GCEventLevel>(Level); GCHeapUtilities::RecordEventStateChange(bIsPublicTraceHandle, keywords, level); + DOTNET_TRACE_CONTEXT * ctxToUpdate; + switch(ProviderIndex) + { + case DotNETRuntime: + ctxToUpdate = &MICROSOFT_WINDOWS_DOTNETRUNTIME_PROVIDER_DOTNET_Context; + break; + case DotNETRuntimeRundown: + ctxToUpdate = &MICROSOFT_WINDOWS_DOTNETRUNTIME_RUNDOWN_PROVIDER_DOTNET_Context; + break; + case DotNETRuntimePrivate: + ctxToUpdate = &MICROSOFT_WINDOWS_DOTNETRUNTIME_PRIVATE_PROVIDER_DOTNET_Context; + break; + case DotNETRuntimeStress: + ctxToUpdate = &MICROSOFT_WINDOWS_DOTNETRUNTIME_STRESS_PROVIDER_DOTNET_Context; + break; + default: + _ASSERTE(!"EtwCallbackCommon was called with invalid context"); + return; + } + + // This callback gets called on both ETW/EventPipe session enable/disable. + // We need toupdate the EventPipe provider context if we are in a callback + // from EventPipe, but not from ETW. + if (isEventPipeCallback) + { + ctxToUpdate->EventPipeProvider.Level = Level; + ctxToUpdate->EventPipeProvider.EnabledKeywordsBitmask = MatchAnyKeyword; + } + // Special check for the runtime provider's GCHeapCollectKeyword. Profilers // flick this to force a full GC. if (g_fEEStarted && !g_fEEShutDown && bIsPublicTraceHandle && @@ -4250,7 +4280,7 @@ VOID EventPipeEtwCallbackDotNETRuntimeStress( { LIMITED_METHOD_CONTRACT; - EtwCallbackCommon(DotNETRuntimeStress, ControlCode, Level, MatchAnyKeyword, FilterData); + EtwCallbackCommon(DotNETRuntimeStress, ControlCode, Level, MatchAnyKeyword, FilterData, true); } VOID EventPipeEtwCallbackDotNETRuntime( @@ -4264,7 +4294,7 @@ VOID EventPipeEtwCallbackDotNETRuntime( { LIMITED_METHOD_CONTRACT; - EtwCallbackCommon(DotNETRuntime, ControlCode, Level, MatchAnyKeyword, FilterData); + EtwCallbackCommon(DotNETRuntime, ControlCode, Level, MatchAnyKeyword, FilterData, true); } VOID EventPipeEtwCallbackDotNETRuntimeRundown( @@ -4278,7 +4308,7 @@ VOID EventPipeEtwCallbackDotNETRuntimeRundown( { LIMITED_METHOD_CONTRACT; - EtwCallbackCommon(DotNETRuntimeRundown, ControlCode, Level, MatchAnyKeyword, FilterData); + EtwCallbackCommon(DotNETRuntimeRundown, ControlCode, Level, MatchAnyKeyword, FilterData, true); } VOID EventPipeEtwCallbackDotNETRuntimePrivate( @@ -4292,7 +4322,7 @@ VOID EventPipeEtwCallbackDotNETRuntimePrivate( { WRAPPER_NO_CONTRACT; - EtwCallbackCommon(DotNETRuntimePrivate, ControlCode, Level, MatchAnyKeyword, FilterData); + EtwCallbackCommon(DotNETRuntimePrivate, ControlCode, Level, MatchAnyKeyword, FilterData, true); } @@ -4434,20 +4464,25 @@ extern "C" // EventPipeEtwCallback contains some GC eventing functionality shared between EventPipe and ETW. // Eventually, we'll want to merge these two codepaths whenever we can. CallbackProviderIndex providerIndex = DotNETRuntime; + DOTNET_TRACE_CONTEXT providerContext = MICROSOFT_WINDOWS_DOTNETRUNTIME_PROVIDER_DOTNET_Context; if (context->RegistrationHandle == Microsoft_Windows_DotNETRuntimeHandle) { providerIndex = DotNETRuntime; + providerContext = MICROSOFT_WINDOWS_DOTNETRUNTIME_PROVIDER_DOTNET_Context; } else if (context->RegistrationHandle == Microsoft_Windows_DotNETRuntimeRundownHandle) { providerIndex = DotNETRuntimeRundown; + providerContext = MICROSOFT_WINDOWS_DOTNETRUNTIME_RUNDOWN_PROVIDER_DOTNET_Context; } else if (context->RegistrationHandle == Microsoft_Windows_DotNETRuntimeStressHandle) { providerIndex = DotNETRuntimeStress; + providerContext = MICROSOFT_WINDOWS_DOTNETRUNTIME_STRESS_PROVIDER_DOTNET_Context; } else if (context->RegistrationHandle == Microsoft_Windows_DotNETRuntimePrivateHandle) { providerIndex = DotNETRuntimePrivate; + providerContext = MICROSOFT_WINDOWS_DOTNETRUNTIME_PRIVATE_PROVIDER_DOTNET_Context; } else { assert(!"unknown registration handle"); return; } - EtwCallbackCommon(providerIndex, ControlCode, Level, MatchAnyKeyword, FilterData); + EtwCallbackCommon(providerIndex, ControlCode, Level, MatchAnyKeyword, FilterData, false); // TypeSystemLog needs a notification when certain keywords are modified, so // give it a hook here. @@ -4479,7 +4514,7 @@ extern "C" // If we have turned on the JIT keyword to the INFORMATION setting (needed to get JIT names) then // we assume that we also want good stack traces so we need to publish unwind information so // ETW can get at it - if(bIsPublicTraceHandle && ETW_CATEGORY_ENABLED((*context), TRACE_LEVEL_INFORMATION, CLR_RUNDOWNJIT_KEYWORD)) + if(bIsPublicTraceHandle && ETW_CATEGORY_ENABLED(providerContext, TRACE_LEVEL_INFORMATION, CLR_RUNDOWNJIT_KEYWORD)) UnwindInfoTable::PublishUnwindInfo(g_fEEStarted != FALSE); #endif @@ -4488,13 +4523,13 @@ extern "C" // Start and End Method/Module Rundowns // Used to fire events that we missed since we started the controller after the process started // flags for immediate start rundown - if(ETW_TRACING_CATEGORY_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_RUNDOWN_PROVIDER_Context, + if(ETW_TRACING_CATEGORY_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_RUNDOWN_PROVIDER_DOTNET_Context, TRACE_LEVEL_INFORMATION, CLR_RUNDOWNSTART_KEYWORD)) ETW::EnumerationLog::StartRundown(); // flags delayed end rundown - if(ETW_TRACING_CATEGORY_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_RUNDOWN_PROVIDER_Context, + if(ETW_TRACING_CATEGORY_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_RUNDOWN_PROVIDER_DOTNET_Context, TRACE_LEVEL_INFORMATION, CLR_RUNDOWNEND_KEYWORD)) ETW::EnumerationLog::EndRundown(); @@ -4506,7 +4541,7 @@ extern "C" } } #ifdef FEATURE_COMINTEROP - if (ETW_EVENT_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_PRIVATE_PROVIDER_Context, CCWRefCountChange)) + if (ETW_EVENT_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_PRIVATE_PROVIDER_DOTNET_Context, CCWRefCountChange)) g_pConfig->SetLogCCWRefCountChangeEnabled(bEnabled != 0); #endif // FEATURE_COMINTEROP @@ -4533,7 +4568,7 @@ VOID ETW::ExceptionLog::ExceptionThrown(CrawlFrame *pCf, BOOL bIsReThrownExcept { return; } - if(!ETW_EVENT_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_PROVIDER_Context, ExceptionThrown_V1)) + if(!ETW_EVENT_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_PROVIDER_DOTNET_Context, ExceptionThrown_V1)) { return; } @@ -4636,7 +4671,7 @@ VOID ETW::ExceptionLog::ExceptionThrownEnd() GC_NOTRIGGER; } CONTRACTL_END; - if (!ETW_EVENT_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_PROVIDER_Context, ExceptionThrownStop)) + if (!ETW_EVENT_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_PROVIDER_DOTNET_Context, ExceptionThrownStop)) { return; } @@ -4654,7 +4689,7 @@ VOID ETW::ExceptionLog::ExceptionCatchBegin(MethodDesc * pMethodDesc, PVOID pEnt GC_NOTRIGGER; } CONTRACTL_END; - if (!ETW_EVENT_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_PROVIDER_Context, ExceptionCatchStart)) + if (!ETW_EVENT_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_PROVIDER_DOTNET_Context, ExceptionCatchStart)) { return; } @@ -4679,7 +4714,7 @@ VOID ETW::ExceptionLog::ExceptionCatchEnd() GC_NOTRIGGER; } CONTRACTL_END; - if (!ETW_EVENT_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_PROVIDER_Context, ExceptionCatchStop)) + if (!ETW_EVENT_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_PROVIDER_DOTNET_Context, ExceptionCatchStop)) { return; } @@ -4694,7 +4729,7 @@ VOID ETW::ExceptionLog::ExceptionFinallyBegin(MethodDesc * pMethodDesc, PVOID pE GC_NOTRIGGER; } CONTRACTL_END; - if (!ETW_EVENT_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_PROVIDER_Context, ExceptionFinallyStart)) + if (!ETW_EVENT_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_PROVIDER_DOTNET_Context, ExceptionFinallyStart)) { return; } @@ -4719,7 +4754,7 @@ VOID ETW::ExceptionLog::ExceptionFinallyEnd() GC_NOTRIGGER; } CONTRACTL_END; - if (!ETW_EVENT_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_PROVIDER_Context, ExceptionFinallyStop)) + if (!ETW_EVENT_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_PROVIDER_DOTNET_Context, ExceptionFinallyStop)) { return; } @@ -4734,7 +4769,7 @@ VOID ETW::ExceptionLog::ExceptionFilterBegin(MethodDesc * pMethodDesc, PVOID pEn GC_NOTRIGGER; } CONTRACTL_END; - if (!ETW_EVENT_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_PROVIDER_Context, ExceptionFilterStart)) + if (!ETW_EVENT_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_PROVIDER_DOTNET_Context, ExceptionFilterStart)) { return; } @@ -4759,7 +4794,7 @@ VOID ETW::ExceptionLog::ExceptionFilterEnd() GC_NOTRIGGER; } CONTRACTL_END; - if (!ETW_EVENT_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_PROVIDER_Context, ExceptionFilterStop)) + if (!ETW_EVENT_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_PROVIDER_DOTNET_Context, ExceptionFilterStop)) { return; } @@ -4779,7 +4814,7 @@ VOID ETW::LoaderLog::DomainLoadReal(BaseDomain *pDomain, __in_opt LPWSTR wszFrie EX_TRY { - if(ETW_TRACING_CATEGORY_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_PROVIDER_Context, + if(ETW_TRACING_CATEGORY_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_PROVIDER_DOTNET_Context, TRACE_LEVEL_INFORMATION, CLR_LOADER_KEYWORD)) { @@ -4801,14 +4836,14 @@ VOID ETW::LoaderLog::DomainUnload(AppDomain *pDomain) EX_TRY { - if(ETW_TRACING_CATEGORY_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_PROVIDER_Context, + if(ETW_TRACING_CATEGORY_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_PROVIDER_DOTNET_Context, TRACE_LEVEL_INFORMATION, KEYWORDZERO)) { DWORD enumerationOptions = ETW::EnumerationLog::GetEnumerationOptionsFromRuntimeKeywords(); // Domain unload also causes type unload events - if(ETW_TRACING_CATEGORY_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_PROVIDER_Context, + if(ETW_TRACING_CATEGORY_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_PROVIDER_DOTNET_Context, TRACE_LEVEL_INFORMATION, CLR_TYPE_KEYWORD)) { @@ -4832,14 +4867,14 @@ VOID ETW::LoaderLog::CollectibleLoaderAllocatorUnload(AssemblyLoaderAllocator *p EX_TRY { - if(ETW_TRACING_CATEGORY_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_PROVIDER_Context, + if(ETW_TRACING_CATEGORY_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_PROVIDER_DOTNET_Context, TRACE_LEVEL_INFORMATION, KEYWORDZERO)) { DWORD enumerationOptions = ETW::EnumerationLog::GetEnumerationOptionsFromRuntimeKeywords(); // Collectible Loader Allocator unload also causes type unload events - if(ETW_TRACING_CATEGORY_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_PROVIDER_Context, + if(ETW_TRACING_CATEGORY_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_PROVIDER_DOTNET_Context, TRACE_LEVEL_INFORMATION, CLR_TYPE_KEYWORD)) { @@ -4864,9 +4899,9 @@ VOID ETW::InfoLog::RuntimeInformation(INT32 type) } CONTRACTL_END; EX_TRY { - if((type == ETW::InfoLog::InfoStructs::Normal && ETW_EVENT_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_PROVIDER_Context, RuntimeInformationStart)) + if((type == ETW::InfoLog::InfoStructs::Normal && ETW_EVENT_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_PROVIDER_DOTNET_Context, RuntimeInformationStart)) || - (type == ETW::InfoLog::InfoStructs::Callback && ETW_EVENT_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_RUNDOWN_PROVIDER_Context, RuntimeInformationDCStart)) + (type == ETW::InfoLog::InfoStructs::Callback && ETW_EVENT_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_RUNDOWN_PROVIDER_DOTNET_Context, RuntimeInformationDCStart)) ) { PCWSTR szDtraceOutput1=W(""),szDtraceOutput2=W(""); @@ -4986,7 +5021,7 @@ VOID ETW::CodeSymbolLog::EmitCodeSymbols(Module* pModule) EX_TRY { if (ETW_TRACING_CATEGORY_ENABLED( - MICROSOFT_WINDOWS_DOTNETRUNTIME_PROVIDER_Context, + MICROSOFT_WINDOWS_DOTNETRUNTIME_PROVIDER_DOTNET_Context, TRACE_LEVEL_VERBOSE, CLR_CODESYMBOLS_KEYWORD)) { @@ -5211,7 +5246,7 @@ VOID ETW::MethodLog::GetR2RGetEntryPoint(MethodDesc *pMethodDesc, PCODE pEntryPo GC_TRIGGERS; } CONTRACTL_END; - if (ETW_EVENT_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_PROVIDER_Context, R2RGetEntryPoint)) + if (ETW_EVENT_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_PROVIDER_DOTNET_Context, R2RGetEntryPoint)) { EX_TRY { @@ -5242,14 +5277,14 @@ VOID ETW::MethodLog::MethodJitted(MethodDesc *pMethodDesc, SString *namespaceOrC EX_TRY { - if(ETW_TRACING_CATEGORY_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_PROVIDER_Context, + if(ETW_TRACING_CATEGORY_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_PROVIDER_DOTNET_Context, TRACE_LEVEL_INFORMATION, CLR_JIT_KEYWORD)) { ETW::MethodLog::SendMethodEvent(pMethodDesc, ETW::EnumerationLog::EnumerationStructs::JitMethodLoad, TRUE, namespaceOrClassName, methodName, methodSignature, pNativeCodeStartAddress, pConfig); } - if(ETW_TRACING_CATEGORY_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_PROVIDER_Context, + if(ETW_TRACING_CATEGORY_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_PROVIDER_DOTNET_Context, TRACE_LEVEL_INFORMATION, CLR_JITTEDMETHODILTONATIVEMAP_KEYWORD)) { @@ -5280,7 +5315,7 @@ VOID ETW::MethodLog::MethodJitting(MethodDesc *pMethodDesc, SString *namespaceOr EX_TRY { - if(ETW_TRACING_CATEGORY_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_PROVIDER_Context, + if(ETW_TRACING_CATEGORY_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_PROVIDER_DOTNET_Context, TRACE_LEVEL_VERBOSE, CLR_JIT_KEYWORD)) { @@ -5303,7 +5338,7 @@ VOID ETW::MethodLog::StubInitialized(ULONGLONG ullHelperStartAddress, LPCWSTR pH EX_TRY { - if(ETW_TRACING_CATEGORY_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_PROVIDER_Context, + if(ETW_TRACING_CATEGORY_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_PROVIDER_DOTNET_Context, TRACE_LEVEL_INFORMATION, CLR_JIT_KEYWORD)) { @@ -5321,7 +5356,7 @@ VOID ETW::MethodLog::StubsInitialized(PVOID *pHelperStartAddress, PVOID *pHelper { WRAPPER_NO_CONTRACT; - if(ETW_TRACING_CATEGORY_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_PROVIDER_Context, + if(ETW_TRACING_CATEGORY_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_PROVIDER_DOTNET_Context, TRACE_LEVEL_INFORMATION, CLR_JIT_KEYWORD)) { @@ -5347,7 +5382,7 @@ VOID ETW::MethodLog::DynamicMethodDestroyed(MethodDesc *pMethodDesc) EX_TRY { - if(ETW_TRACING_CATEGORY_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_PROVIDER_Context, + if(ETW_TRACING_CATEGORY_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_PROVIDER_DOTNET_Context, TRACE_LEVEL_INFORMATION, CLR_JIT_KEYWORD)) ETW::MethodLog::SendMethodEvent(pMethodDesc, ETW::EnumerationLog::EnumerationStructs::JitMethodUnload, TRUE); @@ -5368,7 +5403,7 @@ VOID ETW::MethodLog::MethodRestored(MethodDesc *pMethodDesc) { if(IsRuntimeNgenKeywordEnabledAndNotSuppressed() && - ETW_TRACING_CATEGORY_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_PROVIDER_Context, + ETW_TRACING_CATEGORY_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_PROVIDER_DOTNET_Context, TRACE_LEVEL_INFORMATION, CLR_STARTENUMERATION_KEYWORD)) { @@ -5390,7 +5425,7 @@ VOID ETW::MethodLog::MethodTableRestored(MethodTable *pMethodTable) { if(IsRuntimeNgenKeywordEnabledAndNotSuppressed() && - ETW_TRACING_CATEGORY_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_PROVIDER_Context, + ETW_TRACING_CATEGORY_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_PROVIDER_DOTNET_Context, TRACE_LEVEL_INFORMATION, CLR_STARTENUMERATION_KEYWORD)) { @@ -5562,18 +5597,18 @@ VOID ETW::LoaderLog::ModuleLoad(Module *pModule, LONG liReportedSharedModule) EX_TRY { DWORD enumerationOptions = ETW::EnumerationLog::EnumerationStructs::None; - if(ETW_TRACING_CATEGORY_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_PROVIDER_Context, + if(ETW_TRACING_CATEGORY_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_PROVIDER_DOTNET_Context, TRACE_LEVEL_INFORMATION, KEYWORDZERO)) { - BOOL bTraceFlagLoaderSet = ETW_TRACING_CATEGORY_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_PROVIDER_Context, + BOOL bTraceFlagLoaderSet = ETW_TRACING_CATEGORY_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_PROVIDER_DOTNET_Context, TRACE_LEVEL_INFORMATION, CLR_LOADER_KEYWORD); BOOL bTraceFlagNgenMethodSet = IsRuntimeNgenKeywordEnabledAndNotSuppressed(); - BOOL bTraceFlagStartRundownSet = ETW_TRACING_CATEGORY_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_PROVIDER_Context, + BOOL bTraceFlagStartRundownSet = ETW_TRACING_CATEGORY_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_PROVIDER_DOTNET_Context, TRACE_LEVEL_INFORMATION, CLR_STARTENUMERATION_KEYWORD); - BOOL bTraceFlagPerfTrackSet = ETW_TRACING_CATEGORY_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_PROVIDER_Context, + BOOL bTraceFlagPerfTrackSet = ETW_TRACING_CATEGORY_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_PROVIDER_DOTNET_Context, TRACE_LEVEL_INFORMATION, CLR_PERFTRACK_KEYWORD); @@ -5602,7 +5637,7 @@ VOID ETW::LoaderLog::ModuleLoad(Module *pModule, LONG liReportedSharedModule) } { - BOOL bTraceFlagPerfTrackPrivateSet = ETW_TRACING_CATEGORY_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_PRIVATE_PROVIDER_Context, + BOOL bTraceFlagPerfTrackPrivateSet = ETW_TRACING_CATEGORY_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_PRIVATE_PROVIDER_DOTNET_Context, TRACE_LEVEL_INFORMATION, CLR_PERFTRACK_PRIVATE_KEYWORD); if (liReportedSharedModule == 0 && bTraceFlagPerfTrackPrivateSet) @@ -5626,7 +5661,7 @@ VOID ETW::EnumerationLog::ProcessShutdown() EX_TRY { - if(ETW_TRACING_CATEGORY_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_PROVIDER_Context, TRACE_LEVEL_INFORMATION, KEYWORDZERO)) + if(ETW_TRACING_CATEGORY_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_PROVIDER_DOTNET_Context, TRACE_LEVEL_INFORMATION, KEYWORDZERO)) { DWORD enumerationOptions = GetEnumerationOptionsFromRuntimeKeywords(); @@ -6301,7 +6336,7 @@ VOID ETW::MethodLog::SendMethodEvent(MethodDesc *pMethodDesc, DWORD dwEventOptio { // Forcibly restoring ngen methods can cause all sorts of deadlocks and contract violations // These events are therefore put under the private provider - if(ETW_TRACING_CATEGORY_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_PRIVATE_PROVIDER_Context, + if(ETW_TRACING_CATEGORY_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_PRIVATE_PROVIDER_DOTNET_Context, TRACE_LEVEL_INFORMATION, CLR_PRIVATENGENFORCERESTORE_KEYWORD)) { @@ -6317,13 +6352,13 @@ VOID ETW::MethodLog::SendMethodEvent(MethodDesc *pMethodDesc, DWORD dwEventOptio if(bIsRundownProvider) { - bShowVerboseOutput = ETW_TRACING_CATEGORY_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_RUNDOWN_PROVIDER_Context, + bShowVerboseOutput = ETW_TRACING_CATEGORY_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_RUNDOWN_PROVIDER_DOTNET_Context, TRACE_LEVEL_VERBOSE, KEYWORDZERO); } else if(bIsRuntimeProvider) { - bShowVerboseOutput = ETW_TRACING_CATEGORY_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_PROVIDER_Context, + bShowVerboseOutput = ETW_TRACING_CATEGORY_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_PROVIDER_DOTNET_Context, TRACE_LEVEL_VERBOSE, KEYWORDZERO); } @@ -7284,7 +7319,7 @@ VOID ETW::EnumerationLog::IterateModule(Module *pModule, DWORD enumerationOption } // ModuleRangeLoadPrivate events for module range information from attach/detach scenarios - if (ETW_TRACING_CATEGORY_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_PRIVATE_PROVIDER_Context, + if (ETW_TRACING_CATEGORY_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_PRIVATE_PROVIDER_DOTNET_Context, TRACE_LEVEL_INFORMATION, CLR_PERFTRACK_PRIVATE_KEYWORD) && (enumerationOptions & ETW::EnumerationLog::EnumerationStructs::ModuleRangeLoadPrivate)) @@ -7484,4 +7519,21 @@ bool EventPipeHelper::Enabled() LIMITED_METHOD_CONTRACT; return EventPipe::Enabled(); } + +bool EventPipeHelper::IsEnabled(DOTNET_TRACE_CONTEXT Context, UCHAR Level, ULONGLONG Keyword) +{ + CONTRACTL + { + NOTHROW; + GC_NOTRIGGER; + } + CONTRACTL_END + + if (Level <= Context.EventPipeProvider.Level || Context.EventPipeProvider.Level == 0) + { + return (Keyword & Context.EventPipeProvider.EnabledKeywordsBitmask) != 0; + } + + return false; +} #endif // FEATURE_PERFTRACING diff --git a/src/vm/eventtrace.inl b/src/vm/eventtrace.inl index af5481b4de..ad728085d6 100644 --- a/src/vm/eventtrace.inl +++ b/src/vm/eventtrace.inl @@ -15,7 +15,7 @@ FORCEINLINE bool ETW::CompilationLog::Runtime::IsEnabled() return ETW_TRACING_CATEGORY_ENABLED( - MICROSOFT_WINDOWS_DOTNETRUNTIME_PROVIDER_Context, + MICROSOFT_WINDOWS_DOTNETRUNTIME_PROVIDER_DOTNET_Context, TRACE_LEVEL_INFORMATION, CLR_COMPILATION_KEYWORD); } @@ -29,7 +29,7 @@ FORCEINLINE bool ETW::CompilationLog::Rundown::IsEnabled() return ETW_TRACING_CATEGORY_ENABLED( - MICROSOFT_WINDOWS_DOTNETRUNTIME_RUNDOWN_PROVIDER_Context, + MICROSOFT_WINDOWS_DOTNETRUNTIME_RUNDOWN_PROVIDER_DOTNET_Context, TRACE_LEVEL_INFORMATION, CLR_COMPILATION_RUNDOWN_KEYWORD); } diff --git a/src/vm/excep.cpp b/src/vm/excep.cpp index 7a949f4138..ae4f76ab78 100644 --- a/src/vm/excep.cpp +++ b/src/vm/excep.cpp @@ -4387,7 +4387,7 @@ LONG UserBreakpointFilter(EXCEPTION_POINTERS* pEP) } #endif // DEBUGGING_SUPPORTED - if(ETW_EVENT_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_PRIVATE_PROVIDER_Context, FailFast)) + if(ETW_EVENT_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_PRIVATE_PROVIDER_DOTNET_Context, FailFast)) { // Fire an ETW FailFast event FireEtwFailFast(W("StatusBreakpoint"), diff --git a/src/vm/jithelpers.cpp b/src/vm/jithelpers.cpp index 47e82f400c..67d4e02329 100644 --- a/src/vm/jithelpers.cpp +++ b/src/vm/jithelpers.cpp @@ -5100,7 +5100,7 @@ void DoJITFailFast () __report_gsfailure((ULONG_PTR)0); #endif // defined(_TARGET_X86_) #else // FEATURE_PAL - if(ETW_EVENT_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_PRIVATE_PROVIDER_Context, FailFast)) + if(ETW_EVENT_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_PRIVATE_PROVIDER_DOTNET_Context, FailFast)) { // Fire an ETW FailFast event FireEtwFailFast(W("Unsafe buffer security check failure: Buffer overrun detected"), diff --git a/src/vm/jitinterface.cpp b/src/vm/jitinterface.cpp index d67ad2f251..68918772ab 100644 --- a/src/vm/jitinterface.cpp +++ b/src/vm/jitinterface.cpp @@ -8223,7 +8223,7 @@ void CEEInfo::reportInliningDecision (CORINFO_METHOD_HANDLE inlinerHnd, #endif //_DEBUG //I'm gonna duplicate this code because the format is slightly different. And LoggingOn is debug only. - if (ETW_TRACING_CATEGORY_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_PROVIDER_Context, + if (ETW_TRACING_CATEGORY_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_PROVIDER_DOTNET_Context, TRACE_LEVEL_VERBOSE, CLR_JITTRACING_KEYWORD)) { @@ -8575,7 +8575,7 @@ void CEEInfo::reportTailCallDecision (CORINFO_METHOD_HANDLE callerHnd, #endif //_DEBUG // I'm gonna duplicate this code because the format is slightly different. And LoggingOn is debug only. - if (ETW_TRACING_CATEGORY_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_PROVIDER_Context, + if (ETW_TRACING_CATEGORY_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_PROVIDER_DOTNET_Context, TRACE_LEVEL_VERBOSE, CLR_JITTRACING_KEYWORD)) { diff --git a/src/vm/multicorejitplayer.cpp b/src/vm/multicorejitplayer.cpp index bde2c16bf8..5ea38d9726 100644 --- a/src/vm/multicorejitplayer.cpp +++ b/src/vm/multicorejitplayer.cpp @@ -562,7 +562,7 @@ void MulticoreJitProfilePlayer::JITMethod(Module * pModule, unsigned methodIndex // Ensure non-null module if (pModule == NULL) { - if (ETW_TRACING_CATEGORY_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_PRIVATE_PROVIDER_Context, TRACE_LEVEL_VERBOSE, CLR_PRIVATEMULTICOREJIT_KEYWORD)) + if (ETW_TRACING_CATEGORY_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_PRIVATE_PROVIDER_DOTNET_Context, TRACE_LEVEL_VERBOSE, CLR_PRIVATEMULTICOREJIT_KEYWORD)) { _FireEtwMulticoreJitA(W("NULLMODULEPOINTER"), NULL, methodIndex, 0, 0); } @@ -619,7 +619,7 @@ BadMethod: MulticoreJitTrace(("Filtered out methods: pModule:[%s] token:[%x]", pModule->GetSimpleName(), token)); - if (ETW_TRACING_CATEGORY_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_PRIVATE_PROVIDER_Context, TRACE_LEVEL_VERBOSE, CLR_PRIVATEMULTICOREJIT_KEYWORD)) + if (ETW_TRACING_CATEGORY_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_PRIVATE_PROVIDER_DOTNET_Context, TRACE_LEVEL_VERBOSE, CLR_PRIVATEMULTICOREJIT_KEYWORD)) { _FireEtwMulticoreJitA(W("FILTERMETHOD-GENERIC"), pModule->GetSimpleName(), token, 0, 0); } @@ -744,7 +744,7 @@ HRESULT MulticoreJitProfilePlayer::UpdateModuleInfo() info.Dump(W(" BlockingModule"), i); #endif - if (ETW_TRACING_CATEGORY_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_PRIVATE_PROVIDER_Context, TRACE_LEVEL_VERBOSE, CLR_PRIVATEMULTICOREJIT_KEYWORD)) + if (ETW_TRACING_CATEGORY_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_PRIVATE_PROVIDER_DOTNET_Context, TRACE_LEVEL_VERBOSE, CLR_PRIVATEMULTICOREJIT_KEYWORD)) { _FireEtwMulticoreJitA(W("BLOCKINGMODULE"), info.m_pRecord->GetModuleName(), i, info.m_curLevel, info.m_needLevel); } @@ -842,7 +842,7 @@ bool MulticoreJitProfilePlayer::GroupWaitForModuleLoad(int pos) MulticoreJitTrace(("Delay: %d ms", delay)); - if (ETW_TRACING_CATEGORY_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_PRIVATE_PROVIDER_Context, TRACE_LEVEL_VERBOSE, CLR_PRIVATEMULTICOREJIT_KEYWORD)) + if (ETW_TRACING_CATEGORY_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_PRIVATE_PROVIDER_DOTNET_Context, TRACE_LEVEL_VERBOSE, CLR_PRIVATEMULTICOREJIT_KEYWORD)) { _FireEtwMulticoreJit(W("GROUPWAIT"), W("Delay"), delay, 0, 0); } diff --git a/src/vm/nativeoverlapped.cpp b/src/vm/nativeoverlapped.cpp index a01f71ebb2..55be72453c 100644 --- a/src/vm/nativeoverlapped.cpp +++ b/src/vm/nativeoverlapped.cpp @@ -79,7 +79,7 @@ FCIMPL3(void, CheckVMForIOPacket, LPOVERLAPPED* lpOverlapped, DWORD* errorCode, } // if this will be "dispatched" to the managed callback fire the IODequeue event: - if (*lpOverlapped != NULL && ETW_EVENT_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_PROVIDER_Context, ThreadPoolIODequeue)) + if (*lpOverlapped != NULL && ETW_EVENT_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_PROVIDER_DOTNET_Context, ThreadPoolIODequeue)) FireEtwThreadPoolIODequeue(*lpOverlapped, OverlappedDataObject::GetOverlapped(*lpOverlapped), GetClrInstanceId()); #else // !FEATURE_PAL @@ -144,7 +144,7 @@ FCIMPL1(LPOVERLAPPED, AllocateNativeOverlapped, OverlappedDataObject* overlapped HELPER_METHOD_FRAME_END(); LOG((LF_INTEROP, LL_INFO10000, "In AllocNativeOperlapped thread 0x%x\n", GetThread())); - if (ETW_EVENT_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_PROVIDER_Context, ThreadPoolIODequeue)) + if (ETW_EVENT_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_PROVIDER_DOTNET_Context, ThreadPoolIODequeue)) FireEtwThreadPoolIOPack(lpOverlapped, overlappedUNSAFE, GetClrInstanceId()); return lpOverlapped; diff --git a/src/vm/prestub.cpp b/src/vm/prestub.cpp index 45ee0f02df..0cbd0fc236 100644 --- a/src/vm/prestub.cpp +++ b/src/vm/prestub.cpp @@ -820,7 +820,7 @@ PCODE MethodDesc::JitCompileCodeLockedEventWrapper(PrepareCodeConfig* pConfig, J } #endif // PROFILING_SUPPORTED - if (!ETW_TRACING_CATEGORY_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_PROVIDER_Context, + if (!ETW_TRACING_CATEGORY_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_PROVIDER_DOTNET_Context, TRACE_LEVEL_VERBOSE, CLR_JIT_KEYWORD)) { diff --git a/src/vm/proftoeeinterfaceimpl.cpp b/src/vm/proftoeeinterfaceimpl.cpp index 13bf2a4b4b..f2387232a6 100644 --- a/src/vm/proftoeeinterfaceimpl.cpp +++ b/src/vm/proftoeeinterfaceimpl.cpp @@ -1168,7 +1168,7 @@ bool HeapWalkHelper(Object * pBO, void * pvContext) #ifdef FEATURE_EVENT_TRACE if (s_forcedGCInProgress && - ETW_TRACING_CATEGORY_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_PROVIDER_Context, + ETW_TRACING_CATEGORY_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_PROVIDER_DOTNET_Context, TRACE_LEVEL_INFORMATION, CLR_GCHEAPDUMP_KEYWORD)) { @@ -1320,7 +1320,7 @@ void ScanRootsHelper(Object* pObj, Object ** ppRoot, ScanContext *pSC, uint32_t #ifdef FEATURE_EVENT_TRACE // Notify ETW of the root if (s_forcedGCInProgress && - ETW_TRACING_CATEGORY_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_PROVIDER_Context, + ETW_TRACING_CATEGORY_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_PROVIDER_DOTNET_Context, TRACE_LEVEL_INFORMATION, CLR_GCHEAPDUMP_KEYWORD)) { diff --git a/src/vm/readytoruninfo.cpp b/src/vm/readytoruninfo.cpp index 86eb37201b..e0eebb41c3 100644 --- a/src/vm/readytoruninfo.cpp +++ b/src/vm/readytoruninfo.cpp @@ -807,7 +807,7 @@ PCODE ReadyToRunInfo::GetEntryPoint(MethodDesc * pMD, PrepareCodeConfig* pConfig } done: - if (ETW_EVENT_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_PROVIDER_Context, R2RGetEntryPoint)) + if (ETW_EVENT_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_PROVIDER_DOTNET_Context, R2RGetEntryPoint)) { ETW::MethodLog::GetR2RGetEntryPoint(pMD, pEntryPoint); } diff --git a/src/vm/syncblk.cpp b/src/vm/syncblk.cpp index 5baab75fe5..b7052d4250 100644 --- a/src/vm/syncblk.cpp +++ b/src/vm/syncblk.cpp @@ -2581,7 +2581,7 @@ BOOL AwareLock::EnterEpilogHelper(Thread* pCurThread, INT32 timeOut) // the object associated with this lock. _ASSERTE(pCurThread->PreemptiveGCDisabled()); - BOOLEAN IsContentionKeywordEnabled = ETW_TRACING_CATEGORY_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_PROVIDER_Context, TRACE_LEVEL_INFORMATION, CLR_CONTENTION_KEYWORD); + BOOLEAN IsContentionKeywordEnabled = ETW_TRACING_CATEGORY_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_PROVIDER_DOTNET_Context, TRACE_LEVEL_INFORMATION, CLR_CONTENTION_KEYWORD); LARGE_INTEGER startTicks = { {0} }; if (IsContentionKeywordEnabled) diff --git a/src/vm/threadpoolrequest.cpp b/src/vm/threadpoolrequest.cpp index 1f94a5ece7..65c9c512c0 100644 --- a/src/vm/threadpoolrequest.cpp +++ b/src/vm/threadpoolrequest.cpp @@ -359,7 +359,7 @@ void UnManagedPerAppDomainTPCount::QueueUnmanagedWorkRequest(LPTHREAD_START_ROUT _ASSERTE(pWorkRequest != NULL); PREFIX_ASSUME(pWorkRequest != NULL); - if (ETW_EVENT_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_PROVIDER_Context, ThreadPoolEnqueue) && + if (ETW_EVENT_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_PROVIDER_DOTNET_Context, ThreadPoolEnqueue) && !ThreadpoolMgr::AreEtwQueueEventsSpeciallyHandled(function)) FireEtwThreadPoolEnqueue(pWorkRequest, GetClrInstanceId()); @@ -463,7 +463,7 @@ void UnManagedPerAppDomainTPCount::DispatchWorkItem(bool* foundWork, bool* wasNo wrFunction = pWorkRequest->Function; wrContext = pWorkRequest->Context; - if (ETW_EVENT_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_PROVIDER_Context, ThreadPoolDequeue) && + if (ETW_EVENT_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_PROVIDER_DOTNET_Context, ThreadPoolDequeue) && !ThreadpoolMgr::AreEtwQueueEventsSpeciallyHandled(wrFunction)) FireEtwThreadPoolDequeue(pWorkRequest, GetClrInstanceId()); diff --git a/src/vm/win32threadpool.cpp b/src/vm/win32threadpool.cpp index 2f0625ace4..1ec90c54bc 100644 --- a/src/vm/win32threadpool.cpp +++ b/src/vm/win32threadpool.cpp @@ -2309,7 +2309,7 @@ BOOL ThreadpoolMgr::RegisterWaitForSingleObject(PHANDLE phNewWaitObject, // We fire the "enqueue" ETW event here, to "mark" the thread that had called the API, rather than the // thread that will PostQueuedCompletionStatus (the dedicated WaitThread). // This event correlates with ThreadPoolIODequeue in ThreadpoolMgr::AsyncCallbackCompletion - if (ETW_EVENT_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_PROVIDER_Context, ThreadPoolIOEnqueue)) + if (ETW_EVENT_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_PROVIDER_DOTNET_Context, ThreadPoolIOEnqueue)) FireEtwThreadPoolIOEnqueue((LPOVERLAPPED)waitInfo, reinterpret_cast<void*>(Callback), (dwFlag & WAIT_SINGLE_EXECUTION) == 0, GetClrInstanceId()); BOOL status = QueueUserAPC((PAPCFUNC)InsertNewWaitForSelf, threadCB->threadHandle, (size_t) waitInfo); @@ -2867,7 +2867,7 @@ DWORD WINAPI ThreadpoolMgr::AsyncCallbackCompletion(PVOID pArgs) // We fire the "dequeue" ETW event here, before executing the user code, to enable correlation with // the ThreadPoolIOEnqueue fired in ThreadpoolMgr::RegisterWaitForSingleObject - if (ETW_EVENT_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_PROVIDER_Context, ThreadPoolIODequeue)) + if (ETW_EVENT_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_PROVIDER_DOTNET_Context, ThreadPoolIODequeue)) FireEtwThreadPoolIODequeue(waitInfo, reinterpret_cast<void*>(waitInfo->Callback), GetClrInstanceId()); // the user callback can throw, the host must be prepared to handle it. @@ -3427,7 +3427,7 @@ Top: // Note: we still fire the event for managed async IO, despite the fact we don't have a paired IOEnqueue event // for this case. We do this to "mark" the end of the previous workitem. When we provide full support at the higher // abstraction level for managed IO we can remove the IODequeues fired here - if (ETW_EVENT_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_PROVIDER_Context, ThreadPoolIODequeue) + if (ETW_EVENT_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_PROVIDER_DOTNET_Context, ThreadPoolIODequeue) && !AreEtwIOQueueEventsSpeciallyHandled((LPOVERLAPPED_COMPLETION_ROUTINE)key) && pOverlapped != NULL) { FireEtwThreadPoolIODequeue(pOverlapped, OverlappedDataObject::GetOverlappedForTracing(pOverlapped), GetClrInstanceId()); |