internal static void Initialize() { // Don't allow failures to propagate upstream. Ensure program correctness without tracing. try { Initializing = true; if (s_controllerInstance == null) { int enabled = Config_EnableEventPipe; if (enabled > 0) { // Enable tracing immediately. // It will be disabled automatically on shutdown. EventPipe.Enable(BuildConfigFromEnvironment()); } // If not set at all, we listen for changes in the control file. else if (enabled != 0) { // Create a new controller to listen for commands. s_controllerInstance = new EventPipeController(); } // If enable is explicitly set to 0, then don't start the controller (to avoid overhead). RuntimeEventSource.Initialize(); } } catch { } finally { Initializing = false; } }
internal static void Initialize() { // Don't allow failures to propagate upstream. Ensure program correctness without tracing. try { if (!IsControllerInitialized) { if (Config_EnableEventPipe > 0) { // Enable tracing immediately. // It will be disabled automatically on shutdown. EventPipe.Enable(BuildConfigFromEnvironment()); } RuntimeEventSource.Initialize(); IsControllerInitialized = true; } } catch { } }