Skip to content

Commit

Permalink
[3.1] Backport fixes to ETW/EventPipe events to enable GCDumps (dotne…
Browse files Browse the repository at this point in the history
…t#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 (dotnet#26270)

* Fix unique ETW events for GC Type logging, so they are also fired across EventPipe (dotnet#27250)
  • Loading branch information
John Salem authored Oct 21, 2019
1 parent a31b0b1 commit 89091b5
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions src/vm/eventtrace.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -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);

Expand Down Expand Up @@ -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);

Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 89091b5

Please sign in to comment.