public async ValueTask <ICallTreeData> GetCallTreeAsync(StackViewerModel model, GenericStackSource stackSource = null) { await this.EnsureInitialized(); lock (this.callTreeDataCache) { if (!this.callTreeDataCache.TryGetValue(model, out var value)) { value = new CallTreeData(stackSource ?? this.deserializer.GetStackSource((ProcessIndex)int.Parse(model.Pid), int.Parse(model.StackType)), model, this.symbolReader); this.callTreeDataCache.Add(model, value); } return(value); } }
public async ValueTask <ICallTreeData> GetCallTreeAsync(StackViewerModel model, StackSource stackSource = null) { await this.EnsureInitialized(); lock (this.callTreeDataCache) { if (!this.callTreeDataCache.TryGetValue(model, out var value)) { double start = string.IsNullOrEmpty(model.Start) ? 0.0 : double.Parse(model.Start); double end = string.IsNullOrEmpty(model.End) ? 0.0 : double.Parse(model.End); value = new CallTreeData(stackSource ?? this.deserializer.GetStackSource((ProcessIndex)int.Parse(model.Pid), int.Parse(model.StackType), start, end), model); this.callTreeDataCache.Add(model, value); } return(value); } }
public async ValueTask <ICallTreeData> GetCallTreeAsync(StackViewerModel model, StackSource stackSource = null) { await this.EnsureInitialized(); lock (this.callTreeDataCache) { if (!this.callTreeDataCache.TryGetValue(model, out var value)) { double start = string.IsNullOrEmpty(model.Start) ? 0.0 : double.Parse(model.Start); double end = string.IsNullOrEmpty(model.End) ? 0.0 : double.Parse(model.End); var key = new StackSourceCacheKey((ProcessIndex)int.Parse(model.Pid), int.Parse(model.StackType), start, end, model.DrillIntoKey); if (!this.stackSourceCache.TryGetValue(key, out var ss)) { ss = stackSource ?? this.deserializer.GetStackSource((ProcessIndex)int.Parse(model.Pid), int.Parse(model.StackType), start, end); this.stackSourceCache.Add(key, ss); } else { var drillIntoStackSource = new CopyStackSource(GetTraceEventStackSource(ss)); ss.ForEach(delegate(StackSourceSample sample) { drillIntoStackSource.AddSample(sample); }); ss = drillIntoStackSource; } value = new CallTreeData(stackSource ?? ss, model); this.callTreeDataCache.Add(model, value); } return(value); } }