public void Start(Benchmark benchmark) { ProcessIdsUsedInRuns.Clear(); statsPerProcess.Clear(); var sessionName = GetSessionName("GC", benchmark, benchmark.Parameters); session = new TraceEventSession(sessionName); session.EnableProvider(ClrTraceEventParser.ProviderGuid, TraceEventLevel.Verbose, (ulong)(ClrTraceEventParser.Keywords.GC)); // The ETW collection thread starts receiving events immediately, but we only // start aggregating them after ProcessStarted is called and we know which process // (or processes) we should be monitoring. Communication between the benchmark thread // and the ETW collection thread is through the statsPerProcess concurrent dictionary // and through the TraceEventSession class, which is thread-safe. Task.Factory.StartNew(StartProcessingEvents, TaskCreationOptions.LongRunning); }
public void ProcessStarted(Process process) { ProcessIdsUsedInRuns.Add(process.Id); statsPerProcess.TryAdd(process.Id, null); }
public void ProcessStarted(Process process) { ProcessIdsUsedInRuns.Add(process.Id); }