public void Append(MemoryGraph memoryGraph, string etlName, string processNameOrId = null, double startTimeRelativeMSec = 0)
 {
     using (var source = TraceEventDispatcher.GetDispatcherFromFileName(etlName))
     {
         Append(memoryGraph, source, processNameOrId, startTimeRelativeMSec);
     }
 }
Exemplo n.º 2
0
        public static int Main(string[] args)
        {
            // Additional assemblies will be seen, but these are ones we must see
            string[] AssembliesExpected = new string[] {
                "rundown", // this assembly
                "System.Runtime",
                "Microsoft.Diagnostics.Tracing.TraceEvent",
                "System.Diagnostics.Tracing",
                "System.Private.CoreLib"
            };

            using (var netPerfFile = NetPerfFile.Create(args))
            {
                Console.WriteLine("\tStart: Enable tracing.");
                TraceControl.EnableDefault(netPerfFile.Path);
                Console.WriteLine("\tEnd: Enable tracing.\n");

                // Since all we care about is rundown, there is nothing to do there

                Console.WriteLine("\tStart: Disable tracing.");
                TraceControl.Disable();
                Console.WriteLine("\tEnd: Disable tracing.\n");

                Console.WriteLine("\tStart: Process the trace file.");

                var assembliesLoaded      = new HashSet <string>();
                int nonMatchingEventCount = 0;

                using (var trace = TraceEventDispatcher.GetDispatcherFromFileName(netPerfFile.Path))
                {
                    var rundownParser = new ClrRundownTraceEventParser(trace);

                    rundownParser.LoaderAssemblyDCStop += delegate(AssemblyLoadUnloadTraceData data)
                    {
                        var nameIndex = Array.IndexOf(data.PayloadNames, ("FullyQualifiedAssemblyName"));
                        if (nameIndex >= 0)
                        {
                            // Add the assembly name to a set to verify later
                            assembliesLoaded.Add(((string)data.PayloadValue(nameIndex)).Split(',')[0]);
                        }
                        else
                        {
                            nonMatchingEventCount++;
                        }
                    };

                    trace.Process();
                }
                Console.WriteLine("\tEnd: Processing events from file.\n");

                foreach (var name in AssembliesExpected)
                {
                    Assert.True($"Assembly {name} in loaded assemblies", assembliesLoaded.Contains(name));
                }
                Assert.Equal(nameof(nonMatchingEventCount), nonMatchingEventCount, 0);
            }

            return(100);
        }
Exemplo n.º 3
0
        public static int Main(string[] args)
        {
            using (var netPerfFile = NetPerfFile.Create(args))
            {
                Console.WriteLine("\tStart: Enable tracing.");
                TraceControl.EnableDefault(netPerfFile.Path);
                Console.WriteLine("\tEnd: Enable tracing.\n");

                Console.WriteLine("\tStart: Generate some events.");
                DynamicallyCompiledMethodInvoker invoker = BuildDynamicMethod();
                invoker.Invoke();
                Console.WriteLine("\tEnd: Generate some events.\n");

                Console.WriteLine("\tStart: Disable tracing.");
                TraceControl.Disable();
                Console.WriteLine("\tEnd: Disable tracing.\n");

                Console.WriteLine("\tStart: Process the trace file.");

                int matchingEventCount    = 0;
                int nonMatchingEventCount = 0;

                using (var trace = TraceEventDispatcher.GetDispatcherFromFileName(netPerfFile.Path))
                {
                    string methodNamespace      = "dynamicClass";
                    string methodName           = "DynamicallyCompiledMethod";
                    string methodSignature      = "void  ()";
                    string providerName         = "Microsoft-Windows-DotNETRuntime";
                    string gcTriggeredEventName = "Method/JittingStarted";

                    trace.Clr.MethodJittingStarted += delegate(MethodJittingStartedTraceData data)
                    {
                        if (methodNamespace.Equals(data.MethodNamespace) &&
                            methodName.Equals(data.MethodName) &&
                            methodSignature.Equals(data.MethodSignature) &&
                            providerName.Equals(data.ProviderName) &&
                            gcTriggeredEventName.Equals(data.EventName))
                        {
                            matchingEventCount++;
                        }
                    };

                    trace.Process();
                }
                Console.WriteLine("\tEnd: Processing events from file.\n");

                // CompiledMethod
                Assert.Equal(nameof(matchingEventCount), matchingEventCount, 1);
            }

            return(100);
        }
