Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Only initialize RuntimeEventSource if perftracing is supported
  • Loading branch information
lambdageek committed Jan 17, 2023
commit c8e2c3b1bab22307f028791609200d279a59e72e
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,13 @@ private static void ProcessStartupHooks()
if (!IsSupported)
return;

#if FEATURE_PERFTRACING
// Initialize tracing before any user code can be called if EventSource is enabled.
if (EventSource.IsSupported)
{
System.Diagnostics.Tracing.RuntimeEventSource.Initialize();
}
#endif

string? startupHooksVariable = AppContext.GetData("STARTUP_HOOKS") as string;
if (startupHooksVariable == null)
Expand Down