void AppendMerge(Callstack callstack, int index, SamplingNode root) { if (callstack.Count == index) { return; } SamplingDescription desc = callstack[index]; SamplingNode rootNode = root == null ? this : root; foreach (SamplingNode node in Children) { if (IsSimilar(node.Description, desc)) { ++node.Passed; node.AppendMerge(callstack, index + 1, rootNode); return; } } SamplingNode child = new SamplingNode(rootNode, desc, desc.Address, 1); AddChild(child); child.AppendMerge(callstack, index + 1, rootNode); }
void AppendMerge(Callstack callstack, int index, SamplingNode root) { if (callstack.Count == index) { return; } SamplingDescription desc = callstack[index]; SamplingNode rootNode = root == null ? this : root; foreach (SamplingNode node in Children) { if (IsSimilar(node.Description, desc)) { node.shadowNodes.Add(new SamplingNode(rootNode, desc, 1) { Parent = this, ChildrenDuration = index == callstack.Count - 1 ? 0 : 1 }); ++node.Passed; node.AppendMerge(callstack, index + 1, rootNode); return; } } SamplingNode child = new SamplingNode(rootNode, desc, 1); child.shadowNodes.Add(new SamplingNode(rootNode, desc, 1) { Parent = child, ChildrenDuration = index == callstack.Count - 1 ? 0 : 1 }); AddChild(child); child.AppendMerge(callstack, index + 1, rootNode); }
public override void Load() { if (!IsLoaded) { DescriptionBoard = SamplingDescriptionBoard.Create(Response); Root = SamplingNode.Create(Response.Reader, DescriptionBoard, null); } }
public static SamplingNode Create(List <Callstack> callstacks) { SamplingNode node = new SamplingNode(null, null, 0, (uint)callstacks.Count); callstacks.ForEach(c => node.AppendMerge(c, 0, node)); node.Update(); return(node); }
public override void Load() { if (!IsLoaded) { DescriptionBoard = SamplingDescriptionBoard.Create(Reader); root = SamplingNode.Create(Reader, DescriptionBoard, null); board = new Board <SamplingBoardItem, SamplingDescription, SamplingNode>(root); IsLoaded = true; } }
public override void Load() { if (!IsLoaded) { DescriptionBoard = SamplingDescriptionBoard.Create(Reader); root = SamplingNode.Create(Reader, DescriptionBoard, null); root.CalculateRecursiveExcludeFlag(new Dictionary <Object, int>()); board = new Board <SamplingBoardItem, SamplingDescription, SamplingNode>(root); IsLoaded = true; } }
void Update() { ForEach((node, level) => { SamplingNode sNode = (node as SamplingNode); sNode.Duration = sNode.Passed; uint passedChildren = 0; sNode.Children.ForEach(child => passedChildren += (child as SamplingNode).Passed); sNode.ChildrenDuration = passedChildren; return(true); }); }
public static SamplingNode Create(BinaryReader reader, SamplingDescriptionBoard board, SamplingNode root) { UInt64 address = reader.ReadUInt64(); SamplingDescription desc = null; if (!board.Descriptions.TryGetValue(address, out desc)) { desc = SamplingDescription.UnresolvedDescription; } UInt32 passed = reader.ReadUInt32(); SamplingNode node = new SamplingNode(root, desc, passed); UInt32 childrenCount = reader.ReadUInt32(); for (UInt32 i = 0; i < childrenCount; ++i) { node.AddChild(SamplingNode.Create(reader, board, root != null ? root : node)); } return(node); }
public SamplingFrame(List <Callstack> callstacks, FrameGroup group) : base(null, group) { SampleCount = callstacks.Count; Root = SamplingNode.Create(callstacks); }
//public SamplingNode Parent { get; private set; } SamplingNode(SamplingNode root, SamplingDescription desc, UInt32 passed) : base(root, desc, passed) { Passed = passed; }