Exemplo n.º 4
0
        public static int Main(string[] args)
        {
            using (var netPerfFile = NetPerfFile.Create(args))
            {
                Console.WriteLine("\tStart: Enable tracing.");
                TraceControl.EnableDefault(netPerfFile.Path);
                Console.WriteLine("\tEnd: Enable tracing.\n");

                Console.WriteLine("\tStart: Generate some events.");
                for (int i = 0; i < InducedGCIterations; i++)
                {
                    GC.Collect();
                }
                Console.WriteLine("\tEnd: Generate some events.\n");

                Console.WriteLine("\tStart: Disable tracing.");
                TraceControl.Disable();
                Console.WriteLine("\tEnd: Disable tracing.\n");

                Console.WriteLine("\tStart: Process the trace file.");
                int matchingEventCount    = 0;
                int nonMatchingEventCount = 0;
                using (var trace = TraceEventDispatcher.GetDispatcherFromFileName(netPerfFile.Path))
                {
                    string gcReasonInduced      = GCReason.Induced.ToString();
                    string providerName         = "Microsoft-Windows-DotNETRuntime";
                    string gcTriggeredEventName = "GC/Triggered";

                    trace.Clr.GCTriggered += delegate(GCTriggeredTraceData data)
                    {
                        if (gcReasonInduced.Equals(data.Reason.ToString()) &&
                            providerName.Equals(data.ProviderName) &&
                            gcTriggeredEventName.Equals(data.EventName))
                        {
                            matchingEventCount++;
                        }
                        else
                        {
                            nonMatchingEventCount++;
                        }
                    };

                    trace.Process();
                }
                Console.WriteLine("\tEnd: Processing events from file.\n");

                Assert.Equal(nameof(matchingEventCount), InducedGCIterations, matchingEventCount);
                Assert.Equal(nameof(nonMatchingEventCount), nonMatchingEventCount, 0);
            }

            return(100);
        }
Exemplo n.º 5
0
        /// <summary>
        /// This test collects a trace of itself and then performs some basic validation on the trace.
        /// </summary>
        public static int Main(string[] args)
        {
            // Calculate the path to the config file.
            string configFileName = Assembly.GetEntryAssembly().GetName().Name + ".eventpipeconfig";
            string configFilePath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, configFileName);

            Console.WriteLine("Calculated config file path: " + configFilePath);

            // Write the config file to disk.
            File.WriteAllText(configFilePath, ConfigFileContents);
            Console.WriteLine("Wrote contents of config file.");

            // Wait few seconds to ensure that tracing has started.
            Console.WriteLine($"Waiting {TimeIntervalToReadConfigFile.TotalSeconds} seconds for the config file to be picked up by the next poll operation.");
            Thread.Sleep(TimeIntervalToReadConfigFile);

            // Do some work that we can look for in the trace.
            Console.WriteLine("Do some work that will be captured by the trace.");
            GC.Collect(2, GCCollectionMode.Forced);
            Console.WriteLine("Done with the work.");

            // Delete the config file to start tracing.
            File.Delete(configFilePath);
            Console.WriteLine("Deleted the config file.");

            // Build the full path to the trace file.
            string[] traceFiles = Directory.GetFiles(".", "*.netperf", SearchOption.TopDirectoryOnly);
            Assert.Equal("traceFiles.Length == 1", traceFiles.Length, 1);
            string traceFilePath = traceFiles[0];

            // Poll the file system and wait for the trace file to be written.
            Console.WriteLine("Wait for the config file deletion to be picked up and for the trace file to be written.");

            // Wait for 1 second, which is the poll time when tracing is enabled.
            Thread.Sleep(TimeSpan.FromSeconds(1));

            // Poll for file size changes to the trace file itself.
            // When the size of the trace file hasn't changed for few seconds, consider it fully written out.
            Console.WriteLine($"Waiting for the trace file to be written. Poll every second to watch for {TimeIntervalToReadConfigFile.TotalSeconds} seconds of no file size changes.");
            long     lastSizeInBytes     = 0;
            DateTime timeOfLastChangeUTC = DateTime.UtcNow;

            do
            {
                FileInfo traceFileInfo      = new FileInfo(traceFilePath);
                long     currentSizeInBytes = traceFileInfo.Length;
                Console.WriteLine("Trace file size: " + ((double)currentSizeInBytes / BytesInOneMB));

                if (currentSizeInBytes > lastSizeInBytes)
                {
                    lastSizeInBytes     = currentSizeInBytes;
                    timeOfLastChangeUTC = DateTime.UtcNow;
                }

                Thread.Sleep(TimeSpan.FromSeconds(1));
            } while (DateTime.UtcNow.Subtract(timeOfLastChangeUTC) < TimeIntervalToReadConfigFile);

            int retVal = 0;

            // Use TraceEvent to consume the trace file and look for the work that we did.
            Console.WriteLine("Using TraceEvent to parse the file to find the work that was done during trace capture.");
            using (var trace = TraceEventDispatcher.GetDispatcherFromFileName(traceFilePath))
            {
                string gcReasonInduced      = GCReason.Induced.ToString();
                string providerName         = "Microsoft-Windows-DotNETRuntime";
                string gcTriggeredEventName = "GC/Triggered";

                trace.Clr.GCTriggered += delegate(GCTriggeredTraceData data)
                {
                    if (gcReasonInduced.Equals(data.Reason.ToString()))
                    {
                        Console.WriteLine("Detected an induced GC");
                        retVal = 100;
                    }
                };

                trace.Process();
            }

            // Clean-up the resulting trace file.
            File.Delete(traceFilePath);

            return(retVal);
        }
