protected virtual void DoInterning() { BlockedTimeAnalyzer blockedTimeAnalyzer = new BlockedTimeAnalyzer(this); foreach (var linuxEvent in parser.ParseSkippingPreamble(masterSource)) { // Set the start timestamp of the trace using the first event. if (StartTimeStampMSec == 0) { StartTimeStampMSec = linuxEvent.TimeMSec; } // BlockedTimeAnalyzer handles all sample production. // Only give it the set of events that we want it to process. if (doThreadTime || linuxEvent.Kind == EventKind.Cpu) { blockedTimeAnalyzer.UpdateThreadState(linuxEvent); } } blockedTimeAnalyzer?.FinishAnalyzing(); // TODO: Sort things in blocked time analyzer // this.threadBlockedPeriods.Sort((x, y) => x.StartTime.CompareTo(y.StartTime)); TotalBlockedTime = blockedTimeAnalyzer.TotalBlockedTime; }
protected virtual void DoInterning() { BlockedTimeAnalyzer blockedTimeAnalyzer = doThreadTime ? new BlockedTimeAnalyzer() : null; foreach (var linuxEvent in parser.ParseSkippingPreamble(masterSource)) { blockedTimeAnalyzer?.UpdateThreadState(linuxEvent); AddSample(CreateSampleFor(linuxEvent, blockedTimeAnalyzer)); } blockedTimeAnalyzer?.FinishAnalyzing(); // TODO: Sort things in blocked time analyzer // this.threadBlockedPeriods.Sort((x, y) => x.StartTime.CompareTo(y.StartTime)); TotalBlockedTime = blockedTimeAnalyzer != null ? blockedTimeAnalyzer.TotalBlockedTime : -1; }