summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKoundinya Veluri <kouvel@users.noreply.github.com>2019-06-11 10:58:05 -0700
committerGitHub <noreply@github.com>2019-06-11 10:58:05 -0700
commit3c1997db1614727e0c111efddb01224ac8779826 (patch)
treee90b5696eceec34b0d45c98321ea9aca8cd25cac
parentf537a7aa452cbebed6a6e5a23a79144619c12095 (diff)
downloadcoreclr-3c1997db1614727e0c111efddb01224ac8779826.tar.gz
coreclr-3c1997db1614727e0c111efddb01224ac8779826.tar.bz2
coreclr-3c1997db1614727e0c111efddb01224ac8779826.zip
Refactor one-time ETL rundown event firing (#24993)
- Moved the `RuntimeInformation` and `TieredCompilation/Settings` events to fire on rundown on attach/detach
-rw-r--r--src/inc/eventtracebase.h1
-rw-r--r--src/vm/eventpipe.cpp3
-rw-r--r--src/vm/eventtrace.cpp33
3 files changed, 26 insertions, 11 deletions
diff --git a/src/inc/eventtracebase.h b/src/inc/eventtracebase.h
index 43cc99a7ee..3247348091 100644
--- a/src/inc/eventtracebase.h
+++ b/src/inc/eventtracebase.h
@@ -461,6 +461,7 @@ namespace ETW
static VOID ProcessShutdown();
static VOID ModuleRangeRundown();
+ static VOID SendOneTimeRundownEvents();
static VOID StartRundown();
static VOID EndRundown();
static VOID EnumerateForCaptureState();
diff --git a/src/vm/eventpipe.cpp b/src/vm/eventpipe.cpp
index 0b1ae11e21..d128759f01 100644
--- a/src/vm/eventpipe.cpp
+++ b/src/vm/eventpipe.cpp
@@ -449,9 +449,6 @@ void EventPipe::DisableInternal(EventPipeSessionID id, EventPipeProviderCallback
// Log the process information event.
LogProcessInformationEvent(*s_pEventSource);
- // Log the runtime information event.
- ETW::InfoLog::RuntimeInformation(ETW::InfoLog::InfoStructs::Normal);
-
// Disable pSession tracing.
s_config.Disable(*pSession, pEventPipeProviderCallbackDataQueue);
diff --git a/src/vm/eventtrace.cpp b/src/vm/eventtrace.cpp
index 400fdf208f..46c1e9c649 100644
--- a/src/vm/eventtrace.cpp
+++ b/src/vm/eventtrace.cpp
@@ -3833,6 +3833,27 @@ VOID ETW::EnumerationLog::ModuleRangeRundown()
/****************************************************************************/
+// Called when ETW is turned ON or OFF on an existing process, to send
+// events that are only sent once per rundown
+/****************************************************************************/
+VOID ETW::EnumerationLog::SendOneTimeRundownEvents()
+{
+ CONTRACTL {
+ NOTHROW;
+ GC_TRIGGERS;
+ } CONTRACTL_END;
+
+ // Fire the runtime information event
+ ETW::InfoLog::RuntimeInformation(ETW::InfoLog::InfoStructs::Callback);
+
+ if (ETW::CompilationLog::TieredCompilation::Rundown::IsEnabled() && g_pConfig->TieredCompilation())
+ {
+ ETW::CompilationLog::TieredCompilation::Rundown::SendSettings();
+ }
+}
+
+
+/****************************************************************************/
/* Called when ETW is turned ON on an existing process */
/****************************************************************************/
VOID ETW::EnumerationLog::StartRundown()
@@ -3844,6 +3865,8 @@ VOID ETW::EnumerationLog::StartRundown()
EX_TRY
{
+ SendOneTimeRundownEvents();
+
BOOL bIsPerfTrackRundownEnabled = ETW_TRACING_CATEGORY_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_RUNDOWN_PROVIDER_Context,
TRACE_LEVEL_INFORMATION,
CLR_RUNDOWNPERFTRACK_KEYWORD);
@@ -4016,6 +4039,8 @@ VOID ETW::EnumerationLog::EndRundown()
EX_TRY
{
+ SendOneTimeRundownEvents();
+
BOOL bIsPerfTrackRundownEnabled = ETW_TRACING_CATEGORY_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_RUNDOWN_PROVIDER_Context,
TRACE_LEVEL_INFORMATION,
CLR_RUNDOWNPERFTRACK_KEYWORD);
@@ -4461,14 +4486,6 @@ extern "C"
if(g_fEEStarted && !g_fEEShutDown && bIsRundownTraceHandle)
{
- // Fire the runtime information event
- ETW::InfoLog::RuntimeInformation(ETW::InfoLog::InfoStructs::Callback);
-
- if (ETW::CompilationLog::TieredCompilation::Rundown::IsEnabled() && g_pConfig->TieredCompilation())
- {
- ETW::CompilationLog::TieredCompilation::Rundown::SendSettings();
- }
-
// 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