Exemplo n.º 1
0
        internal static void Enable(EventPipeConfiguration configuration)
        {
            if (configuration == null)
            {
                throw new ArgumentNullException(nameof(configuration));
            }

            if (configuration.Providers == null)
            {
                throw new ArgumentNullException(nameof(configuration.Providers));
            }

            EventPipeProviderConfiguration[] providers = configuration.Providers;

            s_sessionID = EventPipeInternal.Enable(
                configuration.OutputFile,
                configuration.Format,
                configuration.CircularBufferSizeInMB,
                providers);
        }
Exemplo n.º 2
0
        internal static void Enable(EventPipeConfiguration configuration)
        {
            if (configuration == null)
            {
                throw new ArgumentNullException(nameof(configuration));
            }

            if (configuration.Providers == null)
            {
                throw new ArgumentNullException(nameof(configuration.Providers));
            }

            EventPipeProviderConfiguration[] providers = configuration.Providers;

            EventPipeInternal.Enable(
                configuration.OutputFile,
                configuration.CircularBufferSizeInMB,
                configuration.ProfilerSamplingRateInNanoseconds,
                providers,
                providers.Length);
        }
Exemplo n.º 3
0
        internal static void Enable(EventPipeConfiguration configuration)
        {
            if (configuration == null)
            {
                throw new ArgumentNullException(nameof(configuration));
            }

            if (configuration.Providers == null)
            {
                throw new ArgumentNullException(nameof(configuration.Providers));
            }

            EventPipeProviderConfiguration[] providers = configuration.Providers;

            s_sessionID = EventPipeInternal.Enable(
                configuration.OutputFile,
                configuration.CircularBufferSizeInMB,
                (ulong)configuration.ProfilerSamplingRateInNanoseconds,
                providers,
                (uint)providers.Length,
                configuration.MultiFileTraceLengthInSeconds);
        }
Exemplo n.º 4
0
        private void CommitDispatchConfiguration()
        {
            // Ensure that the dispatch task is stopped.
            // This is a no-op if the task is already stopped.
            StopDispatchTask();

            // Stop tracing.
            // This is a no-op if it's already disabled.
            EventPipeInternal.Disable();

            // Check to see if tracing should be enabled.
            if (m_subscriptions.Count <= 0)
            {
                return;
            }

            // Start collecting events.
            EventKeywords aggregatedKeywords = EventKeywords.None;
            EventLevel    highestLevel       = EventLevel.LogAlways;

            foreach (EventListenerSubscription subscription in m_subscriptions.Values)
            {
                aggregatedKeywords |= subscription.MatchAnyKeywords;
                highestLevel        = (subscription.Level > highestLevel) ? subscription.Level : highestLevel;
            }

            EventPipeProviderConfiguration[] providerConfiguration = new EventPipeProviderConfiguration[]
            {
                new EventPipeProviderConfiguration(RuntimeEventSource.EventSourceName, (ulong)aggregatedKeywords, (uint)highestLevel)
            };

            EventPipeInternal.Enable(null, 1024, 1, providerConfiguration, 1);

            // Start the dispatch task.
            StartDispatchTask();
        }