Beispiel #1
0
        static QuicState[] ProcessTraceFiles(IEnumerable <string> filePaths)
        {
            var quicStates = new List <QuicState>();

            foreach (var filePath in filePaths)
            {
                //
                // Create our runtime environment, add file, enable cookers, and process.
                //
                PluginSet pluginSet;

                if (string.IsNullOrWhiteSpace(typeof(QuicEtwSource).Assembly.Location))
                {
                    // Single File EXE
                    pluginSet = PluginSet.Load(new[] { Environment.CurrentDirectory }, new SingleFileAssemblyLoader());
                }
                else
                {
                    pluginSet = PluginSet.Load();
                }

                using var dataSources = DataSourceSet.Create(pluginSet);
                dataSources.AddFile(filePath);
                var info = new EngineCreateInfo(dataSources.AsReadOnly());
                using var runtime = Engine.Create(info);
                runtime.EnableCooker(QuicEventCooker.CookerPath);
                //Console.Write("Processing {0}...", filePath);
                var results = runtime.Process();
                //Console.WriteLine("Done.\n");

                //
                // Return our 'cooked' data.
                //
                quicStates.Add(results.QueryOutput <QuicState>(new DataOutputPath(QuicEventCooker.CookerPath, "State")));
            }

            return(quicStates.ToArray());
        }
Beispiel #2
0
 public void Initialize()
 {
     Directory.CreateDirectory(ScratchDir);
     this.Sut = new EngineCreateInfo();
 }