Exemplo n.º 6
0
        static int Main(string[] args)
        {
            bool pass       = true;
            bool keepOutput = false;

            // Use the first arg as an output filename if there is one
            string outputFilename = null;

            if (args.Length >= 1)
            {
                outputFilename = args[0];
                keepOutput     = true;
            }
            else
            {
                outputFilename = System.IO.Path.GetTempPath() + Guid.NewGuid().ToString() + ".netperf";
            }

            try
            {
                Console.WriteLine("\tStart: Enable tracing.");
                TraceControl.EnableDefault(outputFilename);
                Console.WriteLine("\tEnd: Enable tracing.\n");

                Console.WriteLine("\tStart: Generating CLR events");
                // Allocate for allocIterations iterations.
                for (int i = 0; i < allocIterations; i++)
                {
                    GC.KeepAlive(new object());
                }
                // GC gcIternation times
                for (int i = 0; i < gcIterations; i++)
                {
                    GC.Collect();
                }
                Console.WriteLine("\tEnd: Generating CLR Events\n");

                Console.WriteLine("\tStart: Disable tracing.");
                TraceControl.Disable();
                Console.WriteLine("\tEnd: Disable tracing.\n");

                Console.WriteLine("\tStart: Processing events from file.");
                int allocTickCount = 0;
                int gcTriggerCount = 0;
                using (var trace = TraceEventDispatcher.GetDispatcherFromFileName(outputFilename))
                {
                    trace.Clr.GCAllocationTick += delegate(GCAllocationTickTraceData data)
                    {
                        allocTickCount += 1;

                        // Some basic integrity checks
                        AssertEqual(data.TypeName, "System.Object");
                        AssertEqual(data.AllocationKind.ToString(), GCAllocationKind.Small.ToString());
                        AssertEqual(data.ProviderName, "Microsoft-Windows-DotNETRuntime");
                        AssertEqual(data.EventName, "GC/AllocationTick");
                    };
                    trace.Clr.GCTriggered += delegate(GCTriggeredTraceData data)
                    {
                        gcTriggerCount += 1;

                        // Some basic integrity checks
                        AssertEqual(data.Reason.ToString(), GCReason.Induced.ToString());
                        AssertEqual(data.ProviderName, "Microsoft-Windows-DotNETRuntime");
                        AssertEqual(data.EventName, "GC/Triggered");
                    };

                    trace.Process();
                }
                Console.WriteLine("\tEnd: Processing events from file.\n");

                Console.WriteLine("\tProcessed {0} GCAllocationTick events", allocTickCount);
                Console.WriteLine("\tProcessed {0} GCTriggered events", gcTriggerCount);

                pass &= allocTickCount > 0;
                pass &= gcTriggerCount == gcIterations;
            }
            finally {
                if (keepOutput)
                {
                    Console.WriteLine("\n\tOutput file: {0}", outputFilename);
                }
                else
                {
                    System.IO.File.Delete(outputFilename);
                }
            }

            return(pass ? 100 : 0);
        }
