From 89091b51f3a4ececbf2af2e9fff6f9400efe8191 Mon Sep 17 00:00:00 2001 From: John Salem Date: Mon, 21 Oct 2019 11:22:50 -0700 Subject: [PATCH] [3.1] Backport fixes to ETW/EventPipe events to enable GCDumps (#27297) * Move TypeSystemLog::OnKeywordsChanged from EtwCallback to EtwCallbackCommon to enable this same behavior in ETW and EventPipe. This unblocks parity for GCHeapDumps between ETW and EventPipe (#26270) * Fix unique ETW events for GC Type logging, so they are also fired across EventPipe (#27250) --- src/vm/eventtrace.cpp | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/vm/eventtrace.cpp b/src/vm/eventtrace.cpp index 36235d6..f5f6389 100644 --- a/src/vm/eventtrace.cpp +++ b/src/vm/eventtrace.cpp @@ -1135,6 +1135,7 @@ void BulkComLogger::FlushRcw() #else ULONG result = FireEtXplatGCBulkRCW(m_currRcw, instance, sizeof(EventRCWEntry) * m_currRcw, m_etwRcwData); #endif // !defined(FEATURE_PAL) + result |= EventPipeWriteEventGCBulkRCW(m_currRcw, instance, sizeof(EventRCWEntry) * m_currRcw, m_etwRcwData); _ASSERTE(result == ERROR_SUCCESS); @@ -1224,6 +1225,7 @@ void BulkComLogger::FlushCcw() #else ULONG result = FireEtXplatGCBulkRootCCW(m_currCcw, instance, sizeof(EventCCWEntry) * m_currCcw, m_etwCcwData); #endif //!defined(FEATURE_PAL) + result |= EventPipeWriteEventGCBulkRootCCW(m_currCcw, instance, sizeof(EventCCWEntry) * m_currCcw, m_etwCcwData); _ASSERTE(result == ERROR_SUCCESS); @@ -1428,6 +1430,7 @@ void BulkStaticsLogger::FireBulkStaticsEvent() #else ULONG result = FireEtXplatGCBulkRootStaticVar(m_count, appDomain, instance, m_used, m_buffer); #endif //!defined(FEATURE_PAL) + result |= EventPipeWriteEventGCBulkRootStaticVar(m_count, appDomain, instance, m_used, m_buffer); _ASSERTE(result == ERROR_SUCCESS); @@ -4269,6 +4272,12 @@ VOID EtwCallbackCommon( #endif // !defined(FEATURE_PAL) ETW::GCLog::ForceGC(l64ClientSequenceNumber); } + // TypeSystemLog needs a notification when certain keywords are modified, so + // give it a hook here. + if (g_fEEStarted && !g_fEEShutDown && bIsPublicTraceHandle) + { + ETW::TypeSystemLog::OnKeywordsChanged(); + } } // Individual callbacks for each EventPipe provider. @@ -4488,13 +4497,6 @@ extern "C" EtwCallbackCommon(providerIndex, ControlCode, Level, MatchAnyKeyword, FilterData, false); - // TypeSystemLog needs a notification when certain keywords are modified, so - // give it a hook here. - if (g_fEEStarted && !g_fEEShutDown && bIsPublicTraceHandle) - { - ETW::TypeSystemLog::OnKeywordsChanged(); - } - // A manifest based provider can be enabled to multiple event tracing sessions // As long as there is atleast 1 enabled session, IsEnabled will be TRUE // Since classic providers can be enabled to only a single session, -- 2.7.4