Exemplo n.º 7
0
        /// <summary>
        /// This test collects a trace of itself and then performs some basic validation on the trace.
        /// </summary>
        public int Execute()
        {
            MySimpleEventSource MySimpleEventSource = new MySimpleEventSource(this);

            // Logging before tracing is enable - this should be ignored
            MySimpleEventSource.Request("Test 1");

            // Calculate the path to the config file.
            string configFileName = Assembly.GetEntryAssembly().GetName().Name + ".eventpipeconfig";
            string configFilePath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, configFileName);

            Console.WriteLine("Calculated config file path: " + configFilePath);

            // Write the config file to disk.
            File.WriteAllText(configFilePath, GetConfigFileContents());
            Console.WriteLine("Wrote contents of config file.");

            // Wait few seconds to ensure that tracing has started.
            Console.WriteLine($"Waiting {TimeIntervalToReadConfigFile.TotalSeconds} seconds for the config file to be picked up by the next poll operation.");
            Thread.Sleep(TimeIntervalToReadConfigFile);

            // Do some work that we can look for in the trace.
            Console.WriteLine("Do some work that will be captured by the trace.");
            GC.Collect(2, GCCollectionMode.Forced);

            // Logging while tracing is enabled - this should NOT be ignored
            MySimpleEventSource.Request("Test 2");

            Console.WriteLine("Done with the work.");

            // Delete the config file to start tracing.
            File.Delete(configFilePath);
            Console.WriteLine("Deleted the config file.");

            // Build the full path to the trace file.
            string[] traceFiles = Directory.GetFiles(".", "*.netperf", SearchOption.TopDirectoryOnly);
            Assert.Equal("traceFiles.Length == 1", traceFiles.Length, 1);
            string traceFilePath = traceFiles[0];

            // Poll the file system and wait for the trace file to be written.
            Console.WriteLine("Wait for the config file deletion to be picked up and for the trace file to be written.");

            // Wait for 1 second, which is the poll time when tracing is enabled.
            Thread.Sleep(TimeSpan.FromSeconds(1));

            // Logging after tracing is disabled - this should be ignored
            MySimpleEventSource.Request("Test 3");

            // Poll for file size changes to the trace file itself.
            // When the size of the trace file hasn't changed for few seconds, consider it fully written out.
            Console.WriteLine($"Waiting for the trace file to be written. Poll every second to watch for {TimeIntervalToReadConfigFile.TotalSeconds} seconds of no file size changes.");
            long     lastSizeInBytes     = 0;
            DateTime timeOfLastChangeUTC = DateTime.UtcNow;

            do
            {
                FileInfo traceFileInfo      = new FileInfo(traceFilePath);
                long     currentSizeInBytes = traceFileInfo.Length;
                Console.WriteLine("Trace file size: " + ((double)currentSizeInBytes / BytesInOneMB));

                if (currentSizeInBytes > lastSizeInBytes)
                {
                    lastSizeInBytes     = currentSizeInBytes;
                    timeOfLastChangeUTC = DateTime.UtcNow;
                }

                Thread.Sleep(TimeSpan.FromSeconds(1));
            } while (DateTime.UtcNow.Subtract(timeOfLastChangeUTC) < TimeIntervalToReadConfigFile);

            // Use TraceEvent to consume the trace file and look for the work that we did.
            Console.WriteLine("Using TraceEvent to parse the file to find the work that was done during trace capture.");
            using (TraceEventDispatcher trace = TraceEventDispatcher.GetDispatcherFromFileName(traceFilePath))
            {
                InstallValidationCallbacks(trace);
                trace.Process();
            }

            // Clean-up the resulting trace file.
            File.Delete(traceFilePath);

            return(this.Pass() ? 100 : 10086);
        }
Exemplo n.º 8
0
        static int Main(string[] args)
        {
            bool pass       = true;
            bool keepOutput = false;

            // Use the first arg as an output filename if there is one
            string outputFilename = null;

            if (args.Length >= 1)
            {
                outputFilename = args[0];
                keepOutput     = true;
            }
            else
            {
                outputFilename = System.IO.Path.GetTempPath() + Guid.NewGuid().ToString() + ".netperf";
            }

            SimpleEventSource eventSource = new SimpleEventSource();

            try
            {
                Console.WriteLine("\tStart: Enable tracing.");
                TraceControl.Enable(GetConfig(eventSource, outputFilename));
                Console.WriteLine("\tEnd: Enable tracing.\n");

                Console.WriteLine("\tStart: Messaging.");
                // Send messages
                // Use random numbers and addition as a simple, human readble checksum
                Random generator = new Random();
                for (int i = 0; i < messageIterations; i++)
                {
                    int    x       = generator.Next(1, 1000);
                    int    y       = generator.Next(1, 1000);
                    string formula = String.Format("{0} + {1} = {2}", x, y, x + y);

                    eventSource.MathResult(x, y, x + y, formula);
                }
                Console.WriteLine("\tEnd: Messaging.\n");

                Console.WriteLine("\tStart: Disable tracing.");
                TraceControl.Disable();
                Console.WriteLine("\tEnd: Disable tracing.\n");

                Console.WriteLine("\tStart: Processing events from file.");
                int msgCount = 0;
                using (var trace = TraceEventDispatcher.GetDispatcherFromFileName(outputFilename))
                {
                    var names = new HashSet <string>();

                    trace.Dynamic.All += delegate(TraceEvent data)
                    {
                        if (!names.Contains(data.ProviderName))
                        {
                            Console.WriteLine("\t{0}", data.ProviderName);
                            names.Add(data.ProviderName);
                        }

                        if (data.ProviderName == "SimpleEventSource")
                        {
                            msgCount += 1;
                        }
                    };

                    trace.Process();
                }
                Console.WriteLine("\tEnd: Processing events from file.\n");

                Console.WriteLine("\tProcessed {0} events from EventSource", msgCount);

                pass &= msgCount == messageIterations;
            }
            finally {
                if (keepOutput)
                {
                    Console.WriteLine("\n\tOutput file: {0}", outputFilename);
                }
                else
                {
                    System.IO.File.Delete(outputFilename);
                }
            }

            return(pass ? 100 : 0);
        }
Exemplo n.º 9
0
        public static int Main(string[] args)
        {
            bool pass       = true;
            bool keepOutput = false;

            // Use the first arg as an output filename if there is one.
            string outputFilename = null;

            if (args.Length >= 1)
            {
                outputFilename = args[0];
                keepOutput     = true;
            }
            else
            {
                outputFilename = System.IO.Path.GetTempPath() + Guid.NewGuid().ToString() + ".netperf";
            }

            try
            {
                Console.WriteLine("\tStart: Enable tracing.");
                TraceControl.EnableDefault(outputFilename);
                Console.WriteLine("\tEnd: Enable tracing.\n");

                Console.WriteLine("\tStart: Generate some events.");
                for (int i = 0; i < InducedGCIterations; i++)
                {
                    GC.Collect();
                }
                Console.WriteLine("\tEnd: Generate some events.\n");

                Console.WriteLine("\tStart: Disable tracing.");
                TraceControl.Disable();
                Console.WriteLine("\tEnd: Disable tracing.\n");

                Console.WriteLine("\tStart: Process the trace file.");
                int matchingEventCount    = 0;
                int nonMatchingEventCount = 0;
                using (var trace = TraceEventDispatcher.GetDispatcherFromFileName(outputFilename))
                {
                    string gcReasonInduced      = GCReason.Induced.ToString();
                    string providerName         = "Microsoft-Windows-DotNETRuntime";
                    string gcTriggeredEventName = "GC/Triggered";

                    trace.Clr.GCTriggered += delegate(GCTriggeredTraceData data)
                    {
                        if (gcReasonInduced.Equals(data.Reason.ToString()) &&
                            providerName.Equals(data.ProviderName) &&
                            gcTriggeredEventName.Equals(data.EventName))
                        {
                            matchingEventCount++;
                        }
                        else
                        {
                            nonMatchingEventCount++;
                        }
                    };

                    trace.Process();
                }
                Console.WriteLine("\tEnd: Processing events from file.\n");

                Assert.Equal(nameof(matchingEventCount), InducedGCIterations, matchingEventCount);
                Assert.Equal(nameof(nonMatchingEventCount), nonMatchingEventCount, 0);
            }
            finally {
                if (keepOutput)
                {
                    Console.WriteLine("\n\tOutput file: {0}", outputFilename);
                }
                else
                {
                    System.IO.File.Delete(outputFilename);
                }
            }

            return(100);
        }
Exemplo n.º 10
0
        static int Main(string[] args)
        {
            bool pass = true;

            SimpleEventSource eventSource = new SimpleEventSource();

            using (var netPerfFile = NetPerfFile.Create(args))
            {
                Console.WriteLine("\tStart: Enable tracing.");
                TraceControl.Enable(GetConfig(eventSource, netPerfFile.Path));
                Console.WriteLine("\tEnd: Enable tracing.\n");

                Console.WriteLine("\tStart: Messaging.");
                // Send messages
                // Use random numbers and addition as a simple, human readble checksum
                Random generator = new Random();
                for (int i = 0; i < messageIterations; i++)
                {
                    int    x       = generator.Next(1, 1000);
                    int    y       = generator.Next(1, 1000);
                    string formula = String.Format("{0} + {1} = {2}", x, y, x + y);

                    eventSource.MathResult(x, y, x + y, formula);
                }
                Console.WriteLine("\tEnd: Messaging.\n");

                Console.WriteLine("\tStart: Disable tracing.");
                TraceControl.Disable();
                Console.WriteLine("\tEnd: Disable tracing.\n");

                Console.WriteLine("\tStart: Processing events from file.");
                int msgCount = 0;
                using (var trace = TraceEventDispatcher.GetDispatcherFromFileName(netPerfFile.Path))
                {
                    var names = new HashSet <string>();

                    trace.Dynamic.All += delegate(TraceEvent data)
                    {
                        if (!names.Contains(data.ProviderName))
                        {
                            Console.WriteLine("\t{0}", data.ProviderName);
                            names.Add(data.ProviderName);
                        }

                        if (data.ProviderName == "SimpleEventSource")
                        {
                            msgCount += 1;
                        }
                    };

                    trace.Process();
                }
                Console.WriteLine("\tEnd: Processing events from file.\n");

                Console.WriteLine("\tProcessed {0} events from EventSource", msgCount);

                pass &= msgCount == messageIterations;
            }

            return(pass ? 100 : 0);
        }
Exemplo n.º 11
0
        public static int Main(string[] args)
        {
            bool pass       = true;
            bool keepOutput = false;

            // Use the first arg as an output filename if there is one.
            string outputFilename = null;

            if (args.Length >= 1)
            {
                outputFilename = args[0];
                keepOutput     = true;
            }
            else
            {
                outputFilename = System.IO.Path.GetTempPath() + Guid.NewGuid().ToString() + ".netperf";
            }

            try
            {
                Console.WriteLine("\tStart: Enable tracing.");
                TraceControl.EnableDefault(outputFilename);
                Console.WriteLine("\tEnd: Enable tracing.\n");

                Console.WriteLine("\tStart: Generate some events.");
                DynamicallyCompiledMethodInvoker invoker = BuildDynamicMethod();
                invoker.Invoke();
                Console.WriteLine("\tEnd: Generate some events.\n");

                Console.WriteLine("\tStart: Disable tracing.");
                TraceControl.Disable();
                Console.WriteLine("\tEnd: Disable tracing.\n");

                Console.WriteLine("\tStart: Process the trace file.");

                int matchingEventCount    = 0;
                int nonMatchingEventCount = 0;

                using (var trace = TraceEventDispatcher.GetDispatcherFromFileName(outputFilename))
                {
                    string methodNamespace      = "dynamicClass";
                    string methodName           = "DynamicallyCompiledMethod";
                    string methodSignature      = "void  ()";
                    string providerName         = "Microsoft-Windows-DotNETRuntime";
                    string gcTriggeredEventName = "Method/JittingStarted";

                    trace.Clr.MethodJittingStarted += delegate(MethodJittingStartedTraceData data)
                    {
                        if (methodNamespace.Equals(data.MethodNamespace) &&
                            methodName.Equals(data.MethodName) &&
                            methodSignature.Equals(data.MethodSignature) &&
                            providerName.Equals(data.ProviderName) &&
                            gcTriggeredEventName.Equals(data.EventName))
                        {
                            matchingEventCount++;
                        }
                    };

                    trace.Process();
                }
                Console.WriteLine("\tEnd: Processing events from file.\n");

                // CompiledMethod
                Assert.Equal(nameof(matchingEventCount), matchingEventCount, 1);
            }
            finally
            {
                if (keepOutput)
                {
                    Console.WriteLine("\n\tOutput file: {0}", outputFilename);
                }
                else
                {
                    System.IO.File.Delete(outputFilename);
                }
            }

            return(100);
        }
 public TraceSourceManager(string fileName)
 {
     Source = TraceEventDispatcher.GetDispatcherFromFileName(fileName);
 }